Skip to content

Commit

Permalink
fix: jitter Docker build startup (#3646)
Browse files Browse the repository at this point in the history
ECR Public will throttle to 1 image pull/second.

Since we start multiple workflows in parallel, make sure they don't all pull from ECR Public at the exact same time by jittering their start times.



---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
  • Loading branch information
rix0rrr committed Jul 5, 2022
1 parent 3fda710 commit 5857ea8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ jobs:
${{ runner.os }}-buildx-${{ hashFiles('superchain/*') }}-
${{ runner.os }}-buildx-
# 1 pull per second from ECR Public
- name: Jitter the start time to avoid ECR Public throttling
id: sleep-start
if: steps.should-run.outputs.result == 'true'
run: |-
sleep $((RANDOM % 60))
- name: Determine build time
id: build-time
if: steps.should-run.outputs.result == 'true'
Expand Down

0 comments on commit 5857ea8

Please sign in to comment.