mesosphere-backup / deimos

Mesos containerizer hooks for Docker
Apache License 2.0
249 stars 26 forks source link

[containers.image] default ignored #10

Closed wkf closed 10 years ago

wkf commented 10 years ago

When is the image specificed in default under [containers.image] used? It seems to be ignored now, and the default image is instead something like debian:7. It also looks like I could change the default image by specifying distro and release under [docker.index], but I'm not sure that's the intention of those fields. Thanks!

mhamrah commented 10 years ago

I think the problem is here https://github.com/mesosphere/deimos/blob/673b738112e19aeb46a520a229c349cadcb24437/deimos/containerizer/docker.py#L317

There's no path to read the default image from the config file; it goes straight to a lib_mesos lookup and picts an image based on the distribution.

I've been able to circumvent this by passing the container image when launching tasks via marathon.

wkf commented 10 years ago

Yah, I've been using the same workaround. It's a little unclear to me what the account_libmesos configuration option is for.

yashvyas commented 10 years ago

I am also facing this issue. Like mhamrah pointed out, it is using the matching_image_for_host(**opts) method to default the image which is based on the host machines OS (defaults to Ubuntu14.04 for me). I am not able to use the workaround since Im not using marathon. I'm using deimos via the mesos-jenkins plugin.

Also, deimos is failing to pick up the "append" property from the config file. I have tried to use it to pass the "-e" option to the docker image but it always shows up as empty. Can you guys please add some documentation for the config file, or maybe use a config file that uses ALL the options as the example.

mhamrah commented 10 years ago

The append option in the config file tripped me up as well, check the sys logs to see how Deimos is parsing the array. It could be adding unnecessary spaces, and you need to restart mesos-slave after you make the change.

This worked for me:

/etc/deimos.cfg

[containers.options] append: ["-e", "HOST_IP=192.168.33.12"]

On Jun 30, 2014, at 6:44 AM, Yash Vyas notifications@github.com wrote:

I am also facing this issue. Like mhamrah pointed out, it is using the matching_image_for_host(**opts) method to default the image which is based on the host machines OS (defaults to Ubuntu14.04 for me). Also, deimos is failing to pick up the "append" property from the config file. I have tried to use it to pass the "-e" option to the docker image but it always shows up as empty. Can you guys please add some documentation for the config file, or maybe use a config file that uses ALL the options as the example.

— Reply to this email directly or view it on GitHub https://github.com/mesosphere/deimos/issues/10#issuecomment-47517789.

yashvyas commented 10 years ago

That did work! I tried many different forms, but the form that you showed is the only one that worked. And right after I opened an issue here : https://github.com/mesosphere/deimos/issues/22 :\ Thanks for the help!

On Mon, Jun 30, 2014 at 6:47 AM, Michael Hamrah notifications@github.com wrote:

The append option in the config file tripped me up as well, check the sys logs to see how Deimos is parsing the array. It could be adding unnecessary spaces, and you need to restart mesos-slave after you make the change.

This worked for me:

/etc/deimos.cfg

[containers.options] append: ["-e", "HOST_IP=192.168.33.12"]

On Jun 30, 2014, at 6:44 AM, Yash Vyas notifications@github.com wrote:

I am also facing this issue. Like mhamrah pointed out, it is using the matching_image_for_host(**opts) method to default the image which is based on the host machines OS (defaults to Ubuntu14.04 for me). Also, deimos is failing to pick up the "append" property from the config file. I have tried to use it to pass the "-e" option to the docker image but it always shows up as empty. Can you guys please add some documentation for the config file, or maybe use a config file that uses ALL the options as the example.

— Reply to this email directly or view it on GitHub https://github.com/mesosphere/deimos/issues/10#issuecomment-47517789.

— Reply to this email directly or view it on GitHub https://github.com/mesosphere/deimos/issues/10#issuecomment-47522320.

yashvyas commented 10 years ago

Hi, while looking into this, I also realized that the mesos-slave has an option --default_container_image . So I started up the slave with this option, and deimos still used the host OS for the container image.

The mesos env is getting set up correctly, but I think deimos is not using the MESOS_DEFAULT_CONTAINER_IMAGE value . Excerpt from syslog

Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_NATIVE_LIBRARY=/home/mesos/mesos/mesos-0.19.0/build/src/.libs/libmesos-0.19.0.so
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_CHECKPOINT=0
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_LAUNCHER_DIR=/home/mesos/mesos/mesos-0.19.0/build/src
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_SLAVE_ID=20140626-105439-1283384586-8999-12678-5
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_DIRECTORY=/tmp/mesos/slaves/20140626-105439-1283384586-8999-12678-5/frameworks/20140626-105439-1283384586-8999-12678-0008/executors/mesos-jenkins-bdd04860-8631-4ead-91f5-690936b9def6/runs/ddddf51b-5eb6-4f5e-bca0-5c6aaf23ad2f
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_NATIVE_JAVA_LIBRARY=/home/mesos/mesos/mesos-0.19.0/build/src/.libs/libmesos-0.19.0.so
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_LIBEXEC_DIRECTORY=/home/mesos/mesos/mesos-0.19.0/build/src
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_WORK_DIRECTORY=/tmp/mesos
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() LIBPROCESS_PORT=0
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_DEFAULT_CONTAINER_IMAGE=docker:///guilhem/jenkins-slave:latest
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_EXECUTOR_ID=mesos-jenkins-bdd04860-8631-4ead-91f5-690936b9def6
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_SLAVE_PID=slave(1)@127.0.1.1:5052
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.log_mesos_env() MESOS_FRAMEWORK_ID=20140626-105439-1283384586-8999-12678-0008
Jul  1 09:19:33 mesos-5 deimos[26333]: deimos.containerizer.docker.launch() call // docker --host unix:///var/run/docker.sock run --sig-proxy --rm --cidfile /tmp/deimos/mesos/ddddf51b-5eb6-4f5e-bca0-5c6aaf23ad2f/cid -w /tmp/mesos-sandbox -v /tmp/deimos/mesos/ddddf51b-5eb6-4f5e-bca0-5c6aaf23ad2f/fs:/tmp/mesos-sandbox -e JAVA_HOME=java-6-openjdk-amd64 -c 204 -m 704m ubuntu:14.04 sh -c 'java -DHUDSON_HOME=jenkins -server -Xmx640m -Xms16m -XX:+UseConcMarkSweepGC -Djava.net.preferIPv4Stack=true -jar slave.jar  -jnlpUrl http://mesos-5.dev.orbitz.net:8080/jenkins/computer/mesos-jenkins-bdd04860-8631-4ead-91f5-690936b9def6/slave-agent.jnlp'

As you can see im trying to use this image : https://registry.hub.docker.com/u/guilhem/jenkins-slave/ But deimos still used Ubuntu14.04.