Singularity icon indicating copy to clipboard operation
Singularity copied to clipboard

Redo docker-compose setup without using 'host' mode networking

Open NotBobTheBuilder opened this issue 8 years ago • 6 comments

Steps to reproduce

$ git clone https://github.com/hubspot/singularity
$ cd singularity
$ docker-compose pull
$ docker-compose up
(browse to http://localhost:7099/singularity or http://localhost:8080/baragon/v2/ui)

Expected: pages for either to be served. Actual: can't open connection to server.

docker version 1.12.1 (build: 12133) docker-compose version 1.8.0, build f3628c7 mac osx sierra 10.12 (16A323)

NotBobTheBuilder avatar Oct 05 '16 05:10 NotBobTheBuilder

Hey @NotBobTheBuilder , apologies for the slow response. How are you running docker on your mac? If you are using docker-machine or boot2docker, that address should probably be the ip or hostname of the vm where docker is running instead of localhost (e.g. commonly 192.168.59.103 for boot2docker)

ssalinas avatar Oct 26 '16 18:10 ssalinas

I'm using vanilla docker for mac.

NotBobTheBuilder avatar Oct 26 '16 18:10 NotBobTheBuilder

Ok, I haven't played around with docker for mac myself, but I believe it creates a hostname docker.local for containers. I would try hitting docker.local:7099/singularity first. If that is the case, we can update the docs now that docker for mac is becoming more popular.

If that doesn't work you can:

  • check the running containers, be sure that singularity_scheduler_1 is running properly
  • if singularity_scheduler_1 is not running, check the logs for it (docker logs singularity_scheduler_1). If you see an exception that it encountered during startup, feel free to gist it or add it in this issue, and one of us can take a look.

ssalinas avatar Oct 26 '16 19:10 ssalinas

@NotBobTheBuilder are you still having issues?

ssalinas avatar Nov 07 '16 21:11 ssalinas

I run into the same issue using "Docker for Mac"(docker 1.12.1). singularity_scheduler_1 log actually looks good. But "net:host" only exports the ports within xhyveVM and they are not accessible from MacOS as far as I know.

For now, just to be able to test it on Mac, I needed to go back to docker-machine + virtualbox + ssh tunnelling[1]. I may try to rewrite docker-compose.yml exposing ports and using link between containers.

It's really a Docker for Mac issue, more context: https://forums.docker.com/t/should-docker-run-net-host-work/14215/22 https://forums.docker.com/t/explain-networking-known-limitations-explain-host/15205/2

[1] a hack to see Singularity UI at localhost:7099 docker-machine ssh default -N -L 5050:localhost:5050 -L 7099:localhost:7099

felixgborrego avatar Nov 08 '16 21:11 felixgborrego

Thanks for the input @felixgborrego . Tried the docker for mac bit myself and it does seem like there isn't a clean way to get host networking mode working in an easy manner. Renaming the issue here to reflect that we need to get the dev setup working with port mappings and container linking. There will be a few tricky pieces like getting the mesos slave api to play nicely and getting hostnames within the containers correct, but can probably be done with a bit of tinkering.

ssalinas avatar Nov 10 '16 22:11 ssalinas