How can I run Julia “Sockets” test inside docker environments?
I tried & finished with errors
docker run -it --rm julia:1.0.3 julia -e 'Base.runtests("Sockets")'
docker run --privileged -it --rm julia:1.0.3 julia -e 'Base.runtests("Sockets")'
docker run --net=host -it --rm julia:1.0.3 julia -e 'Base.runtests("Sockets")'
My environment:
Added later:
SOLUTION: You need to enable IPv6 support in the Docker daemon AND --fixed-cidr-v6
must be provided.
Can you show the errors you’re getting? It’s probably just a bad assumption in Sockets’ tests, or a misconfiguration of your docker networking setup.
docker run -it --rm julia:1.0.3 julia -e 'Base.runtests("Sockets")'
...
Error in testset Sockets:
Error During Test at /usr/local/julia/share/julia/stdlib/v1.0/Sockets/test/runtests.jl:228
Got exception outside of a @test
IOError: UDP send failed: address not available (EADDRNOTAVAIL)
Stacktrace:
[1] try_yieldto(::typeof(Base.ensure_rescheduled), ::Base.RefValue{Task}) at ./event.jl:196
[2] wait() at ./event.jl:255
[3] wait(::Condition) at ./event.jl:46
[4] stream_wait(::UDPSocket, ::Condition) at ./stream.jl:47
[5] send(::UDPSocket, ::IPv6, ::UInt16, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Sockets/src/Sockets.jl:355
[6] macro expansion at /usr/local/julia/share/julia/stdlib/v1.0/Sockets/test/runtests.jl:277 [inlined]
[7] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
[8] top-level scope at /usr/local/julia/share/julia/stdlib/v1.0/Sockets/test/runtests.jl:230
[9] include at ./boot.jl:317 [inlined]
[10] include_relative(::Module, ::String) at ./loading.jl:1044
....
full LOGS:
On dev1 ( Ubuntu 18.04 + Docker 18.09.0 linux/amd64
):
On Cloud : Ubuntu 18.10 + Docker 18.09.0
Ok, this helps. What it looks like is that your container does not have an IPv6 loopback address configured (::1
specifically). Hence, you get an EADDRNOTAVAIL error since the tests try to send to this address, which is almost always available outside of a container, including within VMs (hence why tests pass on CI). Try getting this to run within your container:
ip -6 addr
When I run this on my baremetal host, I get the following:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
1 Like
I’m not able to find daemon.json file in my vm