Repository navigation
ci-flake: cache native audio apt packages for backend unit shards - #23266
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d882c65dbf
ℹ️ 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".
| # Cold downloads hit the old 3m ceiling in runs 39737797248, | ||
| # 39741657961 and 39741511929. Keep a bounded cold-cache allowance; | ||
| # warm runs reuse .debs while apt still resolves current dependencies. | ||
| timeout-minutes: 5 |
There was a problem hiding this comment.
Raise the job timeout with the apt allowance
On a cold-cache run where this step uses most of its new five-minute allowance, a shard near the documented 602-second test duration cannot finish under the unchanged 15-minute job timeout: those two steps alone can consume just over 15 minutes, before checkout, Python/uv setup, dependency sync, Helm setup, cache restore/save, and teardown. Thus the slow-download scenario this change is intended to admit can still be terminated at the job level; increase the enclosing job timeout while retaining the 720-second test regression gate.
Useful? React with 👍 / 👎.
…3308) ## Summary The `apt-native-audio-replay-timeout` flake persisted after #23266 because that fix left three exposure paths on the hot step of `backend-unit-tests.yml` shards, all observed on 2026-10-22: 1. **Runner image rollout empties the cache.** The cache key pins `ImageVersion`; image `20261021.345.10` rolled out on 10-21/22, and with no `restore-keys` every shard of the first runs on the new image went cold into a 62.8 MB download. On throttled `azure.archive.ubuntu.com` runners that cannot finish inside the 5m step budget (observed 10–60s per small package). 2. **The 6-shard save race leaves no entry.** All shards save the same primary key concurrently; the cache service reserves per key, so losing shards log `Unable to reserve cache ... another job may be creating this cache` (run 39790722827 shard 1, 13:53:38Z) and shards whose install timed out never reach the save step at all — main-push run 39791659773 had 5/6 shards fail this way, so nothing repopulated the cache for anyone. 3. **Even a cache hit is not network-free.** Run 39782487842 shard 3 restored the cached `.deb`s at 12:57:16Z and still timed out at 13:02:29Z inside `apt-get update -qq`, which downloads package indexes from the mirror regardless of cached archives. Confirmed occurrences of the 5-minute `Install native audio replay dependencies` timeout: runs 39790722827 (PR #23302, shards 2+3), 39791659773 (main push, shards 1/2/4/5/6), 39782487842 (shards 3/4/5, one of them with a warm cache). The same code passed with a warm old-image cache at 12:15Z (run 39776810910), so this is CI infrastructure flakiness, not a regression. ## Changes (all inside this flake's own step in `.github/workflows/backend-unit-tests.yml`) - `restore-keys` fallback across `ImageVersion` bumps within the same runner OS: the `.deb` set tracks the ubuntu24 distro repos, not the image patch version, so the newest saved image keeps every run warm through rollouts. - Warm installs replay the cached dependency closure with `sudo dpkg -i` — zero network on the hot path. `apt-get` (update + `install -f`, bounded by the existing Acquire retries/timeouts) runs only as repair if the replay fails; the cold path is unchanged and keeps its 5m bounded allowance. - Single-writer cache save (shard 1 only), removing the concurrent same-key save race. A `restore-keys` fallback hit reports `cache-hit: 'false'`, so shard 1 also backfills the exact key for new image versions. `.github` is edited only for this flake's own step and no workflow is added, per the 10-22 CI flake-fix and caching direction. ## Verification - `actionlint` clean on the modified workflow; YAML parse and `bash -n` on the changed run block pass. - `scripts/pr-preflight --suggest`: ci lane, no product-invariant citations, no failure-class declaration required. - The restored-cache-but-still-timed-out shard (39782487842 shard 3) demonstrates the warm path must skip `apt-get update`; `dpkg -i` of the cached 87-`.deb` closure needs no indexes and no mirror. ## Risk - `dpkg -i` replays exactly the saved closure; if a future image bump ever made that replay fail, the apt repair path resolves and downloads only the delta before failing loudly — no silent skips. - Old-image cache entries are reused across image bumps; they come from the same ubuntu24 noble/noble-updates pools the images are built from, and a stale set degrades to the apt repair path, not a hang. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/23308?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/23308?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F23308&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
The backend unit shards intermittently exhaust their three-minute native audio installation deadline while downloading Ubuntu packages, before any tests execute. Cache the ffmpeg/libopus0
.debarchives per runner OS, architecture and image version, and save them immediately after installation so later test failures do not prevent cache seeding. Apt still updates its indexes and resolves/installs the current packages on every run. Allow five minutes for a cold cache while retaining the existing network bounds and job/test budgets.Confirmed the same timeout in three separate PR runs:
A successful peer shard downloaded the same 62.8 MB in seven seconds and finished installing in about 21 seconds. Failing shards were still making download progress at the old deadline. The extra two minutes accommodate cold mirror variability; subsequent runs reuse package archives.
David explicitly authorized CI flake fixes and dependency caching on 2026-10-22 (SCA-988). This change is limited to the failing native audio setup and its cache steps in the existing workflow.
Validation (run with
nice -n 19):actionlint .github/workflows/backend-unit-tests.ymlbackend/.venv/bin/python .github/scripts/check_workflow_apt_network_bounds.pybackend/.venv/bin/python -m unittest discover -s .github/scripts -p test_check_workflow_apt_network_bounds.py— 18 tests passed.backend/.venv/bin/python .github/scripts/check_ci_budget.py --refresh— no substantive inventory/budget changes; discarded unrelated Unicode serialization churn.make preflight— all 26 checks passed on the final commit.Ubuntu apt/cache execution remains for hosted CI; the local macOS host has no running Docker daemon.
Product invariants affected
none