← Back to Pull requests

WIP test: exempt transient platform pods from the pool isolation check #116

Open
unknown opened this pull request with 496 lines diff across 6 files
View on GitHub
unknown unknown commented on Nov 04, 2026 13:51 UTC
Author

Fixes https://github.com/kubernetes-sigs/ai-conformance/issues/115

verifyPoolIsIdle treats every non-DaemonSet pod on the target accelerator pool as a foreign workload. The NVIDIA GPU Operator creates nvidia-cuda-validator as a plain pod on each node once it joins, so while that pod is briefly Running the isolation preflight fails and TestAcceleratorClusterAutoscaling aborts before it ever exercises the autoscaler.

This exempts a pod only when all three hold:
- it is in a platform/operator namespace, never a user namespace;
- it is explicitly RestartPolicy: Never or OnFailure — an unset policy is defaulted to Always by the API server, so it does not qualify;
- it does not itself request accelerator resources.

All three are required. An earlier version of this patch checked only the restart policy and the accelerator request, which silently exempted any user batch Job on the pool and broke two existing subtests (rejects a foreign scheduled Pod and rejects other pending target-pool demand, both of which use pods with an unset RestartPolicy). The namespace condition is what keeps those passing.

Testing


Before — upstream fd9ba2d, unmodified

    cluster_autoscaling_test.go:117: Captured accelerator pool baseline: 2 Ready, schedulable nodes matching node.kubernetes.io/instance-type=g5.xlarge
    cluster_autoscaling_test.go:183: Baseline established: 2 accelerator Pods occupy 2 distinct pool nodes
    cluster_autoscaling_test.go:201: Scale-up triggered by Pending Pod autoscaler-trigger: 0/7 nodes are available: 2 Insufficient nvidia.com/gpu, 2 node(s) didn't match Pod's node affinity/selector, 3 node(s) had untolerated taint(s).
    cluster_autoscaling_test.go:217: FAIL: Accelerator pool did not scale up successfully: last observed pool size 3, wanted at least 3 and a Running trigger Pod: target accelerator pool is not isolated; found foreign workloads: nvidia-gpu-operator/nvidia-cuda-validator-6qwst on ip-10-0-11-129.ec2.internal
--- FAIL: TestAcceleratorClusterAutoscaling (709.68s)

The pool scaled up correctly to 3 nodes. The GPU Operator then created
nvidia-cuda-validator-6qwst on the newly added node, and because that pod is a plain
pod rather than a DaemonSet member, the isolation re-check counted it as a foreign
workload while it was still Running.

After — same commit plus the fix

    cluster_autoscaling_test.go:117: Captured accelerator pool baseline: 2 Ready, schedulable nodes matching node.kubernetes.io/instance-type=g5.xlarge
    cluster_autoscaling_test.go:183: Baseline established: 2 accelerator Pods occupy 2 distinct pool nodes
    cluster_autoscaling_test.go:201: Scale-up triggered by Pending Pod autoscaler-trigger: 0/8 nodes are available: 1 node(s) were unschedulable, 2 Insufficient nvidia.com/gpu, 2 node(s) didn't match Pod's node affinity/selector, 3 node(s) had untolerated taint(s).
    cluster_autoscaling_test.go:225: PASS: Accelerator pool scaled from 2 to 3 nodes; trigger Pod is Running on new node ip-10-0-18-147.ec2.internal

The same scale-up step that previously aborted now passes.

Unit tests

TestVerifyPoolIsIdle goes from 7 to 10 subtests, all passing; go vet ./test/ is clean.
The added cases cover the validator pod being ignored, a RestartPolicy: Never pod in a
user namespace still being reported, and a platform-namespace pod that requests
nvidia.com/gpu still being reported.

Environment: OpenShift 5.0.0-rc.8, Kubernetes v1.36.5,
GPU Operator v26.7.2 (driver 615.71.09),
AWS g5.xlarge (A10G),
RHCOS 10.2 / kernel 6.12.0-211.69.1.el10_2,
allocation mode: device-plugin

Open question — isPlatformNamespace matches the prefixes kube- openshift- gpu-operator and nvidia-. That covers OpenShift + NVIDIA, but this suite also serves GKE, Talos and others. Happy to make it a flag, or derive it from where the accelerator operator runs, if maintainers prefer.

Diff: 496 lines (+372 / -124) across 6 files Reviewer: haircommander Review duration: 43680m
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.47) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 496 lines diff across 6 files
0.47
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.371
Shallow Review Depth shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #116"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 47.5% (MEDIUM) · Higher = larger blast radius
47.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 25.3% · Safe to merge
25.3%