Attempting to fix CI build's cache issues - #4915
Closed
anupsdf wants to merge 15 commits into
Closed
Conversation
anupsdf
requested review from
Copilot and
graydon
and removed request for
Copilot
August 29, 2025 21:43
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves CI caching efficiency by fixing key naming issues and expanding cache availability beyond the master branch. The changes address poor cache hit rates by using more descriptive cache keys and adding fallback restore mechanisms.
- Replaces confusing cache key reference with explicit OS-toolchain-protocol-SHA format
- Adds hierarchical restore keys to improve cache hit rates across builds
- Removes master branch restriction for cache saving to benefit PR builds
anupsdf
commented
Aug 29, 2025
Contributor
Author
There was a problem hiding this comment.
Probe Cache step above was looking for a different key and not this steps.cache.outputs.cache-primary-key
Also separated config updates from the in-memory config. The motivation of the changes is as follows: - Config is semantically not mutable. It's just a view for the ledger snapshot that is convenient to pass around and sometimes store. - Config caching during apply resulted in some bugs (like broken updates for some state archival settings). Loading the config is cheap enough, so we just load it from LTX during the apply process. - Updates are performed on the ledger entries and they don't need to be coupled with the view data structure. On-demand config loading is still not 100% fool-proof and it's still possible to accidentally access stale config during the apply flow. However, I don't have a better idea for how this could be further improved at the moment. But at least outside of the apply flow only the last closed config can be accessed now, which I think is a net win for the change.
Attempting to fix CI build's cache issues
anupsdf
force-pushed
the
cache_gha_builds
branch
from
August 29, 2025 22:06
92040ed to
0bf413a
Compare
Also separated config updates from the in-memory config. The motivation of the changes is as follows: - Config is semantically not mutable. It's just a view for the ledger snapshot that is convenient to pass around and sometimes store. - Config caching during apply resulted in some bugs (like broken updates for some state archival settings). Loading the config is cheap enough, so we just load it from LTX during the apply process. - Updates are performed on the ledger entries and they don't need to be coupled with the view data structure. On-demand config loading is still not 100% fool-proof and it's still possible to accidentally access stale config during the apply flow. However, I don't have a better idea for how this could be further improved at the moment. But at least outside of the apply flow only the last closed config can be accessed now, which I think is a net win for the change.
Attempting to fix CI build's cache issues
anupsdf
marked this pull request as draft
August 29, 2025 22:30
Contributor
Author
|
Test deletion of cache when PR is closed. |
Contributor
Author
|
Deletion failed with message, |
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.
what
Attempting to fix CI build's cache issues since it seems our CI builds are not using the cache well.
The problems identified are,
steps.cache.outputs.cache-primary-keywas used when saving the cache but in probe cache we used a different key. This might be why it was broken.