Attempt to cache docker images in CI#13125
Merged
pchickey merged 1 commit intobytecodealliance:mainfrom Apr 20, 2026
Merged
Conversation
Linux package servers have been particularly flaky today so I've re-investigated how to maybe cache everything. The idea here is that we use the "officially recommended" way of caching builds of docker images on github actions, notably using the github actions cache. The way this is configured is that some extra steps happen on github which populate the github actions cache and local docker daemon such that when the actual build happens, totally independently of these github actions steps, it just so happens to get cache hits. This is done to ensure that if we make a mistake here it doesn't result in stale builds, just slower builds. The overall hope here is that by using the github actions cache for docker images we can hit package installation less than we currently do. The hope is that all the images fit within the github actions cache. I think they do but it's pretty noisy and each build generates new entries so I'm not entirely sure what's happening. Local testing shows that reruns do indeed proceed faster and don't hit `apt-get` for example, though. This doesn't entirely insulate us from issues with `apt-get` because runs will still use `apt-get` externally from docker, such as just installing a few extra packages. I don't know how to make those more robust, but hopefully we can at least reduce some flakiness by caching some things. prtest:full
33f7f27 to
80d7736
Compare
pchickey
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linux package servers have been particularly flaky today so I've re-investigated how to maybe cache everything. The idea here is that we use the "officially recommended" way of caching builds of docker images on github actions, notably using the github actions cache. The way this is configured is that some extra steps happen on github which populate the github actions cache and local docker daemon such that when the actual build happens, totally independently of these github actions steps, it just so happens to get cache hits. This is done to ensure that if we make a mistake here it doesn't result in stale builds, just slower builds.
The overall hope here is that by using the github actions cache for docker images we can hit package installation less than we currently do. The hope is that all the images fit within the github actions cache. I think they do but it's pretty noisy and each build generates new entries so I'm not entirely sure what's happening. Local testing shows that reruns do indeed proceed faster and don't hit
apt-getfor example, though.This doesn't entirely insulate us from issues with
apt-getbecause runs will still useapt-getexternally from docker, such as just installing a few extra packages. I don't know how to make those more robust, but hopefully we can at least reduce some flakiness by caching some things.