CI: the cache warm on main builds its five shards in parallel

`cargo xtask ci warm` builds only shard GATE_SHARD of GATE_SHARDS when the gate sets them, and
every shard when neither is set; one set without the other, a non-number, a count other than the
shard count, or a shard out of range is an error. ci.yml turns on the gate's `warm-split`, so
main's warm runs as five `cache warm <k>/5` legs and a `cache warm` leg that saves the entry.

The cold-cache cleanup waits for the split legs before it times the saving leg's start, and fails
when a split leg fails. The cache-prune watch and both jobs' timeouts cover a split leg followed
by the saving leg.
This commit is contained in:
dotCooCoo committed 2026-11-29 06:09:05 -08:00
1 parent d4d8da4544
commit 3a617b1324
5 files changed
+222 -31

No files matched your search

+15 -8
View File
@@ -46,6 +46,9 @@ jobs:
test-shards: 5
shard-command: cargo xtask ci shard
warm-command: cargo xtask ci warm
# The warm build runs as one `cache warm <k>/5` leg per shard, in parallel (each builds what
# its shard builds), and `cache warm` puts their files into the one entry it saves.
warm-split: true
# The dependency cache also keeps the compiled workspace crates and test executables, so a
# pull request's shards rebuild only the crates its changes reach. Each main run's `cache
# warm` leg saves a rolling entry of its own, every leg restores the newest one, and
@@ -61,13 +64,14 @@ jobs:
# Keeps one rolling gate entry on main, so the repository stays within its 10 GB Actions cache
# budget. It runs beside the gate and prunes each time the `cache warm` leg finishes saving. A
# failed prune warns instead of failing the run, and cache-prune.yml prunes again after every
# attempt, re-runs of failed jobs included. `watch-minutes` is longer than the gate's
# `timeout-minutes`, so the watch outlasts a cold `cache warm` leg.
# attempt, re-runs of failed jobs included. `watch-minutes` is longer than twice the gate's
# `timeout-minutes`, so the watch outlasts a cold `cache warm <k>/5` leg followed by a
# `cache warm` leg.
cache-prune:
name: cache prune
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
timeout-minutes: 170
timeout-minutes: 320
permissions:
actions: write
steps:
@@ -80,7 +84,7 @@ jobs:
continue-on-error: true
with:
watch: true
watch-minutes: 160
watch-minutes: 310
saving-jobs: |
^gate( / cache warm \(.*\))?$
@@ -90,14 +94,17 @@ jobs:
# the old entries when the `cache warm` leg starts saving (scripts/ci-clear-rolling-cache.py).
# When the leg fails or is canceled, before its save or during it, this job fails too, so "Re-run
# failed jobs" runs it again beside the re-run leg. The leg starts after `gate / select legs` and a
# free runner: the script fails when the leg has not started within 120 minutes, and then waits
# up to 160 minutes from the leg's start. This job's timeout is longer than both together, so the
# script reports a leg that starts late with its own error before the job times out.
# free runner, and with `warm-split` after every `cache warm <k>/5` leg. The script suspends its
# start deadline while any split leg is queued or running, then allows 180 minutes from the last
# split completion for the saving leg to start. Without split legs, it allows 180 minutes from
# the script's start. A failed split leg fails this job too. The script then waits up to 160
# minutes from the saving leg's start. GitHub's 360-minute job limit can end this job before the
# script's deadlines expire when split builds or runner waits take too long.
cold-cache-clear:
name: cold cache clear
if: github.event_name == 'schedule'
runs-on: ubuntu-24.04
timeout-minutes: 290
timeout-minutes: 360
permissions:
actions: write
steps: