From 0b0c3f26b61e1cd3c0b427c97a6aa1daac212800 Mon Sep 17 00:00:00 2001 From: Aaron Erickson Date: Wed, 23 Sep 2026 07:51:58 -0700 Subject: [PATCH 1/3] fix(install): preserve implicit single-Station fallback Signed-off-by: Aaron Erickson --- scripts/install.sh | 8 +++++-- ...install-station-controller-binding.test.ts | 22 +++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 7c6dd07091d..6df2fc0f1b7 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -7053,12 +7053,16 @@ ensure_station_express_pair() { || error "Dual DGX Station preparation returned an inconsistent reboot result; refusing to continue." [ "${_STATION_EXPRESS_DEFERRED_MANAGED_PAIR:-0}" != "1" ] \ || error "The running managed dual-Station head could not be matched to its trusted reciprocal peer; refusing single-Station fallback." - [ "${_STATION_EXPRESS_MIGRATING_LEGACY_HEAD:-0}" != "1" ] \ - || error "The running legacy single-Station head could not be matched to a trusted reciprocal peer; refusing migration and single-Station fallback." [ -z "${NEMOCLAW_DGX_STATION_PEER:-}" ] \ || error "The explicit DGX Station peer could not be qualified; refusing single-Station fallback." station_dual_pair_resume_pending \ && error "Dual DGX Station preparation returned a single-Station result while exact pair resume state is pending; refusing to discard it." + if [ "${_STATION_EXPRESS_MIGRATING_LEGACY_HEAD:-0}" = "1" ]; then + # An implicit peer miss keeps the existing single-Station workload. + # Recheck its ownership before continuing without host preparation. + station_migratable_legacy_single_head_running \ + || error "The existing single-Station workload changed during peer discovery; refusing fallback." + fi if [ "${_STATION_EXPRESS_MODEL_WAS_EXPLICIT:-0}" = "0" ]; then NEMOCLAW_VLLM_MODEL="$STATION_ULTRA_VLLM_MODEL" NEMOCLAW_MODEL="$STATION_ULTRA_SERVED_MODEL" diff --git a/test/installer-integration/install-station-controller-binding.test.ts b/test/installer-integration/install-station-controller-binding.test.ts index 756667266fc..245e5a29a96 100644 --- a/test/installer-integration/install-station-controller-binding.test.ts +++ b/test/installer-integration/install-station-controller-binding.test.ts @@ -397,7 +397,20 @@ printf 'REUSE=%s MIGRATE=%s\n' "$_STATION_EXPRESS_DEFERRED_MANAGED_PAIR" "$_STAT }, ); - it("passes legacy migration to the coordinator without managed-pair reuse", () => { + it.each([ + { + name: "continues with an unchanged legacy single-Station head", + headStatus: 0, + status: 0, + message: /using the existing single-Station Ultra recipe/u, + }, + { + name: "refuses fallback when the legacy single-Station head changes", + headStatus: 1, + status: 1, + message: /single-Station workload changed/u, + }, + ])("$name (#12283)", ({ headStatus, status, message }) => { const argsFile = path.join(os.tmpdir(), `nemoclaw-legacy-args-${process.pid}-${Date.now()}`); const { home, result, output } = runInstallerBody( ` @@ -415,18 +428,19 @@ _STATION_EXPRESS_MODEL_WAS_EXPLICIT=0 _STATION_INSTALL_MODE='express' _STATION_EXPRESS_DEFERRED_MANAGED_PAIR=0 _STATION_EXPRESS_MIGRATING_LEGACY_HEAD=1 +station_migratable_legacy_single_head_running() { return "$LEGACY_HEAD_STATUS"; } NEMOCLAW_VLLM_MODEL='nemotron-3-ultra-550b-a55b' unset NEMOCLAW_DGX_STATION_PEER ensure_station_express_pair `, - { ARGS_FILE: argsFile }, + { ARGS_FILE: argsFile, LEGACY_HEAD_STATUS: String(headStatus) }, ); try { - expect(result.status, output).not.toBe(0); + expect(result.status, output).toBe(status); const args = fs.readFileSync(argsFile, "utf8"); expect(args).toContain("--migrate-legacy-single-head"); expect(args).not.toContain("--reuse-existing-managed-pair"); - expect(output).toMatch(/legacy single-Station head.*refusing migration/u); + expect(output).toMatch(message); } finally { fs.rmSync(argsFile, { force: true }); fs.rmSync(home, { recursive: true, force: true }); From 66d830007a09e9d7824f887a53a862d9c59d57db Mon Sep 17 00:00:00 2001 From: Aaron Erickson Date: Wed, 23 Sep 2026 09:12:42 -0700 Subject: [PATCH 2/3] docs(install): explain legacy Station fallback revalidation --- docs/inference/set-up-vllm-on-two-dgx-stations.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/inference/set-up-vllm-on-two-dgx-stations.mdx b/docs/inference/set-up-vllm-on-two-dgx-stations.mdx index 420852dec55..8257a57ef96 100644 --- a/docs/inference/set-up-vllm-on-two-dgx-stations.mdx +++ b/docs/inference/set-up-vllm-on-two-dgx-stations.mdx @@ -42,6 +42,8 @@ After qualification, the installer prepares the peer with the same reviewed help No managed-vLLM image or model download starts before the pair qualification or single-Station fallback decision completes. If no trusted pair qualifies, Express retains the single-Station Ultra recipe. +When Express recognizes an existing legacy single-Station workload, that workload must remain unchanged during peer discovery. +If it changes, the installer stops and reports the change instead of continuing the upgrade. If the read-only preparation check finds an active vLLM workload on an automatically discovered peer, Express leaves that peer unchanged. It retains the single-Station Ultra recipe. From b9b5b775e096fd1f2c633d04494e7b9ea3179c2d Mon Sep 17 00:00:00 2001 From: Aaron Erickson Date: Wed, 23 Sep 2026 11:22:37 -0700 Subject: [PATCH 3/3] fix(install): retain single-Station fallback for unusable automatic peers --- .../set-up-vllm-on-two-dgx-stations.mdx | 4 +- scripts/install.sh | 2 +- scripts/lib/dgx-station-peer.mts | 5 +- ...install-station-controller-binding.test.ts | 16 +++++- .../install-station-pair-preparation.test.ts | 52 +++++++++++-------- 5 files changed, 50 insertions(+), 29 deletions(-) diff --git a/docs/inference/set-up-vllm-on-two-dgx-stations.mdx b/docs/inference/set-up-vllm-on-two-dgx-stations.mdx index 8257a57ef96..12394841d32 100644 --- a/docs/inference/set-up-vllm-on-two-dgx-stations.mdx +++ b/docs/inference/set-up-vllm-on-two-dgx-stations.mdx @@ -43,7 +43,9 @@ After qualification, the installer prepares the peer with the same reviewed help No managed-vLLM image or model download starts before the pair qualification or single-Station fallback decision completes. If no trusted pair qualifies, Express retains the single-Station Ultra recipe. When Express recognizes an existing legacy single-Station workload, that workload must remain unchanged during peer discovery. -If it changes, the installer stops and reports the change instead of continuing the upgrade. +If it changes, the installer stops and reports the image and ownership-contract mismatch instead of continuing the upgrade. +Inspect the `nemoclaw-vllm` container with `docker inspect nemoclaw-vllm`. +Restore the original single-Station workload before retrying, or stop the upgrade if the change was intentional. If the read-only preparation check finds an active vLLM workload on an automatically discovered peer, Express leaves that peer unchanged. It retains the single-Station Ultra recipe. diff --git a/scripts/install.sh b/scripts/install.sh index 6df2fc0f1b7..fba8ead47a4 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -7061,7 +7061,7 @@ ensure_station_express_pair() { # An implicit peer miss keeps the existing single-Station workload. # Recheck its ownership before continuing without host preparation. station_migratable_legacy_single_head_running \ - || error "The existing single-Station workload changed during peer discovery; refusing fallback." + || error "The nemoclaw-vllm container no longer matches the legacy image ($STATION_ULTRA_LEGACY_VLLM_IMAGE) and ownership contract after peer discovery. Inspect it with 'docker inspect nemoclaw-vllm'; restore the original single-Station workload before retrying, or stop this upgrade if the change was intentional." fi if [ "${_STATION_EXPRESS_MODEL_WAS_EXPLICIT:-0}" = "0" ]; then NEMOCLAW_VLLM_MODEL="$STATION_ULTRA_VLLM_MODEL" diff --git a/scripts/lib/dgx-station-peer.mts b/scripts/lib/dgx-station-peer.mts index a7dd5d7bf76..77f4abd09d2 100644 --- a/scripts/lib/dgx-station-peer.mts +++ b/scripts/lib/dgx-station-peer.mts @@ -831,10 +831,7 @@ export function prepareDualStationPair( const selected = selectPretrustedTarget(options, local, resume, deps); if ("kind" in selected) return selected; const strict = Boolean( - resume || - options.explicitPeer?.trim() || - options.reuseExistingManagedPair || - options.migrateLegacySingleStationHead, + resume || options.explicitPeer?.trim() || options.reuseExistingManagedPair, ); const { binding, automatic } = selected; diff --git a/test/installer-integration/install-station-controller-binding.test.ts b/test/installer-integration/install-station-controller-binding.test.ts index 245e5a29a96..7540d63123a 100644 --- a/test/installer-integration/install-station-controller-binding.test.ts +++ b/test/installer-integration/install-station-controller-binding.test.ts @@ -408,7 +408,8 @@ printf 'REUSE=%s MIGRATE=%s\n' "$_STATION_EXPRESS_DEFERRED_MANAGED_PAIR" "$_STAT name: "refuses fallback when the legacy single-Station head changes", headStatus: 1, status: 1, - message: /single-Station workload changed/u, + message: + /nemoclaw-vllm.*legacy image.*ownership contract.*restore the original single-Station workload/u, }, ])("$name (#12283)", ({ headStatus, status, message }) => { const argsFile = path.join(os.tmpdir(), `nemoclaw-legacy-args-${process.pid}-${Date.now()}`); @@ -417,6 +418,7 @@ printf 'REUSE=%s MIGRATE=%s\n' "$_STATION_EXPRESS_DEFERRED_MANAGED_PAIR" "$_STAT node() { if [[ "\${1:-}" == "--no-warnings" ]]; then printf '%s\\n' "$*" >"$ARGS_FILE" + : >"$HOME/after-discovery" printf '%s\\n' '{"kind":"single-station","reason":"fixture"}' return 0 fi @@ -428,7 +430,14 @@ _STATION_EXPRESS_MODEL_WAS_EXPLICIT=0 _STATION_INSTALL_MODE='express' _STATION_EXPRESS_DEFERRED_MANAGED_PAIR=0 _STATION_EXPRESS_MIGRATING_LEGACY_HEAD=1 -station_migratable_legacy_single_head_running() { return "$LEGACY_HEAD_STATUS"; } +command_exists() { return 0; } +docker() { + local image="$STATION_ULTRA_LEGACY_VLLM_IMAGE" + if [[ -f "$HOME/after-discovery" && "$LEGACY_HEAD_STATUS" == "1" ]]; then image='changed-image'; fi + printf 'inspect\\n' >>"$HOME/docker-inspections" + printf '/nemoclaw-vllm|true|%s|true|-|-|-|-|-|-|-|-\\n' "$image" +} +station_migratable_legacy_single_head_running || exit 97 NEMOCLAW_VLLM_MODEL='nemotron-3-ultra-550b-a55b' unset NEMOCLAW_DGX_STATION_PEER ensure_station_express_pair @@ -441,6 +450,9 @@ ensure_station_express_pair expect(args).toContain("--migrate-legacy-single-head"); expect(args).not.toContain("--reuse-existing-managed-pair"); expect(output).toMatch(message); + expect(fs.readFileSync(path.join(home, "docker-inspections"), "utf8")).toBe( + "inspect\ninspect\n", + ); } finally { fs.rmSync(argsFile, { force: true }); fs.rmSync(home, { recursive: true, force: true }); diff --git a/test/installer-integration/install-station-pair-preparation.test.ts b/test/installer-integration/install-station-pair-preparation.test.ts index 2841b54f645..1c7c01126e2 100644 --- a/test/installer-integration/install-station-pair-preparation.test.ts +++ b/test/installer-integration/install-station-pair-preparation.test.ts @@ -469,27 +469,37 @@ describe("deterministic dual-DGX Station peer discovery", () => { expect(harness.calls.some((call) => call.startsWith("remote:"))).toBe(false); }); - it("falls back only before mutation and fails closed for explicit connectivity failure", () => { - const automatic = new PreparationHarness(); - trustFirstRail(automatic); - automatic.localConnectivity = false; - expect(prepareDualStationPair(preparationOptions(), automatic.deps)).toMatchObject({ - kind: "single-station", - reason: expect.stringMatching(/jumbo-frame/), - }); - expect(automatic.statePhases).toEqual([]); - - const explicitTarget = "ubuntu@station-b"; - const explicit = new PreparationHarness(); - explicit.trusted.set(explicitTarget, sshBinding(explicitTarget)); - explicit.peerConnectivity = false; - expect(() => - prepareDualStationPair( - { ...preparationOptions(), explicitPeer: explicitTarget }, - explicit.deps, - ), - ).toThrow(/jumbo-frame/); - }); + it.each([false, true])( + "falls back before mutation and retains explicit-peer refusal with legacy migration=%s", + (migrateLegacySingleStationHead) => { + const automatic = new PreparationHarness(); + trustFirstRail(automatic); + automatic.localConnectivity = false; + expect( + prepareDualStationPair( + { ...preparationOptions(), migrateLegacySingleStationHead }, + automatic.deps, + ), + ).toMatchObject({ + kind: "single-station", + reason: expect.stringMatching(/jumbo-frame/), + }); + expect(automatic.statePhases).toEqual([]); + expect(automatic.calls.filter((call) => call.startsWith("remote:"))).toEqual([]); + expect(automatic.calls).not.toContain("local:--bind-controller"); + + const explicitTarget = "ubuntu@station-b"; + const explicit = new PreparationHarness(); + explicit.trusted.set(explicitTarget, sshBinding(explicitTarget)); + explicit.peerConnectivity = false; + expect(() => + prepareDualStationPair( + { ...preparationOptions(), explicitPeer: explicitTarget, migrateLegacySingleStationHead }, + explicit.deps, + ), + ).toThrow(/jumbo-frame/); + }, + ); it("leaves an automatically discovered peer with active vLLM unchanged", () => { const harness = new PreparationHarness();