-
Notifications
You must be signed in to change notification settings - Fork 418
chore(ci): reduce docker hub rate limit usage in hive-consume workflow #2004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
danceratopz
merged 5 commits into
ethereum:forks/amsterdam
from
spencer-tb:chore/hive-consume-docker-rate-limits
Jan 13, 2026
+126
−5
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0132094
chore(ci): use docker image cache to reduce docker hub rate limits
spencer-tb f45dcf6
chore(ci): address reviewer comments
spencer-tb 2aa265c
chore(ci): address reviewer comments
spencer-tb 5f5cdc5
Update .github/actions/cache-docker-images/action.yaml
spencer-tb 45d5078
chore(ci): use title case for workflow job names
spencer-tb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Cache Docker Images | ||
| description: Cache Docker images to avoid Docker Hub rate limits | ||
|
|
||
| inputs: | ||
| images: | ||
| description: "Space-separated list of Docker images to cache" | ||
| required: true | ||
| default: "docker.io/ethereum/client-go:latest docker.io/alpine:latest docker.io/library/golang:1-alpine" | ||
| cache-key-prefix: | ||
| description: "Prefix for the cache key" | ||
| required: false | ||
| default: "docker-images" | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Get week number | ||
| id: week | ||
| shell: bash | ||
| run: echo "num=$(date +%U)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Restore Docker image cache | ||
| id: cache-restore | ||
| uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | ||
| with: | ||
| path: /tmp/docker-images | ||
| key: ${{ inputs.cache-key-prefix }}-week${{ steps.week.outputs.num }}-${{ hashFiles('.github/actions/cache-docker-images/action.yaml', 'execution-specs/.github/actions/cache-docker-images/action.yaml') }} | ||
|
|
||
| - name: Pull and save Docker images | ||
| shell: bash | ||
| run: | | ||
| mkdir -p /tmp/docker-images | ||
| for image in ${{ inputs.images }}; do | ||
| # Create a safe filename from image name | ||
| filename=$(echo "$image" | sed 's/[\/:]/-/g').tar.gz | ||
| if [ ! -f "/tmp/docker-images/$filename" ]; then | ||
| echo "Pulling $image..." | ||
| docker pull "$image" | ||
| echo "Saving $image to /tmp/docker-images/$filename..." | ||
| docker save "$image" | gzip > "/tmp/docker-images/$filename" | ||
| else | ||
| echo "Cache hit for $image, skipping pull" | ||
| fi | ||
| done | ||
|
|
||
| - name: Save Docker image cache | ||
| if: steps.cache-restore.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | ||
| with: | ||
| path: /tmp/docker-images | ||
| key: ${{ inputs.cache-key-prefix }}-week${{ steps.week.outputs.num }}-${{ hashFiles('.github/actions/cache-docker-images/action.yaml', 'execution-specs/.github/actions/cache-docker-images/action.yaml') }} | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: Load Cached Docker Images | ||
| description: Load Docker images from cache | ||
|
|
||
| inputs: | ||
| cache-key-prefix: | ||
| description: "Prefix for the cache key" | ||
| required: false | ||
| default: "docker-images" | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Get week number | ||
| id: week | ||
| shell: bash | ||
| run: echo "num=$(date +%U)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Restore Docker image cache | ||
| uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 | ||
| with: | ||
| path: /tmp/docker-images | ||
| key: ${{ inputs.cache-key-prefix }}-week${{ steps.week.outputs.num }}-${{ hashFiles('.github/actions/cache-docker-images/action.yaml', 'execution-specs/.github/actions/cache-docker-images/action.yaml') }} | ||
|
|
||
| - name: Load cached Docker images | ||
| shell: bash | ||
| run: | | ||
| if [ -d /tmp/docker-images ]; then | ||
| for file in /tmp/docker-images/*.tar.gz; do | ||
| if [ -f "$file" ]; then | ||
| echo "Loading $file..." | ||
| gunzip -c "$file" | docker load | ||
| fi | ||
| done | ||
| else | ||
| echo "::error::No cached images found - cache may not exist yet. Run the cache-docker-images action first." | ||
| exit 1 | ||
| fi | ||
danceratopz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.