|
19 | 19 | # |
20 | 20 | # Image distribution: a single `build-image` job builds the nvml-mock image once |
21 | 21 | # and pushes it to the ephemeral, auth-free ttl.sh registry (works on fork PRs) |
22 | | -# as E2E_IMAGE. Every leg then pulls that ref and the harness kind-loads it |
23 | | -# (E2E_SKIP_BUILD=true) instead of rebuilding per leg. |
| 22 | +# as E2E_IMAGE (24h TTL). Every leg then pulls that image by digest (immune to |
| 23 | +# tag overwrite on the anonymous registry), tags it to E2E_IMAGE, and the harness |
| 24 | +# kind-loads it (E2E_SKIP_BUILD=true) instead of rebuilding per leg. |
24 | 25 | name: nvml-mock E2E (Go) |
25 | 26 |
|
26 | 27 | permissions: |
|
52 | 53 | GO_VERSION: ${{ inputs.golang_version }} |
53 | 54 | KIND_VERSION: "v0.31.0" |
54 | 55 | KIND_AMD64_SHA256: "eb244cbafcc157dff60cf68693c14c9a75c4e6e6fedaf9cd71c58117cb93e3fa" |
55 | | - # Per-commit, ephemeral (1h TTL) ttl.sh ref the build-image job publishes and |
56 | | - # every leg pulls. Auth-free, so it also works on fork PRs. |
57 | | - E2E_IMAGE: ttl.sh/nvml-mock-${{ github.sha }}:1h |
| 56 | + # Per-commit, ephemeral (24h TTL) ttl.sh ref the build-image job publishes and |
| 57 | + # every leg pulls (by digest, then tags locally to this ref for the harness). |
| 58 | + # Auth-free, so it also works on fork PRs. 24h (ttl.sh max) keeps the image |
| 59 | + # alive long enough to re-run individual failed legs without a full rebuild. |
| 60 | + E2E_IMAGE: ttl.sh/nvml-mock-${{ github.sha }}:24h |
58 | 61 | E2E_SKIP_BUILD: "true" |
59 | 62 | E2E_ARTIFACTS: ${{ github.workspace }}/artifacts/e2e/go |
60 | 63 |
|
|
63 | 66 | # instead of rebuilding the image per job (see issue #460). |
64 | 67 | build-image: |
65 | 68 | runs-on: ubuntu-latest |
| 69 | + outputs: |
| 70 | + # Digest of the pushed image (sha256:...). Legs pull by digest so an |
| 71 | + # anonymous ttl.sh tag overwrite cannot substitute the image between |
| 72 | + # this push and their pulls. |
| 73 | + digest: ${{ steps.build.outputs.digest }} |
66 | 74 | steps: |
67 | 75 | - name: Checkout |
68 | 76 | uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 |
|
71 | 79 | uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4 |
72 | 80 |
|
73 | 81 | - name: Build and push nvml-mock image to ttl.sh |
| 82 | + id: build |
74 | 83 | uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7 |
75 | 84 | with: |
76 | 85 | context: . |
@@ -101,8 +110,15 @@ jobs: |
101 | 110 | - name: Install Helm |
102 | 111 | uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5 |
103 | 112 |
|
104 | | - - name: Pull pre-built nvml-mock image from ttl.sh |
105 | | - run: docker pull "${{ env.E2E_IMAGE }}" |
| 113 | + - name: Pull pre-built nvml-mock image from ttl.sh (pinned by digest) |
| 114 | + run: | |
| 115 | + # Content-addressed pull: even if the sha-derived tag is overwritten on |
| 116 | + # the anonymous ttl.sh registry, the digest fetches exactly what |
| 117 | + # build-image pushed. Re-tag to E2E_IMAGE for the harness kind-load and |
| 118 | + # Helm repo:tag split. |
| 119 | + pinned="ttl.sh/nvml-mock-${{ github.sha }}@${{ needs.build-image.outputs.digest }}" |
| 120 | + docker pull "$pinned" |
| 121 | + docker tag "$pinned" "${{ env.E2E_IMAGE }}" |
106 | 122 |
|
107 | 123 | - name: Install Kind |
108 | 124 | run: | |
@@ -150,8 +166,15 @@ jobs: |
150 | 166 | - name: Install Helm |
151 | 167 | uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5 |
152 | 168 |
|
153 | | - - name: Pull pre-built nvml-mock image from ttl.sh |
154 | | - run: docker pull "${{ env.E2E_IMAGE }}" |
| 169 | + - name: Pull pre-built nvml-mock image from ttl.sh (pinned by digest) |
| 170 | + run: | |
| 171 | + # Content-addressed pull: even if the sha-derived tag is overwritten on |
| 172 | + # the anonymous ttl.sh registry, the digest fetches exactly what |
| 173 | + # build-image pushed. Re-tag to E2E_IMAGE for the harness kind-load and |
| 174 | + # Helm repo:tag split. |
| 175 | + pinned="ttl.sh/nvml-mock-${{ github.sha }}@${{ needs.build-image.outputs.digest }}" |
| 176 | + docker pull "$pinned" |
| 177 | + docker tag "$pinned" "${{ env.E2E_IMAGE }}" |
155 | 178 |
|
156 | 179 | - name: Install Kind |
157 | 180 | run: | |
@@ -197,8 +220,15 @@ jobs: |
197 | 220 | - name: Install Helm |
198 | 221 | uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5 |
199 | 222 |
|
200 | | - - name: Pull pre-built nvml-mock image from ttl.sh |
201 | | - run: docker pull "${{ env.E2E_IMAGE }}" |
| 223 | + - name: Pull pre-built nvml-mock image from ttl.sh (pinned by digest) |
| 224 | + run: | |
| 225 | + # Content-addressed pull: even if the sha-derived tag is overwritten on |
| 226 | + # the anonymous ttl.sh registry, the digest fetches exactly what |
| 227 | + # build-image pushed. Re-tag to E2E_IMAGE for the harness kind-load and |
| 228 | + # Helm repo:tag split. |
| 229 | + pinned="ttl.sh/nvml-mock-${{ github.sha }}@${{ needs.build-image.outputs.digest }}" |
| 230 | + docker pull "$pinned" |
| 231 | + docker tag "$pinned" "${{ env.E2E_IMAGE }}" |
202 | 232 |
|
203 | 233 | - name: Install Kind |
204 | 234 | run: | |
@@ -240,8 +270,15 @@ jobs: |
240 | 270 | - name: Install Helm |
241 | 271 | uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5 |
242 | 272 |
|
243 | | - - name: Pull pre-built nvml-mock image from ttl.sh |
244 | | - run: docker pull "${{ env.E2E_IMAGE }}" |
| 273 | + - name: Pull pre-built nvml-mock image from ttl.sh (pinned by digest) |
| 274 | + run: | |
| 275 | + # Content-addressed pull: even if the sha-derived tag is overwritten on |
| 276 | + # the anonymous ttl.sh registry, the digest fetches exactly what |
| 277 | + # build-image pushed. Re-tag to E2E_IMAGE for the harness kind-load and |
| 278 | + # Helm repo:tag split. |
| 279 | + pinned="ttl.sh/nvml-mock-${{ github.sha }}@${{ needs.build-image.outputs.digest }}" |
| 280 | + docker pull "$pinned" |
| 281 | + docker tag "$pinned" "${{ env.E2E_IMAGE }}" |
245 | 282 |
|
246 | 283 | - name: Install Kind |
247 | 284 | run: | |
@@ -285,8 +322,15 @@ jobs: |
285 | 322 | - name: Install Helm |
286 | 323 | uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5 |
287 | 324 |
|
288 | | - - name: Pull pre-built nvml-mock image from ttl.sh |
289 | | - run: docker pull "${{ env.E2E_IMAGE }}" |
| 325 | + - name: Pull pre-built nvml-mock image from ttl.sh (pinned by digest) |
| 326 | + run: | |
| 327 | + # Content-addressed pull: even if the sha-derived tag is overwritten on |
| 328 | + # the anonymous ttl.sh registry, the digest fetches exactly what |
| 329 | + # build-image pushed. Re-tag to E2E_IMAGE for the harness kind-load and |
| 330 | + # Helm repo:tag split. |
| 331 | + pinned="ttl.sh/nvml-mock-${{ github.sha }}@${{ needs.build-image.outputs.digest }}" |
| 332 | + docker pull "$pinned" |
| 333 | + docker tag "$pinned" "${{ env.E2E_IMAGE }}" |
290 | 334 |
|
291 | 335 | - name: Install Kind |
292 | 336 | run: | |
|
0 commit comments