Skip to content

Commit 94e8f2d

Browse files
authored
Merge branch 'main' into fix/1779-merge-gate-go-build-cache
2 parents b54f2c9 + 78e9bf3 commit 94e8f2d

122 files changed

Lines changed: 11579 additions & 513 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/RENOVATE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Self-hosted Renovate keeps the project's dependencies up to date across `go.mod`
99

1010
- Configuration: [`.github/renovate.json5`](renovate.json5)
1111
- Workflow: [`.github/workflows/renovate.yaml`](workflows/renovate.yaml)
12-
- Companion script: [`tools/update-chainsaw-checksums`](../tools/update-chainsaw-checksums)
12+
- Companion scripts: [`tools/update-chainsaw-checksums`](../tools/update-chainsaw-checksums), [`tools/update-helmfile-checksums`](../tools/update-helmfile-checksums), [`tools/update-helm-diff-checksums`](../tools/update-helm-diff-checksums)
1313

1414
Policy choices (schedule, cooldown, auto-merge scope, group consolidation) are documented inline in `renovate.json5`. This doc covers what's covered, how to extend coverage, and the known gotchas.
1515

@@ -25,6 +25,8 @@ Policy choices (schedule, cooldown, auto-merge scope, group consolidation) are d
2525
| `.settings.yaml` (28 tool entries) | custom regex manager (`# renovate:` annotations) |
2626
| `.settings.yaml` `nvkind` SHA | dedicated git-refs digest customManager (`# renovate-digest:`) |
2727
| `.settings.yaml` `chainsaw_checksums` | `postUpgradeTasks``tools/update-chainsaw-checksums` |
28+
| `.settings.yaml` `helmfile_checksums` | `postUpgradeTasks``tools/update-helmfile-checksums` |
29+
| `.settings.yaml` `helm_diff_checksums` | `postUpgradeTasks``tools/update-helm-diff-checksums` |
2830
| `.go-version` (Go toolchain) | dedicated `golang-version` customManager (`go-toolchain` group) |
2931

3032
The `go` directive in `go.mod` is intentionally not bumped — the Go toolchain version is owned by `.go-version`. Makefile (`GOTOOLCHAIN`), the `load-versions` composite action, `install-karpenter-kwok`, and validator Dockerfiles (`--build-arg GO_VERSION`) all read from that single file.

.github/actions/e2e/action.yml

Lines changed: 96 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,38 +43,98 @@ runs:
4343
- name: Install E2E testing tools
4444
uses: ./.github/actions/install-e2e-tools
4545

46-
- name: Create Kind cluster
47-
shell: bash
48-
run: make cluster-create
49-
50-
- name: Deploy aicrd to Kind
46+
- name: Create Kind cluster and deploy aicrd
5147
shell: bash
5248
env:
5349
GOFLAGS: -mod=vendor
5450
run: |
55-
# Build and push aicrd image (replaces Tilt custom_build)
51+
# If any `wait` below fails, `set -e` (GitHub's default shell flags)
52+
# exits this script immediately - any background job not yet reached
53+
# by its own `wait` would otherwise keep running. Most consequential
54+
# for pid_cluster specifically: the job's always()-run Cleanup step
55+
# (`make cluster-delete`) could then race a still-in-flight
56+
# `make cluster-create`. Kill whatever is still alive on any exit.
57+
cleanup_background_jobs() {
58+
local rc=$?
59+
for pid in "$pid_cluster" "$pid_dep" "$pid_perf" "$pid_conf" "$pid_cli" "$pid_aicr" "$pid_validators"; do
60+
[ -n "$pid" ] && kill -0 "$pid" 2>/dev/null && kill "$pid" 2>/dev/null
61+
done
62+
exit "$rc"
63+
}
64+
trap cleanup_background_jobs EXIT
65+
66+
# This step folds what used to be two separate steps (Create Kind
67+
# cluster / Deploy aicrd) into one, so GitHub's per-step red-X no
68+
# longer says at a glance which phase failed. Group markers fold the
69+
# log into the same phases instead.
70+
echo "::group::cluster-and-builds"
71+
# cluster-create (~35s locally; Kind bring-up + registry) and the
72+
# host compiles below touch none of each other's inputs/outputs, so
73+
# launch everything in the background up front. Each later command
74+
# waits only on the specific PID(s) its own inputs actually depend
75+
# on: aicrd's ko build needs just the cluster/registry (not the
76+
# validator/CLI binaries), so it must not be gated behind builds it
77+
# doesn't read from - an earlier version of this step wait'ed on all
78+
# four build PIDs before it, which measured ~19s slower in CI than
79+
# the original sequential script for no reason: nothing here reads
80+
# dist/validator/* or dist/e2e/aicr until the docker build step below.
81+
pid_cluster=""; pid_dep=""; pid_perf=""; pid_conf=""; pid_cli=""; pid_aicr=""; pid_validators=""
82+
make cluster-create > /tmp/cluster-create.log 2>&1 &
83+
pid_cluster=$!
84+
85+
mkdir -p dist/validator dist/e2e
86+
for phase in deployment performance conformance; do
87+
mkdir -p "validators/${phase}/testdata"
88+
done
89+
90+
# Compile validator binaries + the host aicr CLI on the runner (Go
91+
# build cache hit) while the cluster comes up. This is also much
92+
# faster than building inside Docker (no cache sharing there). Go's
93+
# build cache is safe for concurrent use by simultaneous go
94+
# commands, including ko's own internal compile of aicrd below.
95+
CGO_ENABLED=0 go build -trimpath -o dist/validator/deployment ./validators/deployment &
96+
pid_dep=$!
97+
CGO_ENABLED=0 go build -trimpath -o dist/validator/performance ./validators/performance &
98+
pid_perf=$!
99+
CGO_ENABLED=0 go build -trimpath -o dist/validator/conformance ./validators/conformance &
100+
pid_conf=$!
101+
go build -o dist/e2e/aicr ./cmd/aicr &
102+
pid_cli=$!
103+
104+
# aicrd only needs the cluster/registry - build and push it (replaces
105+
# Tilt custom_build) as soon as that's ready, not gated behind the
106+
# unrelated validator/CLI builds above.
107+
#
108+
# cluster-create's output was redirected to a file above so it
109+
# wouldn't interleave with the concurrent builds; print it on
110+
# failure too (not just success), since a failed `wait` here is the
111+
# most common, most opaque failure on this step and would otherwise
112+
# exit via the EXIT trap with zero diagnostic output.
113+
wait $pid_cluster || { cat /tmp/cluster-create.log; exit 1; }
114+
cat /tmp/cluster-create.log
115+
echo "::endgroup::"
116+
117+
echo "::group::deploy-aicrd"
56118
KO_DOCKER_REPO=localhost:5001/aicrd ko build --bare --tags=tilt ./cmd/aicrd
57119
58120
# Apply namespace first (must exist before deployment references it)
59121
kubectl apply -f tilt/k8s/namespace.yaml
60122
kubectl apply -f tilt/k8s/
61-
62-
# Build images + CLI binary in parallel while deployment starts
123+
echo "::endgroup::"
124+
125+
echo "::group::validator-images"
126+
# The validator images COPY the binaries built above, so wait for
127+
# those specifically (not pid_cli, which nothing here needs) before
128+
# building them.
129+
wait $pid_dep
130+
wait $pid_perf
131+
wait $pid_conf
132+
133+
# Build + push the remaining images. Validator binaries are already
134+
# compiled above; this is just the COPY-only image build + push.
63135
KO_DOCKER_REPO=localhost:5001/aicr ko build --bare --tags=local ./cmd/aicr &
64136
pid_aicr=$!
65-
# Compile validator binaries on host (Go build cache hit) then COPY-only images.
66-
# This is much faster than building inside Docker (no cache sharing).
67137
(
68-
mkdir -p dist/validator
69-
CGO_ENABLED=0 go build -trimpath -o dist/validator/deployment ./validators/deployment &
70-
CGO_ENABLED=0 go build -trimpath -o dist/validator/performance ./validators/performance &
71-
CGO_ENABLED=0 go build -trimpath -o dist/validator/conformance ./validators/conformance &
72-
wait
73-
# Build per-phase COPY-only images and push to local registry.
74-
# Ensure testdata dirs exist (conformance has none).
75-
for phase in deployment performance conformance; do
76-
mkdir -p "validators/${phase}/testdata"
77-
done
78138
for phase in deployment performance conformance; do
79139
docker build -t "localhost:5001/aicr-validators/${phase}:latest" -f - . <<DOCKERFILE
80140
FROM nvcr.io/nvidia/distroless/static:v4.0.0@sha256:d90158b69e250d2018f32622b5c622925202ee97224a990a54b63811cb1e3d69
@@ -99,10 +159,14 @@ runs:
99159
docker push "localhost:5001/aicr-validators/aiperf-bench:latest"
100160
) &
101161
pid_validators=$!
102-
go build -o dist/e2e/aicr ./cmd/aicr &
103-
pid_cli=$!
104-
wait $pid_aicr $pid_validators $pid_cli
105-
162+
# Separate waits, not `wait $pid_aicr $pid_validators`: bash returns
163+
# only the LAST pid's exit status from a combined wait, so a failed
164+
# pid_aicr would be silently masked whenever pid_validators succeeds.
165+
wait $pid_aicr
166+
wait $pid_validators
167+
echo "::endgroup::"
168+
169+
echo "::group::rollout-and-verify"
106170
# Wait for deployment rollout (may already be ready)
107171
kubectl rollout status deployment/aicrd -n aicr --timeout=120s
108172
@@ -112,6 +176,13 @@ runs:
112176
curl -sf http://localhost:5001/v2/aicr-validators/performance/tags/list
113177
curl -sf http://localhost:5001/v2/aicr-validators/conformance/tags/list
114178
curl -sf http://localhost:5001/v2/aicr-validators/aiperf-bench/tags/list
179+
echo "::endgroup::"
180+
181+
# Not needed by anything above, but its output (dist/e2e/aicr) is
182+
# used by a later step (AICR_BIN) - wait now so a build failure here
183+
# fails this step instead of surfacing as a confusing missing-binary
184+
# error two steps later, and so the step's own exit code reflects it.
185+
wait $pid_cli
115186
116187
- name: Set up fake GPU environment
117188
shell: bash
@@ -151,6 +222,7 @@ runs:
151222
shell: bash
152223
run: |
153224
mkdir -p /tmp/debug-artifacts
225+
cp /tmp/cluster-create.log /tmp/debug-artifacts/cluster-create.log 2>/dev/null || true
154226
kubectl get all --all-namespaces > /tmp/debug-artifacts/all-resources.txt || true
155227
kubectl get events --all-namespaces --sort-by='.lastTimestamp' > /tmp/debug-artifacts/events.txt || true
156228
kubectl logs -n aicr -l app.kubernetes.io/name=aicrd --tail=500 > /tmp/debug-artifacts/aicrd-logs.txt || true

.github/renovate.json5

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,16 @@
319319
},
320320
},
321321

322+
// ---- helm-diff bumps refresh per-arch SHA256 checksums via post-upgrade script ----
323+
{
324+
matchDepNames: ["databus23/helm-diff"],
325+
postUpgradeTasks: {
326+
commands: ["./tools/update-helm-diff-checksums {{{newVersion}}}"],
327+
fileFilters: [".settings.yaml"],
328+
executionMode: "update",
329+
},
330+
},
331+
322332
// ---- aiperf-bench base image is capped below python 3.14 ----
323333
// PR #1906 auto-bumped this to 3.14 and broke the UAT validator image
324334
// build (aiperf's pyzmq/uvloop had no cp314 wheels, and the single-stage

.github/workflows/on-push.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
persist-credentials: false
9494

9595
- name: Setup Docker Buildx
96-
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
96+
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
9797

9898
- name: Authenticate to registry
9999
uses: ./.github/actions/ghcr-login
@@ -154,7 +154,7 @@ jobs:
154154
uses: ./.github/actions/ghcr-login
155155

156156
- name: Setup Docker Buildx
157-
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
157+
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
158158

159159
- name: Create multi-arch manifests for validator images
160160
env:

.github/workflows/on-tag.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ jobs:
243243
persist-credentials: false
244244

245245
- name: Setup Docker Buildx
246-
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
246+
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
247247

248248
- name: Authenticate to registry
249249
uses: ./.github/actions/ghcr-login
@@ -320,7 +320,7 @@ jobs:
320320
persist-credentials: false
321321

322322
- name: Setup Docker Buildx
323-
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
323+
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
324324

325325
- name: Authenticate to registry
326326
uses: ./.github/actions/ghcr-login
@@ -375,7 +375,7 @@ jobs:
375375
uses: ./.github/actions/ghcr-login
376376

377377
- name: Setup Docker Buildx
378-
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
378+
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
379379

380380
# Inline by design: this job creates only run-unique candidate manifests.
381381
# The shared docker-manifest action also writes public aliases, which must

.github/workflows/renovate.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,18 @@ jobs:
122122
# checksums getting committed alongside a version bump (the version
123123
# changes but the helmfile_checksums/chainsaw_checksums block does
124124
# not), which then breaks E2E/CLI E2E at the sha256 verify step.
125-
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^\\./tools/update-[a-z]+-checksums "]'
125+
# `[a-z-]+` (not `[a-z]+`) so hyphenated tool names match too, e.g.
126+
# tools/update-helm-diff-checksums.
127+
#
128+
# The stale-checksum symptom above is not uniform across the three
129+
# tools. A hook that runs but *fails* (renamed asset, egress blip)
130+
# leaves the new version pinned against the old checksums, and only
131+
# helmfile/chainsaw fail a PR-gating job for it — qualification.yaml
132+
# feeds their sha256 into setup-build-tools, which verifies it.
133+
# helm_diff_checksums is read solely by tests/uat/lib/phases.sh, so a
134+
# stale helm-diff pin stays green on every PR check and first surfaces
135+
# in nightly UAT, across all clouds. Renovate's "Artifact update
136+
# problem" warning in the PR body is the signal to heed; helm-diff is
137+
# deliberately not auto-merged, so a human sees it.
138+
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^\\./tools/update-[a-z-]+-checksums "]'
126139
LOG_LEVEL: ${{ inputs.logLevel || 'info' }}

.github/workflows/uat-aws.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ jobs:
322322
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
323323
- name: Set up Docker Buildx
324324
if: inputs.aicr_version == '' && inputs.skip_tests != true && inputs.lifecycle != 'daytime-down'
325-
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
325+
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
326326

327327
# Main cell only: release cells use the released validator images the
328328
# released binary self-resolves to (skipped when aicr_version is set).

.github/workflows/vuln-scan-images.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
persist-credentials: false
140140

141141
- name: Setup Docker Buildx
142-
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
142+
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
143143

144144
- name: Authenticate to registry
145145
uses: ./.github/actions/ghcr-login
@@ -213,7 +213,7 @@ jobs:
213213
persist-credentials: false
214214

215215
- name: Setup Docker Buildx
216-
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
216+
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
217217

218218
- name: Authenticate to registry
219219
uses: ./.github/actions/ghcr-login
@@ -262,7 +262,7 @@ jobs:
262262
uses: ./.github/actions/ghcr-login
263263

264264
- name: Setup Docker Buildx
265-
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
265+
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
266266

267267
- name: Create multi-arch manifests
268268
run: |

.settings.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,24 @@ testing_tools:
8484
helm: 'v4.2.4'
8585
# renovate: datasource=github-releases depName=databus23/helm-diff depType=testing_tools
8686
helm_diff: 'v3.15.11'
87+
# helm_diff_checksums are refreshed automatically by tools/update-helm-diff-checksums
88+
# via Renovate postUpgradeTasks whenever the helm-diff version above is bumped.
89+
# The darwin_* keys name GOOS (matching the sibling blocks); upstream labels
90+
# those release assets "macos".
91+
helm_diff_checksums:
92+
linux_amd64: 'ed54aa5a14a51a6e44cf8ab6020aaa9e56779b4d33bc2adf07abea6b240a5e7c'
93+
linux_arm64: '1c38c487ec348fe5ef2b10c61deddff79f0fa5bfbab762b302874578e6dc2d2c'
94+
darwin_amd64: '833e1054d0cfe28bbd6f2edc4c1d5b786968b7732f8df6fe99b67c3bf12bf7bb'
95+
darwin_arm64: 'ba489cc4a5998ad259fbc18c454f2319da26ba4c8f469e7acb587a07e61072cd'
8796
# renovate: datasource=github-releases depName=helmfile/helmfile depType=testing_tools
88-
helmfile: 'v1.7.3'
97+
helmfile: 'v1.7.4'
8998
# helmfile_checksums are refreshed automatically by tools/update-helmfile-checksums
9099
# via Renovate postUpgradeTasks whenever the helmfile version above is bumped.
91100
helmfile_checksums:
92-
linux_amd64: '23d7df593f704ab1709b3020c8c8083b1517c9e780b5010e756a7d36bd901552'
93-
linux_arm64: '4a2346df40362f49f395e47d5d6a16a29322b5c6968720c1bde60d101ae97e3b'
94-
darwin_amd64: 'b1be552f6ff68c7c10f064dec657e4297bc581eecf1ed66ff433964e17d9eb36'
95-
darwin_arm64: 'b69933ab364b010c320d1c858265d1845735784d8b317211e046cf74e22c6e80'
101+
linux_amd64: 'f96ef0a015df06b29d7f38bf0ca08821018ae25eb96bf2c7abd3affa1b84e112'
102+
linux_arm64: '0292f57a4638a21e775b0ce8bde37ee3fdd65dbbdbe0e5b9a06718f1dd04c7fa'
103+
darwin_amd64: '7a0951fcc5bb991d7ea3a0c80e35754eb3981dcadba19795edbec7cba2518ae2'
104+
darwin_arm64: 'e1490d371fecc1f2d9aae914ef34058f3cb2363c9ee63350b37a85c3994d71d9'
96105
# renovate: datasource=github-releases depName=kubernetes-sigs/kwok depType=testing_tools
97106
kwok: 'v0.8.0'
98107
# renovate: datasource=github-releases depName=kyverno/chainsaw depType=testing_tools
@@ -115,7 +124,7 @@ testing_tools:
115124
# Run with USE_SSL=1: sigstore's awskms signer hardcodes https://, so the e2e
116125
# serves TLS with a mkcert cert (see mkcert below).
117126
# renovate: datasource=docker depName=ministackorg/ministack depType=testing_tools
118-
ministack_image: 'ministackorg/ministack:1.4.17'
127+
ministack_image: 'ministackorg/ministack:1.4.19'
119128
# OpenBAO: the Linux Foundation Apache-2.0 fork of HashiCorp Vault, used by the
120129
# Vault KMS e2e to exercise the hashivault:// signing/verification path against
121130
# a real Transit secrets engine. API-identical to Vault; the sigstore hashivault

0 commit comments

Comments
 (0)