ci: persist ccache across ephemeral runner pods via actions/cache - #7809
Open
MrLi000001 wants to merge 5 commits into
Open
ci: persist ccache across ephemeral runner pods via actions/cache#7809MrLi000001 wants to merge 5 commits into
MrLi000001 wants to merge 5 commits into
Conversation
MrLi000001
force-pushed
the
ci/ccache-actions-cache
branch
from
August 12, 2026 17:57
8bd3dac to
d99f43f
Compare
# Conflicts: # .github/workflows/cuda.yml
- Unpack: replace cache-hit=='true' gate with a file-existence check. actions/cache outputs cache-hit=false on restore-keys prefix hits even though the cache IS downloaded, so the old condition skipped unpacking and every build ran fully cold despite downloading 1.2GB. - Restore: match all ephemeral ARC runners by excluding VM name prefix (iZ0x) instead of only gpu-runner-*, which missed cpu-runner-* pods.
Restore ccache unconditionally so every runner (VM/pod) attempts a
restore; the previous ${{ !startsWith(runner.name, 'iZ0x') }} guard
was not evaluated reliably and the guard provides no benefit (a VM
restore hit simply refreshes local cache from the cloud).
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.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
This PR does not need an issue: it is a CI-infrastructure-only change. The motivation is
backed by 1683 workflow runs (2026-04 to 2026-08): ARC runner pods rebuild from an empty
ccache on every job (build median 2021s / ~34min) while VM runners hit their warm local
cache (median 155s) — a 13x gap that is growing as the pod share rises (16% in June to
39% in August). The pod cache is lost because ephemeral pods are recreated per job and
/tmp/ccachelives in the pod's temporary storage.Unit Tests and/or Case Tests for my changes
python -c "import yaml; yaml.safe_load(open('.github/workflows/test.yml')); yaml.safe_load(open('.github/workflows/cuda.yml'))"ccache -sstats.GitHub Actions run itself is the verification; expected CI behavior (documented below)
will be confirmed by the run logs after merge.
What's changed?
test.yml/cuda.ymlthrough the GitHub Actions CacheService so ephemeral ARC runner pods no longer start every job with a cold cache.
if: startsWith(runner.name, 'gpu-runner-')); VMrunners keep their warm local cache untouched and only upload it as the cloud seed.
cache quota; unpack after restore with ownership fix.
ccache-<toolchain>-${{ github.sha }}withrestore-keys: ccache-<toolchain>-— exact key for re-runs, prefix fallback for newcommits/PRs.
runner.nameis intentionally absent from the key because pod names arerandom per job (would always miss) and VM/pod caches should be shared.
CCACHE_BASEDIR: ${{ github.workspace }}so cached objects remain portable acrosscheckout paths.
RUNNER_NAME/ runner type in the logs to allow timing statistics grouped byrunner type (pod vs vm).
subsequent runs = restore hit, pod build step from ~2021s down to the minute scale.
Governance Notes