Repository navigation
CI: keep ccache on failed builds, bound the CUDA Windows timeout, stop uploading the debug bundle on green runs - #81
Conversation
…p uploading the debug bundle on green runs
… CUDA Windows cap to 345
|
Review round 1 applied. Two findings were genuine blockers; both verified against real data before changing anything. 1. Raised to 345: under GitHub's 360 hard cap, clear of the observed max by 40 min, still catches a genuine wedge. 2. All 9 Also in this push:
Correction to the PR description. It says the child "must stay UNDER assemble's That points at a real pre-existing problem this PR does not fix: simulating the early-start pattern over 65 historical runs, 5 (7.7%) would have blown the 330-minute waiter deadline, dominated by queue wait rather than build time. Raising the waiter deadline and assemble's 350 is the change that would actually save those runs. Left out deliberately -- it is a behaviour change to the publish path and wants its own PR. Not changed, with reasons:
All 12 workflow files parse. |
…fix the same cancelled-vs-failure bug on the rescue bundle
|
Round 2 applied. Verdict was no blockers, and the round-1 premise came back confirmed by direct experiment rather than inference: on a probe repo, a job killed by Two changes in this push. 1. I set both to So on the timeout path evict now skips and the whole window goes to the save; on the ordinary failure path both still run. All 9 sites in both directions, verified through the YAML parser rather than grep: 2. I gated it Worth noting nothing else in Also confirmed by the reviewer and unchanged:
One consequence I am accepting rather than fixing: a step still running when the teardown window expires is recorded Not taken: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0eb29fa16
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # the CANCELLATION path, not the failure path, so !cancelled() would | ||
| # skip the save on the single most expensive case -- a leg that | ||
| # compiled for hours and then hit the cap. | ||
| if: ${{ always() }} |
There was a problem hiding this comment.
Update the stale cache-persistence rationale
When a configure, build, packaging, or upload step fails, always() now persists the partial cache, but the ccache setup at lines 265-267 still says that a failed package does not persist a cache for an unshipped bundle; the Ubuntu setup also refers readers back to that rationale. Update that earlier explanation so maintainers are not given the opposite failure behavior.
Useful? React with 👍 / 👎.
| # always(), not !cancelled(): a timeout-minutes expiry puts the job on | ||
| # the CANCELLATION path, not the failure path, so !cancelled() would | ||
| # skip the save on the single most expensive case -- a leg that | ||
| # compiled for hours and then hit the cap. |
There was a problem hiding this comment.
Condense the repeated cache commentary
This nine-line explanation, together with the preceding eviction explanation, is duplicated across every new cache-save site and repeatedly hard-wraps sentences. The repository requires comments to remain concise, avoid excessive commentary, and avoid fixed-column wrapping, so reduce this to the non-obvious condition rationale rather than copying the full operational history into every workflow.
AGENTS.md reference: AGENTS.md:L75-L81
Useful? React with 👍 / 👎.
| # the CANCELLATION path, not the failure path, so !cancelled() would | ||
| # skip the save on the single most expensive case -- a leg that | ||
| # compiled for hours and then hit the cap. | ||
| if: ${{ always() }} |
There was a problem hiding this comment.
Use a fresh key for each failed cache snapshot
When a failed or cancelled attempt saves this partial directory, it claims the same tag-specific primary key that ccache-action restores at line 100; the trailing dash is deliberately an exact match. GitHub cache entries are immutable, so a rerun or superseding build can compile the remaining objects but cannot replace that first partial snapshot, leaving the next build to restore an unnecessarily incomplete cache. Add a unique attempt suffix to the manual save key while retaining the existing restore prefix.
Useful? React with 👍 / 👎.
| # Kept but moved after publish and gated on failure(), so it still rescues | ||
| # a failed-publish run without re-running the 40-job matrix, and costs | ||
| # nothing when the run is green. |
There was a problem hiding this comment.
Describe the cancellation fallback accurately
When the assemble job is cancelled by its timeout or a superseding nightly, always() && !success() is intended to run this upload even though failure() is false, but the immediately preceding summary still says the step is gated on failure(). Update that summary so it does not contradict the condition and the detailed cancellation rationale directly below it.
Useful? React with 👍 / 👎.
| if-no-files-found: warn | ||
| # rerun-failed-jobs reuses the run id, and artifacts persist across | ||
| # attempts, so a second failed attempt would 409 on the duplicate name. | ||
| overwrite: true |
There was a problem hiding this comment.
Preserve the previous rescue artifact across reruns
On a rerun of failed jobs where the previous attempt already uploaded this rescue bundle, overwrite: true deletes that artifact before uploading its replacement. If the new attempt is cancelled, times out, or loses the artifact service during this roughly 688 MiB upload, the only complete rescue bundle is lost; this is especially likely when the step is running inside the short cancellation teardown window described above. Give each run attempt a distinct artifact name instead of overwriting the prior fallback.
Useful? React with 👍 / 👎.
Three independent CI fixes, each from a measurement on real runs. No build logic changes.
1.
Save ccachenow survives a failed buildSave ccachehad noif:, so it only ran when every prior step succeeded. A failed or timed-out build discarded a cache containing hundreds of already-compiled objects, and left a hole in the cache lineage.That matters because ccache hit rate tracks the gap between the restored cache tag and the tag being built:
The saved-tag lineage for the portable profiles is
b10241, b10265, b10290, b10297, b10310-- b10298 is missing, so b10310 fell back to b10297 (gap 13) instead of gap 12. Every hole widens the next gap.Now
if: ${{ !cancelled() }}on all 9Save ccachesteps across the 6 prebuilt workflows. Notalways(): a cancelled job has no useful cache state.2. CUDA Windows timeout is bounded under
assembleassemblesetstimeout-minutes: 350. The build children set nothing, so they inherit GitHub's 360-minute default.Assemble therefore expires ~11 minutes before the job it is waiting on. A build leg in the 350-360 minute band kills the publish while the build is about to succeed, discarding the whole 40-job run.
x64/cuda12-portablehas already been observed at 214 minutes, so the band is reachable.Adds
timeout-minutes: 300to the CUDA Windows job so it fails cleanly inside assemble's budget.3. The debug bundle no longer uploads on green runs
Upload full release set (artifacts)had noif:and sat before the publish gate, so every run uploaded ~688 MiB of Actions artifact storage for a bundle nothing reads:download-artifactin this repo references it (children pullinputs.source_artifact, assemble pullspattern: app-*)actions/artifactsreturns nothinginstall_llama_prebuilt.py->release_asset_download_url)Uploading ahead of the gate also meant unpublished, unverified builds were world-downloadable -- on a public repo any signed-in user can download an artifact.
The step is kept, moved after
Publish GitHub releaseand gated onfailure(), so it still rescues a failed publish without re-running the matrix, and costs nothing when the run is green.if-no-files-foundrelaxed towarnso an early failure with nodist/cannot turn one diagnosable failure into two.Why this matters beyond CI hygiene
On 2026-08-07 org-wide Actions scheduling stalled for ~39 minutes of dead queue: Actions artifact storage had reached ~492 GiB, 449 GiB of it in this repo, and GitHub stopped scheduling runs across
unslothai/*while personal-account repos ran the same workflows normally. Purging artifacts restored scheduling within ~45 seconds. Repo retention was already 1 day; volume alone did it.Note every prebuilt is currently stored twice -- as an Actions artifact and as a release asset (measured on b10297: 37 artifacts / 7.42 GiB vs 42 assets / 7.81 GiB). A follow-up can delete each run's
app-*artifacts once the release is published and verified, which reclaims 99.3% of that. This PR does not attempt it.Test plan
Save ccacheruns on a failed legccache statsgroup -- this is the first run to restore a post-fix uncapped cache (the 500 MB cap was lifted in 4a03725 on 08-07 09:52, but b10310 restored a cache written at 04:14, before it), so the hit rate should recover toward 68%+unsloth-prebuilt-<tag>artifactAll 7 workflow files parse (
yaml.safe_load).