Repository navigation
ci: keep a timed-out apt download instead of discarding it - #5522
Merged
Merged
Conversation
A slow mirror stops Install Tier 2 Packages at its 10-minute step timeout
with every finished .deb already in the archive dir, and Save apt Downloads
then never ran: its `if:` carried no status function, so GitHub applied an
implicit success() and skipped the step. Run 45194364427 reached Get:145 of
roughly 594 packages and threw all of it away; the next run started at Get:1
and timed out again. On a slow link the download cannot fit in one window,
so the loop never converges.
Two changes make progress cumulative:
* Save apt Downloads runs on (!cancelled()) instead of success, so a
timed-out install still persists what it downloaded. The shared cache
action's inner save step gets the same treatment, since an inner step
otherwise inherits the failed job status.
* A cache entry is immutable, so saving again under the same key is a
no-op. The save key now ends in the .deb count at save time and both
restore steps match the prefix and take the newest entry. The key stays
content-derived (no run or PR identifiers), so per-PR entries still
cannot overflow the 10 GB cache.
Tests updated to pin the new contract: the save key must end in the count,
both consumers must restore by prefix, and the save must survive a failure.
6 tasks
zackees
enabled auto-merge
November 23, 2026 18:09
KelboLive
pushed a commit
to KelboLive/obs-studio
that referenced
this pull request
Nov 29, 2026
The Tier 2 jobs download ~339 MB of .debs inside a ten-minute step. On a slow link no build ever finishes the download, so obs-rust#5522 (keep a timed-out download instead of discarding it) preserves partial progress but has no run that ends with a complete archive to publish. The archive only grows when a build gets lucky. Add ci/seed_apt_cache.py and apt-seed.yaml: a scheduled job with no build to lose. It restores the same cache entry the builds restore, downloads the package list into the same archive directory in bounded attempts, and saves the larger result under the same content key with the .deb count appended. Every scheduled run either finishes the set or leaves a strictly larger archive than it found, so the cache converges without a human and without depending on a build surviving its timeout. The seed reuses build-project's exact path and key shape on purpose: a seed that writes a different path or key warms nothing. ci/test_apt_seed.py pins that parity against build-project.yaml rather than against a copy of the key, so a future edit to either side fails the test instead of silently de-warming the cache. Job guards follow the repository rules: root jobs in a scheduled workflow skip a scheduled run in a fork (obs-rust#1258), cache writers publish only from master, and the workflow is declared in ci.toml's allow list.
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.
The loop
On a slow link the 339 MB apt archive cannot download inside one 10-minute step window, and today a timed-out download is thrown away:
Install Tier 2 Packages 📦hitstimeout-minutes: 10with every finished.debalready in$TIER2_APT_ARCHIVES.Save apt Downloads 💾never runs — itsif:has no status function, so GitHub applies an implicitsuccess().Get:1.Run 45194364427 reached
Get:145of roughly 594 packages and discarded all of it; step 10Save apt Downloads 💾showsskippedin the job's step list. That is the "keeps happening over and over" behaviour: the archive never advances past whatever one timeout window fetched, so it never converges.Fix
1. Save on failure.
Save apt Downloads 💾now runs on(!cancelled()). The shared./.github/actions/cachewrapper's inner save step gets the same treatment — an inner step would otherwise inherit the failed job status and still skip.!cancelled()rather thanalways(): a cancelled run must not write a half-filled entry, but a failed one should keep its downloads.2. Make the archive cumulative. A cache entry is immutable, so re-saving under the same key is a silent no-op and one
always()save would freeze the archive at whatever the first failure fetched. The save key now ends in the.debcount at save time:and both restore steps match the prefix and take the newest (largest) entry:
The key stays content-derived — no run id, no PR number — so the original constraint that per-PR entries overflowed the 10 GB cache still holds, and saves remain master-only. Entries stop being created once the count stabilises, i.e. once the archive is complete.
Tests
ci/test_tier2_apt_cache.pyandci/test_tier2_build_setup.pyupdated to pin the new contract rather than the old one:${{ steps.apt-count.outputs.count }}and must not containgithub.!cancelled()) and must skip an empty archiveNot addressed here
This makes the download converge across runs on a slow link; it does not make it fast. The larger win is still
ghcr.io/obs-rust/tier2-linuxbeing readable anonymously soTIER2_PREBAKEDcan betrueand the apt fetch leaves the critical path entirely — the package is currently private (anonymous probe 401), which needs package-admin access, tracked in #5501.