From 9afc771c549f9a8cad9917f99cc9f61e73f0fac0 Mon Sep 17 00:00:00 2001 From: Greg Mann Date: Fri, 2 Dec 2016 19:03:51 -0800 Subject: [PATCH 1/5] Added note on LIBPROCESS_ADVERTISE_IP to the readme. --- mesos/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesos/README.md b/mesos/README.md index e8cea98..404e0fe 100644 --- a/mesos/README.md +++ b/mesos/README.md @@ -10,7 +10,6 @@ Dockerfiles: https://github.com/mesosphere/docker-containers/tree/master/mesos Other Mesosphere Packages: https://mesosphere.com/downloads/ - ## Machines The recommended way to run Mesos in Docker is to run each master and slave container on their own machine, with their own IP. @@ -19,6 +18,7 @@ The recommended way to run Mesos in Docker is to run each master and slave conta Host networking (`--net=host`) is recommended. While Mesos *can* operate in bridge networking, it is slower and has many caveats and configuration complexities. +On Mac OSX, Mesos may be unable to perform a hostname lookup within the Docker container, in which case the master/agent will not launch. To fix this, specify `-e LIBPROCESS_ADVERTISE_IP=127.0.0.1` in the Docker command-line flags. This explicitly sets the IP that Mesos should advertise to other processes, eliminating the need for a hostname lookup. ## Example: Local Dev/Test From e672a4757f78c0a7611993c141f456b420e62784 Mon Sep 17 00:00:00 2001 From: Greg Mann Date: Fri, 2 Dec 2016 20:06:57 -0800 Subject: [PATCH 2/5] Added information on agent Docker configuration to README. --- mesos/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mesos/README.md b/mesos/README.md index 404e0fe..343a6da 100644 --- a/mesos/README.md +++ b/mesos/README.md @@ -59,6 +59,26 @@ docker run -d --net=host \ [Slave Configuration Reference](https://open.mesosphere.com/reference/mesos-slave/) +If the agent will make use of the Docker runtime, it can be configured in two different ways: +* The agent can use its own Docker installation within the container, thus running Docker-in-Docker. +* The host system's Docker installation can be mapped into the container so that the agent runs Docker containers on the host system. This will allow the agent's containers to continue running over agent failovers. + +To use the container's Docker installation: +``` +docker run -d --net=host --privileged \ + -e MESOS_PORT=5051 \ + -e MESOS_MASTER=zk://127.0.0.1:2181/mesos \ + -e MESOS_SWITCH_USER=0 \ + -e MESOS_CONTAINERIZERS=docker,mesos \ + -e MESOS_LOG_DIR=/var/log/mesos \ + -e MESOS_WORK_DIR=/var/tmp/mesos \ + -v "$(pwd)/log/mesos:/var/log/mesos" \ + -v "$(pwd)/tmp/mesos:/var/tmp/mesos" \ + --entrypoint /bin/bash \ + mesosphere/mesos-slave:0.28.0-2.0.16.ubuntu1404 -c "sudo service docker start; mesos-agent" +``` + +To use the host system's Docker installation: ``` docker run -d --net=host --privileged \ -e MESOS_PORT=5051 \ From 201a3fa253e234528834ccade8994664a9585718 Mon Sep 17 00:00:00 2001 From: Greg Mann Date: Tue, 6 Dec 2016 08:36:07 -0800 Subject: [PATCH 3/5] Renamed 'slave' to 'agent' in Mesos containers. --- mesos/Makefile | 6 ++--- mesos/README.md | 22 +++++++++---------- .../{mesos-slave => mesos-agent} | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) rename mesos/dockerfile-templates/{mesos-slave => mesos-agent} (74%) diff --git a/mesos/Makefile b/mesos/Makefile index 66f35b2..485a31e 100644 --- a/mesos/Makefile +++ b/mesos/Makefile @@ -21,12 +21,12 @@ ifndef VERSION @exit 1 endif -images: check-version mesos mesos-master mesos-slave +images: check-version mesos mesos-master mesos-agent push: check-version docker push mesosphere/mesos:$(MESOS_TAG) docker push mesosphere/mesos-master:$(MESOS_TAG) - docker push mesosphere/mesos-slave:$(MESOS_TAG) + docker push mesosphere/mesos-agent:$(MESOS_TAG) mesos: check-version echo $(VERSION) @@ -45,6 +45,6 @@ mesos-master: mesos check-version sed "s/{VERSION}/$(VERSION)/g" dockerfile-templates/$@ > $@ docker build -t mesosphere/$@:$(MESOS_TAG) - < $@ -mesos-slave: mesos check-version +mesos-agent: mesos check-version sed "s/{VERSION}/$(VERSION)/g" dockerfile-templates/$@ > $@ docker build -t mesosphere/$@:$(MESOS_TAG) - < $@ diff --git a/mesos/README.md b/mesos/README.md index 343a6da..9de95ad 100644 --- a/mesos/README.md +++ b/mesos/README.md @@ -2,9 +2,9 @@ [Mesosphere](https://mesosphere.com/) builds [Apache Mesos](http://mesos.apache.org/) into several [Docker](https://www.docker.com/) containers: -- [mesosphere/mesos](https://hub.docker.com/r/mesosphere/mesos/) - Both the master and slave in the same container. Requires a custom command to run. +- [mesosphere/mesos](https://hub.docker.com/r/mesosphere/mesos/) - Both the master and agent in the same container. Requires a custom command to run. - [mesosphere/mesos-master](https://hub.docker.com/r/mesosphere/mesos-master/) - Mesos-Master only -- [mesosphere/mesos-slave](https://hub.docker.com/r/mesosphere/mesos-slave/) - Mesos-Slave only +- [mesosphere/mesos-agent](https://hub.docker.com/r/mesosphere/mesos-agent/) - Mesos-Agent only Dockerfiles: https://github.com/mesosphere/docker-containers/tree/master/mesos @@ -12,7 +12,7 @@ Other Mesosphere Packages: https://mesosphere.com/downloads/ ## Machines -The recommended way to run Mesos in Docker is to run each master and slave container on their own machine, with their own IP. +The recommended way to run Mesos in Docker is to run each master and agent container on their own machine, with their own IP. ## Networking @@ -22,13 +22,13 @@ On Mac OSX, Mesos may be unable to perform a hostname lookup within the Docker c ## Example: Local Dev/Test -For development or experimentation, one Master and one Slave can be run on the same machine. +For development or experimentation, one Master and one Agent can be run on the same machine. -The following commands set up a local development environment with Exhibitor/Zookeeper, Mesos-Master, and Mesos-Slave, using host networking. This is not fit for production. +The following commands set up a local development environment with Exhibitor/Zookeeper, Mesos-Master, and Mesos-Agent, using host networking. This is not fit for production. Caveats: -- Docker containers launched by the Mesos-Slave will continue running on the host after the Mesos-Slave container has been stopped. -- Docker volumes created by the Mesos-Slave will be relative to the host, not the Mesos-Slave container. +- Docker containers launched by the Mesos-Agent will continue running on the host after the Mesos-Agent container has been stopped. +- Docker volumes created by the Mesos-Agent will be relative to the host, not the Mesos-Agent container. ### Launch Exhibitor (Zookeeper) @@ -55,9 +55,9 @@ docker run -d --net=host \ mesosphere/mesos-master:0.28.0-2.0.16.ubuntu1404 ``` -### Launch Mesos-Slave +### Launch Mesos-Agent -[Slave Configuration Reference](https://open.mesosphere.com/reference/mesos-slave/) +[Agent Configuration Reference](https://open.mesosphere.com/reference/mesos-agent/) If the agent will make use of the Docker runtime, it can be configured in two different ways: * The agent can use its own Docker installation within the container, thus running Docker-in-Docker. @@ -75,7 +75,7 @@ docker run -d --net=host --privileged \ -v "$(pwd)/log/mesos:/var/log/mesos" \ -v "$(pwd)/tmp/mesos:/var/tmp/mesos" \ --entrypoint /bin/bash \ - mesosphere/mesos-slave:0.28.0-2.0.16.ubuntu1404 -c "sudo service docker start; mesos-agent" + mesosphere/mesos-agent:0.28.0-2.0.16.ubuntu1404 -c "sudo service docker start; mesos-agent" ``` To use the host system's Docker installation: @@ -93,5 +93,5 @@ docker run -d --net=host --privileged \ -v /cgroup:/cgroup \ -v /sys:/sys \ -v /usr/local/bin/docker:/usr/local/bin/docker \ - mesosphere/mesos-slave:0.28.0-2.0.16.ubuntu1404 + mesosphere/mesos-agent:0.28.0-2.0.16.ubuntu1404 ``` diff --git a/mesos/dockerfile-templates/mesos-slave b/mesos/dockerfile-templates/mesos-agent similarity index 74% rename from mesos/dockerfile-templates/mesos-slave rename to mesos/dockerfile-templates/mesos-agent index 69d108f..b5645cc 100644 --- a/mesos/dockerfile-templates/mesos-slave +++ b/mesos/dockerfile-templates/mesos-agent @@ -1,4 +1,4 @@ FROM mesosphere/mesos:{VERSION} MAINTAINER Mesosphere -ENTRYPOINT ["mesos-slave"] +ENTRYPOINT ["mesos-agent"] From f0f681fc7fcf5069fb97b22219b91a9b7216a13c Mon Sep 17 00:00:00 2001 From: Greg Mann Date: Tue, 6 Dec 2016 17:12:25 -0800 Subject: [PATCH 4/5] Changed Mesos Makefile to tag 'latest'. --- mesos/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mesos/Makefile b/mesos/Makefile index 485a31e..2bf5838 100644 --- a/mesos/Makefile +++ b/mesos/Makefile @@ -40,11 +40,17 @@ mesos: check-version sed -i -e "s/{UBUNTU_TESTING}//g" $@ ; \ fi docker build -t mesosphere/$@:$(MESOS_TAG) - < $@ + $(eval IMAGE_ID=$(shell docker images | grep 'mesosphere/$@ ' | grep $(MESOS_TAG) | awk '{print $$3}')) + docker tag $(IMAGE_ID) mesosphere/$@:latest mesos-master: mesos check-version sed "s/{VERSION}/$(VERSION)/g" dockerfile-templates/$@ > $@ docker build -t mesosphere/$@:$(MESOS_TAG) - < $@ + $(eval IMAGE_ID=$(shell docker images | grep 'mesosphere/$@' | grep $(MESOS_TAG) | awk '{print $$3}')) + docker tag $(shell docker images | grep "mesosphere/$@" | awk '{print $3}') mesosphere/$@:latest mesos-agent: mesos check-version sed "s/{VERSION}/$(VERSION)/g" dockerfile-templates/$@ > $@ docker build -t mesosphere/$@:$(MESOS_TAG) - < $@ + $(eval IMAGE_ID=$(shell docker images | grep 'mesosphere/$@' | grep $(MESOS_TAG) | awk '{print $$3}')) + docker tag $(shell docker images | grep "mesosphere/$@" | awk '{print $3}') mesosphere/$@:latest From c657f92cf25d51c7bd6f19d3ba17bc5a5fba1342 Mon Sep 17 00:00:00 2001 From: Greg Mann Date: Tue, 6 Dec 2016 17:21:57 -0800 Subject: [PATCH 5/5] Added a prominent note to Mesos README about production use. --- mesos/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mesos/README.md b/mesos/README.md index 9de95ad..98fd007 100644 --- a/mesos/README.md +++ b/mesos/README.md @@ -1,5 +1,7 @@ # Mesos in Docker +## NOTE: These images are not suitable for production use! + [Mesosphere](https://mesosphere.com/) builds [Apache Mesos](http://mesos.apache.org/) into several [Docker](https://www.docker.com/) containers: - [mesosphere/mesos](https://hub.docker.com/r/mesosphere/mesos/) - Both the master and agent in the same container. Requires a custom command to run.