Skip to content

Commit f0e61f1

Browse files
Giulio2002SharovBot
andauthored
[SharovBot] ci(kurtosis): cache third-party containers and erigon build layers (#19493)
**[SharovBot]** ## Summary Two caching strategies for `assertoor_regular_test` and `assertoor_pectra_test` to reduce runtime and eliminate Docker Hub dependency on every run. --- ## 1. BuildKit GHA layer cache for the erigon Docker build **Before:** bare `docker build -t test/erigon:current .` — no caching, full recompile every run **After:** `docker/build-push-action@v6` with `cache-from/cache-to: type=gha` - Caches all Docker layers (including Go module download) in GitHub Actions cache - Both jobs share scope `kurtosis-erigon-build` — same commit = same layers, only one cold build per push - **Expected speedup:** ~10–15 min cold → ~3–5 min warm on cache hit ## 2. `actions/cache` + `docker save/load` for pinned third-party containers | Image | Size (approx) | |-------|--------------| | `sigp/lighthouse:v7.0.1` | ~300 MB compressed | | `consensys/teku:25.9.1` | ~250 MB compressed | | `ethpandaops/assertoor:v0.0.17` | ~80 MB compressed | - Cache key = all three image name+tag strings → auto-invalidates on any version bump - Both jobs use the same cache key (same images in both configs) - On cache miss: pulls from Docker Hub + saves to cache; on hit: loads from cache (no Docker Hub call) - **Eliminates Docker Hub rate-limit risk** for these images (avoids the login timeout issue entirely) ## Image versions as env vars Extracted to top-level `env:` block for easy future bumps: ```yaml LIGHTHOUSE_IMAGE: "sigp/lighthouse:v7.0.1" TEKU_IMAGE: "consensys/teku:25.9.1" ASSERTOOR_IMAGE: "ethpandaops/assertoor:v0.0.17" ``` Co-authored-by: SharovBot <sharovbot@erigon.ci>
1 parent d07d250 commit f0e61f1

File tree

1 file changed

+76
-4
lines changed

1 file changed

+76
-4
lines changed

.github/workflows/test-kurtosis-assertoor.yml

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: Kurtosis Assertoor GitHub Action
33
env:
44
DOCKERHUB_REPOSITORY: "erigontech/erigon"
55
APP_REPO: "erigontech/erigon"
6+
# Pinned versions of third-party containers — bump here when upgrading.
7+
# These are cached via actions/cache (docker save/load) to avoid re-pulling
8+
# on every run and to eliminate Docker Hub rate-limit exposure.
9+
LIGHTHOUSE_IMAGE: "sigp/lighthouse:v7.0.1"
10+
TEKU_IMAGE: "consensys/teku:25.9.1"
11+
ASSERTOOR_IMAGE: "ethpandaops/assertoor:v0.0.17"
612

713
on:
814
push:
@@ -47,9 +53,42 @@ jobs:
4753
username: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_USERNAME }}
4854
password: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}
4955

50-
- name: Docker build current branch
56+
- name: Set up Docker Buildx
57+
uses: docker/setup-buildx-action@v3
58+
59+
- name: Restore cached third-party containers
60+
id: cache-cl-images
61+
uses: actions/cache@v4
62+
with:
63+
path: /tmp/docker-cache
64+
key: docker-cl-${{ env.LIGHTHOUSE_IMAGE }}-${{ env.TEKU_IMAGE }}-${{ env.ASSERTOOR_IMAGE }}
65+
66+
- name: Load cached containers into daemon
67+
if: steps.cache-cl-images.outputs.cache-hit == 'true'
5168
run: |
52-
docker build -t test/erigon:current .
69+
docker load -i /tmp/docker-cache/lighthouse.tar
70+
docker load -i /tmp/docker-cache/teku.tar
71+
docker load -i /tmp/docker-cache/assertoor.tar
72+
73+
- name: Pull third-party containers and save to cache
74+
if: steps.cache-cl-images.outputs.cache-hit != 'true'
75+
run: |
76+
mkdir -p /tmp/docker-cache
77+
docker pull ${{ env.LIGHTHOUSE_IMAGE }}
78+
docker pull ${{ env.TEKU_IMAGE }}
79+
docker pull ${{ env.ASSERTOOR_IMAGE }}
80+
docker save ${{ env.LIGHTHOUSE_IMAGE }} -o /tmp/docker-cache/lighthouse.tar
81+
docker save ${{ env.TEKU_IMAGE }} -o /tmp/docker-cache/teku.tar
82+
docker save ${{ env.ASSERTOOR_IMAGE }} -o /tmp/docker-cache/assertoor.tar
83+
84+
- name: Build erigon Docker image (with BuildKit layer cache)
85+
uses: docker/build-push-action@v6
86+
with:
87+
context: .
88+
load: true
89+
tags: test/erigon:current
90+
cache-from: type=gha,scope=kurtosis-erigon-build
91+
cache-to: type=gha,mode=max,scope=kurtosis-erigon-build
5392

5493
- name: Run regular Kurtosis + assertoor tests
5594
uses: ethpandaops/kurtosis-assertoor-github-action@v1
@@ -91,9 +130,42 @@ jobs:
91130
username: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_USERNAME }}
92131
password: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}
93132

94-
- name: Docker build current branch
133+
- name: Set up Docker Buildx
134+
uses: docker/setup-buildx-action@v3
135+
136+
- name: Restore cached third-party containers
137+
id: cache-cl-images
138+
uses: actions/cache@v4
139+
with:
140+
path: /tmp/docker-cache
141+
key: docker-cl-${{ env.LIGHTHOUSE_IMAGE }}-${{ env.TEKU_IMAGE }}-${{ env.ASSERTOOR_IMAGE }}
142+
143+
- name: Load cached containers into daemon
144+
if: steps.cache-cl-images.outputs.cache-hit == 'true'
95145
run: |
96-
docker build -t test/erigon:current .
146+
docker load -i /tmp/docker-cache/lighthouse.tar
147+
docker load -i /tmp/docker-cache/teku.tar
148+
docker load -i /tmp/docker-cache/assertoor.tar
149+
150+
- name: Pull third-party containers and save to cache
151+
if: steps.cache-cl-images.outputs.cache-hit != 'true'
152+
run: |
153+
mkdir -p /tmp/docker-cache
154+
docker pull ${{ env.LIGHTHOUSE_IMAGE }}
155+
docker pull ${{ env.TEKU_IMAGE }}
156+
docker pull ${{ env.ASSERTOOR_IMAGE }}
157+
docker save ${{ env.LIGHTHOUSE_IMAGE }} -o /tmp/docker-cache/lighthouse.tar
158+
docker save ${{ env.TEKU_IMAGE }} -o /tmp/docker-cache/teku.tar
159+
docker save ${{ env.ASSERTOOR_IMAGE }} -o /tmp/docker-cache/assertoor.tar
160+
161+
- name: Build erigon Docker image (with BuildKit layer cache)
162+
uses: docker/build-push-action@v6
163+
with:
164+
context: .
165+
load: true
166+
tags: test/erigon:current
167+
cache-from: type=gha,scope=kurtosis-erigon-build
168+
cache-to: type=gha,mode=max,scope=kurtosis-erigon-build
97169

98170
- name: Run Pectra Kurtosis + assertoor tests
99171
uses: ethpandaops/kurtosis-assertoor-github-action@v1

0 commit comments

Comments
 (0)