perf: run a chart's bundled image pushers concurrently - #291
Open
cristifalcas wants to merge 1 commit into
Open
Conversation
A chart's image pushers ran one at a time. Each pusher is a separate
process that re-does the registry auth handshake from scratch before it
looks at anything, so the wall time scaled linearly with the image count
even when every image was already present in the registry. An 11-image
chart spent over a minute per `helm_upgrade` re-checking images it had
already pushed.
The same sequential loop was duplicated across the runner, pusher and
registrar, so hoist it into `helm_utils.RunImagePushers` and run the
pushers concurrently, bounded by `RULES_HELM_IMAGE_PUSH_CONCURRENCY`
(default 4). The default is deliberately modest: the setting multiplies an
already-parallel conversation rather than starting one -- remote.Write
uploads a single image's layers 4 at a time, and nests that again per child
for a multi-platform index -- and a registry that throttles with a bare
HTTP 429 instead of a docker-distribution error body gets no retry out of
go-containerregistry, so an aggressive default turns throttling into a
failed push.
Three details follow from running the pushers at once:
- Every pusher is announced before its process starts, so the run is
never silent and a push that stalls against a registry names itself. A
CI step with a no-output timeout would otherwise be killed with an
empty log.
- Concurrent pushers writing to a shared stdout interleave line by line,
so each one's output is captured and replayed as a single block when it
exits. At a concurrency of 1 nothing can collide, and the pusher
inherits stdout and stderr and writes through live -- which is what
makes `RULES_HELM_IMAGE_PUSH_CONCURRENCY=1` a real fallback to the
previous behaviour rather than a nominal one.
- Failing on the first error would abandon pushers already in flight.
Every pusher now runs to completion and the errors are joined, so a run
reports all of its failures rather than only the earliest.
The variable is documented in the README and on each of the four rules that
honour it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cristifalcas
marked this pull request as ready for review
August 5, 2026 19:01
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.
A chart's image pushers ran one at a time. Each pusher is a separate process that re-does the registry auth handshake from scratch first thing, so the wall time scaled linearly with the image count even when every image was already present in the registry. An 11-image chart spent over a minute per
helm_upgradere-checking images it had already pushed.Run the pushers concurrently, up to
RULES_HELM_IMAGE_PUSH_CONCURRENCY(default 8). Set it to 1 to restore the previous serial behaviour.Consequences:
Test: ~15s with this, against ~68s with main.