Repository navigation
fix(recipe): let a Slurm bundle's own recipe.yaml load back - #2994
Conversation
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>
Recipe evidence checkNo leaf overlays affected by this PR. This gate is warning-only and never blocks merge. |
|
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 configurationConfiguration used: Repository: NVIDIA/aicr/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthrough
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to 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)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Coverage Report ✅
Coverage BadgeMerging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
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. |
Summary
A Slurm bundle's own
recipe.yamlfailed to load back under the defaultdisabledaccounting mode and undercustomer-managed. Accounting validation now treats a component absent from the recipe as satisfying an expectedinstall: false/accounting.enabled: false.Motivation / Context
The bundler writes
recipe.yamlafter dropping disabled components (filterEnabledComponents) but keepsconfiguration.slurm.accounting. On reload,ValidateCoherence→validateAccountingConfigurationrequired the droppedmariadb-operator-crds,mariadb-operatorandslurm-accounting-mariadbrefs to be present withinstall: false, which pruning makes impossible: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
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component/*)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)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-providedmode, oraccounting.enabled: trueonslinky-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.yamlbytes (and sochecksums.txtand the attestation subject) for every bundle, and would put disabled components in front of every consumer that readsrecipe.yamlas the deployed set.Testing
TestLoadConfiguredRecipeAcceptsPrunedDisabledComponentsbuilds aneks/h100/training/ubuntu/slurmrecipe per accounting mode, drops disabled refs the way the bundler does, and loads it throughLoadFromFileWithProvider. It fails onmainfordisabledandcustomer-managed, and passes with the fix. End to end with a binary from this branch, the same Slurm bundle now passesaicr upgrade-check --from <bundle>and re-bundles from its ownrecipe.yamlwith an identical folder layout.make qualifynot yet run.Risk Assessment
Rollout notes: N/A. Loosens only the absent-and-expected-false case; nothing that loaded before is rejected now.
Checklist
make testwith-race) (affected packages only, see Testing)make lint) (golangci-lint onpkg/recipeonly)git commit -S) — GPG signing info