fix(onboard): claim bootstrap terminal outcomes - #8077
Conversation
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
📝 WalkthroughWalkthroughThe change adds shared managed-bootstrap terminal finalization and updates Docker sandbox lifecycle methods to propagate commit and rollback failures. Tests cover outcome claiming, duplicate calls, opposing outcomes, supervisor readiness, backup removal, and commit failure handling. ChangesManaged bootstrap finalization
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant RuntimePatch
participant DockerSandboxCreate
participant ManagedBootstrapFinalizer
participant FailureReporter
RuntimePatch->>DockerSandboxCreate: commitAfterReady()
DockerSandboxCreate->>ManagedBootstrapFinalizer: commit()
ManagedBootstrapFinalizer-->>DockerSandboxCreate: resolve or reject
DockerSandboxCreate->>FailureReporter: report failure when required
DockerSandboxCreate-->>RuntimePatch: return or reject commit result
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall coverage in commit 83e7fe5 in the TypeScript / code-coverage/cliThe overall coverage in commit 83e7fe5 in the Show a code coverage summary of the most impacted files.
Updated |
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate. Since last review: 0 prior items resolved · 0 still apply · 0 new items found 2 semantic terminology decisionsTerminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.
E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: 2 optional E2E recommendations
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/lib/onboard/docker-gpu-sandbox-create.ts (1)
390-419: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winTreat
commit()failure as terminal.
commit()claims the outcome before it settles. Therefore,rollback()always rejects after a failedcommit(). Mark the cutover finalized directly, setrolledBack: false, and do not retrycommitAfterReady(). Add lifecycle coverage for this path.🤖 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 `@src/lib/onboard/docker-gpu-sandbox-create.ts` around lines 390 - 419, Update the managedBootstrapCutover commit failure path to treat commit() as terminal: mark cutoverFinalized true, disable needsSupervisorWait, and remove the rollback attempt and rollback-error handling. Report rolledBack: false in the onPatchFailureExit context and preserve the existing failure propagation without retrying commitAfterReady(); add lifecycle coverage for this failed-commit behavior.Source: Path instructions
🤖 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.
Outside diff comments:
In `@src/lib/onboard/docker-gpu-sandbox-create.ts`:
- Around line 390-419: Update the managedBootstrapCutover commit failure path to
treat commit() as terminal: mark cutoverFinalized true, disable
needsSupervisorWait, and remove the rollback attempt and rollback-error
handling. Report rolledBack: false in the onPatchFailureExit context and
preserve the existing failure propagation without retrying commitAfterReady();
add lifecycle coverage for this failed-commit behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2f3e9368-59c5-42b7-9b87-666e3a407327
📒 Files selected for processing (11)
src/lib/onboard/docker-gpu-local-inference.test.tssrc/lib/onboard/docker-gpu-local-inference.tssrc/lib/onboard/docker-gpu-sandbox-create-lifecycle.test.tssrc/lib/onboard/docker-gpu-sandbox-create.tssrc/lib/onboard/docker-startup-command-sandbox-create.test.tssrc/lib/onboard/managed-bootstrap/README.mdsrc/lib/onboard/managed-bootstrap/docker-runtime.tssrc/lib/onboard/managed-bootstrap/runtime-create.test.tssrc/lib/onboard/managed-bootstrap/runtime-create.tssrc/lib/onboard/sandbox-create-launch.tstest/runtime-provider-source-shape.test.ts
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
apurvvkumaria
left a comment
There was a problem hiding this comment.
Approve — reviewed exact head 83e7fe5. Terminal bootstrap outcomes are claimed through the managed runtime boundary without widening provider authority, and the launch/create/lifecycle tests cover successful, failed, and already-terminal transitions. I found no blocking defect. The current dependency-resolution CI failures are inherited from the exact ancestor/base rather than this change.
## Summary Hardens the dormant managed-bootstrap path so create outcomes are explicit, shared-state rollback remains transaction-owned, and recovery receipts replay durably across runtime providers. This consolidates the additive source work from #8077, #8078, #8080, and the already-incorporated behavior from #8083 without registering or activating a managed runtime. ## Related Issue Refs #7744 ## Changes - Return terminal managed-bootstrap outcomes and preserve explicit rollback evidence through Docker sandbox creation. - Keep application environment and shared-state rollback authority inside the managed-startup transaction, including environment-neutral status and rollback probes. - Move receipt comparison into the provider-neutral adapter, validate pre-journal snapshot identity, and retain exact atomic leftovers for durable replay. - Add focused lifecycle, transaction, compatibility, replay, and source-shape coverage while keeping the candidate provider inert. - Preserve the donor heads under `backup/podman-stack/pr8077-source-83e7fe53`, `backup/podman-stack/pr8078-source-9d4dc59c`, `backup/podman-stack/pr8080-source-9096a968`, and `backup/podman-stack/pr8083-source-a2ae901b`. The adapter contract is currently required by managed-bootstrap journal and runtime construction consumers. A Docker-local change is insufficient because later Podman and MXC-style providers must compare the same durable receipts without central runtime switches. The managed-bootstrap adapter, runtime, journal, shared-state, and source-shape tests protect that boundary. ## Type of Change - [ ] Code change (feature, bug fix, or refactor) - [x] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: No user-visible provider is registered or activated in this additive slice; the internal managed-bootstrap README documents the architecture change. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Maintainer-authored implementation scope under #7744; the provider remains inert and repository advisors must still clear the exact head before merge. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `docs-updated` - Evidence: Updated `src/lib/onboard/managed-bootstrap/README.md`. The managed-bootstrap provider remains unregistered and unsupported in production, so no user-facing `docs/` change is required. - Agent: Codex Desktop <!-- docs-review-head-sha: b3973ce --> <!-- docs-review-agents-blob-sha: 3dd7c24 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run validate:pr` passed after refreshing `origin/main` when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: Targeted Vitest run covering all 12 changed test files passed 175/175 tests at `b3973cebb50d`. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: Local `npm test` was attempted and encountered widespread unrelated five-second timeouts across existing installer, package-contract, rebuild, inference, and policy tests; authoritative sharded CI is pending. - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Aaron Erickson <aerickson@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Commit and rollback failures now surface reliably instead of being silently ignored. * Improved recovery when runtime finalization or supervisor reconnection fails. * Prevented mismatched container images from advancing through setup. * Strengthened rollback protection after a commit becomes durable. * **Compatibility** * Added support for valid legacy transaction manifests while rejecting malformed or incomplete data. * **Reliability** * Repeated commit or rollback requests now produce consistent results, including after acknowledgement failures. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
|
Superseded by clean consolidated replacement #8225, now merged. The donor head remains preserved under backup/podman-stack/pr8077-source-83e7fe53. |
Summary
Make managed bootstrap completion a single claimed terminal outcome so commit and rollback cannot race, and ensure post-ready commit failures remain fatal instead of allowing onboarding to report failure and continue. The finalizer is provider-neutral so later Podman and MXC-style runtimes can reuse it without central driver switches.
Related Issue
Part of #7744.
Stack Position
862492d14be86897c23daf1f8106d8126579dbc183e7fe53a05619bfc5c1401701ec844bbde818d9c54d875bb1bc397ddd7c257e9ca4622ddacd0e97; the non-document slice remains byte-identical at6b09c9e459ecea4c29549cae05e92d6d7121bee1, while feat(images): package and publish all-agent managed images #8047 absorbed the epic-link portion of the earlier documentation patch.Changes
Type of Change
Quality Gates
Documentation Writer Review
docs-updatedsrc/lib/onboard/managed-bootstrap/README.mdnow records synchronous terminal-outcome claiming, same-outcome promise sharing, and opposite-outcome rejection after acknowledgement loss.src/lib/onboard/sandbox-create-launch.tsnow names the complete durable lifecycle, recovery, rollback, all-agent amd64/arm64, GPU/local-inference, regression, and exact-head/base activation gates tracked by [Epic] Support native Podman with buildless managed onboarding #7744. The independent review passed on correction commitc2c3b400a2bdd12b248f96fa39398dfc90a4c62d; the signed append-only stack now reaches exact feat(images): package and publish all-agent managed images #8047 head862492d14be86897c23daf1f8106d8126579dbc1at this PR head83e7fe53a05619bfc5c1401701ec844bbde818d9. Advisor-requested Docker lifecycle composition coverage proves that a failed claimed commit cannot finalize rollback. feat(images): package and publish all-agent managed images #8047 now supplies the epic link directly; the provider-neutral terminal-outcome documentation remains unchanged.DGX Station Hardware Evidence
Verification
83e7fe53a05619bfc5c1401701ec844bbde818d9is signed-DCO and GitHub Verified on exact feat(images): package and publish all-agent managed images #8047 base862492d14be86897c23daf1f8106d8126579dbc1. The current patch isc54d875bb1bc397ddd7c257e9ca4622ddacd0e97; all non-document changes remain byte-identical, and the documentation delta only shrank because feat(images): package and publish all-agent managed images #8047 already carries the epic link. Fresh exact-head CI, advisors, CodeRabbit, managed-image builds, and protected E2E are running.Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run validate:prpassed after refreshingorigin/mainwhen hooks were skipped or unavailablenpm run build:cli, CLI typecheck, Biome, the test-conditional scan, andgit diff --checkpassed. The refreshed exact head additionally passes 5 focused files / 40 tests, the source-shape inventory 2/2,npm run build:cli, CLI typecheck, targeted Biome, andgit diff --check.npm run docsbuilds without warnings (doc changes only)Signed-off-by: Aaron Erickson aerickson@nvidia.com
Summary by CodeRabbit
Bug Fixes
Documentation