Skip to content

xtask: Retry transient registry errors when pulling images - #92

Draft
cgwalters-bot wants to merge 1 commit into
cgwalters-forge:mainfrom
cgwalters-bot:dispatch/implement/agent-run-41757387607
Draft

cgwalters-bot wants to merge 1 commit into
cgwalters-forge:mainfrom
cgwalters-bot:dispatch/implement/agent-run-41757387607

Conversation

@cgwalters-bot

Copy link
Copy Markdown
Collaborator

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.

Closes #86

Generated by dispatch · ◷

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:deep Bot draft that needs a real review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant