Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/inference/set-up-vllm-on-two-dgx-stations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ 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 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.

Expand Down
8 changes: 6 additions & 2 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 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"
NEMOCLAW_MODEL="$STATION_ULTRA_SERVED_MODEL"
Expand Down
5 changes: 1 addition & 4 deletions scripts/lib/dgx-station-peer.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,28 @@ 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:
/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()}`);
const { home, result, output } = runInstallerBody(
`
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
Expand All @@ -415,18 +430,29 @@ _STATION_EXPRESS_MODEL_WAS_EXPLICIT=0
_STATION_INSTALL_MODE='express'
_STATION_EXPRESS_DEFERRED_MANAGED_PAIR=0
_STATION_EXPRESS_MIGRATING_LEGACY_HEAD=1
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
`,
{ 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);
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 });
Expand Down
52 changes: 31 additions & 21 deletions test/installer-integration/install-station-pair-preparation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading