[review] fix: ECR Public のレート制限による push 失敗に対処 - #50
Merged
Conversation
全バージョンを一斉に push すると ECR Public の API クォータ (PutImage / InitiateLayerUpload / CompleteLayerUpload はいずれも 10 req/sec) を超えて "toomanyrequests: Rate exceeded" で失敗していた。 - build_and_push / create_manifest に max-parallel: 8 を設定 - build-push-action では push せず、リトライ付きの docker push に分離 - docker manifest push にも同様のリトライを追加 - リトライの待ち時間を見込んで create_manifest の timeout を 10 分に延長 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
背景
Docker build and pushでtoomanyrequests: Rate exceededによる失敗が頻発していました。PutImage/InitiateLayerUpload/CompleteLayerUploadはいずれも 10 req/sec( service quotas )no-cache: trueで毎回全レイヤーが新規アップロードになるため、ピークで容易に上限を超えるなお 31548782825 で実際に失敗したジョブは
3.3.2, arm64の 1 つだけで、残りの X は fail-fast による巻き添えキャンセルです。変更内容
同時実行数を絞る
build_and_push( 86 leg )とcreate_manifest( 43 leg )の両方にmax-parallel: 8を設定。docker manifest pushもPutImageを消費するため、そちらにも入れています。push にリトライを追加
docker/build-push-action自体にリトライ機構がないため、push: false+load: trueでビルドのみ行い、push を独立ステップに分離しました。15s → 30s → 45s → 60s のバックオフで最大 5 回リトライします。docker manifest pushにも同じリトライを適用しています。リトライの待ち時間( 最大 150s )を見込んで
create_manifestのtimeout-minutesを 5 → 10 に延長しました。確認したこと
YAML.safe_load_fileでパース、bash -nで両スクリプトの構文チェックload: trueが default builder( docker driver )で動作し、ローカルイメージストアにタグ付きで載ることを確認。ログ上この repo の runner はpushing ... with docker:= docker driver今回入れていないもの
fail-fast: false: 1 leg の失敗で残りのバッチが巻き添えキャンセルされる挙動は残ります。create_manifestは matrix の全 leg 成功が条件なので、付けても付けなくても manifest の整合性には影響しません( 逆にcreate_manifestにif: always()を付けるのは、--amendが前回 run の古い arch タグと混ざる危険があるため NG )🤖 Generated with Claude Code