ci(reborn): share one Rust cache across the closure (fix per-crate cache LRU eviction) - #5118
Conversation
…r-crate caches The closure's crate-tests matrix used a per-crate cache key (`reborn-tests-<crate>`), producing ~60 caches that each bundle the cargo registry + a target dir (~0.4-0.7 GB each), plus 4 per-partition root caches (~1 GB each). That's ~30+ GB competing for GitHub's ~10 GB per-repo cache LRU, so the caches evict each other almost as fast as they're written: a live snapshot showed only 10 of 64 crates had a cache present, summing to 18 GB and actively evicting. The result is "No cache found" on most jobs -> the crates.io registry is re-downloaded from cold every run, and 64 parallel cold downloads amplify transient registry flakes (the SSL_ERROR_SYSCALL / HTTP2 reds we saw). Switch both matrices to `shared-key`: - crate-tests -> `shared-key: reborn-tests-crates` (one entry for all crate jobs; the registry + shared-dep build is downloaded/compiled once and resident, not ~60x). - root partitions -> `shared-key: reborn-tests-root` (all 4 partitions compile the identical root build, so one cache is strictly better than 4 copies). This drops the reborn-tests cache footprint from ~30+ GB / 68 entries to ~2 entries that comfortably fit the LRU, so the registry stays resident and stops being re-downloaded. Complements CARGO_NET_RETRY (#5115), which remains the safety net for the now-rare cold download. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbitRelease Notes
WalkthroughThe reborn-tests workflow updates Rust cache keying in two jobs. The ~60 crate-test matrix jobs move from per-package keys to a single ChangesCI Cache Key Consolidation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
🚅 Deployed to the ironclaw-pr-5118 environment in ironclaw-ci-preview
|
Problem (root cause of the closure's re-downloads + flakes)
The closure's crate-tests matrix used a per-crate cache key (
reborn-tests-<crate>), so it produced ~60 caches (registry + target each, ~0.4–0.7 GB) plus 4 per-partition root caches (~1 GB each) → ~30+ GB competing for GitHub's ~10 GB per-repo cache LRU.They evict each other almost as fast as they're written. Live snapshot when we investigated:
So most jobs hit "No cache found" → re-download the crates.io registry from cold every run → and ~60 parallel cold downloads amplify transient registry flakes (the
SSL_ERROR_SYSCALL/ HTTP2 reds). It was LRU eviction, not code changes — the keys were valid; the entries were just evicted.Fix
Switch both matrices to rust-cache
shared-key:shared-key: reborn-tests-crates— one entry for all crate jobs; the registry + shared-dep build is downloaded/compiled once and stays resident, not ~60×.shared-key: reborn-tests-root— all 4 partitions compile the identical root build, so one shared cache is strictly better than 4 copies.Drops the reborn-tests cache footprint from ~30+ GB / 68 entries → ~2 entries that comfortably fit the LRU → the registry stays resident → no more cold re-downloads.
Trade-off
Crate-test target caching is now shared rather than per-crate, so a given crate may recompile its own (small) crate-specific code more often — but the shared dependency build (the bulk) and the registry (the download-relevant part) are always cached. The download/flake fix is the priority; if per-crate compile time regresses, we can add a separate per-crate target cache later.
Relationship to #5115
Complementary: this removes the cause of cold downloads (cache eviction);
CARGO_NET_RETRY(#5115) remains the safety net for the now-rare cold download.Automated agent-authored.