Repository navigation
574 lines (521 loc) · 26.6 KB
/
Copy pathtest-e2e.yml
File metadata and controls
574 lines (521 loc) · 26.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
name: Tests
on:
pull_request:
paths:
- 'api/**'
- 'cmd/**'
- 'internal/**'
- 'images/artifact-downloader/**'
# aim-dummy is the kind-runnable test image for BYO base-image / custom-model
# e2e fixtures. Changes to it can break those tests, so re-run e2e too.
- 'images/aim-dummy/**'
- 'config/**'
- 'go.mod'
- 'go.sum'
- 'Dockerfile'
- 'Makefile'
- 'hack/**'
- 'tests/**'
- 'docs/docs/admin/upgrading.md'
- 'mise.toml'
- '.github/workflows/test-e2e.yml'
permissions:
contents: read
packages: read
# Opt JavaScript actions (checkout, cache, upload-artifact, docker/*, mise-action,
# etc.) onto Node 24 ahead of GitHub's June 16, 2026 default flip. Without this
# they run on the deprecated Node 20 runtime and the runner emits a warning. See
# https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
test-unit:
name: test-unit
runs-on: ubuntu-latest
steps:
- name: Clone the code
uses: actions/checkout@v4
# Runner instances share a home directory. Concurrent cache restores must
# not overwrite the mise executable or tools another job is using.
- name: Isolate mise state
run: |
echo "MISE_DATA_DIR=${RUNNER_TEMP}/mise/data" >> "$GITHUB_ENV"
echo "MISE_CACHE_DIR=${RUNNER_TEMP}/mise/cache" >> "$GITHUB_ENV"
echo "MISE_CONFIG_DIR=${RUNNER_TEMP}/mise/config" >> "$GITHUB_ENV"
- name: Setup mise
uses: jdx/mise-action@v2
with:
cache_key_prefix: mise-isolated-v1
env:
# mise-action also unpacks its executable under os.tmpdir().
TMPDIR: ${{ runner.temp }}
# Load only mise.toml (CI tools); skip mise.local.toml dev tools.
# NOTE: MISE_LOCAL_CONFIG_ALLOWED is NOT a real mise setting (it was a
# no-op, so CI was installing/compiling every dev tool from
# mise.local.toml). Overriding the config filenames is the correct
# mechanism to exclude the local config.
MISE_OVERRIDE_CONFIG_FILENAMES: "mise.toml"
- name: Cache Go modules and build
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
# Key on go.sum (NOT every *.go file). A source-hash key changes on
# every commit, so the exact key never hits and actions/cache re-saves
# the whole ~/.cache/go-build at the end of every run. On the shared
# self-hosted runner that save races with the other job and with Go's
# own background cache trimming, producing a torn snapshot. Restoring
# that snapshot later surfaces as
# "link: ...: reference to nonexistent package ..." during `go test`.
# A go.sum key hits on most runs (so no save), and the v2 prefix
# abandons the already-poisoned cache namespace.
key: go-v2-${{ runner.os }}-${{ hashFiles('go.sum') }}
restore-keys: |
go-v2-${{ runner.os }}-
# TODO: Consider adding -race flag for race detection (adds 2-10x build time)
- name: Run tests
run: |
set -o pipefail
make test-artifact-downloader
make test-upgrade-preflight
# The operator-start test in cmd/ runs against an envtest control plane.
KUBEBUILDER_ASSETS="$(make -s envtest)"
export KUBEBUILDER_ASSETS
# Self-heal for a corrupt Go build cache.
if ! go test ./... 2>&1 | tee /tmp/go-test.log; then
if grep -q "reference to nonexistent package" /tmp/go-test.log; then
echo "::warning::Corrupt Go build cache detected; running 'go clean -cache' and retrying."
go clean -cache
go test ./...
else
exit 1
fi
fi
test-e2e:
name: test-e2e (${{ matrix.mode }})
runs-on: ubuntu-latest
timeout-minutes: 60
# Matrix on the operator's eager runtime-projection mode. The default
# `Both` leg is the full kind suite (mode-gated tests stay excluded via
# CHAINSAW_PROJECTION_MODE_EXCLUDE). The `Reduced` leg
# exists because the Reduced/model-slug projection paths
# (planClusterModelSlugRuntime / planNamespaceModelSlugRuntime, the scope-aware
# lazy resolver, model-slug lazy completion) also need their mutually
# exclusive Reduced behavior covered. It starts an operator in that mode
# (Helm value) and runs ONLY the matching mode-gated tests. `slug` is the
# lowercase form used in resource / artifact names that must differ per leg.
#
# `Exhaustive` has no dedicated cluster leg: Both exercises its per-profile
# branch alongside the model-slug branch, while Exhaustive's unique property
# (absence of the model-slug runtime) is pinned by unit tests. The default
# lane's mode-both smoke asserts that both runtimes coexist.
strategy:
fail-fast: false
matrix:
include:
- mode: Both
slug: both
- mode: Reduced
slug: reduced
concurrency:
# Include the mode so the matrix legs do not cancel each other under the
# shared cancel-in-progress group.
group: test-e2e-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.mode }}
cancel-in-progress: true
env:
# Per-leg cluster / image names so concurrent matrix legs never collide.
KIND_CLUSTER: aim-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.slug }}
ARTIFACT_DOWNLOADER_IMAGE: aim-artifact-downloader:${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.slug }}
OPERATOR_IMAGE_REPOSITORY: aim-engine
OPERATOR_IMAGE_TAG: ${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.slug }}
OPERATOR_IMAGE: aim-engine:${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.slug }}
# AIM_DUMMY_TAG pins the aim-dummy test image (BYO base-image, custom-model,
# discovery fixtures). It defines the canonical
# docker.io/amdenterpriseai/aim-dummy:<tag> ref the fixtures hardcode; the
# `make test-chainsaw-kind-zot` step rewrites that ref to the ephemeral
# in-cluster Zot registry so the operator can read image metadata without
# depending on an external registry. Keep in sync with the Makefile default.
AIM_DUMMY_TAG: "0.2.0"
steps:
- name: Free up disk space
run: |
echo "Before cleanup:"
df -h /
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
echo "After cleanup:"
df -h /
- name: Clone the code
uses: actions/checkout@v4
- name: Show runner specs
run: |
echo "Runner: ${RUNNER_NAME}"
echo "OS: ${RUNNER_OS}"
echo "Arch: ${RUNNER_ARCH}"
echo "CPU count:"
nproc
echo "Memory:"
free -h
echo "Disk:"
df -h /
# Keep the matrix legs (and other workflows on this host) from restoring
# their mise caches over the same executable and tool installations.
- name: Isolate mise state
run: |
echo "MISE_DATA_DIR=${RUNNER_TEMP}/mise/data" >> "$GITHUB_ENV"
echo "MISE_CACHE_DIR=${RUNNER_TEMP}/mise/cache" >> "$GITHUB_ENV"
echo "MISE_CONFIG_DIR=${RUNNER_TEMP}/mise/config" >> "$GITHUB_ENV"
- name: Setup mise
uses: jdx/mise-action@v2
with:
cache_key_prefix: mise-isolated-v1
env:
TMPDIR: ${{ runner.temp }}
# Load only mise.toml (CI tools); skip mise.local.toml dev tools.
# NOTE: MISE_LOCAL_CONFIG_ALLOWED is NOT a real mise setting (it was a
# no-op, so CI was installing/compiling every dev tool from
# mise.local.toml). Overriding the config filenames is the correct
# mechanism to exclude the local config.
MISE_OVERRIDE_CONFIG_FILENAMES: "mise.toml"
- name: Cache Go modules and build
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
# Key on go.sum (NOT every *.go file). A source-hash key changes on
# every commit, so the exact key never hits and actions/cache re-saves
# the whole ~/.cache/go-build at the end of every run. On the shared
# self-hosted runner that save races with the other job and with Go's
# own background cache trimming, producing a torn snapshot. Restoring
# that snapshot later surfaces as
# "link: ...: reference to nonexistent package ..." during `go test`.
# A go.sum key hits on most runs (so no save), and the v2 prefix
# abandons the already-poisoned cache namespace.
key: go-v2-${{ runner.os }}-${{ hashFiles('go.sum') }}
restore-keys: |
go-v2-${{ runner.os }}-
- name: Set per-run kubeconfig path
run: echo "KUBECONFIG=${RUNNER_TEMP}/kubeconfig-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${{ matrix.slug }}" >> "${GITHUB_ENV}"
- name: Set per-run isolated Helm and Helmfile config
# Per-run isolated Helm and Helmfile config. Helmfile keeps unpacked OCI
# charts in its own cache (separate from HELM_CACHE_HOME); sharing that
# cache between the concurrent matrix legs lets one job remove a chart
# path while the other is installing it.
run: |
HELM_BASE="${RUNNER_TEMP}/helm"
HELMFILE_BASE="${RUNNER_TEMP}/helmfile"
{
echo "HELM_CACHE_HOME=${HELM_BASE}/cache"
echo "HELM_CONFIG_HOME=${HELM_BASE}/config"
echo "HELM_DATA_HOME=${HELM_BASE}/data"
echo "HELM_REGISTRY_CONFIG=${HELM_BASE}/registry/config.json"
echo "HELMFILE_CACHE_HOME=${HELMFILE_BASE}/cache"
} >> "${GITHUB_ENV}"
mkdir -p "${HELM_BASE}/cache" "${HELM_BASE}/config" "${HELM_BASE}/data" "${HELM_BASE}/registry"
mkdir -p "${HELMFILE_BASE}/cache"
echo '{}' > "${HELM_BASE}/registry/config.json"
- name: Create Kind cluster
run: kind create cluster --name "${KIND_CLUSTER}" --config hack/kind/config.yaml
- name: Install Kind dependencies (NFS provisioner)
run: helmfile sync -f hack/kind/helmfile.yaml.gotmpl
- name: Verify NFS server and CSI driver readiness
run: |
echo "--- Waiting for NFS server pod ---"
kubectl wait --for=condition=Ready --timeout=180s pod -l app=nfs-server -n nfs-system
echo "--- Waiting for csi-driver-nfs controller ---"
kubectl rollout status deployment/csi-nfs-controller -n kube-system --timeout=180s
echo "--- Waiting for csi-driver-nfs node DaemonSet ---"
kubectl rollout status daemonset/csi-nfs-node -n kube-system --timeout=180s
echo "--- Verifying default StorageClass ---"
NFS_DEFAULT="$(kubectl get storageclass nfs -o jsonpath='{.metadata.annotations.storageclass\.kubernetes\.io/is-default-class}')"
if [ "${NFS_DEFAULT}" != "true" ]; then
echo "Expected storageclass 'nfs' to be default but got '${NFS_DEFAULT}'"
kubectl get storageclass -o wide
exit 1
fi
echo "--- RWX PVC smoke test ---"
kubectl create namespace storage-smoke --dry-run=client -o yaml | kubectl apply -f -
cat <<'EOF' | kubectl apply -n storage-smoke -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-smoke-pvc
spec:
storageClassName: nfs
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Mi
EOF
kubectl wait --for=jsonpath='{.status.phase}'=Bound --timeout=180s pvc/nfs-smoke-pvc -n storage-smoke
kubectl delete namespace storage-smoke --wait=false
- name: Login to GHCR
# Authenticate helm to ghcr.io so the kserve / kserve-crd / kedify-otel
# OCI chart pulls in "Install core dependencies" aren't subject to GHCR's
# anonymous-pull rate limit (the shared self-hosted runner's IP gets
# denied with a 403 on the anonymous token endpoint under load). This
# writes into the per-run isolated HELM_REGISTRY_CONFIG set above, so the
# dependency sync actually uses these credentials.
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Install core dependencies
run: helmfile sync -f hack/dependencies/helmfile.yaml.gotmpl
- name: Verify Envoy Gateway platform integration
run: |
mise exec -- make verify-gateway
kubectl wait \
--for=jsonpath='{.status.ancestors[0].conditions[?(@.type=="Accepted")].status}'=True \
envoyextensionpolicy/route-activation-metrics \
--namespace envoy-gateway-system \
--timeout=180s
- name: Install Kind-local Zot registry
run: make kind-zot-install
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build artifact-downloader image
uses: docker/build-push-action@v6
with:
context: images/artifact-downloader
load: true
tags: ${{ env.ARTIFACT_DOWNLOADER_IMAGE }}
cache-from: type=gha,scope=artifact-downloader
cache-to: type=gha,scope=artifact-downloader,mode=max
- name: Build operator image
uses: docker/build-push-action@v6
with:
context: .
load: true
tags: ${{ env.OPERATOR_IMAGE }}
# Override the Dockerfile's public-mirror default so the operator
# binary's compiled-in DefaultDownloadImage matches the bare local
# tag we just built and will kind-load. With IfNotPresent pull policy,
# the spawned artifact-downloader pods find the local image and never
# contact any registry during chainsaw tests.
build-args: |
VERSION=${{ env.OPERATOR_IMAGE_TAG }}
ARTIFACT_DOWNLOADER_IMG=${{ env.ARTIFACT_DOWNLOADER_IMAGE }}
cache-from: type=gha
cache-to: type=gha,mode=max
# NOTE: aim-dummy is built, pushed to Zot, and kind-loaded by the
# `make test-chainsaw-kind-zot` step below. AIMModel discovery reads the
# image's OCI labels from a registry inside the operator (remote.Get), while
# workload pods use the exact same refs preloaded into Kind's containerd.
- name: Load images into Kind
run: |
set -euo pipefail
kind load docker-image "${ARTIFACT_DOWNLOADER_IMAGE}" --name "${KIND_CLUSTER}"
kind load docker-image "${OPERATOR_IMAGE}" --name "${KIND_CLUSTER}"
- name: Generate CRDs
run: make crds
- name: Generate Helm chart
run: make helm
- name: Create aim-system namespace
run: kubectl create namespace aim-system --dry-run=client -o yaml | kubectl apply -f -
- name: Initialize SeaweedFS bucket
run: make seaweedfs-init-bucket
- name: Install CRDs
run: kubectl apply --server-side -f dist/crds.yaml
- name: Install operator via Helm
# manager.runtimeProjectionMode is set at install time (deterministic, no
# post-install patch race) so each matrix leg's operator starts in its
# mode. The Kind values mount Zot's public CA without replacing the
# operator's normal public root set.
run: helm install aim-engine dist/chart --namespace aim-system --create-namespace -f hack/kind/operator-values.yaml --set manager.image.repository="${OPERATOR_IMAGE_REPOSITORY}" --set manager.image.tag="${OPERATOR_IMAGE_TAG}" --set manager.runtimeProjectionMode="${{ matrix.mode }}" --set acceleratorDetector.enable=false --set scaleFromZero.gatewayProvider=envoyGateway --set scaleFromZero.gatewayMetricsCollector.management=helm
- name: Wait for operator to be ready
run: kubectl wait --for=condition=Available --timeout=120s deployment/aim-engine-controller-manager -n aim-system
- name: Assert operator runtime-projection mode
# Fail loudly before the gated tests run if the mode did not take: the
# Reduced tests silently mis-pass (assert the wrong shape) against an
# operator in the wrong mode, so gate on the live arg first.
run: |
set -euo pipefail
args="$(kubectl -n aim-system get deployment aim-engine-controller-manager -o jsonpath='{.spec.template.spec.containers[?(@.name=="manager")].args}')"
echo "manager args: ${args}"
if ! printf '%s' "${args}" | grep -q -- '--runtime-projection-mode=${{ matrix.mode }}'; then
echo "expected --runtime-projection-mode=${{ matrix.mode }} on the operator but it was not set" >&2
exit 1
fi
echo "confirmed operator running with --runtime-projection-mode=${{ matrix.mode }}"
- name: Wait for Envoy Gateway metrics collector to be ready
run: |
set -euo pipefail
COLLECTOR_DEPLOY=aim-engine-envoy-gateway-metrics-collector
for i in $(seq 1 24); do
if kubectl -n aim-system get deploy "${COLLECTOR_DEPLOY}" >/dev/null 2>&1; then
kubectl -n aim-system rollout status "deploy/${COLLECTOR_DEPLOY}" --timeout=120s
RECEIVER_PORT="$(
kubectl -n aim-system get service "${COLLECTOR_DEPLOY}" \
-o jsonpath='{.spec.ports[?(@.port==4317)].port}' 2>/dev/null || true
)"
if [ "${RECEIVER_PORT}" = "4317" ]; then
exit 0
fi
echo "Waiting for ${COLLECTOR_DEPLOY} Service port 4317..."
fi
echo "Waiting for OTel Operator to create ${COLLECTOR_DEPLOY} ($i/24)..."
sleep 5
done
echo "scale-from-zero collector deployment never appeared" >&2
kubectl -n aim-system get opentelemetrycollectors,deploy 2>&1 || true
exit 1
- name: Point Envoy Gateway at the Helm-managed OTLP collector
run: >
COLLECTOR_HOST=aim-engine-envoy-gateway-metrics-collector.aim-system.svc.cluster.local
bash hack/configure-envoy-collector-sink.sh
# Whole-run metrics history: an in-cluster poller scrapes the operator's
# protected /metrics every few seconds for the duration of the suite, so we
# get a time-series of workqueue depth / reconcile latency / queue-duration
# (not just a point-in-time snapshot) to diagnose reconcile-queue starvation.
- name: Start metrics history poller
run: |
kubectl apply -f hack/ci/metrics-poller.yaml
kubectl rollout status deployment/aim-metrics-poller -n aim-system --timeout=120s
# rollout status only proves the pod is Running (the poller has no
# readiness probe). Gate until it has emitted at least one real scrape
# (a workqueue_ line), proving it authenticated and reached /metrics, so
# collection is provably live before the first chainsaw test runs.
echo "Waiting for metrics poller to begin collecting..."
collecting=false
for _ in $(seq 1 30); do
if kubectl logs deployment/aim-metrics-poller -c poller -n aim-system --tail=300 2>/dev/null | grep -q '^workqueue_'; then
echo "Metrics poller is collecting."
collecting=true
break
fi
sleep 2
done
if [ "${collecting}" != "true" ]; then
echo "WARNING: metrics poller did not produce a scrape within ~60s; continuing without gating."
kubectl logs deployment/aim-metrics-poller -c poller -n aim-system --tail=20 || true
fi
- name: Debug operator status
if: always()
run: |
echo "=== Operator Deployment ==="
kubectl get deployment -n aim-system
echo "=== Operator Pods ==="
kubectl get pods -n aim-system
echo "=== Operator Pod Describe ==="
kubectl describe pods -n aim-system -l control-plane=controller-manager || true
echo "=== Operator Logs (last 50 lines) ==="
kubectl logs -n aim-system -l control-plane=controller-manager --tail=50 || true
echo "=== CRDs ==="
kubectl get crds | grep aim || true
- name: Require Hugging Face token for trusted live tests
if: matrix.mode == 'Both' && github.event.pull_request.head.repo.full_name == github.repository
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: test -n "${HF_TOKEN}" || { echo "HF_TOKEN repository secret is required"; exit 1; }
- name: Run Chainsaw tests
# DEFAULT lane (Both). Builds aim-dummy, pushes it through a
# TLS-valid localhost port-forward into the Kind-local Zot registry,
# kind-loads the exact in-cluster refs, and runs against a throwaway copy
# of tests/e2e with only the registry/repository prefix rewritten.
if: matrix.mode == 'Both'
env:
MISE_OVERRIDE_CONFIG_FILENAMES: "mise.toml"
# Empty on fork PRs; public-model tests then exercise anonymous access.
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: mise exec -- make test-chainsaw-kind-zot
- name: Run mode-gated Chainsaw projection tests
# NON-DEFAULT lane (Reduced). Runs ONLY the mode-gated projection tests
# (selector flipped to INCLUDE requires in (<mode>-mode)) against the
# operator started in this mode above. These paths are otherwise CI-dark;
# they need no aim-dummy/ttl rewrite (they reference no aim-dummy image).
if: matrix.mode != 'Both'
run: make test-chainsaw-projection-mode ENV=kind MODE=${{ matrix.mode }}
# Dump the poller's accumulated time-series (TS-marked metric snapshots).
# Runs always() so we capture history for both passing and failing runs.
- name: Capture metrics history
if: always()
run: |
mkdir -p .tmp/metrics-history
kubectl logs deployment/aim-metrics-poller -c poller -n aim-system --tail=-1 \
> .tmp/metrics-history/operator-metrics.log 2>&1 || true
# If the poller container restarted mid-run, the current logs miss the
# earlier window; grab the prior container's logs and the pod describe
# (restart count / OOM reason) so the time-series isn't silently lost.
kubectl logs deployment/aim-metrics-poller -c poller -n aim-system --previous --tail=-1 \
> .tmp/metrics-history/operator-metrics-previous.log 2>&1 || true
kubectl describe pod -n aim-system -l app=aim-metrics-poller \
> .tmp/metrics-history/poller-pod-describe.txt 2>&1 || true
# Storage/shared-infra status time-series from the status-poller sidecar
# (restartCount / OOMKilled / phase for NFS server, CSI driver, operator).
kubectl logs deployment/aim-metrics-poller -c status-poller -n aim-system --tail=-1 \
> .tmp/metrics-history/infra-status.log 2>&1 || true
kubectl logs deployment/aim-metrics-poller -c status-poller -n aim-system --previous --tail=-1 \
> .tmp/metrics-history/infra-status-previous.log 2>&1 || true
# End-of-run snapshot of the NFS server itself: describe (restart count /
# OOM reason / probe failures) and recent Warning events for nfs-system.
kubectl describe pod -n nfs-system -l app=nfs-server \
> .tmp/metrics-history/nfs-server-describe.txt 2>&1 || true
kubectl get events -n nfs-system --sort-by=.lastTimestamp \
> .tmp/metrics-history/nfs-server-events.txt 2>&1 || true
- name: Upload Chainsaw report
if: always()
uses: actions/upload-artifact@v4
with:
name: chainsaw-report-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.slug }}
path: .tmp/chainsaw-reports/
if-no-files-found: warn
retention-days: 14
# Per-failed-test debug bundles (pod logs, describe, events) written by the
# config-level chainsaw `catch` at failure time, before namespace teardown.
# Only present when tests fail, so missing files is not a warning.
- name: Upload Chainsaw failure debug bundle
if: always()
uses: actions/upload-artifact@v4
with:
name: chainsaw-debug-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.slug }}
path: .tmp/chainsaw-debug/
if-no-files-found: ignore
retention-days: 14
- name: Upload metrics history
if: always()
uses: actions/upload-artifact@v4
with:
name: metrics-history-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.slug }}
path: .tmp/metrics-history/
if-no-files-found: ignore
retention-days: 14
- name: Debug on failure
if: failure()
run: |
echo "=== Operator Logs (full) ==="
kubectl logs -n aim-system -l control-plane=controller-manager --tail=200 || true
echo "=== All AIM resources ==="
kubectl get aimservice,aimmodel,aimprofilecache,aimartifact -A || true
echo "=== Pods across all namespaces ==="
kubectl get pods -A || true
echo "=== Non-running pods ==="
kubectl get pods -A --field-selector 'status.phase!=Running,status.phase!=Succeeded' || true
echo "=== Events (warnings only) ==="
kubectl get events -A --field-selector type=Warning --sort-by='.lastTimestamp' || true
echo "=== Storage classes ==="
kubectl get storageclass -o wide || true
echo "=== Zot registry ==="
kubectl get certificate,issuer,deploy,pod,service -n zot-system || true
kubectl logs deployment/zot -n zot-system --tail=200 || true
echo "=== PVs ==="
kubectl get pv || true
echo "=== PVCs ==="
kubectl get pvc -A || true
echo "=== Pending PVCs ==="
kubectl get pvc -A --field-selector status.phase=Pending || true
echo "=== Describe pending PVCs ==="
for pvc in $(kubectl get pvc -A --field-selector status.phase=Pending -o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\n"}{end}'); do
ns="${pvc%/*}"
name="${pvc#*/}"
echo "--- ${ns}/${name} ---"
kubectl describe pvc -n "${ns}" "${name}" || true
done
- name: Delete Kind cluster
if: always()
run: kind delete cluster --name "${KIND_CLUSTER}" || true
- name: Delete kubeconfig
if: always()
run: rm -f "${KUBECONFIG}"