Skip to content

Revert "feat(slinky-slurm): AKS H100 recipe, Enroot/Pyxis, Gres/GPU (#1744)" - #1788

Merged
njhensley merged 2 commits into
NVIDIA:mainfrom
njhensley:revert/1744-slinky-slurm
Jul 16, 2026
Merged

njhensley merged 2 commits into
NVIDIA:mainfrom
njhensley:revert/1744-slinky-slurm

Conversation

@njhensley

Copy link
Copy Markdown
Member

Summary

Reverts #1744 (feat(slinky-slurm): add AKS H100 recipe, Enroot/Pyxis support, and Gres/GPU config, commit 7e54fca7).

Motivation / Context

#1744 was squash-merged from a branch based on stale main. Its diff did not only add the slinky-slurm feature — it also reverted unrelated work that had already landed on main, including the UAT cluster debug-bundle collector (tests/uat/lib/collect-debug.sh, #1764) and a broad set of deletions across the bundler deployers (argocd/flux/helmfile), bundler config, and docs. This revert restores that clobbered work. The slinky-slurm feature can be re-landed cleanly on top of current main.

Fixes: N/A
Related: #1744, #1764

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Build/CI/tooling

Component(s) Affected

  • Bundlers (pkg/bundler, pkg/component/*)
  • Recipe engine / data (pkg/recipe)
  • Docs/examples (docs/, examples/)
  • Other: UAT workflows/scripts, validator conformance checks, OpenAPI

Implementation Notes

Produced with git revert 7e54fca7; clean, no conflicts (64 files, +1753/-1072). The revert re-adds files #1744 deleted (notably tests/uat/lib/collect-debug.sh) and removes the files it added (e.g. recipes/overlays/h100-aks-ubuntu-training-slurm.yaml).

Testing

make qualify

Risk Assessment

  • Medium — Touches multiple components, but is a mechanical git revert that restores previously-reviewed, already-merged state.

Rollout notes: Re-land the slinky-slurm feature in a fresh PR rebased on current main so it no longer clobbers intervening work.

Checklist

  • Tests pass locally (make test with -race)
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality
  • I updated docs if user-facing behavior changed
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S)

…, and Gres/GPU config (NVIDIA#1744)"

This reverts commit 7e54fca (PR NVIDIA#1744).

PR NVIDIA#1744 was squash-merged from a branch based on stale main. Its diff did
not just add the slinky-slurm feature — it also reverted unrelated work that
had already landed on main, including the UAT cluster debug-bundle collector
(tests/uat/lib/collect-debug.sh, NVIDIA#1764) and deletions across the bundler
deployers (argocd/flux/helmfile), config, and docs. Reverting NVIDIA#1744 restores
that clobbered work.

Signed-off-by: Nathan Hensley <[email protected]>
@njhensley
njhensley requested review from a team as code owners July 16, 2026 15:20
@njhensley njhensley added the theme/recipes Recipe expansion, overlays, mixins, and component registry label Jul 16, 2026
@njhensley njhensley self-assigned this Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Recipe evidence check

Other affected recipes without evidence yet: 4

These recipes are affected by this PR but carry no committed evidence pointer, so there is
nothing to verify. This is expected — evidence is hardware-gated and added over time.

  • gb200-eks-ubuntu-training-slurm
  • h100-eks-ubuntu-training-slurm
  • h100-gke-cos-training-slurm
  • h100-kind-training-slurm

This gate is warning-only and never blocks merge. See ADR-007 for the trust model.

@njhensley
njhensley enabled auto-merge (squash) July 16, 2026 15:31

@yuanchen8911 yuanchen8911 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll reapply it?

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 756f281a-d8e6-4887-9efa-38def0cb43be

📥 Commits

Reviewing files that changed from the base of the PR and between b51f317 and 8a2eacd.

📒 Files selected for processing (3)
  • .github/workflows/uat-aws.yaml
  • .github/workflows/uat-azure.yaml
  • .github/workflows/uat-gcp.yaml

📝 Walkthrough

Walkthrough

The pull request adds serial deployment support across the bundle API, CLI, configuration, Argo CD, Flux, and Helmfile generators. It introduces shared UAT cluster-debug collection before teardown, updates Slurm health validation and recipes, removes an AKS Slurm recipe, and bumps the nvidia-tuned package to 0.3.2. Documentation, generated artifacts, workflow timeouts, and integration tests are updated accordingly.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

  • NVIDIA/aicr#1746: Overlaps directly with the serial deployment flag and deployer implementation.
  • NVIDIA/aicr#1764: Overlaps with UAT debug collection and failure-artifact wiring.
  • NVIDIA/aicr#1744: Overlaps with Slurm conformance validator changes.

Suggested labels: theme/deployer

Suggested reviewers: mchmarny

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: reverting the slinky-slurm AKS H100 feature work.
Description check ✅ Passed The description is on-topic and matches the revert of #1744 plus restoration of unrelated changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
validators/conformance/slinky_slurm_health_check.go (1)

189-217: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Sequential node lookups without a context-cancellation check.

This loop issues one Nodes().Get call per NodeSet pod sequentially, with no ctx.Ctx.Done() check between iterations, and these per-pod lookups are independent work that could fan out via errgroup.WithContext instead. If the context is canceled mid-loop, the Get call surfaces context.Canceled, but it's then wrapped as ErrCodeInternal rather than being recognized as a cancellation, and unrelated in-flight lookups continue sequentially instead of a fast, parallel exit.

As per coding guidelines: "Always check ctx.Done() in loops and long-running operations in Go code" and "Use errgroup.WithContext for concurrent fan-out of independent work instead of sequential calls."

♻️ Suggested refactor using errgroup + ctx.Done()
 func skipIfAllNodeSetPodsAreKWOK(ctx *validators.Context, namespace string) error {
 	pods, err := listSlinkyNodeSetPods(ctx, namespace)
 	if err != nil {
 		return err
 	}
 	if len(pods) == 0 {
 		return errors.New(errors.ErrCodeNotFound, "slinky-slurm selected but no NodeSet pods were found")
 	}
 
-	var resolved, kwok int
-	for _, pod := range pods {
-		if pod.Spec.NodeName == "" {
-			continue
-		}
-		node, getErr := ctx.Clientset.CoreV1().Nodes().Get(ctx.Ctx, pod.Spec.NodeName, metav1.GetOptions{})
-		if getErr != nil {
-			return errors.Wrap(errors.ErrCodeInternal,
-				fmt.Sprintf("failed to get node %s for NodeSet pod %s", pod.Spec.NodeName, pod.Name), getErr)
-		}
-		resolved++
-		if _, ok := node.Annotations[kwokNodeAnnotation]; ok {
-			kwok++
-		}
-	}
+	g, gCtx := errgroup.WithContext(ctx.Ctx)
+	var mu sync.Mutex
+	var resolved, kwok int
+	for _, pod := range pods {
+		pod := pod
+		if pod.Spec.NodeName == "" {
+			continue
+		}
+		g.Go(func() error {
+			select {
+			case <-gCtx.Done():
+				return gCtx.Err()
+			default:
+			}
+			node, getErr := ctx.Clientset.CoreV1().Nodes().Get(gCtx, pod.Spec.NodeName, metav1.GetOptions{})
+			if getErr != nil {
+				return errors.Wrap(errors.ErrCodeInternal,
+					fmt.Sprintf("failed to get node %s for NodeSet pod %s", pod.Spec.NodeName, pod.Name), getErr)
+			}
+			mu.Lock()
+			resolved++
+			if _, ok := node.Annotations[kwokNodeAnnotation]; ok {
+				kwok++
+			}
+			mu.Unlock()
+			return nil
+		})
+	}
+	if err := g.Wait(); err != nil {
+		return err
+	}
 	if resolved == len(pods) && kwok == resolved {
 		return validators.Skip("Slinky NodeSet pods are on KWOK nodes; skipping Slurm health validation")
 	}
 	return nil
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@validators/conformance/slinky_slurm_health_check.go` around lines 189 - 217,
Refactor skipIfAllNodeSetPodsAreKWOK to perform the independent node lookups
through errgroup.WithContext, using the derived context for each Nodes().Get
call. Check the context cancellation signal before or during iteration and
return cancellation directly rather than wrapping it as ErrCodeInternal;
preserve the existing node-resolution and KWOK counting behavior and error
messages for non-cancellation failures.

Source: Coding guidelines

tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml (1)

143-201: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Validate the complete dependency lists in the Chainsaw checks.

Both scripts can accept invalid output because they inspect only one dependency per release.

  • tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml#L143-L201: parse every dependsOn edge and reject branching; a linear chain requires at most one child per predecessor.
  • tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml#L151-L164: require exactly one complete needs entry for every non-root serial release.
  • tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml#L242-L297: validate every default-mode needs target remains within its component.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml` around lines 143 - 201,
Update tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml lines 143-201 to parse
every dependsOn entry for each HelmRelease, reject releases with multiple
dependencies, and verify the complete edge set forms a single linear chain with
no branching, cycles, or orphans. Update
tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml lines 151-164 to parse the
complete needs list and require exactly one target for every non-root serial
release. Update tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml lines
242-297 to validate every default-mode needs target belongs to the same
component rather than checking only one entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/integrator/talos-integration.md`:
- Around line 112-116: Update the Argo CD deployer documentation to qualify the
`level*4 + phase` sync-wave formula as the default-mode behavior, and document
that `--serial` instead assigns each folder its linear index. Preserve the
existing dependency-order and namespace-first explanation while clearly
distinguishing the two modes.

In `@pkg/bundler/handler.go`:
- Around line 387-396: Update the serial query handling around
query.Get("serial") to distinguish an absent parameter from an explicitly empty
serial value. Check query-key presence separately, reject present-but-empty
values with the existing invalid-boolean error, and preserve boolean parsing for
non-empty values; add a regression test covering ?serial=.

In `@tests/uat/aws/run`:
- Around line 313-321: Extract the duplicated readiness-gate persistence and
failure skyhook-capture logic from the cloud run scripts into a shared helper,
then update the AWS, GCP, and Azure run flows to call it. Preserve each script’s
existing provider-specific behavior, including Azure az-relogin handling, while
centralizing gate-log initialization, attempt-result tracking/appending, vrc
capture, and capture_skyhook_snapshot.

In `@tests/uat/azure/run`:
- Around line 360-368: Consolidate the readiness-gate persistence and
skyhook-capture logic currently duplicated in the Azure runner with the
equivalent AWS and GCP runner implementation. Extract or reuse a shared helper
for the CLUSTER_DEBUG_GATE_LOG setup, attempt recording, and capture behavior,
then update the affected Azure flow to call it while preserving timestamped
validation output and immediate failure diagnostics.

In `@tests/uat/gcp/run`:
- Around line 313-321: Consolidate the readiness-gate persistence and
skyhook-capture logic currently duplicated in the GCP runner’s setup and
attempt-handling sections, matching the shared implementation used by the AWS
and Azure runners. Update the relevant readiness initialization and the
referenced blocks around the attempt loop and failure handling to reuse the
common helper or shared path, while preserving timestamped validation output and
immediate failure diagnostics.

In `@tests/uat/lib/collect-debug.sh`:
- Around line 143-157: Ensure the collector remains non-failing under set -e by
guarding the _cd_section pipeline with || true or an equivalent explicit
successful return. Apply the same protection to the MANIFEST.yaml generation,
node-reboot-fingerprint tee block, and per-pod log redirect block so write
failures cannot skip later collection sections.
- Around line 244-279: Update the namespace iteration around
CLUSTER_DEBUG_LOG_NAMESPACES to process all allowlisted operator/check
namespaces first, then perform the general namespace sweep for remaining
namespaces. Preserve the existing pods/jobs/events collection for every
namespace and the describe/log collection only for allowlisted namespaces, while
avoiding duplicate processing when a namespace appears in both groups.

---

Outside diff comments:
In `@tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml`:
- Around line 143-201: Update tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml
lines 143-201 to parse every dependsOn entry for each HelmRelease, reject
releases with multiple dependencies, and verify the complete edge set forms a
single linear chain with no branching, cycles, or orphans. Update
tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml lines 151-164 to parse the
complete needs list and require exactly one target for every non-root serial
release. Update tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml lines
242-297 to validate every default-mode needs target belongs to the same
component rather than checking only one entry.

In `@validators/conformance/slinky_slurm_health_check.go`:
- Around line 189-217: Refactor skipIfAllNodeSetPodsAreKWOK to perform the
independent node lookups through errgroup.WithContext, using the derived context
for each Nodes().Get call. Check the context cancellation signal before or
during iteration and return cancellation directly rather than wrapping it as
ErrCodeInternal; preserve the existing node-resolution and KWOK counting
behavior and error messages for non-cancellation failures.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 4667767a-e13a-4e86-8a99-ed1f5d827a53

📥 Commits

Reviewing files that changed from the base of the PR and between 65f598d and b51f317.

📒 Files selected for processing (64)
  • .github/workflows/uat-aws.yaml
  • .github/workflows/uat-azure.yaml
  • .github/workflows/uat-gcp.yaml
  • api/aicr/v1/server.yaml
  • demos/cuj1-slinky-slurm.md
  • docs/contributor/component.md
  • docs/integrator/components/nodewright.md
  • docs/integrator/data-flow.md
  • docs/integrator/recipe-development.md
  • docs/integrator/talos-integration.md
  • docs/user/air-gap-mirror.md
  • docs/user/api-reference.md
  • docs/user/cli-reference.md
  • docs/user/component-catalog.md
  • docs/user/container-images.md
  • docs/user/recipe-health.md
  • pkg/bundler/bundler.go
  • pkg/bundler/config/config.go
  • pkg/bundler/config/config_test.go
  • pkg/bundler/deployer/argocd/argocd.go
  • pkg/bundler/deployer/argocd/argocd_test.go
  • pkg/bundler/deployer/argocd/testdata/helm_and_kustomize/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/helm_and_manifest_only/001-cert-manager/application.yaml
  • pkg/bundler/deployer/argocd/testdata/kustomize_only/001-my-kustomize-app/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/mixed_component/002-gpu-operator-post/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/001-gpu-operator/application.yaml
  • pkg/bundler/deployer/argocd/testdata/readiness_gate/002-gpu-operator-readiness/application.yaml
  • pkg/bundler/deployer/argocdhelm/argocdhelm.go
  • pkg/bundler/deployer/argocdhelm/testdata/helm_and_manifest_only/templates/cert-manager.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator-post.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/mixed_component/templates/gpu-operator.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator-readiness.yaml
  • pkg/bundler/deployer/argocdhelm/testdata/readiness_gate/templates/gpu-operator.yaml
  • pkg/bundler/deployer/flux/flux.go
  • pkg/bundler/deployer/flux/flux_test.go
  • pkg/bundler/deployer/helmfile/crd_split_test.go
  • pkg/bundler/deployer/helmfile/helmfile.go
  • pkg/bundler/deployer/helmfile/helmfile_test.go
  • pkg/bundler/deployer/helmfile/releases.go
  • pkg/bundler/handler.go
  • pkg/bundler/handler_test.go
  • pkg/cli/bundle.go
  • pkg/recipe/deployment_order_guard_test.go
  • pkg/recipe/metadata_store_test.go
  • pkg/recipe/metadata_test.go
  • recipes/components/nodewright-customizations/manifests/tuning-generic.yaml
  • recipes/components/nodewright-customizations/manifests/tuning.yaml
  • recipes/components/slinky-slurm/values.yaml
  • recipes/overlays/gb200-eks-ubuntu-training-slurm.yaml
  • recipes/overlays/h100-aks-ubuntu-training-slurm.yaml
  • recipes/overlays/h100-eks-ubuntu-training-slurm.yaml
  • recipes/overlays/h100-gke-cos-training-slurm.yaml
  • recipes/validators/README.md
  • recipes/validators/catalog.yaml
  • tests/chainsaw/cli/bundle-flux/chainsaw-test.yaml
  • tests/chainsaw/cli/bundle-helmfile/chainsaw-test.yaml
  • tests/uat/aws/run
  • tests/uat/azure/run
  • tests/uat/gcp/run
  • tests/uat/lib/collect-debug.sh
  • validators/conformance/slinky_slurm_health_check.go
  • validators/conformance/slinky_slurm_health_check_test.go
  • validators/conformance/slinky_slurm_imex_channel_check.go
💤 Files with no reviewable changes (7)
  • recipes/overlays/h100-aks-ubuntu-training-slurm.yaml
  • docs/user/air-gap-mirror.md
  • pkg/recipe/deployment_order_guard_test.go
  • pkg/recipe/metadata_test.go
  • recipes/components/slinky-slurm/values.yaml
  • demos/cuj1-slinky-slurm.md
  • pkg/recipe/metadata_store_test.go

Comment on lines +112 to +116
- **Argo CD deployer:** each folder becomes an Application with an
`argocd.argoproj.io/sync-wave` annotation. Waves are assigned by
dependency depth (`level*4 + phase`), and the `-pre` phase sorts
before the primary within the component's band, so Argo applies the
namespace first. No operator action needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Qualify the sync-wave formula as default-mode behavior.

Line 113 states that Argo CD always uses level*4 + phase, but --serial assigns each folder its linear index instead. Document both modes so serial users do not rely on the wrong wave values.

Proposed wording
-- **Argo CD deployer:** each folder becomes an Application with an
-  `argocd.argoproj.io/sync-wave` annotation. Waves are assigned by
-  dependency depth (`level*4 + phase`), and the `-pre` phase sorts
-  before the primary within the component's band, so Argo applies the
-  namespace first. No operator action needed.
+- **Argo CD deployer:** each folder becomes an Application with an
+  `argocd.argoproj.io/sync-wave` annotation. By default, waves are
+  assigned by dependency depth (`level*4 + phase`); with `--serial`,
+  folders use a linear sequence instead. In both modes, `-pre` sorts
+  before the primary, so Argo applies the namespace first.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **Argo CD deployer:** each folder becomes an Application with an
`argocd.argoproj.io/sync-wave` annotation. Waves are assigned by
dependency depth (`level*4 + phase`), and the `-pre` phase sorts
before the primary within the component's band, so Argo applies the
namespace first. No operator action needed.
- **Argo CD deployer:** each folder becomes an Application with an
`argocd.argoproj.io/sync-wave` annotation. By default, waves are
assigned by dependency depth (`level*4 + phase`); with `--serial`,
folders use a linear sequence instead. In both modes, `-pre` sorts
before the primary, so Argo applies the namespace first.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/integrator/talos-integration.md` around lines 112 - 116, Update the Argo
CD deployer documentation to qualify the `level*4 + phase` sync-wave formula as
the default-mode behavior, and document that `--serial` instead assigns each
folder its linear index. Preserve the existing dependency-order and
namespace-first explanation while clearly distinguishing the two modes.

Comment thread pkg/bundler/handler.go
Comment on lines +387 to +396
// Parse serial (deploy components one at a time instead of parallelizing
// independent ones; the API counterpart of the --serial CLI flag).
if v := query.Get("serial"); v != "" {
b, parseErr := strconv.ParseBool(v)
if parseErr != nil {
return nil, aicrerrors.Wrap(aicrerrors.ErrCodeInvalidRequest,
"serial must be a boolean (true/false)", parseErr)
}
params.serial = b
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject explicitly empty serial values.

query.Get("serial") returns an empty string both when the parameter is absent and when the request contains ?serial=, so the latter is silently accepted as false instead of rejected as an invalid boolean. Check key presence separately before parsing, and add a serial= regression case.

Proposed fix
-	if v := query.Get("serial"); v != "" {
+	if _, present := query["serial"]; present {
+		v := query.Get("serial")
 		b, parseErr := strconv.ParseBool(v)
 		if parseErr != nil {
 			return nil, aicrerrors.Wrap(aicrerrors.ErrCodeInvalidRequest,
 				"serial must be a boolean (true/false)", parseErr)
 		}
 		params.serial = b
 	}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Parse serial (deploy components one at a time instead of parallelizing
// independent ones; the API counterpart of the --serial CLI flag).
if v := query.Get("serial"); v != "" {
b, parseErr := strconv.ParseBool(v)
if parseErr != nil {
return nil, aicrerrors.Wrap(aicrerrors.ErrCodeInvalidRequest,
"serial must be a boolean (true/false)", parseErr)
}
params.serial = b
}
// Parse serial (deploy components one at a time instead of parallelizing
// independent ones; the API counterpart of the --serial CLI flag).
if _, present := query["serial"]; present {
v := query.Get("serial")
b, parseErr := strconv.ParseBool(v)
if parseErr != nil {
return nil, aicrerrors.Wrap(aicrerrors.ErrCodeInvalidRequest,
"serial must be a boolean (true/false)", parseErr)
}
params.serial = b
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/bundler/handler.go` around lines 387 - 396, Update the serial query
handling around query.Get("serial") to distinguish an absent parameter from an
explicitly empty serial value. Check query-key presence separately, reject
present-but-empty values with the existing invalid-boolean error, and preserve
boolean parsing for non-empty values; add a regression test covering ?serial=.

Comment thread tests/uat/aws/run
Comment on lines +313 to +321
# Persist each attempt's validate output (timestamped) to the bundle so the
# status.status progression across the tuning-settling window survives into the
# failure artifact — capturing the complete→in_progress flips as they happen
# (see CLUSTER_DEBUG_GATE_LOG in tests/uat/lib/collect-debug.sh). The mktemp
# gate_log is still used for the immediate on-screen failure diagnostic.
mkdir -p "${CLUSTER_DEBUG_DIR}"
: > "${CLUSTER_DEBUG_GATE_LOG}" || true
local ready_deadline=$(( SECONDS + READINESS_TIMEOUT_SECONDS ))
local attempt=1 streak=0 ready=false remaining
local attempt=1 streak=0 ready=false remaining attempt_result

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Readiness-gate persistence + skyhook-capture-on-failure logic duplicated verbatim across all three cloud run scripts.

This block (gate-log init + attempt-result tracking + append) and the vrc-capture/capture_skyhook_snapshot block are essentially identical to the same ranges in tests/uat/gcp/run and structurally the same (plus az-relogin) in tests/uat/azure/run. See consolidated comment for the cross-file recommendation.

Also applies to: 337-360, 395-409

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/uat/aws/run` around lines 313 - 321, Extract the duplicated
readiness-gate persistence and failure skyhook-capture logic from the cloud run
scripts into a shared helper, then update the AWS, GCP, and Azure run flows to
call it. Preserve each script’s existing provider-specific behavior, including
Azure az-relogin handling, while centralizing gate-log initialization,
attempt-result tracking/appending, vrc capture, and capture_skyhook_snapshot.

Comment thread tests/uat/azure/run
Comment on lines +360 to +368
# Persist each attempt's validate output (timestamped) to the bundle so the
# status.status progression across the tuning-settling window survives into the
# failure artifact — capturing the complete→in_progress flips as they happen
# (see CLUSTER_DEBUG_GATE_LOG in tests/uat/lib/collect-debug.sh). The mktemp
# gate_log is still used for the immediate on-screen failure diagnostic.
mkdir -p "${CLUSTER_DEBUG_DIR}"
: > "${CLUSTER_DEBUG_GATE_LOG}" || true
local ready_deadline=$(( SECONDS + READINESS_TIMEOUT_SECONDS ))
local attempt=1 streak=0 ready=false remaining
local attempt=1 streak=0 ready=false remaining attempt_result

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Same readiness-gate persistence + skyhook-capture logic duplicated here as in tests/uat/aws/run and tests/uat/gcp/run.

See consolidated comment for the cross-file recommendation.

Also applies to: 398-421, 456-470

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/uat/azure/run` around lines 360 - 368, Consolidate the readiness-gate
persistence and skyhook-capture logic currently duplicated in the Azure runner
with the equivalent AWS and GCP runner implementation. Extract or reuse a shared
helper for the CLUSTER_DEBUG_GATE_LOG setup, attempt recording, and capture
behavior, then update the affected Azure flow to call it while preserving
timestamped validation output and immediate failure diagnostics.

Comment thread tests/uat/gcp/run
Comment on lines +313 to +321
# Persist each attempt's validate output (timestamped) to the bundle so the
# status.status progression across the tuning-settling window survives into the
# failure artifact — capturing the complete→in_progress flips as they happen
# (see CLUSTER_DEBUG_GATE_LOG in tests/uat/lib/collect-debug.sh). The mktemp
# gate_log is still used for the immediate on-screen failure diagnostic.
mkdir -p "${CLUSTER_DEBUG_DIR}"
: > "${CLUSTER_DEBUG_GATE_LOG}" || true
local ready_deadline=$(( SECONDS + READINESS_TIMEOUT_SECONDS ))
local attempt=1 streak=0 ready=false remaining
local attempt=1 streak=0 ready=false remaining attempt_result

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Same readiness-gate persistence + skyhook-capture logic duplicated here as in tests/uat/aws/run and tests/uat/azure/run.

See consolidated comment for the cross-file recommendation.

Also applies to: 337-360, 395-409

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/uat/gcp/run` around lines 313 - 321, Consolidate the readiness-gate
persistence and skyhook-capture logic currently duplicated in the GCP runner’s
setup and attempt-handling sections, matching the shared implementation used by
the AWS and Azure runners. Update the relevant readiness initialization and the
referenced blocks around the attempt loop and failure handling to reuse the
common helper or shared path, while preserving timestamped validation output and
immediate failure diagnostics.

Comment on lines +143 to +157
# _cd_section runs a labeled command group, teeing to both the step log (folded
# in an Actions ::group::) and a file in the bundle. The command is bounded by
# CLUSTER_DEBUG_CMD_TIMEOUT (via _cd_bounded), so a single hung call can't starve
# later sections. Callers must pass an EXTERNAL command (kubectl / bash -c), never
# a bare shell function — `timeout` cannot invoke a function; route function-based
# sections directly (see the node-reboot-fingerprint section). Never fails.
_cd_section() {
local label="$1" outfile="$2"; shift 2
{
echo "##### ${label} #####"
echo "\$ $*"
_cd_bounded "$@" 2>&1 || true
echo
} | tee -a "${CLUSTER_DEBUG_DIR}/${outfile}"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

_cd_section (and the 3 raw tee/>> blocks) can abort the whole collector under set -e.

_cd_section's body ends on } | tee -a "${file}" with no trailing || true/explicit return 0, so its exit status is whatever tee returns. Every call site (nodes/events/pods/CR/namespace sections) is invoked bare, with no || true. The MANIFEST.yaml generation (167-195), the node-reboot-fingerprint block (216-220), and the per-pod log block (268-277) have the same gap — their pipe/redirect exit status is unguarded. Under the caller scripts' set -e (confirmed by tests/uat/azure/run's own comment referencing "a set -e (L41) abort"), a single failed write (disk full, permission, unmounted workspace) aborts collect_cluster_debug immediately, skipping every later section — contradicting the documented invariant that "the whole collector is wrapped so it never fails the run" (lines 32-36). The outer workflow step still "succeeds" (run: ... debug ... || true), so this silently truncates the bundle rather than failing the job — but it defeats the tool's purpose exactly when the cluster is degraded enough to make writes flaky.

🛡️ Proposed fix: guarantee success at the function/block boundary
 _cd_section() {
   local label="$1" outfile="$2"; shift 2
   {
     echo "##### ${label} #####"
     echo "\$ $*"
     _cd_bounded "$@" 2>&1 || true
     echo
-  } | tee -a "${CLUSTER_DEBUG_DIR}/${outfile}"
+  } | tee -a "${CLUSTER_DEBUG_DIR}/${outfile}" || true
 }

Apply the same || true to the MANIFEST.yaml tee (line 195), the node-reboot-fingerprint tee -a (line 220), and the per-pod-log >> redirect block (line 277).

Also applies to: 167-195, 216-220, 268-277

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/uat/lib/collect-debug.sh` around lines 143 - 157, Ensure the collector
remains non-failing under set -e by guarding the _cd_section pipeline with ||
true or an equivalent explicit successful return. Apply the same protection to
the MANIFEST.yaml generation, node-reboot-fingerprint tee block, and per-pod log
redirect block so write failures cannot skip later collection sections.

Comment on lines +244 to +279
local ns
for ns in $(_cd_bounded kubectl get ns -o name 2>/dev/null | sed 's|namespace/||'); do
local nsfile="ns-${ns}.txt"
_cd_section "[${ns}] pods (wide)" "${nsfile}" \
kubectl get pods -n "${ns}" -o wide
_cd_section "[${ns}] jobs" "${nsfile}" \
kubectl get jobs -n "${ns}" -o wide
_cd_section "[${ns}] events (by time)" "${nsfile}" \
kubectl get events -n "${ns}" --sort-by=.lastTimestamp

# `describe pods` and full logs are limited to the operator/check namespaces
# in the allowlist. `describe` renders literal (non-Secret) env values in its
# Environment section; scoping it to trusted operator namespaces — rather than
# every namespace — bounds credential/PII exposure in the public-repo artifact
# (a UAT recipe override or third-party chart with a literal-env secret would
# otherwise leak straight in). The get/events above still cover every namespace.
case " ${CLUSTER_DEBUG_LOG_NAMESPACES} " in
*" ${ns} "*) ;;
*) continue ;;
esac
_cd_section "[${ns}] describe pods" "${nsfile}" \
kubectl describe pods -n "${ns}"
local logfile="logs-${ns}.txt" p
for p in $(_cd_bounded kubectl get pods -n "${ns}" -o name 2>/dev/null); do
{
echo "===== ${ns}/${p} (current) ====="
_cd_bounded kubectl logs -n "${ns}" "${p#pod/}" --all-containers \
--tail="${CLUSTER_DEBUG_LOG_TAIL}" 2>&1 || true
# --previous survives a container restart across a reboot — the log that
# actually explains a tuning-reboot crash is usually the previous one.
echo "===== ${ns}/${p} (previous, if any) ====="
_cd_bounded kubectl logs -n "${ns}" "${p#pod/}" --all-containers --previous \
--tail="${CLUSTER_DEBUG_LOG_TAIL}" 2>&1 || true
} >> "${CLUSTER_DEBUG_DIR}/${logfile}"
done
done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Prioritize allowlisted operator/check namespaces before the general namespace sweep.

The loop visits every cluster namespace (in kubectl get ns's default, effectively alphabetical, order) and only checks CLUSTER_DEBUG_LOG_NAMESPACES after the unconditional pods/jobs/events sections. If the per-command 30s bound is exhausted repeatedly (plausible on the very degraded-apiserver conditions this collector targets) before the outer 8-minute workflow step timeout, generic namespaces alphabetically ahead of skyhook/gpu-operator/etc. (e.g. default, kube-system) could consume the budget before the documented highest-value namespaces are reached.

♻️ Proposed fix: iterate allowlisted namespaces first, then the rest
-  for ns in $(_cd_bounded kubectl get ns -o name 2>/dev/null | sed 's|namespace/||'); do
+  local _all_ns _ordered_ns
+  _all_ns="$(_cd_bounded kubectl get ns -o name 2>/dev/null | sed 's|namespace/||')"
+  _ordered_ns="${CLUSTER_DEBUG_LOG_NAMESPACES} $(comm -23 <(printf '%s\n' ${_all_ns} | sort) <(printf '%s\n' ${CLUSTER_DEBUG_LOG_NAMESPACES} | tr ' ' '\n' | sort))"
+  for ns in ${_ordered_ns}; do
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
local ns
for ns in $(_cd_bounded kubectl get ns -o name 2>/dev/null | sed 's|namespace/||'); do
local nsfile="ns-${ns}.txt"
_cd_section "[${ns}] pods (wide)" "${nsfile}" \
kubectl get pods -n "${ns}" -o wide
_cd_section "[${ns}] jobs" "${nsfile}" \
kubectl get jobs -n "${ns}" -o wide
_cd_section "[${ns}] events (by time)" "${nsfile}" \
kubectl get events -n "${ns}" --sort-by=.lastTimestamp
# `describe pods` and full logs are limited to the operator/check namespaces
# in the allowlist. `describe` renders literal (non-Secret) env values in its
# Environment section; scoping it to trusted operator namespaces — rather than
# every namespace — bounds credential/PII exposure in the public-repo artifact
# (a UAT recipe override or third-party chart with a literal-env secret would
# otherwise leak straight in). The get/events above still cover every namespace.
case " ${CLUSTER_DEBUG_LOG_NAMESPACES} " in
*" ${ns} "*) ;;
*) continue ;;
esac
_cd_section "[${ns}] describe pods" "${nsfile}" \
kubectl describe pods -n "${ns}"
local logfile="logs-${ns}.txt" p
for p in $(_cd_bounded kubectl get pods -n "${ns}" -o name 2>/dev/null); do
{
echo "===== ${ns}/${p} (current) ====="
_cd_bounded kubectl logs -n "${ns}" "${p#pod/}" --all-containers \
--tail="${CLUSTER_DEBUG_LOG_TAIL}" 2>&1 || true
# --previous survives a container restart across a reboot — the log that
# actually explains a tuning-reboot crash is usually the previous one.
echo "===== ${ns}/${p} (previous, if any) ====="
_cd_bounded kubectl logs -n "${ns}" "${p#pod/}" --all-containers --previous \
--tail="${CLUSTER_DEBUG_LOG_TAIL}" 2>&1 || true
} >> "${CLUSTER_DEBUG_DIR}/${logfile}"
done
done
local _all_ns _ordered_ns
_all_ns="$(_cd_bounded kubectl get ns -o name 2>/dev/null | sed 's|namespace/||')"
_ordered_ns="${CLUSTER_DEBUG_LOG_NAMESPACES} $(comm -23 <(printf '%s\n' ${_all_ns} | sort) <(printf '%s\n' ${CLUSTER_DEBUG_LOG_NAMESPACES} | tr ' ' '\n' | sort))"
for ns in ${_ordered_ns}; do
local nsfile="ns-${ns}.txt"
_cd_section "[${ns}] pods (wide)" "${nsfile}" \
kubectl get pods -n "${ns}" -o wide
_cd_section "[${ns}] jobs" "${nsfile}" \
kubectl get jobs -n "${ns}" -o wide
_cd_section "[${ns}] events (by time)" "${nsfile}" \
kubectl get events -n "${ns}" --sort-by=.lastTimestamp
# `describe pods` and full logs are limited to the operator/check namespaces
# in the allowlist. `describe` renders literal (non-Secret) env values in its
# Environment section; scoping it to trusted operator namespaces — rather than
# every namespace — bounds credential/PII exposure in the public-repo artifact
# (a UAT recipe override or third-party chart with a literal-env secret would
# otherwise leak straight in). The get/events above still cover every namespace.
case " ${CLUSTER_DEBUG_LOG_NAMESPACES} " in
*" ${ns} "*) ;;
*) continue ;;
esac
_cd_section "[${ns}] describe pods" "${nsfile}" \
kubectl describe pods -n "${ns}"
local logfile="logs-${ns}.txt" p
for p in $(_cd_bounded kubectl get pods -n "${ns}" -o name 2>/dev/null); do
{
echo "===== ${ns}/${p} (current) ====="
_cd_bounded kubectl logs -n "${ns}" "${p#pod/}" --all-containers \
--tail="${CLUSTER_DEBUG_LOG_TAIL}" 2>&1 || true
# --previous survives a container restart across a reboot — the log that
# actually explains a tuning-reboot crash is usually the previous one.
echo "===== ${ns}/${p} (previous, if any) ====="
_cd_bounded kubectl logs -n "${ns}" "${p#pod/}" --all-containers --previous \
--tail="${CLUSTER_DEBUG_LOG_TAIL}" 2>&1 || true
} >> "${CLUSTER_DEBUG_DIR}/${logfile}"
done
done
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/uat/lib/collect-debug.sh` around lines 244 - 279, Update the namespace
iteration around CLUSTER_DEBUG_LOG_NAMESPACES to process all allowlisted
operator/check namespaces first, then perform the general namespace sweep for
remaining namespaces. Preserve the existing pods/jobs/events collection for
every namespace and the describe/log collection only for allowlisted namespaces,
while avoiding duplicate processing when a namespace appears in both groups.

@njhensley
njhensley merged commit e0efbb5 into NVIDIA:main Jul 16, 2026
168 checks passed
@njhensley
njhensley deleted the revert/1744-slinky-slurm branch July 16, 2026 15:40
mohityadav8 pushed a commit to mohityadav8/aicr that referenced this pull request Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants