New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide caching of docker images across VM instances #952

Closed
jstrachan opened this Issue May 24, 2017 · 38 comments

Comments

Projects
None yet
9 participants
@jstrachan
Contributor

jstrachan commented May 24, 2017

this might be a bit tricky to implement, but it'd be awesome if we could use a http proxy with a persistent cache in the docker daemon in minishift thats stored on the host volume somewhere, so that if you do:

minishift start
# download and run lots of images...
minishift delete
...
minishift start
# download and run lots of images - using the previous image cache!

when trying out new versions of minishift/openshift and apps its pretty common to trash your VM and recreate it again. I'm on kinda slow wifi as am sure most folks are when at conferences or with customers; it'd be awesome to be able to cache docker images on our host operating system.

@hferentschik hferentschik changed the title from provide caching of docker images across VM images to Provide caching of docker images across VM images May 24, 2017

@hferentschik

This comment has been minimized.

Show comment
Hide comment
@hferentschik

hferentschik May 24, 2017

Member

We are already working on an approach for caching images. See also #143, even though this might initially just cache the OpenShift related images. The long term plan is to use the libraries used under the hood of skopeo to cache all images.

I leave this issue open, even though it is partly a duplicate of #143. As said, the latter might end up as an intermediate solution first until we can work around issues with containers/storage and containers/image. We can use #143 to implement a simple solution targeting mainly at seedup of the bootstrap process and take this issue as continuation to provide a full image chache.

Member

hferentschik commented May 24, 2017

We are already working on an approach for caching images. See also #143, even though this might initially just cache the OpenShift related images. The long term plan is to use the libraries used under the hood of skopeo to cache all images.

I leave this issue open, even though it is partly a duplicate of #143. As said, the latter might end up as an intermediate solution first until we can work around issues with containers/storage and containers/image. We can use #143 to implement a simple solution targeting mainly at seedup of the bootstrap process and take this issue as continuation to provide a full image chache.

@jorgemoralespou

This comment has been minimized.

Show comment
Hide comment
@jorgemoralespou

jorgemoralespou May 24, 2017

Contributor

I ultimately want caching of all images in order to make minishift environment transportable #397 (targeted for 1.4).

Contributor

jorgemoralespou commented May 24, 2017

I ultimately want caching of all images in order to make minishift environment transportable #397 (targeted for 1.4).

@hferentschik

This comment has been minimized.

Show comment
Hide comment
@hferentschik

hferentschik May 24, 2017

Member

I ultimately want caching of all images in order to make minishift environment transportable

+1

Member

hferentschik commented May 24, 2017

I ultimately want caching of all images in order to make minishift environment transportable

+1

@jorgemoralespou

This comment has been minimized.

Show comment
Hide comment
@jorgemoralespou

jorgemoralespou May 24, 2017

Contributor

I would want to be able to have in configuration a whitelist/blacklist of images to be cached so the developer can have greater granularity on what to save/restore.

Ideally, any image built by the VM should not be same, anything else could potentially be saved, being all the openshift related images the most important, although there is a big chance that all the technology related images would need to be cached. I wouldn't be happy to need to pull down openjdk or EAP or other images every time I create a VM.

Contributor

jorgemoralespou commented May 24, 2017

I would want to be able to have in configuration a whitelist/blacklist of images to be cached so the developer can have greater granularity on what to save/restore.

Ideally, any image built by the VM should not be same, anything else could potentially be saved, being all the openshift related images the most important, although there is a big chance that all the technology related images would need to be cached. I wouldn't be happy to need to pull down openjdk or EAP or other images every time I create a VM.

@budhram

This comment has been minimized.

Show comment
Hide comment
@budhram

budhram May 25, 2017

Member

I would want to be able to have in configuration a whitelist/blacklist of images to be cached so the developer can have greater granularity on what to save/restore.

Seems to be the advanced step for #397 and can be taken after it.

Member

budhram commented May 25, 2017

I would want to be able to have in configuration a whitelist/blacklist of images to be cached so the developer can have greater granularity on what to save/restore.

Seems to be the advanced step for #397 and can be taken after it.

@paoloantinori

This comment has been minimized.

Show comment
Hide comment
@paoloantinori

paoloantinori May 29, 2017

Hi, I'd also love to see this implemented at minishift level, but in the meanwhile I can suggest @jstrachan and anyone else the old workflow that we used for a little while in Fabric8 Vagrantfile ancient time: https://github.com/paoloantinori/fabric8-installer/blob/94b5a7c26bf2563c79d20e73671ea8c55f1ffa26/vagrant/kubernetes/Vagrantfile

The idea is to deploy on you host a (containerized) instance of a Docker Registry, and to configure it to mirror Docker Hub (or any other registry that you want).

It's a fairly simple workflow:


# unset old docker env vars, in case they pointed to a minishift instance:
unset DOCKER_HOST
unset DOCKER_API_VERSION
unset DOCKER_TLS_VERIFY
unset DOCKER_CERT_PATH
# run on your host a docker registry, mirroring docker hub. Pass it a long lasting volume
echo "Starting Docker Registry container..."
docker run -p 5000:5000 -d --restart=always --name registry_cache   \
  -e REGISTRY_PROXY_REMOTEURL=http://registry-1.docker.io \
  -v /500GB/fabric8_vm_cache/docker_registry_cache:/var/lib/registry \
  registry:2

# eventually pre-populate your mirror cache ( but you can even let it happen at the first run):
#     docker pull openshift/origin:v1.5.0
#     docker pull openshift/origin-pod:v1.5.0
#     docker pull openshift/origin-haproxy-router:v1.5.0
#     docker pull openshift/origin-haproxy-registry:v1.5.0
#     docker pull openshift/origin-docker-registry:v1.5.0
#     docker pull openshift/origin-deployer:v1.5.0


# this is the hardest part, you have to pick a good ipaddress for your host, since minishift does not like localhost
#     hostname -I
#     192.168.1.67 192.168.42.1 192.168.122.1 192.168.121.1 172.28.128.1 172.17.0.1
minishift start --registry-mirror http://192.168.121.1:5000

# enjoy your local cache
# companion blogpost: http://giallone.blogspot.it/2016/04/dockercachingproxy.html

paoloantinori commented May 29, 2017

Hi, I'd also love to see this implemented at minishift level, but in the meanwhile I can suggest @jstrachan and anyone else the old workflow that we used for a little while in Fabric8 Vagrantfile ancient time: https://github.com/paoloantinori/fabric8-installer/blob/94b5a7c26bf2563c79d20e73671ea8c55f1ffa26/vagrant/kubernetes/Vagrantfile

The idea is to deploy on you host a (containerized) instance of a Docker Registry, and to configure it to mirror Docker Hub (or any other registry that you want).

It's a fairly simple workflow:


# unset old docker env vars, in case they pointed to a minishift instance:
unset DOCKER_HOST
unset DOCKER_API_VERSION
unset DOCKER_TLS_VERIFY
unset DOCKER_CERT_PATH
# run on your host a docker registry, mirroring docker hub. Pass it a long lasting volume
echo "Starting Docker Registry container..."
docker run -p 5000:5000 -d --restart=always --name registry_cache   \
  -e REGISTRY_PROXY_REMOTEURL=http://registry-1.docker.io \
  -v /500GB/fabric8_vm_cache/docker_registry_cache:/var/lib/registry \
  registry:2

# eventually pre-populate your mirror cache ( but you can even let it happen at the first run):
#     docker pull openshift/origin:v1.5.0
#     docker pull openshift/origin-pod:v1.5.0
#     docker pull openshift/origin-haproxy-router:v1.5.0
#     docker pull openshift/origin-haproxy-registry:v1.5.0
#     docker pull openshift/origin-docker-registry:v1.5.0
#     docker pull openshift/origin-deployer:v1.5.0


# this is the hardest part, you have to pick a good ipaddress for your host, since minishift does not like localhost
#     hostname -I
#     192.168.1.67 192.168.42.1 192.168.122.1 192.168.121.1 172.28.128.1 172.17.0.1
minishift start --registry-mirror http://192.168.121.1:5000

# enjoy your local cache
# companion blogpost: http://giallone.blogspot.it/2016/04/dockercachingproxy.html
@budhram

This comment has been minimized.

Show comment
Hide comment
@budhram

budhram May 29, 2017

Member

Hi @paoloantinori ,

The idea is to deploy on you host a (containerized) instance of a Docker Registry, and to configure it to mirror Docker Hub (or any other registry that you want).

Nice idea 👍

It's a fairly simple workflow:

Looks promising.

Member

budhram commented May 29, 2017

Hi @paoloantinori ,

The idea is to deploy on you host a (containerized) instance of a Docker Registry, and to configure it to mirror Docker Hub (or any other registry that you want).

Nice idea 👍

It's a fairly simple workflow:

Looks promising.

@jorgemoralespou

This comment has been minimized.

Show comment
Hide comment
@jorgemoralespou

jorgemoralespou May 31, 2017

Contributor

@paoloantinori @hferentschik @budhrg keep in mind that this solution AFAICT only caches one external registry. In our case we might be pulling images down from multiple. Initially docker.io and registry.access.redhat.com.

Although I have to say that it's a workaround that we used before when we developed the all-in-one, as provided some easy benefits.

Also, we used some other workarounds: http://unpoucode.blogspot.com.es/2014/11/use-proxy-for-speeding-up-docker-images.html

Contributor

jorgemoralespou commented May 31, 2017

@paoloantinori @hferentschik @budhrg keep in mind that this solution AFAICT only caches one external registry. In our case we might be pulling images down from multiple. Initially docker.io and registry.access.redhat.com.

Although I have to say that it's a workaround that we used before when we developed the all-in-one, as provided some easy benefits.

Also, we used some other workarounds: http://unpoucode.blogspot.com.es/2014/11/use-proxy-for-speeding-up-docker-images.html

@jhcook

This comment has been minimized.

Show comment
Hide comment
@jhcook

jhcook Jun 29, 2017

I ultimately want caching of all images in order to make minishift environment transportable

+1

jhcook commented Jun 29, 2017

I ultimately want caching of all images in order to make minishift environment transportable

+1

hferentschik added a commit to hferentschik/minishift that referenced this issue Jul 3, 2017

hferentschik added a commit to hferentschik/minishift that referenced this issue Jul 3, 2017

@hferentschik

This comment has been minimized.

Show comment
Hide comment
@hferentschik

hferentschik Jul 4, 2017

Member

So turns our containers/image is missing the functionality we need. It allows to store single images in OCI format, but not creating a multi image OCI image repository - containers/image#155.

We can evaluate how much effort it would take to implement this in containers/image.

Member

hferentschik commented Jul 4, 2017

So turns our containers/image is missing the functionality we need. It allows to store single images in OCI format, but not creating a multi image OCI image repository - containers/image#155.

We can evaluate how much effort it would take to implement this in containers/image.

hferentschik added a commit to hferentschik/minishift that referenced this issue Jul 5, 2017

hferentschik added a commit to hferentschik/minishift that referenced this issue Jul 5, 2017

@hferentschik hferentschik modified the milestones: v1.3.0, v1.4.0 Jul 12, 2017

hferentschik added a commit to hferentschik/minishift that referenced this issue Jul 18, 2017

hferentschik added a commit to hferentschik/minishift that referenced this issue Jul 18, 2017

hferentschik added a commit to hferentschik/minishift that referenced this issue Jul 18, 2017

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 26, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 27, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 27, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 28, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 28, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 29, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 29, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 29, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 30, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 30, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 30, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 30, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 30, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 30, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 30, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 30, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 30, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Nov 30, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Dec 1, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Dec 1, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Dec 1, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Dec 1, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Dec 3, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Dec 3, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

hferentschik added a commit to hferentschik/minishift that referenced this issue Dec 4, 2017

Issue minishift#952 Implementing image caching using OCI based image …
…cache

- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue minishift#1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images

LalatenduMohanty added a commit that referenced this issue Dec 5, 2017

Issue #952 Implementing image caching using OCI based image cache
- Switching to containers/image OCI tansport for image caching
- Addressing cross compilation issues by making sure the right build tags are used
- Replacing current ImageHandler with an OCI based ImageHandler
- Making sure image caching work in conjunction with profiles (issue #1666)
- Implementing image commands import, export and list
- Adding commands image config [view|add|remove] for configuring the list of persistent cache images
@LalatenduMohanty

This comment has been minimized.

Show comment
Hide comment
@LalatenduMohanty

LalatenduMohanty Dec 5, 2017

Member

Resolved via #1685

Member

LalatenduMohanty commented Dec 5, 2017

Resolved via #1685

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment