Skip to content

fix(recipe): let a Slurm bundle's own recipe.yaml load back - #2994

Merged
lockwobr merged 1 commit into
mainfrom
fix/slurm-bundle-recipe-reload
Sep 30, 2026
Merged

lockwobr merged 1 commit into
mainfrom
fix/slurm-bundle-recipe-reload

Conversation

@lockwobr

@lockwobr lockwobr commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A Slurm bundle's own recipe.yaml failed to load back under the default disabled accounting mode and under customer-managed. Accounting validation now treats a component absent from the recipe as satisfying an expected install: false / accounting.enabled: false.

Motivation / Context

The bundler writes recipe.yaml after dropping disabled components (filterEnabledComponents) but keeps configuration.slurm.accounting. On reload, ValidateCoherence → validateAccountingConfiguration required the dropped mariadb-operator-crds, mariadb-operator and slurm-accounting-mariadb refs to be present with install: false, which pruning makes impossible:

$ aicr bundle --recipe <slurm-bundle>/recipe.yaml ...
[cli] command failed: error=[INVALID_REQUEST] accounting mode requires component "mariadb-operator-crds"
$ aicr upgrade-check --from <slurm-bundle>
[cli] command failed: error=[INVALID_REQUEST] accounting mode requires component "mariadb-operator-crds"

Reproduced with a binary built from main. It surfaced in #2840, whose KWOK legs read the inventory back from every deployed bundle: the three Tier 2 *-training-slurm (helm) legs fail on it.

Fixes: #2995
Related: #2840, #1970

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

  • CLI (cmd/aicr, pkg/cli)
  • API server (cmd/aicrd, pkg/server)
  • Recipe engine / data (pkg/recipe)
  • Bundlers (pkg/bundler, pkg/component/*)
  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)
  • Validator (pkg/validator)
  • Core libraries (pkg/errors, pkg/k8s)
  • Docs/examples (docs/, examples/)
  • Other: ____________

Implementation Notes

The fix is in the validator, not the bundler. An absent component installs nothing, so it meets a requirement that the component be off. A requirement that it be on (aicr-provided mode, or accounting.enabled: true on slinky-slurm) still fails closed when the ref is missing; the new test pins that case.

The alternative, writing the unpruned recipe into the bundle, would change recipe.yaml bytes (and so checksums.txt and the attestation subject) for every bundle, and would put disabled components in front of every consumer that reads recipe.yaml as the deployed set.

Testing

go test -race ./pkg/recipe/... ./pkg/bundler/ ./pkg/config/... ./pkg/client/v1/...   # ok
golangci-lint run -c .golangci.yaml ./pkg/recipe/...                                   # 0 issues

TestLoadConfiguredRecipeAcceptsPrunedDisabledComponents builds an eks/h100/training/ubuntu/slurm recipe per accounting mode, drops disabled refs the way the bundler does, and loads it through LoadFromFileWithProvider. It fails on main for disabled and customer-managed, and passes with the fix. End to end with a binary from this branch, the same Slurm bundle now passes aicr upgrade-check --from <bundle> and re-bundles from its own recipe.yaml with an identical folder layout.

make qualify not yet run.

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert
  • Medium — Touches multiple components or has broader impact
  • High — Breaking change, affects critical paths, or complex rollout

Rollout notes: N/A. Loosens only the absent-and-expected-false case; nothing that loaded before is rejected now.

Checklist

  • Tests pass locally (make test with -race) (affected packages only, see Testing)
  • Linter passes (make lint) (golangci-lint on pkg/recipe only)
  • 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) — GPG signing info

The bundler writes recipe.yaml after dropping every disabled component,
but keeps configuration.slurm.accounting. Reloading it then demanded the
dropped MariaDB refs carry install=false, so under the default disabled
mode, and under customer-managed, no Slurm bundle's recipe could be read
back: not by `aicr bundle --recipe <bundle>/recipe.yaml`, and not by
`aicr upgrade-check --from <bundle>`.

An absent component installs nothing, so it now satisfies an expected
false. A component the mode needs installed is still required.

Signed-off-by: Brian Lockwood <lockwobr@gmail.com>
@lockwobr lockwobr added the theme/recipes Recipe expansion, overlays, mixins, and component registry label Sep 30, 2026
@lockwobr lockwobr self-assigned this Sep 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Recipe evidence check

No leaf overlays affected by this PR.

This gate is warning-only and never blocks merge.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/aicr/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 2734317c-d66a-4a10-882b-76569c06e7cb

📥 Commits

Reviewing files that changed from the base of the PR and between 2bd3f39 and cee41f5.

📒 Files selected for processing (2)
  • pkg/recipe/accounting.go
  • pkg/recipe/accounting_loader_test.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

requireBoolOverride now accepts a missing component when the expected override is false. Added tests cover loading recipes with pruned components for disabled and customer-managed accounting, and confirm that AICR-provided accounting still requires the MariaDB operator.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: mchmarny

Merge Risk: ⚪ Minimal · up to cee41

The change allows bundled Slurm recipes to reload after disabled components are pruned, while retaining validation for required components. No actionable merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the main fix: allowing a Slurm bundle's own pruned recipe.yaml to load again.
Description check ✅ Passed The description directly explains the accounting validation bug, the affected modes, the implementation, tests, motivation, and reported verification results.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@lockwobr
lockwobr marked this pull request as ready for review September 30, 2026 04:38
@lockwobr
lockwobr requested a review from a team as a code owner September 30, 2026 04:38
@lockwobr
lockwobr enabled auto-merge (squash) September 30, 2026 04:46
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report ✅

Metric Value
Coverage 85.0%
Threshold 83%
Status Pass
Coverage Badge
![Coverage](https://img.shields.io/badge/coverage-85.0%25-brightgreen)

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/NVIDIA/aicr/pkg/recipe 90.53% (+0.05%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/NVIDIA/aicr/pkg/recipe/accounting.go 86.96% (+1.24%) 184 (+2) 160 (+4) 24 (-2) 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@mchmarny mchmarny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approve: no findings against cee41f5.

@lockwobr
lockwobr merged commit 7827c27 into main Sep 30, 2026
82 of 83 checks passed
@lockwobr
lockwobr deleted the fix/slurm-bundle-recipe-reload branch September 30, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M theme/recipes Recipe expansion, overlays, mixins, and component registry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slurm bundle's recipe.yaml fails to load back under default accounting mode

2 participants