HubSpot / Singularity

Scheduler (HTTP API and webapp) for running Mesos tasks—long running processes, one-off tasks, and scheduled jobs. #hubspot-open-source
http://getsingularity.com/
Apache License 2.0
822 stars 188 forks source link

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

Open NotBobTheBuilder opened 8 years ago

NotBobTheBuilder commented 8 years ago

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)

ssalinas commented 7 years ago

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)

NotBobTheBuilder commented 7 years ago

I'm using vanilla docker for mac.

ssalinas commented 7 years ago

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:

ssalinas commented 7 years ago

@NotBobTheBuilder are you still having issues?

felixgborrego commented 7 years ago

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

ssalinas commented 7 years ago

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.