Caching (question / enhancement)
This is awesome.
Can you explain how build and image pull caching can work with cbi? How can I configure one or more of the build tools, e.g. docker, to either cache previous builds or previous image pulls?
Related to https://github.com/kubeflow/kubeflow/issues/289#issuecomment-377827101
Thanks for your interest in CBI!
Can you explain how build and image pull caching can work with cbi? How can I configure one or more of the build tools, e.g. docker, to either cache previous builds or previous image pulls?
This is plugin-specific.
Docker plugin
Docker plugin connects to a random Docker daemon that is running on a Kubernetes node, via a bind-mounted /var/run/docker.sock.
The less number of nodes, the higher probability to hit the cache. (and higher load on the each of the nods)
I think we should also extend Docker plugin pod template to support setting NodeSelector, so as to limit the Docker node to be used.
BuildKit plugin
BuildKit plugins connects to a BuildKit service running on the Kubernetes cluster.
The less number of BuildKit replicas, the higher probability to hit the cache.
BuildKit also plans to implement cache-aware load-balancing mode: https://github.com/moby/buildkit/issues/62
Buildah plugin
Buildah plugin creates an one-shot buildah container.
Buildah does not seem to support instruction cache, AFAIK. Probably, future version of Buildah plugin would support caching, as in the case of img plugin (below).
img plugin (Not implemented yet)
img plugin would creates an one-shot kubectl exec some-stateful-img-pod img .... container.
The less number of img pods, the higher probability to hit the cache.
GCB plugin (Not implemented yet)
Needs investigation. ( https://cloud.google.com/container-builder/docs/speeding-up-builds?hl=en#caching_directories_with_google_cloud_storage )
Great summary, thanks for the info!
Thanks @AkihiroSuda for your great work.
BuildKit plugin
BuildKit plugins connects to a BuildKit service running on the Kubernetes cluster.
The less number of BuildKit replicas, the higher probability to hit the cache.
BuildKit also plans to implement cache-aware load-balancing mode: moby/buildkit#62
I'm studying how to use the buildkit to build image with cache, and find "cache-aware load-balancing mode" would be a great feature. Do we have plan when to release it? Also, for this Distributed build mode, could you provide more detail docs?
It is still under discussion and would still take months for implementation
OK, thanks~