Repository navigation
ci(package): retry apt fetches and docker builds behind the Ubuntu mirror - #18797
Conversation
…rror The package job builds three Docker images whose apt-get update/install hit archive.ubuntu.com with no retry, timeout, or mirror fallback. When the mirror is mid-sync every build dies in one of three ways: - per-package fetch stalls (~64 s each, `Ign:` lines) until the runner's 10-minute docker build timeout fires: https://github.com/stablyai/orca/actions/runs/33935104546/job/101221447425 - `apt-get update` exit 100 with `Hash Sum mismatch` on noble-updates/restricted/Packages.gz: https://github.com/stablyai/orca/actions/runs/33935104546/job/101226099525 - `apt-get update` exit 100 with `File has unexpected size ... Mirror sync in progress?`: https://github.com/stablyai/orca/actions/runs/33935244026/job/101231083497 Each Dockerfile now retries `apt-get update` up to five times with Acquire::Retries and a 30 s HTTP timeout, clearing /var/lib/apt/lists between attempts so a half-synced index is never reused, and passes the same acquire options to `apt-get install`. Each runner script retries the whole `docker build` once when the first attempt fails or times out.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughDockerfiles now retry Merge Risk: ⚪ Minimal · up to Docker image builds now tolerate transient Ubuntu mirror and build failures through bounded retries while preserving final failure behavior. No current merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Bounded apt retry loop in the three package-job Dockerfiles —
apt-get updateis now a 5-attempt loop withAcquire::Retries=5andAcquire::http::Timeout=30, clearing/var/lib/apt/lists/*between attempts so a half-synced index is never reused; the trailing list cleanup is preserved and theFROM/ARG/ENTRYPOINTsurface is untouched. - One
docker buildretry in the three runner scripts — each script retries a failed or timed-out build once, logging the first failure before the second attempt; only a second failure surfaces as an error.
The shell loop is correct: Docker runs RUN via /bin/sh -c without set -e, so apt-get update && break falls through to the retry branch on failure, break exits the loop with status 0 so done && apt-get install runs on success, and exit 100 only fires on the fifth failure. The two different retry mechanisms in the .mjs files are each the right shape for their docker() helper (the pairing and CLI scripts throw; run-headless-serve-shutdown-docker.mjs must use allowFailure because its fail() sets process.exitCode, which a try/catch would leave set on a recovered retry). The remaining bare apt-get update sites (config/docker/headless-pairing/Dockerfile.build, the ubuntu:20.04 floor-smoke) are out of scope — the former is unreferenced and the latter is release-cut-only and already wrapped in nick-fields/retry@v4.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…rror (stablyai#18797) The package job builds three Docker images whose apt-get update/install hit archive.ubuntu.com with no retry, timeout, or mirror fallback. When the mirror is mid-sync every build dies in one of three ways: - per-package fetch stalls (~64 s each, `Ign:` lines) until the runner's 10-minute docker build timeout fires: https://github.com/stablyai/orca/actions/runs/33935104546/job/101221447425 - `apt-get update` exit 100 with `Hash Sum mismatch` on noble-updates/restricted/Packages.gz: https://github.com/stablyai/orca/actions/runs/33935104546/job/101226099525 - `apt-get update` exit 100 with `File has unexpected size ... Mirror sync in progress?`: https://github.com/stablyai/orca/actions/runs/33935244026/job/101231083497 Each Dockerfile now retries `apt-get update` up to five times with Acquire::Retries and a 30 s HTTP timeout, clearing /var/lib/apt/lists between attempts so a half-synced index is never reused, and passes the same acquire options to `apt-get install`. Each runner script retries the whole `docker build` once when the first attempt fails or times out.

ELI5
When Ubuntu's package mirror is mid-sync, the three Docker images the
packagejob builds either hang downloading packages or fail with a corrupt index. Now each image retries the index refresh a few times (with per-download timeouts) and the runner scripts retry the wholedocker buildonce, so a flaky mirror no longer fails unrelated PRs.What Changed
config/docker/cli-launch-contract/Dockerfile,config/docker/headless-serve-shutdown/Dockerfile,config/docker/headless-pairing/Dockerfile: the bareapt-get updateis now a bounded 5-attempt loop with-o Acquire::Retries=5 -o Acquire::http::Timeout=30, clearing/var/lib/apt/lists/*between attempts so a half-synced index is never reused.apt-get installgets the same acquire options. Package lists are byte-identical;FROM,ARG,ENV,useradd,COPY,ENTRYPOINTuntouched.config/scripts/run-linux-cli-launch-contract-docker.mjs,config/scripts/run-headless-serve-shutdown-docker.mjs,config/scripts/run-headless-linux-pairing-docker.mjs:docker buildis retried once on failure or timeout; the first error is logged before the retry, and only a second failure throws.Why
Six
packagejob failures across four PRs tonight, all inside the DockerfileRUN apt-get update && apt-get install ...againstarchive.ubuntu.com(91.189.91.81), in three shapes:Ign:lines) until the runner's 10-minutedocker buildtimeout: https://github.com/stablyai/orca/actions/runs/33935104546/job/101221447425apt-get updateexit 100 withHash Sum mismatchonnoble-updates/restricted/Packages.gz: https://github.com/stablyai/orca/actions/runs/33935104546/job/101226099525apt-get updateexit 100 withFile has unexpected size (742980 != 742981). Mirror sync in progress?: https://github.com/stablyai/orca/actions/runs/33935244026/job/101231083497There was no retry, mirror, cache, or apt timeout anywhere (
Acquire::Retries|type=cache|mirror|sources.list|apt-get -ohas zero hits underconfig/docker/andconfig/scripts/run-*docker*.mjs). apt's ownAcquire::Retriescovers transient per-file failures; the outer loop covers the index-levelHash Sum mismatch/ wrong-size cases where apt refuses to proceed; the build-level retry covers a whole-image stall. No GitHub-Azure-only mirror, registry auth, or BuildKit cache mounts, because the reliability gate inconfig/reliability-gates.jsoncalso records local runs of these scripts.Linked Issue
N/A — CI infrastructure flake. Blocked PRs: #18739, #18744, #18747, #18764.
Visual Proof
N/A — CI-only change, no UI or user-facing behavior.
Testing
docker build -f config/docker/cli-launch-contract/Dockerfile config/docker/cli-launch-contractsucceeds locally (macOS, Docker Desktop); the aptRUNlayer completed in 16 s on the first attempt.node --checkon the three.mjsrunners;oxfmt --checkandoxlintclean on them.pnpm run check:code-quality:changed: 0 new findings across 3 changed files (oxlint, type-aware, React Doctor).CI on this PR exercises all three images via the
packagejob.I manually tested these changes locally
Automated tests added/updated, or explained why not below — no unit tests: the change is a Dockerfile shell loop and a
docker buildretry in CI runner scripts; thepackagejob on this PR is the test.Negative user-facing trade-offs
None for users. CI cost: only when the mirror is unhealthy, up to 5 × 20 s of extra sleep per image plus one extra
docker buildattempt (bounded by the existing 10-minute build timeout). On a healthy mirror the build is unchanged.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)