diff --git a/.github/workflows/e2e-vitest-scenarios.yaml b/.github/workflows/e2e-vitest-scenarios.yaml index 5cc5eb06d1c..514486c1737 100644 --- a/.github/workflows/e2e-vitest-scenarios.yaml +++ b/.github/workflows/e2e-vitest-scenarios.yaml @@ -794,6 +794,8 @@ jobs: needs: generate-matrix if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',gpu-e2e-vitest,') || contains(format(',{0},', inputs.scenarios), ',gpu-e2e,') }} runs-on: linux-amd64-gpu-rtxpro6000-latest-1 + # The 55 minute install command includes a cold 40 minute model pull; + # 35 minutes remain for runner setup, assertions, artifacts, and cleanup. timeout-minutes: 90 env: FREE_STANDING_VITEST_JOB: "1" @@ -804,6 +806,7 @@ jobs: NEMOCLAW_NON_INTERACTIVE: "1" NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE: "1" NEMOCLAW_PROVIDER: "ollama" + NEMOCLAW_OLLAMA_PULL_TIMEOUT: "2400" NEMOCLAW_SANDBOX_NAME: "e2e-gpu-ollama" OPENSHELL_GATEWAY: "nemoclaw" steps: @@ -5664,6 +5667,19 @@ jobs: with: persist-credentials: false + - name: Configure isolated Docker auth directory + run: echo "DOCKER_CONFIG=${RUNNER_TEMP}/docker-config-spark-install" >> "$GITHUB_ENV" + + - name: Authenticate to Docker Hub + if: github.ref == 'refs/heads/main' + # Authentication only accelerates pulls; anonymous pulls remain valid. + continue-on-error: true + uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0 + with: + registry: docker.io + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up Node uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.0.0 with: @@ -5696,6 +5712,15 @@ jobs: if-no-files-found: ignore retention-days: 14 + - name: Clean up Docker auth + if: always() + run: | + set -euo pipefail + if [[ -n "${DOCKER_CONFIG:-}" && "${DOCKER_CONFIG}" == "${RUNNER_TEMP}/docker-config-spark-install" ]]; then + docker logout docker.io || true + rm -rf -- "${DOCKER_CONFIG}" + fi + # ── PR result comment (mirrors nightly-e2e.yaml's report-to-pr) ─────────── # Posts a results table on the open PR for the dispatching branch (or the # PR identified by `inputs.pr_number`). `if: always()` so the comment lands diff --git a/.github/workflows/nightly-e2e.yaml b/.github/workflows/nightly-e2e.yaml index 8206b39faae..81290c191cc 100644 --- a/.github/workflows/nightly-e2e.yaml +++ b/.github/workflows/nightly-e2e.yaml @@ -407,7 +407,15 @@ jobs: github_token: true secrets: *nightly-e2e-default-secrets openclaw-tui-chat-correlation-e2e: + # Keep this strict hosted-correlation probe out of the peak inference burst. + # Selective dispatches skip unselected dependencies, so always() preserves + # targeted execution while the full gate waits for the peak hosted jobs. + needs: + - token-rotation-e2e + - channels-stop-start-openclaw-e2e + - channels-stop-start-hermes-e2e if: >- + always() && github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' || inputs.jobs == '' || @@ -2242,13 +2250,16 @@ jobs: inputs.jobs == '' || contains(format(',{0},', inputs.jobs), ',gpu-e2e,')) runs-on: linux-amd64-gpu-rtxpro6000-latest-1 - timeout-minutes: 30 + # A cold runner may spend up to 40 minutes pulling the 35B model; + # 15 minutes remain for install/assertions and 5 minutes for cleanup. + timeout-minutes: 60 env: NEMOCLAW_NON_INTERACTIVE: "1" NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE: "1" NEMOCLAW_SANDBOX_NAME: "e2e-gpu-ollama" NEMOCLAW_RECREATE_SANDBOX: "1" NEMOCLAW_PROVIDER: "ollama" + NEMOCLAW_OLLAMA_PULL_TIMEOUT: "2400" steps: - *target-ref-checkout diff --git a/test/e2e-release-gate-workflow.test.ts b/test/e2e-release-gate-workflow.test.ts new file mode 100644 index 00000000000..16479442875 --- /dev/null +++ b/test/e2e-release-gate-workflow.test.ts @@ -0,0 +1,84 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { readFileSync } from "node:fs"; + +import { describe, expect, it } from "vitest"; + +import { + loadE2eWorkflowContract, + readYaml, + type WorkflowJob, +} from "./helpers/e2e-workflow-contract"; + +const { nightlyWorkflow } = loadE2eWorkflowContract(); +const vitestWorkflow = readYaml<{ jobs: Record }>( + ".github/workflows/e2e-vitest-scenarios.yaml", +); + +describe("release gate workflow resource contracts", () => { + it("runs the strict hosted TUI correlation probe after peak hosted lifecycle jobs", () => { + const job = nightlyWorkflow.jobs["openclaw-tui-chat-correlation-e2e"]; + const dependencies = [ + "token-rotation-e2e", + "channels-stop-start-openclaw-e2e", + "channels-stop-start-hermes-e2e", + ]; + + expect(job.needs).toEqual(dependencies); + for (const dependency of dependencies) expect(nightlyWorkflow.jobs).toHaveProperty(dependency); + expect(job.if).toContain("always()"); + expect(job.if).toContain(",openclaw-tui-chat-correlation-e2e,"); + }); + + it("budgets cold Ollama pulls in both retained and Vitest GPU lanes", () => { + const nightlyJob = nightlyWorkflow.jobs["gpu-e2e"]; + const vitestJob = vitestWorkflow.jobs["gpu-e2e-vitest"]; + const liveTest = readFileSync( + new URL("./e2e-scenario/live/gpu-e2e.test.ts", import.meta.url), + "utf8", + ); + + expect(nightlyJob["timeout-minutes"]).toBe(60); + expect(nightlyJob.env?.NEMOCLAW_OLLAMA_PULL_TIMEOUT).toBe("2400"); + expect(vitestJob["timeout-minutes"]).toBe(90); + expect(vitestJob.env?.NEMOCLAW_OLLAMA_PULL_TIMEOUT).toBe("2400"); + expect(liveTest).toContain("timeoutMs: 55 * 60_000"); + }); + + it("authenticates Spark image pulls with an isolated Docker config", () => { + const steps = vitestWorkflow.jobs["spark-install-vitest"].steps ?? []; + const stepIndex = (name: string) => steps.findIndex((step) => step.name === name); + const configure = steps.find( + (step) => step.name === "Configure isolated Docker auth directory", + ); + const auth = steps.find((step) => step.name === "Authenticate to Docker Hub"); + const cleanup = steps.find((step) => step.name === "Clean up Docker auth"); + + expect(configure?.run).toBe( + 'echo "DOCKER_CONFIG=${RUNNER_TEMP}/docker-config-spark-install" >> "$GITHUB_ENV"', + ); + expect(auth?.uses).toBe("docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee"); + expect(auth?.if).toBe("github.ref == 'refs/heads/main'"); + expect(auth?.["continue-on-error"]).toBe(true); + expect(auth?.with).toMatchObject({ + registry: "docker.io", + username: "${{ secrets.DOCKERHUB_USERNAME }}", + password: "${{ secrets.DOCKERHUB_TOKEN }}", + }); + expect(auth?.env).toBeUndefined(); + expect(auth?.run).toBeUndefined(); + expect(stepIndex("Configure isolated Docker auth directory")).toBeLessThan( + stepIndex("Authenticate to Docker Hub"), + ); + expect(stepIndex("Authenticate to Docker Hub")).toBeLessThan( + stepIndex("Run Spark install live test"), + ); + expect(cleanup?.if).toBe("always()"); + expect(cleanup?.run).toContain( + '"${DOCKER_CONFIG}" == "${RUNNER_TEMP}/docker-config-spark-install"', + ); + expect(cleanup?.run).toContain("docker logout docker.io || true"); + expect(cleanup?.run).toContain('rm -rf -- "${DOCKER_CONFIG}"'); + }); +}); diff --git a/test/e2e-scenario/fixtures/availability-env.ts b/test/e2e-scenario/fixtures/availability-env.ts index b05dfa29866..4cdbba83722 100644 --- a/test/e2e-scenario/fixtures/availability-env.ts +++ b/test/e2e-scenario/fixtures/availability-env.ts @@ -11,14 +11,15 @@ const AVAILABILITY_PROBE_EXTRA_ENV_KEYS = [ "DOCKER_CERT_PATH", "DOCKER_API_VERSION", "XDG_RUNTIME_DIR", + "NEMOCLAW_OLLAMA_PULL_TIMEOUT", ]; export function buildAvailabilityProbeEnv( base: NodeJS.ProcessEnv = process.env, ): NodeJS.ProcessEnv { // Availability probes run outside live scenario phases, but they need - // the same child-env and PATH policy. Add only Docker - // discovery knobs on top of the shared fixture boundary. + // the same child-env and PATH policy. Add Docker discovery knobs and the + // workflow-owned local-model pull budget on top of the shared boundary. return buildChildEnv(base, { additionalAllowedEnv: AVAILABILITY_PROBE_EXTRA_ENV_KEYS, fixtureOverlay: {}, diff --git a/test/e2e-scenario/live/gpu-e2e-helpers.ts b/test/e2e-scenario/live/gpu-e2e-helpers.ts index 3661ef1aa18..0d08745af85 100644 --- a/test/e2e-scenario/live/gpu-e2e-helpers.ts +++ b/test/e2e-scenario/live/gpu-e2e-helpers.ts @@ -25,9 +25,12 @@ function tcpPort(value: string | undefined, fallback: string): string { return raw; } -export function env(extra: NodeJS.ProcessEnv = {}): NodeJS.ProcessEnv { +export function env( + extra: NodeJS.ProcessEnv = {}, + base: NodeJS.ProcessEnv = process.env, +): NodeJS.ProcessEnv { return { - ...buildAvailabilityProbeEnv(), + ...buildAvailabilityProbeEnv(base), NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE: "1", NEMOCLAW_NON_INTERACTIVE: "1", NEMOCLAW_PROVIDER: "ollama", diff --git a/test/e2e-scenario/live/gpu-e2e.test.ts b/test/e2e-scenario/live/gpu-e2e.test.ts index b479cc9cc87..04fe8feae94 100644 --- a/test/e2e-scenario/live/gpu-e2e.test.ts +++ b/test/e2e-scenario/live/gpu-e2e.test.ts @@ -132,7 +132,7 @@ test.skipIf(!shouldRunLiveE2EScenarios())( artifactName: "install-gpu-ollama", cwd: REPO_ROOT, env: env(), - timeoutMs: 45 * 60_000, + timeoutMs: 55 * 60_000, }); expect(install.exitCode, resultText(install)).toBe(0); await artifacts.writeText("install-gpu-ollama.log", resultText(install)); diff --git a/test/e2e-scenario/support-tests/gpu-e2e-helpers.test.ts b/test/e2e-scenario/support-tests/gpu-e2e-helpers.test.ts new file mode 100644 index 00000000000..1ba0b9eb166 --- /dev/null +++ b/test/e2e-scenario/support-tests/gpu-e2e-helpers.test.ts @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +import { describe, expect, it } from "vitest"; + +import { env } from "../live/gpu-e2e-helpers.ts"; + +describe("GPU E2E helpers", () => { + it("forwards the workflow-owned Ollama model pull timeout", () => { + expect(env({}, { NEMOCLAW_OLLAMA_PULL_TIMEOUT: "2400" }).NEMOCLAW_OLLAMA_PULL_TIMEOUT).toBe( + "2400", + ); + }); + + it("does not synthesize an Ollama model pull timeout outside workflow configuration", () => { + expect(env({}, {}).NEMOCLAW_OLLAMA_PULL_TIMEOUT).toBeUndefined(); + }); +}); diff --git a/test/helpers/e2e-workflow-contract.ts b/test/helpers/e2e-workflow-contract.ts index be32fff8765..fa605ee7b13 100644 --- a/test/helpers/e2e-workflow-contract.ts +++ b/test/helpers/e2e-workflow-contract.ts @@ -9,6 +9,8 @@ import YAML from "yaml"; const REPO_ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", ".."); export type WorkflowJob = { + if?: string; + needs?: string | string[]; "runs-on"?: string; "timeout-minutes"?: number; uses?: string; @@ -23,6 +25,7 @@ export type WorkflowJob = { }; export type WorkflowStep = { + "continue-on-error"?: boolean; id?: string; name?: string; if?: string; diff --git a/src/lib/onboard/inference-selection-validation.test.ts b/test/package-contract/inference-selection-validation.test.ts similarity index 98% rename from src/lib/onboard/inference-selection-validation.test.ts rename to test/package-contract/inference-selection-validation.test.ts index 9f367fcdc01..9c1d40b5c1a 100644 --- a/src/lib/onboard/inference-selection-validation.test.ts +++ b/test/package-contract/inference-selection-validation.test.ts @@ -8,7 +8,7 @@ import os from "node:os"; import path from "node:path"; import { describe, it } from "vitest"; -const REPO_ROOT = path.join(import.meta.dirname, "../../.."); +const REPO_ROOT = path.join(import.meta.dirname, "../.."); describe("inference selection validation", () => { it("preserves non-zero exit signaling when non-interactive endpoint validation fails (#5721)", () => {