-
Notifications
You must be signed in to change notification settings - Fork 8
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
Evaluate if we want to move to BuildKit for automatic Docker image handling #89
Comments
I'm going to document the different points we discussed whenever I have some time. 1. Layer CachingBuilding the docker images from scratch only works well when we have decent and reliable caching. We need two types of caching:
The simplest approach is using GitHub Action's built-in cache. Unfortunately it's limited to 10GiB of total cache space per repo which we think we will shortly exceed - especially with the CUDA containers. Another option is to use a Container Registry for layer caching which is the most well supported option in BuildKit. We can use GCP's Artifact Registry for that which means we are not limited by size. We would create two registries - one for main branch caching and one for PR-based layer caching. Only trusted build runners can write into the formerm but for PR-based caching we have to be careful what jobs can write into the layer cache for PRs. We cannot give untrusted runnners (which we want to support in the future) write access to that second registry. If we were doing that we might be vulnerable to cache poisining attack. One option to solve this is to have an isolated cache per PR - as it's implemented by GHA's caching system. As far as I've seen Docker registries don't support that (We would also need some federated authentication system to support that which makes it even more complicated) So only 2 options remain:
I think both options have their advantages. The first allows a simpler workflow design with the disadvantage of disabled caching for large docker containers. The second has no size limit but needs more plumbing around (like the cleanup jobs for example) |
BuildKit allows an easy management of Docker images in a CI scenario as it can automatically rebuild images when the image's input files (Dockerfile and context) changes. So no manual builds and pushes are needed.
One of many tutorials describing the workflow is here: https://testdriven.io/blog/faster-ci-builds-with-docker-cache/
PR #77 implements some parts of it in the first commit (We later decided to not implement it for now).
The text was updated successfully, but these errors were encountered: