force docker re-pull

8,293 views
Skip to first unread message

Aaron Carey

unread,
Mar 10, 2015, 7:39:37 AM3/10/15
to marathon-...@googlegroups.com
Hi,

Hopefully this is a quick one:

I'm trying to get marathon to force a re-pull of the docker image it runs when I submit a job to it. Currently if the slave node already has the image pulled from our private repo, it will just use that one (even when newer versions have been committed to the repo).

What's the best thing to do here?

Thanks!

Aaron

Dario Rexin

unread,
Mar 10, 2015, 8:38:39 AM3/10/15
to Aaron Carey, marathon-...@googlegroups.com
Hi Aaron,

we recommend to use tagged versions. This also makes it easier to go back to an older version / configuration when something goes wrong.

Cheers,
Dario

--
You received this message because you are subscribed to the Google Groups "marathon-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to marathon-framew...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aaron Carey

unread,
Mar 10, 2015, 9:57:49 AM3/10/15
to Dario Rexin, marathon-...@googlegroups.com
Thanks Dario,

I was wondering if that might be the way to go!

Aaron



From: Dario Rexin [da...@mesosphere.io]
Sent: 10 March 2015 12:38
To: Aaron Carey
Cc: marathon-...@googlegroups.com
Subject: Re: force docker re-pull

Aaron Carey

unread,
Mar 10, 2015, 11:01:05 AM3/10/15
to Dario Rexin, marathon-...@googlegroups.com
After some experimenting I don't seem to be able to get Marathon to pull the correct tag from the repo:

curl -X POST -d @marathon.json -H 'Content-Type: application/json' marathon.floatingfish.io:8080/v2/apps
{"id":"/rabbitmq-v1.1","cmd":null,"args":[""],"user":null,"env":{},"instances":1,"cpus":1.0,"mem":256.0,"disk":0.0,"executor":"","constraints":[],"uris":[],"storeUrls":[],"ports":[5672,15672],"requirePorts":false,"backoffSeconds":1,"backoffFactor":1.15,"maxLaunchDelaySeconds":3600,"container":{"type":"DOCKER","volumes":[{"containerPath":"/var/run/docker.sock","hostPath":"/var/run/docker.sock","mode":"RW"}],"docker":{"image":"docker-registry.floatingfish.io:5000/rabbitmq:v1.1","network":"BRIDGE","portMappings":[{"containerPort":5672,"hostPort":0,"servicePort":0,"protocol":"tcp"},{"containerPort":15672,"hostPort":0,"servicePort":0,"protocol":"tcp"}],"privileged":false,"parameters":[{"key":"link","value":"consul:consul"}]}},"healthChecks":[],"dependencies":[],"upgradeStrategy":{"minimumHealthCapacity":0.5,"maximumOverCapacity":0.2},"labels":{},"version":"0002-01-01T00:00:00.000Z"}

The tag is present in the response from the marathon REST api, but when I actually log into the machine that's running the image, it's not the right one:

CONTAINER ID        IMAGE                                                     COMMAND                CREATED              STATUS              PORTS                                                                                                                                                                                        NAMES
4a017f4dc012        docker-registry.floatingfish.io:5000/rabbitmq:latest      "/opt/register/start   About a minute ago   Up About a minute   0.0.0.0:31000->5672/tcp, 0.0.0.0:31001->15672/tcp

(Id should be d8ce779d9c68 in this case)

Any ideas?

Thanks!
Aaron



From: Aaron Carey
Sent: 10 March 2015 13:57
To: Dario Rexin
Cc: marathon-...@googlegroups.com
Subject: RE: force docker re-pull

Dario Rexin

unread,
Mar 10, 2015, 11:11:54 AM3/10/15
to Aaron Carey, marathon-...@googlegroups.com
Hi Aaron,

two things I noticed.

1. updating an app should be done with a PUT to /v2/apps/{appId} instead of a post to the /v2/apps
2. you shouldn’t set the version field

Could you please try that?

Cheers,
Dario

Aaron Carey

unread,
Mar 10, 2015, 11:15:15 AM3/10/15
to Dario Rexin, marathon-...@googlegroups.com
Hi Dario,

I've tried it without setting the version field and get the same problem.

This is meant to start up a new app, rather than updating an existing one.. shouldn't that be done with a POST?

Thanks for your help! :)

Aaron


From: marathon-...@googlegroups.com [marathon-...@googlegroups.com] on behalf of Dario Rexin [da...@mesosphere.io]
Sent: 10 March 2015 15:11

Dario Rexin

unread,
Mar 10, 2015, 11:20:38 AM3/10/15
to Aaron Carey, marathon-...@googlegroups.com, Timothy Chen
Hi Aaron,

if it’s a new app POST is correct, but PUT should also work. What versions of Marathon and Mesos are you running?

I also added Tim Chen, one of the Mesos committers who worked on the Docker integration, to this thread.

@Tim Any idea what’s wrong here?

Aaron Carey

unread,
Mar 10, 2015, 11:23:38 AM3/10/15
to Dario Rexin, marathon-...@googlegroups.com, Timothy Chen
Marathon 0.8.0
Mesos 0.21.1

Thanks guys!

Aaron


From: Dario Rexin [da...@mesosphere.io]
Sent: 10 March 2015 15:20
To: Aaron Carey
Cc: marathon-...@googlegroups.com; Timothy Chen

Aaron Carey

unread,
Mar 11, 2015, 5:05:05 AM3/11/15
to Dario Rexin, marathon-...@googlegroups.com, Timothy Chen
Looking into it I think I may have solved my own problem...

Turns out the tags are working, but docker is showing the 'latest' tag instead of the 'v1.1' tag, although the actual images are the same...

Thanks for your help!

Aaron


From: marathon-...@googlegroups.com [marathon-...@googlegroups.com] on behalf of Aaron Carey [aca...@ilm.com]
Sent: 10 March 2015 15:23
To: Dario Rexin
Cc: marathon-...@googlegroups.com; Timothy Chen

Timothy Chen

unread,
Mar 11, 2015, 12:34:07 PM3/11/15
to Aaron Carey, Dario Rexin, marathon-...@googlegroups.com
Glad you figured it out.

Let us know if you have any more problems.

Tim 

Reply all
Reply to author
Forward
0 new messages