Download stack images before update installation?


We are using Rancher 1.x to run our application containers on bare metal servers in the field and notice that the update of our container stack can take quite a while. This is mostly due to new container images being downloaded (on sometimes slow internet connections), containers being re-instantiated, etc…
And the user of the Rancher UI does not really see what is happening and why it takes so long.

The whole experience is much smoother if we first pull all new container images separately (on the command line; in the background) and then do a stack update in the Rancher UI. Because Rancher then doesn’t have to download the images anymore as part of the stack update.

Is there a way to do this pre-downloading of images via Rancher perhaps ? Obviously Rancher knows which images are required for a catalog update so could do this.
Or are there any other common solutions for this ?


The closest thing we have is an API called Pull Task, but we don’t expose it in the UI. I don’t really have any documentation on how to use it, you might just need to play with it to get it to work, but here is an example of it being used in our CLI:

Basically, you post to https://localhost:8080/v2-beta/pulltasks (subsituting your domain for localhost) with a body that looks like:

  "mode": "all",
  "labels": { // map of host labels for selecting which hosts to pull on}
  "image": "<your image here>"

It’s not the prettiest API in the world and its just a convenience step because (as you know) upgrading a stack will pull images. So that’s why we dont really advertise/document it. But maybe it can work for you.

@cjellick Thanks for your suggestion! Will have a look.