-
Notifications
You must be signed in to change notification settings - Fork 74
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
Caching in GitHub Actions doesn't seem to be working right #163
Comments
The caching also doesn't seem to be working as one would hope within the Docker image builder workflows. There, however, you have an additional caching mechanism to worry about beyond just GitHub Actions cache: the Docker cache. I believe things are plumbed properly so that Docker will attempt to use GitHub Actions' cache, but the underlying caching problem reported above is surely impacting that as well. |
In #164, I've improved the caching situation in regular GitHub Actions some, giving a 30-50% reduction in build times when a cache hit occurs. To fix the caching problems in Docker, more work is involved. See here for some ideas: https://gist.github.com/noelbundick/6922d26667616e2ba5c3aff59f0824cd |
Note for Docker caching problems in CI: It looks like building the Debian-based Docker images does |
I recently split out Vectorscan into its own published crate. Now in the CI jobs, that long-building package can be cached, and cached build job times are all under 2 minutes. For example: https://github.com/praetorian-inc/noseyparker/actions/runs/8594814073 |
Relevant discussion I saw over the weekend about caching and Docker builds in GitHub Actions: https://news.ycombinator.com/item?id=39956327. It sounds like the caching scheme we are currently using (GitHub Actions cache for Docker) is doomed, as the cache is too small for the images we are building. One possible alternative is to use the |
* Adjust Docker image cache settings. The cache is not being used effectively for whatever reason (see #163), and the previous setting of `mode=max` ended up quickly causing the cache to thrash. Now, use `mode=min`. * Remove CI cruft and rename some matrix build fields for clarity * In release builds, disable caching
I experimented a bunch in #169, but failed to find a GitHub Actions incantation that resulted in Docker image builds that actually effectively cached the build stages. Caching works better now for regular CI jobs, but for jobs that build Docker images, the caching mostly doesn't work at all. |
Going back to the matter I brought up earlier, I still think the The other problem I see with changing Docker cache mode to
The current Dockerfiles setup will cache only
|
Oh, I understand what you're saying about that now. Read from the cache if possible, but don't write to it in release builds. I suspect that it's not going to do anything today in terms of cache benefit. But worth a try. |
Describe the bug
The GitHub Actions workflows for Nosey Parker don't seem to make effective use of the Actions cache. This causes workflows to run much slower than they might otherwise.
To Reproduce
For example, take a successful CI run, and then rerun it. Examine the details of the actions log. Additionally, check the build timing artifacts that are produced by the CI jobs; these give more details as to how many dependencies are being rebuilt by
cargo
and how long they are taking.Expected behavior
You would expect that the jobs would complete quickly, since nothing has changed and the cache has been populated.
Actual behavior
The jobs build nearly everything from scratch, even when cache entries are found.
The text was updated successfully, but these errors were encountered: