Skip to content

Commit 4dfcc00

Browse files
committed
fix(onboard): isolate N1x rebuild intent
Signed-off-by: San Dang <sdang@nvidia.com>
1 parent 5cb5206 commit 4dfcc00

4 files changed

Lines changed: 25 additions & 8 deletions

File tree

src/lib/onboard/authoritative-rebuild-target.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ describe("authoritative rebuild runtime preflight options", () => {
4747
noGpu: false,
4848
allowDeferredN1xManagedVllm: true,
4949
});
50+
51+
const { allowDeferredN1xManagedVllm: _recordedIntent, ...withoutRecordedIntent } = options;
52+
expect(authoritativeRebuildRuntimePreflightOptions(withoutRecordedIntent)).toEqual({
53+
sandboxGpu: "enable",
54+
sandboxGpuDevice: "nvidia.com/gpu=all",
55+
noGpu: false,
56+
allowDeferredN1xManagedVllm: false,
57+
});
5058
});
5159
});
5260

src/lib/onboard/authoritative-rebuild-target.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,14 @@ export type AuthoritativeRebuildPreflightOptions = Pick<
3636
/** Project only the target-bound GPU and N1x intent into runtime preflight. */
3737
export function authoritativeRebuildRuntimePreflightOptions(
3838
opts: AuthoritativeRebuildPreflightOptions,
39-
): Pick<
40-
OnboardOptions,
41-
"sandboxGpu" | "sandboxGpuDevice" | "noGpu" | "allowDeferredN1xManagedVllm"
42-
> {
39+
): Pick<OnboardOptions, "sandboxGpu" | "sandboxGpuDevice" | "noGpu"> & {
40+
allowDeferredN1xManagedVllm: boolean;
41+
} {
4342
return {
4443
sandboxGpu: opts.sandboxGpu,
4544
sandboxGpuDevice: opts.sandboxGpuDevice,
4645
noGpu: opts.noGpu,
47-
allowDeferredN1xManagedVllm: opts.allowDeferredN1xManagedVllm,
46+
allowDeferredN1xManagedVllm: opts.allowDeferredN1xManagedVllm === true,
4847
};
4948
}
5049

src/lib/onboard/fatal-runtime-preflight.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ afterEach(() => {
9191
});
9292

9393
describe("report-backed runtime readiness (#7411)", () => {
94-
it("requires explicit managed-vLLM intent for the Deferred N1x readiness exception (#8574)", () => {
94+
it("requires explicit managed-vLLM intent and lets rebuild reject ambient intent (#9292)", () => {
9595
const readiness: SystemReadinessReport = {
9696
schemaVersion: "1.1.0",
9797
status: "incompatible",
@@ -152,6 +152,14 @@ describe("report-backed runtime readiness (#7411)", () => {
152152
exitProcess: exit as never,
153153
}),
154154
).toBe(readiness);
155+
156+
expect(() =>
157+
assertOnboardSystemReadiness(readiness, hostWithRuntime("docker"), {
158+
explicitlyOptedOutGpuPassthrough: false,
159+
allowDeferredN1xManagedVllm: false,
160+
exitProcess: exit as never,
161+
}),
162+
).toThrow("exit");
155163
});
156164

157165
it("rejects ambiguous gateway ownership before the caller can run effects", () => {

src/lib/onboard/fatal-runtime-preflight.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ import { MANAGED_VLLM_PROVIDER_KEY } from "./vllm-menu";
4444

4545
export type FatalRuntimePreflightOptions = Pick<
4646
OnboardOptions,
47-
"sandboxGpu" | "sandboxGpuDevice" | "gpu" | "noGpu" | "allowDeferredN1xManagedVllm"
47+
"sandboxGpu" | "sandboxGpuDevice" | "gpu" | "noGpu"
4848
> & {
49+
/** Explicit false prevents ambient provider intent from crossing a rebuild boundary. */
50+
allowDeferredN1xManagedVllm?: boolean;
4951
optedOutGpuPassthrough?: boolean;
5052
};
5153

@@ -155,7 +157,7 @@ export function assertOnboardSystemReadiness(
155157
allowStorageRemediation: options.allowStorageRemediation === true,
156158
allowPortableHostPreparation: options.allowPortableHostPreparation,
157159
allowDeferredN1xManagedVllm:
158-
options.allowDeferredN1xManagedVllm === true ||
160+
options.allowDeferredN1xManagedVllm ??
159161
process.env.NEMOCLAW_PROVIDER === MANAGED_VLLM_PROVIDER_KEY,
160162
});
161163
if (admission.admitted) return readinessReport;

0 commit comments

Comments
 (0)