Skip to content

ci: retry the local registry's image pull while mirror.gcr.io rate-limits it - #978

Open
cikowski wants to merge 2 commits into
mainfrom
ci/registry-pull-retry
Open

cikowski wants to merge 2 commits into
mainfrom
ci/registry-pull-retry

Conversation

@cikowski

@cikowski cikowski commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Every job that starts a local registry pulls mirror.gcr.io/library/registry:2 anonymously with a bare docker run, so one rate-limited pull fails the job. On 2026-12-01, integration-local-slow (7/12) failed three times in a row on the v0.9.1675 bump commit at "Start the local registry", with 429 Too Many Requests and then error from registry: Quota exceeded for quota metric 'Requests per project in the US multi-region' ... per minute. Because publish-pypi.yml waits for Local backends to pass on the tagged commit, that held the release back. Every other shard passed.

This change pulls the registry image through the repo's existing infra_build.py retry before each docker run. That helper already retries docker push and the release's pip installs while a registry rate-limits them, waiting 30, 60 and then 120 s. Its rate-limit pattern now also matches mirror.gcr.io's quota error, which carries no 429.

  • local-backends.yml: "Start the local registry" in integration-local-slow and integration-local-gateway pull with retry. integration-local started the registry as a services: container. The runner pulls a services container before any step runs, so nothing can retry it. It is now the same "Start the local registry" step as the other two jobs, on the same port 5000.
  • publish-pypi.yml: the two steps that start the computers' local registry pull it with retry first.
  • infra_build.py: _RATE_LIMITED also matches Quota exceeded for quota metric.

CI config and its helper only. No product code changes, and no test's selection or behaviour changes.

Rollout

Takes effect on the next workflow run after merge. Nothing to deploy and nothing to migrate. A pull that is still rate-limited after the last wait fails the step as it does today, about 3.5 minutes later. Revert: revert this commit.

How it was tested

Validation: head 4f638f78.

Done when Status Evidence
a registry image pull that hits mirror.gcr.io's quota error is tried again MET test_retry_tries_again_while_mirror_gcr_io_is_over_its_quota: the quota message from the failed run is retried once and the pull then succeeds. fails on main's infra_build.py (1 failed, 12 passed on -k retry, run by the test review) and passes on head
every step that starts a local registry pulls its image with retry first MET test_every_local_registry_pulls_its_image_with_retry_before_it_starts reads every workflow: all 5 registry starts pull with retry before docker run, and no job keeps a services: registry. Removing the 5 pull lines leaves the rest of the suite green, which is why it was added
the registry still serves on port 5000 in integration-local CI integration-local on this PR
  • CI on this PR runs the unit tier (including tst/unit/test_infra_build_script.py) and every Local backends job that starts a registry.
  • Not run locally: the repo's suites (CI only for this change).
  • Screenshots: none (CI config).

Quality bar

Head 4f638f78.

Gate Ran on Result
Local CI 4f638f78 relaxed: no full local suites for a CI-config change; the test review ran tst/unit/test_release_infra_images.py (64 passed) and tst/unit/test_infra_build_script.py -k retry (13 passed)
Baseline on main df247358 both new tests fail on main (assert 4 == 5; 1 of 13 retry tests fails), as intended
CI 4f638f78 35 green. Two jobs were rerun: a gateway shard whose test build of a site image hit a mirror.gcr.io 429 after this PR's retried registry pull had waited out the quota, and a cancelled plugin-api run
Greptile 4f638f78 5/5
Test review 4f638f78 PASS after round 2 (round 1 FAIL: no test failed if the workflow wiring was reverted): 64 passed, 5 of 5 wiring mutants killed, the new test fails on main
Adversarial review f5f81942 PASS: same port and host for integration-local, no dockerd restart after the registry starts, timeouts fit the worst-case wait
Conformance review f5f81942 PASS
pr_gate.py check 4f638f78 runs at ready

Relaxations: local CI, as above (CI config only; the touched test files were run by the test review).

Not in this PR

  • mirror_base_images.py keeps its own shorter waits (10 and 20 s). A base it cannot pull falls back to its build's own pull, so a rate limit there doesn't fail a job.

Known limitations:

  • Quota exceeded for quota metric also matches a per-day quota, which a retry can't clear, so such a failure takes about 3.5 minutes longer to fail: the per-minute one is what failed the runs here.
  • The two registry steps in publish-pypi.yml run only on a release, so this PR's CI doesn't run them; the wiring test covers them.

🤖 Generated with Claude Code

Confidence Score: 5/5RetriggerView in Greptile

The PR appears safe to merge; no actionable issues were found.

Summary

Adds retries before all five local registry starts and recognizes mirror.gcr.io's quota error.

  • Local registry pulls retry quota failures before startup.

Reviews (5) · Last reviewed commit: "test: every local registry start pulls i..." · Reviewed by Greptile

…mits it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cikowski
cikowski requested a review from a team as a code owner December 1, 2026 16:08

@agutmanstein-scale agutmanstein-scale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude, on Alec's behalf: approving. This only changes CI. Each local registry pulls its image with retry before docker run, integration-local's services container becomes the same step on port 5000, and the rate-limit pattern gains mirror.gcr.io's quota error.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants