Repository navigation
fix(release): try an infra image's build, push or tag again while a registry rate-limits it - #272
Merged
Merged
Conversation
…egistry rate-limits it The first run by hand failed twice on a base image's pull: the ten builds started together, and public.ecr.aws answered 429 Too Many Requests, since it allows one anonymous pull a second. A failed build would also keep a release off PyPI. infra_build.py retry runs a command, and again after 30, 60 and 120 seconds while what it printed says a registry rate-limited it (ECR Public's 429, or the toomanyrequests error GHCR and Docker Hub send); any other failure fails at once. The workflow wraps docker build, docker push and imagetools create in it, the registry lookups behind exists and verify-record retry the same way, and the build matrix runs four at a time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
| process = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) | ||
| printed = [] | ||
| for line in process.stdout: | ||
| sys.stdout.write(line) |
There was a problem hiding this comment.
_streamed writes each line without flushing it. In the release workflow, Python's output goes to a pipe, so short messages stay buffered until enough output arrives or the helper exits. The retry warning can also remain hidden during the waits, making the job look stuck. Flush after forwarding each line and printing the warning, or run the helper with unbuffered output.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/scripts/infra_build.py
Line: 116
Comment:
**Progress messages arrive late**
`_streamed` writes each line without flushing it. In the release workflow, Python's output goes to a pipe, so short messages stay buffered until enough output arrives or the helper exits. The retry warning can also remain hidden during the waits, making the job look stuck. Flush after forwarding each line and printing the warning, or run the helper with unbuffered output.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Collaborator
Author
There was a problem hiding this comment.
Valid: fixed in #273, since this one had merged. _streamed flushes after each line it forwards, and the retry warning is printed with flush=True.
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.
What and why
The first run by hand of the release workflow on main (run 39511020412) failed on both attempts in the same place: a base image's pull,
429 Too Many Requestsfrompublic.ecr.aws.fail-fastthen cancelled the rest.What changes
infra_build.py retry COMMAND...runs the command, and again after 30, 60 and 120 seconds while what it printed says a registry rate-limited it: ECR Public's 429, or thetoomanyrequestserror GHCR and Docker Hub send. Any other failure fails at once.docker build,docker pushandimagetools createin it. The registry lookups behindexistsandverify-recordretry the same way.max-parallel: 4), so its burst of base-image pulls is smaller.The script still uses only the standard library and the docker CLI.
How it was tested
retrypasses a whole command line, flags included, through to the command.The real check is the next run by hand on main.
🤖 Generated with Claude Code
The PR appears safe to merge, with a non-blocking improvement needed to show command output promptly.
Fix with agent prompt
Summary
Adds bounded retries for registry rate limits during image builds, pushes, tagging, and lookups.
One non-blocking issue remains: forwarded output and retry warnings can stay buffered.
Reviews (1) · Last reviewed commit: "fix(release): try an infra image's build..." · Reviewed by Greptile