-
Notifications
You must be signed in to change notification settings - Fork 233
Helios Testing broken with Docker for Mac (beta) #916
Comments
Java and Unix sockets are not the best of friends, although I believe the docker client that helios-testing uses does support unix sockets. Is it possible to simply configure docker beta for mac to listen on a tcp port? |
Also, do you have any docker beta invites to hand out? ;) |
I can use an IP but in this case that would be localhost/127.0.0.1 which also seems to confuse Helios: https://github.com/spotify/helios/blob/9b45e0ded17147d9f6081874c80b5bf94a1dd4da/docs/integration_tests_with_helios_solo.md#issues-if-docker_host-refers-to-localhost-or-127001 😞 Unfortunately I don't get additional beta keys to hand out but after signing up for it I got my key within 3 days. So big chance that you can get one for yourself fairly quickly. |
Thanks for tracing this down to the problematic code path. It seems like a bunch of tools make assumptions that docker-for-mac breaks. I'm curious - does docker-for-mac set |
It doesn't set The part I haven't figured out is why it goes coocoo when you specify a |
@daenney ah that is what I figured, thanks. Hopefully my beta invite comes through soon so I can test this out locally as well 😄 |
@daenney just for completeness can you paste how your |
Sure thing, here you go. private static final HeliosDeploymentResource soloResource =
new HeliosDeploymentResource(HeliosSoloDeployment.fromEnv().build());
private static final TemporaryJobs temporaryJobs = TemporaryJobs.builder()
.client(soloResource.client())
.build();
@ClassRule
public static final RuleChain chain = RuleChain
.outerRule(soloResource)
.around(temporaryJobs);
@BeforeClass
public static void setupContainers() throws IOException {
TemporaryJob podserviceJob = temporaryJobs.job()
.image("<the-registry>/spotify/podservice-integrationtest:latest")
.port("podservice", 12000)
.deploy(); |
@danielnorberg i also got my key just 2 days after signing up, there doesn't appear to be an actual wait |
#920 fixes a part of this, where The next issue I am seeing is that the container that is launched for my TemporaryJobs locally (with Docker for Mac) has an IP address like |
Another incompatibility: |
I created a topic on the Docker for Mac forums about the IP address issues I am having now: https://forums.docker.com/t/ip-address-given-to-container-is-not-routable-in-bridge-mode/12725. This might be the last issue with helios-testing and Docker for Mac. |
So, helios assumes that the IP address of the container (i.e. Docker for Mac gives a container an IP on a bridge, like Routing to the container's IP seems to be not yet be supported in Docker for Mac. |
Interesting rabbit hole you've gone down so far 😄 |
#927 addresses some of my last comment. TemporaryJobs tries to figure out what address to use to communicate with any ports mapped from the container to the host, and ends up using a bad value for Docker for Mac. I've found another new issue though - it seems like the port mapped by Docker for Mac accepts connections as soon as the container is started (i.e. if port 8080 on the container is mapped to If the TemporaryJob has a healthcheck, then there isn't an issue, but in cases where the "probing" of the port is assumed to be enough, then the test will end up running as soon as the container is started, which might be well before the container is actually accepting connections on the internal port. |
need to add a healthcheck to the TemporaryJob to avoid helios-testing from thinking that the job is immediately available after the deploy finishes. see: #13 (comment) spotify/helios#916 (comment)
need to add a healthcheck to the TemporaryJob to avoid helios-testing from thinking that the job is immediately available after the deploy finishes. see: #13 (comment) spotify/helios#916 (comment)
Closing this as there is one known issue outlined in the previous comment but otherwise helios-testing works with docker for mac (as far as we know) |
execStart should use the 'noTimeoutClient'.
The Docker for Mac beta ships a Docker setup packaged and well running on top of xhyve. Though the
docker
CLI is smart enough to find it (it knows where the socket is) other tools that look for the docker daemon need theDOCKER_HOST
environment variable to be set. In this case, it should point atunix:///var/tmp/docker.sock
.Unfortunately setting
DOCKER_HOST
seems to break theTemporaryJobs.builder()
as that contains a fair amount of glue to try and figure out where the heck Docker went. This results in the following stack trace:I believe that this is caused by the following code path: https://github.com/spotify/helios/blob/83bb315662db0b1eede2385a178e2afe48d633e2/helios-testing/src/main/java/com/spotify/helios/testing/TemporaryJobs.java#L565-607
We end up hitting L596 and because
DOCKER_HOST
is set and will now try to parseunix:///var/tmp/docker.sock
as a URI and callgetHost()
on it, which will returnnull
. Because of the string concat and not explicitly checking for thatnull
it means we end up adding an endpoint ofhttp://null:5801
.This in turn causes the eventual
java.net.UnknownHostException: null: unknown error
when we try to do the DNS lookup for the host part of the endpoint.The text was updated successfully, but these errors were encountered: