Repository navigation
xtask: Retry transient registry errors when pulling images - #92
Draft
cgwalters-bot wants to merge 1 commit into
Draft
cgwalters-bot wants to merge 1 commit into
cgwalters-bot wants to merge 1 commit into
Conversation
Several CI jobs failed on the first attempt of `podman pull -q --retry 5 --retry-delay 5s` with `writing blob ... happened during read: unexpected EOF`. podman does not count that error as retryable, so its `--retry` never kicked in.
This adds `cargo xtask pull-images IMAGE...`. It runs `podman pull -q` and retries with capped exponential backoff, but only when stderr shows a transient transport error (EOF, connection reset/refused, i/o timeout, TLS handshake, HTTP 429/5xx). Signature-policy rejections, unknown manifests and other errors fail at once. `BOOTC_CI_RETRIES` and `BOOTC_CI_DELAY` set the attempt count (capped at 10) and the initial delay. The defaults are 3 attempts and 2s, so local runs stay fast.
The `package` pull and `_pull-lbi-images` now go through it. `build` also pre-pulls `{{base}}` when it is not already local, so jobs run with `BOOTC_SKIP_PACKAGE=1` no longer leave that pull to `podman build`. The Dockerfile never uses `buildroot_base`, so `build` has nothing to pre-pull for it. `build-fetch` keeps its unconditional retry loop, and the workflows and `podman push` are unchanged.
Verified with `cargo test -p xtask` (data-driven tests through an injected runner and sleeper; nothing really sleeps), `just --dry-run package`/`build`, and a fake `podman` on PATH. rustfmt and clippy were not installed where this was written, so `cargo fmt --check` and `cargo clippy` were not run.
One review pass found no blockers. Open follow-ups:
- podman now uses its default internal retries rather than `--retry 5`, and errors outside the list, such as DNS failures, now fail without a retry.
- Jobs that never built xtask now compile it.
- With CI's 10/60 settings, a misclassified error can take about 17 minutes per image before it fails.
Generated-by: https://github.com/cgwalters/#llms
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.
Several CI jobs failed on the first attempt of
podman pull -q --retry 5 --retry-delay 5swithwriting blob ... happened during read: unexpected EOF. podman does not count that error as retryable, so its--retrynever kicked in.This adds
cargo xtask pull-images IMAGE.... It runspodman pull -qand retries with capped exponential backoff, but only when stderr shows a transient transport error (EOF, connection reset/refused, i/o timeout, TLS handshake, HTTP 429/5xx). Signature-policy rejections, unknown manifests and other errors fail at once.BOOTC_CI_RETRIESandBOOTC_CI_DELAYset the attempt count (capped at 10) and the initial delay. The defaults are 3 attempts and 2s, so local runs stay fast.The
packagepull and_pull-lbi-imagesnow go through it.buildalso pre-pulls{{base}}when it is not already local, so jobs run withBOOTC_SKIP_PACKAGE=1no longer leave that pull topodman build. The Dockerfile never usesbuildroot_base, sobuildhas nothing to pre-pull for it.build-fetchkeeps its unconditional retry loop, and the workflows andpodman pushare unchanged.Verified with
cargo test -p xtask(data-driven tests through an injected runner and sleeper; nothing really sleeps),just --dry-run package/build, and a fakepodmanon PATH. rustfmt and clippy were not installed where this was written, socargo fmt --checkandcargo clippywere not run.One review pass found no blockers. Open follow-ups:
--retry 5, and errors outside the list, such as DNS failures, now fail without a retry.Closes #86