Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
105 changes: 105 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,23 @@ jobs:
- name: Prepare E2E workspace
uses: NVIDIA/NemoClaw/.github/actions/prepare-e2e@50281ee84c4a6fc759da95ea28fc0b7d9c378a28

- name: Initialize runner comparison evidence
if: ${{ matrix.agent == 'hermes' || matrix.agent == 'deepagents' }}
continue-on-error: true
shell: bash
run: |
set -euo pipefail
mkdir -p "$E2E_ARTIFACT_DIR"
snapshots_file="$E2E_ARTIFACT_DIR/runner-resource-snapshots.jsonl"
summary_file="$E2E_ARTIFACT_DIR/runner-resource-summary.json"
export E2E_RESOURCE_SNAPSHOTS_FILE="$snapshots_file"
export E2E_RESOURCE_SUMMARY_FILE="$summary_file"
npx tsx tools/e2e/runner-pressure.mts initialize-measurement
{
printf 'E2E_RESOURCE_SNAPSHOTS_FILE=%s\n' "$snapshots_file"
printf 'E2E_RESOURCE_SUMMARY_FILE=%s\n' "$summary_file"
} >> "$GITHUB_ENV"

- name: Install and verify cloudflared prerequisite
# Update posture: maintainers review upstream cloudflared releases and
# update the version and reviewed SHA256 together in both explicit MCP
Expand Down Expand Up @@ -603,6 +620,16 @@ jobs:
--silent=false --reporter=default --reporter=test/e2e/risk-signal-reporter.ts
fi

- name: Summarize runner comparison evidence
if: ${{ always() && (matrix.agent == 'hermes' || matrix.agent == 'deepagents') }}
continue-on-error: true
shell: bash
run: |
set -euo pipefail
export E2E_RESOURCE_SNAPSHOTS_FILE="$E2E_ARTIFACT_DIR/runner-resource-snapshots.jsonl"
export E2E_RESOURCE_SUMMARY_FILE="$E2E_ARTIFACT_DIR/runner-resource-summary.json"
npx tsx tools/e2e/runner-pressure.mts summarize-measurement

- id: mcp_artifact_secret_scan
name: Scan MCP artifacts for fixture credentials
if: always()
Expand Down Expand Up @@ -2083,6 +2110,22 @@ jobs:
- name: Prepare E2E workspace
uses: NVIDIA/NemoClaw/.github/actions/prepare-e2e@50281ee84c4a6fc759da95ea28fc0b7d9c378a28

- name: Initialize runner comparison evidence
continue-on-error: true
shell: bash
run: |
set -euo pipefail
mkdir -p "$E2E_ARTIFACT_DIR"
snapshots_file="$E2E_ARTIFACT_DIR/runner-resource-snapshots.jsonl"
summary_file="$E2E_ARTIFACT_DIR/runner-resource-summary.json"
export E2E_RESOURCE_SNAPSHOTS_FILE="$snapshots_file"
export E2E_RESOURCE_SUMMARY_FILE="$summary_file"
npx tsx tools/e2e/runner-pressure.mts initialize-measurement
{
printf 'E2E_RESOURCE_SNAPSHOTS_FILE=%s\n' "$snapshots_file"
printf 'E2E_RESOURCE_SUMMARY_FILE=%s\n' "$summary_file"
} >> "$GITHUB_ENV"

- name: Install OpenShell
# Direct Vitest execution uses bin/nemoclaw.js instead of install.sh,
# so install OpenShell explicitly before onboard and SSH-agent probes.
Expand Down Expand Up @@ -2116,6 +2159,16 @@ jobs:
"$OPENSHELL_BIN" --version
npx tsx tools/e2e/live-vitest-invocation.mts run --test-path test/e2e/live/common-egress-agent.test.ts

- name: Summarize runner comparison evidence
if: always()
continue-on-error: true
shell: bash
run: |
set -euo pipefail
export E2E_RESOURCE_SNAPSHOTS_FILE="$E2E_ARTIFACT_DIR/runner-resource-snapshots.jsonl"
export E2E_RESOURCE_SUMMARY_FILE="$E2E_ARTIFACT_DIR/runner-resource-summary.json"
npx tsx tools/e2e/runner-pressure.mts summarize-measurement

- name: Upload common-egress agent artifacts
if: always()
uses: NVIDIA/NemoClaw/.github/actions/upload-e2e-artifacts@7768e15eb90d3ee2d33432f481dfe8747e4f6d57
Expand Down Expand Up @@ -2310,6 +2363,22 @@ jobs:
- name: Prepare E2E workspace
uses: NVIDIA/NemoClaw/.github/actions/prepare-e2e@50281ee84c4a6fc759da95ea28fc0b7d9c378a28

- name: Initialize runner comparison evidence
continue-on-error: true
shell: bash
run: |
set -euo pipefail
mkdir -p "$E2E_ARTIFACT_DIR"
snapshots_file="$E2E_ARTIFACT_DIR/runner-resource-snapshots.jsonl"
summary_file="$E2E_ARTIFACT_DIR/runner-resource-summary.json"
export E2E_RESOURCE_SNAPSHOTS_FILE="$snapshots_file"
export E2E_RESOURCE_SUMMARY_FILE="$summary_file"
npx tsx tools/e2e/runner-pressure.mts initialize-measurement
{
printf 'E2E_RESOURCE_SNAPSHOTS_FILE=%s\n' "$snapshots_file"
printf 'E2E_RESOURCE_SUMMARY_FILE=%s\n' "$summary_file"
} >> "$GITHUB_ENV"

- name: Install OpenShell CLI
run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh

Expand Down Expand Up @@ -2344,6 +2413,16 @@ jobs:
fi
exit "$test_status"

- name: Summarize runner comparison evidence
if: always()
continue-on-error: true
shell: bash
run: |
set -euo pipefail
export E2E_RESOURCE_SNAPSHOTS_FILE="$E2E_ARTIFACT_DIR/runner-resource-snapshots.jsonl"
export E2E_RESOURCE_SUMMARY_FILE="$E2E_ARTIFACT_DIR/runner-resource-summary.json"
npx tsx tools/e2e/runner-pressure.mts summarize-measurement

- name: Upload Hermes rebuild artifacts
if: always()
uses: NVIDIA/NemoClaw/.github/actions/upload-e2e-artifacts@7768e15eb90d3ee2d33432f481dfe8747e4f6d57
Expand Down Expand Up @@ -2386,6 +2465,22 @@ jobs:
- name: Prepare E2E workspace
uses: NVIDIA/NemoClaw/.github/actions/prepare-e2e@50281ee84c4a6fc759da95ea28fc0b7d9c378a28

- name: Initialize runner comparison evidence
continue-on-error: true
shell: bash
run: |
set -euo pipefail
mkdir -p "$E2E_ARTIFACT_DIR"
snapshots_file="$E2E_ARTIFACT_DIR/runner-resource-snapshots.jsonl"
summary_file="$E2E_ARTIFACT_DIR/runner-resource-summary.json"
export E2E_RESOURCE_SNAPSHOTS_FILE="$snapshots_file"
export E2E_RESOURCE_SUMMARY_FILE="$summary_file"
npx tsx tools/e2e/runner-pressure.mts initialize-measurement
{
printf 'E2E_RESOURCE_SNAPSHOTS_FILE=%s\n' "$snapshots_file"
printf 'E2E_RESOURCE_SUMMARY_FILE=%s\n' "$summary_file"
} >> "$GITHUB_ENV"

- name: Install OpenShell CLI
run: env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u NVIDIA_INFERENCE_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh

Expand Down Expand Up @@ -2419,6 +2514,16 @@ jobs:
fi
exit "$test_status"

- name: Summarize runner comparison evidence
if: always()
continue-on-error: true
shell: bash
run: |
set -euo pipefail
export E2E_RESOURCE_SNAPSHOTS_FILE="$E2E_ARTIFACT_DIR/runner-resource-snapshots.jsonl"
export E2E_RESOURCE_SUMMARY_FILE="$E2E_ARTIFACT_DIR/runner-resource-summary.json"
npx tsx tools/e2e/runner-pressure.mts summarize-measurement

- name: Upload Hermes stale-base rebuild artifacts
if: always()
uses: NVIDIA/NemoClaw/.github/actions/upload-e2e-artifacts@7768e15eb90d3ee2d33432f481dfe8747e4f6d57
Expand Down
30 changes: 28 additions & 2 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,38 @@ variable, an organization owner must:
`NVIDIA/NemoClaw` and workflow access to
`NVIDIA/NemoClaw/.github/workflows/e2e.yaml@refs/heads/main`.
3. Record at least five standard-runner samples for each eligible lane,
including queue time, execution time, peak CPU, memory and disk use,
infrastructure failures, and estimated cost.
retaining each lane's `runner-resource-summary.json` artifact together with
its Actions queue time, full job duration, infrastructure result, and
estimated cost.
4. Copy the larger runner's workflow label into the repository variable, then
repeat the same measurements for at least five representative executions
per migrated lane.

Each eligible job has a best-effort initialization step for
`runner-resource-snapshots.jsonl` immediately after the shared workspace
preparation step. When initialization succeeds, the initial sample, automatic
live-test heartbeats and phase changes, and an `always()`-conditioned
best-effort final sample share that one private ledger. This keeps both
serialized Deep Agents Vitest invocations in one job-level measurement. A
best-effort finalizer writes `runner-resource-summary.json` before artifact
scanning and upload. The summary
contains the measured window, sample and valid CPU-interval counts, logical CPU
capacity, peak sampled host CPU percentage, the highest sampled cgroup
`memory.peak` counter (or a sampled `MemAvailable` fallback), memory capacity,
peak workspace growth, minimum free workspace bytes, and workspace capacity.
The cgroup peak can include activity before the ledger starts because the
kernel counter is cumulative for that cgroup. Resource fields are numeric; the
remaining strings are canonical timestamps and fixed lane or source labels.

A comparison needs at least two snapshots to form a measured window, and CPU
requires adjacent samples at least one second apart. Treat these values as
sampled evidence rather than exact instantaneous peaks; the heartbeat interval
is one minute. Queue time, full job duration, and the infrastructure result
remain Actions metadata because they sit outside the measured job window;
estimate cost from those records and the configured runner rate. Compare at
least five standard and five larger-runner summaries per eligible lane, and
retain the matching Actions run links with the decision record.

Clearing `E2E_LARGER_RUNNER_LABEL` is the rollback. It sends the eligible lanes
back to `ubuntu-latest` without changing selectors, test setup, or test
semantics. Do not replace this experiment with a persistent self-hosted runner;
Expand Down
37 changes: 31 additions & 6 deletions test/e2e/fixtures/e2e-test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { createHash } from "node:crypto";

import { test as base, expect } from "vitest";

import {
appendResourcePhaseBaseline,
appendResourceSnapshot,
collectResourceSnapshot,
} from "../../../tools/e2e/runner-pressure.mts";
import { renderSnapshotLine } from "../../../tools/e2e/runner-pressure-core.mts";
Expand Down Expand Up @@ -56,7 +59,10 @@ function resourcePhaseLabel(targetId: string, phase: string): string {
.toLowerCase()
.replace(/[^a-z0-9]+/gu, "-")
.replace(/^-|-$/gu, "");
return `${targetId}.${suffix}`;
const label = `${targetId}.${suffix}`;
if (label.length <= 64) return label;
const digest = createHash("sha256").update(label).digest("hex").slice(0, 8);
return `${label.slice(0, 55)}-${digest}`;
}

export const test = base.extend<E2ETargetFixtures>({
Expand All @@ -79,19 +85,38 @@ export const test = base.extend<E2ETargetFixtures>({
async ({ artifacts, secrets, task }, use) => {
const targetId = process.env.E2E_TARGET_ID;
const baselinePath = process.env.E2E_RESOURCE_PHASE_BASELINES_FILE;
const snapshotsPath = process.env.E2E_RESOURCE_SNAPSHOTS_FILE;
const progress = startTestProgress(task.name, "test body", {
logLine:
process.env.NEMOCLAW_RUN_LIVE_E2E === "1"
? (line) => process.stdout.write(`${secrets.redact(line)}\n`)
: () => {
// Keep fixture and support tests quiet; live runs need the heartbeat.
},
...(targetId && baselinePath
...(targetId && (baselinePath || snapshotsPath)
? {
sampleResourceEvidence: (phase: string) =>
renderSnapshotLine(collectResourceSnapshot(resourcePhaseLabel(targetId, phase))),
recordResourceBaseline: (phase: string) =>
appendResourcePhaseBaseline(baselinePath, resourcePhaseLabel(targetId, phase)),
sampleResourceEvidence: (phase: string) => {
const snapshot = collectResourceSnapshot(resourcePhaseLabel(targetId, phase), {
includeDiagnostics: Boolean(baselinePath),
});
if (snapshotsPath) {
try {
appendResourceSnapshot(snapshotsPath, snapshot);
} catch {
// Comparison telemetry must not change the live test result.
}
}
return renderSnapshotLine(snapshot);
},
...(baselinePath
? {
recordResourceBaseline: (phase: string) =>
appendResourcePhaseBaseline(
baselinePath,
resourcePhaseLabel(targetId, phase),
),
}
: {}),
}
: {}),
});
Expand Down
45 changes: 37 additions & 8 deletions test/e2e/support/e2e-progress-fixture.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";

import { afterAll, expect, vi } from "vitest";

import { afterAll, expect } from "vitest";
import { parseSnapshotLine } from "../../../tools/e2e/runner-pressure-core.mts";
import { test } from "../fixtures/e2e-test.ts";
import type { ProgressSummary } from "../fixtures/progress.ts";

const artifactRoot = fs.mkdtempSync(path.join(os.tmpdir(), "nemoclaw-progress-fixture-"));
const resourceSnapshots = path.join(artifactRoot, "runner-resource-snapshots.jsonl");
let progressArtifact = "";

vi.stubEnv("E2E_ARTIFACT_DIR", artifactRoot);
const fixtureEnvironment = {
E2E_ARTIFACT_DIR: artifactRoot,
E2E_TARGET_ID: "fixture-progress-target",
NEMOCLAW_E2E_SHARD: "fixture-progress-shard",
E2E_RESOURCE_SNAPSHOTS_FILE: resourceSnapshots,
} as const;
const previousEnvironment = Object.fromEntries(
Object.keys(fixtureEnvironment).map((key) => [key, process.env[key]]),
) as Record<keyof typeof fixtureEnvironment, string | undefined>;
Object.assign(process.env, fixtureEnvironment);
fs.writeFileSync(resourceSnapshots, "", { mode: 0o600 });

afterAll(() => {
try {
Expand All @@ -26,9 +37,29 @@ afterAll(() => {
});
expect(summary.finishedAtMs).not.toBeNull();
expect(summary.durationMs).not.toBeNull();
expect(summary.phases.at(-1)?.label).toBe("final fixture phase");
expect(summary.phases.at(-1)?.label).toBe(
"phase 5 current base built by authoritative rebuild",
);
const snapshots = fs
.readFileSync(resourceSnapshots, "utf8")
.trim()
.split("\n")
.map(parseSnapshotLine);
expect(snapshots).toHaveLength(4);
expect(snapshots.slice(0, 2).map((snapshot) => snapshot.phase)).toEqual([
"fixture-progress-target.test-body",
"fixture-progress-target.test-body",
]);
const longPhaseLabels = snapshots.slice(2).map((snapshot) => snapshot.phase);
expect(longPhaseLabels[0]).toHaveLength(64);
expect(longPhaseLabels[0]).toMatch(/^fixture-progress-target\.[a-z0-9-]+-[0-9a-f]{8}$/u);
expect(longPhaseLabels[1]).toBe(longPhaseLabels[0]);
} finally {
vi.unstubAllEnvs();
for (const [key, value] of Object.entries(previousEnvironment)) {
value === undefined
? Reflect.deleteProperty(process.env, key)
: Reflect.set(process.env, key, value);
}
fs.rmSync(artifactRoot, { force: true, recursive: true });
}
});
Expand All @@ -38,7 +69,5 @@ test("automatic progress fixture writes completed target and shard evidence", as
progress,
}) => {
progressArtifact = artifacts.pathFor("test-progress.json");
vi.stubEnv("E2E_TARGET_ID", "fixture-progress-target");
vi.stubEnv("NEMOCLAW_E2E_SHARD", "fixture-progress-shard");
progress.phase("final fixture phase");
progress.phase("phase 5 current base built by authoritative rebuild");
});
14 changes: 14 additions & 0 deletions test/e2e/support/rebuild-hermes-progress.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,18 @@ describe("Hermes rebuild live progress", () => {
}).not.toThrow();
expect(state.clearCalls).toBe(1);
});

it("keeps the live result independent from a failed measurement append", () => {
const { options, state } = progressHarness();
options.sampleResourceEvidence = () => {
throw new Error("measurement ledger unavailable");
};

expect(() => {
const progress = startTestProgress("rebuild-hermes", "phase 2 old base build", options);
state.timerCallback?.();
progress.stop();
}).not.toThrow();
expect(state.clearCalls).toBe(1);
});
});
Loading
Loading