marathon icon indicating copy to clipboard operation
marathon copied to clipboard

Provide way to upgrade Docker containers without changing Mesos environment

Open papile opened this issue 12 years ago • 8 comments

Currently if you just need to upgrade an application Docker container you need to create a change in the Mesos/Marathon environment to trigger Mesos/Marathon to upgrade your running container according to the specified minimumHealthCapacity parameters.

It is a frequent use case to have a code change, build a new container, and push the container to a Docker registry. Then to make those changes live you would want Mesos/Marathon to do a rolling upgrade of your running nodes. Right now I am having to change a dummy environment variable to have this happen. It would be nice if Marathon could have a PUT rest call to the running application name where you can place a flag like upgradeContainer=true in order for it to know to pull the Docker container again and upgrade your nodes. Or this could also be accomplished by storing the hash of the pulled containers and triggering upgrades if there is a change on a subsequently pulled container.

papile avatar Oct 06 '14 16:10 papile

Can't you do this with tags on the Docker image? Assuming you had a Docker container with helloworld:v1 deployed, the following should upgrade it to v2.

curl -XPUT
-H "Accept: application/json"
-H "Content-Type: application/json" http://marathon:8080/v2/apps/services/helloworld 
-d '{
  "container": { "docker" : { "image": "helloworld:v2" } }
}'

deverton avatar Oct 07 '14 22:10 deverton

@deverton that's a good point. It seems like @papile (correct me if I've misunderstood) wants to use a volatile tag like :latest in the app definition. I would advise using a real tag in production, but in general there's a good point here. Other users might want a rolling restart of all of the app instances without any configuration change.

ConnorDoyle avatar Oct 07 '14 23:10 ConnorDoyle

I think that if you're using a tag such as :latest, Mesos won't pull the new image MESOS-1762. It's worth noting that if you're running an upgrade of a container with the same tag, it could be different versions running on different slaves in the cluster.

antonlindstrom avatar Oct 08 '14 09:10 antonlindstrom

My two cents: After having spent just over 2 weeks with docker/mesos/marathon I have come to realize that in not less than 2 occasions, :latest is a cause of much headache. The problem is that the :latest tag is ephemeral and can change while another deploy is happening or maybe even when a scale up is happening. This can lead to the cluster going into some weird states (mixed version). I would very much advise against using :latest in favour of simplicity, predictability and repeatability of environments. It goes a long way when one is attempting to debug even simple applications.

ankurcha avatar Oct 28 '14 04:10 ankurcha

I agree with @ankurcha, but I also see a lot of people have the need of able to pull each task launch with their own considerations and scenarios. There is already an ticket on MESOS to support a task level configuration, I won't be getting to this most likely until 0.22.0 since it's not a blocker for most.

tnachen avatar Oct 28 '14 04:10 tnachen

An option has been added to DockerInfo which is now available in Mesos 0.22.0. Any thoughts on when this might be added to Marathon?

mindscratch avatar Apr 10 '15 12:04 mindscratch

+1 - it's useful for snapshot deployments on staging systems...

Pindar avatar Sep 23 '15 17:09 Pindar

We support the usage of force_pull.

jasongilanfarr avatar Feb 01 '17 21:02 jasongilanfarr