fix(inference): adopt an interrupted managed vLLM container holding the serving port - #11587
Conversation
…he serving port Host-local lifecycle recovery admits only a completed authenticated install: it requires the runtime receipt written after startup and the auth label a profile adds only for managed bearer auth. An install interrupted before either exists leaves its own managed container running on the serving port, so the guard reported that port as held by another process and neither onboard --resume nor a fresh install could make progress. Classify the port holder by its ownership labels when recovery cannot claim it, and reuse the existing replacement path for a running managed container. A foreign or unlabeled holder, an ambiguous inspection, a distributed head or worker, and a container that is not running all remain conflicts. Fixes #11426 Signed-off-by: Ho Lim <subhoya@gmail.com>
Review found that ownership alone did not prove the managed container was the process holding the serving port: a managed container published on another host port would have been adopted and removed while an unrelated process kept the port, freeing nothing and destroying an unrelated runtime. Compare the container's published binding for the fixed container port with the port that failed, and keep the conflict outcome when they differ or the binding cannot be read. Signed-off-by: Ho Lim <subhoya@gmail.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review. 📝 WalkthroughWalkthroughThe installer now adopts eligible managed vLLM containers that hold the configured loopback serving port. It preserves the recovered Docker context and validates ownership during replacement. Tests cover recovery, foreign containers, incorrect ports, non-loopback bindings, and replacement races. ChangesManaged vLLM container recovery
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant vLLMInstaller
participant PortProbe
participant DockerDefaultContext
vLLMInstaller->>PortProbe: detect configured serving port
vLLMInstaller->>DockerDefaultContext: inspect port holder
DockerDefaultContext-->>vLLMInstaller: return ownership and binding data
vLLMInstaller->>DockerDefaultContext: adopt or replace eligible container
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The recovery flow validates managed ownership, exact loopback port binding, and Docker context before replacement, with focused coverage for foreign, mismatched, and remote-context cases. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/pluginThe overall line coverage in commit 55b330e in the TypeScript / code-coverage/cliThe overall line coverage in commit 55b330e in the Show a line coverage summary of the most impacted files.
Updated |
Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
rsliter
left a comment
There was a problem hiding this comment.
Reviewed exact commit 55b330e against issue #11426. The implementation keeps adoption on the physical host Docker boundary, requires managed running ownership plus a loopback-covering binding on the failed port, and revalidates the exact container ID before removal. Negative coverage includes foreign ownership, remote Docker selectors, mismatched ports and addresses, stopped state, inspection ambiguity, and ID drift. The focused suite passes 18/18 locally. The repository-owned CI and self-hosted qualification runs are green. Approval applies to the implementation; merge remains separately gated.
## Outcome Configuration export can read a NemoClaw-managed gateway from the canonical owner-private default state directory even when that directory predates explicit ownership markers. The selected inference-routing E2E also accepts OpenShell's current scope-bound credential placeholder and continues to verify delegated bearer resolution. ## Reason Exact-candidate run 34649953836 and exact-base replay 34651044220 reproduced the same two failures: default-gateway SDK reads stopped before the sandbox inventory RPC, and TC-INF-12 rejected the valid OpenShell 0.0.116 scope-bound placeholder. These inherited failures block deterministic qualification of #11587. ### Related issues Refs #11421 ## Changes - Preserve strict ownership-marker requirements for explicit gateway state overrides while recognizing the canonical owner-private default state used by installations created before markers. - Cover both the legacy-default connection path and rejection of an unmarked explicit override. - Share the bounded OpenShell placeholder grammar for unscoped, generation-scoped, and scope-bound credentials between TC-INF-12 and its mapped fast test. - Integrate current main so trusted E2E compares the candidate against the exact PR base instead of treating intervening main changes as candidate-managed-image inputs. ## Verification - `npx vitest run --project cli src/lib/adapters/openshell/sandbox-command-sdk.test.ts src/lib/adapters/config/live-export-source.test.ts` — 93 tests passed. - `npx vitest run --project e2e-support test/e2e/support/hosted-inference.test.ts` — 19 tests passed. - `npx tsx scripts/checks/e2e-mock-parity.mts --base origin/main --head HEAD` — passed. - `NODE_OPTIONS=--max-old-space-size=8192 npm run typecheck:cli` — passed. - `npm run test:changed` — the growth-guardrail preflight passed; no additional source tests were selected after base integration. - `NODE_OPTIONS=--max-old-space-size=8192 npm run validate:pr` — passed at `1f5269c49138fea461d3351f5d5c39c73f5d1ba1` against canonical main `37261efb99c0dcbfcef6551efa0c59357e96fcbe`. - The pre-repair exact-head hosted CI run [34666334600](https://github.com/NVIDIA/NemoClaw/actions/runs/34666334600) passed every selected job, including all 12 CLI shards. Current-head run [34668234877](https://github.com/NVIDIA/NemoClaw/actions/runs/34668234877) is qualifying the one-line E2E repair. - Trusted manual PR E2E run [34667270786](https://github.com/NVIDIA/NemoClaw/actions/runs/34667270786) ran `inference-routing,network-policy` in mock mode against head `092fdefc472882cd135a4f839d2285da4969b467`, with correlation `57e03ed4-c1ad-4a14-9f45-112ad6c8d10a`. Network policy passed. TC-INF-12 failed after credential rotation because its second assertion still required only the generation-scoped placeholder. Cleanup and artifact upload passed. Commit `1f5269c49138fea461d3351f5d5c39c73f5d1ba1` reuses the bounded credential-reference matcher for the rotated placeholder. - The diff contains no secrets, API keys, or credentials. ## Review notes Alternative review completed for `1f5269c49138fea461d3351f5d5c39c73f5d1ba1`. Local Advisor failed before specialist analysis because its OpenShell sandbox never passed supervisor-relay readiness (`sandbox is not ready`, SSH status 255); cleanup succeeded, but no specialist artifacts were produced. Manual review of the full diff and the one-line E2E repair found no remaining actionable issue. The repair reuses the bounded matcher already exercised by the fast support test. Focused tests and canonical validation passed. The residual limitation is the absence of Advisor specialist artifacts; current-head CodeRabbit and trusted E2E evidence remain pending. ## Dependency - [#11598](#11598) merged as `37261efb99c0dcbfcef6551efa0c59357e96fcbe`; that fix is integrated into the current head, so qualification has resumed. --- Signed-off-by: Julie Yaunches <jyaunches@nvidia.com> --------- Signed-off-by: Julie Yaunches <jyaunches@nvidia.com>
Outcome
Managed vLLM onboarding now reclaims an interrupted NemoClaw container only when the container is on the same local Docker boundary and one published binding covers the probed loopback endpoint on the requested port. This same-repository continuation adopts the exact reviewed candidate from #11530 so required SDK CI and trusted E2E can run.
Reason
The source contribution fixes the recovery gap in #11426, but fork heads cannot consume the base-controlled OpenShell SDK package and are rejected by manual PR E2E. The copy-pr-bot branch preserves the exact signed candidate while providing the repository-owned source identity those gates require.
Related issues
Fixes #11426
Adopts #11530. Do not merge both pull requests.
Changes
Verification
Review notes
Sensitive paths: src/lib/inference/vllm.ts and src/lib/inference/vllm-serving-port.test.ts. The complete two-file candidate at bf1b1d8 was reviewed through #11530, including correctness, Docker locality, destructive-removal guards, binding parsing, sibling recovery paths, regression coverage, and credential boundaries. CodeRabbit findings on remote Docker routing and binding addresses were reproduced and repaired. The local PR Advisor was attempted on each repaired candidate but could not start its first specialist sandbox because the local OpenShell relay refused the connection; cleanup succeeded and no artifacts were produced. Alternative review completed; this is not an Advisor clearance.
Signed-off-by: Julie Yaunches jyaunches@nvidia.com
Summary by CodeRabbit