Skip to content

fix(ci): enable NVIDIA self-hosted runners for PR E2E tests - #2374

Merged
brandonpelfrey merged 9 commits into
NVIDIA:mainfrom
jyaunches:ci/test-self-hosted-runners
Apr 24, 2026
Merged

brandonpelfrey merged 9 commits into
NVIDIA:mainfrom
jyaunches:ci/test-self-hosted-runners

Conversation

@jyaunches

@jyaunches jyaunches commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix snapshot rollback failure on NVIDIA self-hosted runners and move all E2E jobs back to self-hosted.

Root Cause

NVIDIA self-hosted runners use Docker with the containerd overlayfs snapshotter (io.containerd.snapshotter.v1), while GitHub-hosted runners use the legacy overlay2 driver. On the containerd snapshotter, directories can span different overlay layers, causing rename(2) to return EXDEV (cross-device link not permitted).

rollbackFromSnapshot() and cutoverHost() in snapshot.ts both used bare renameSync() which fails with EXDEV on these runners. The bare catch {} swallowed the error and returned false, producing the "Rollback returned false" failure with no diagnostic output.

This also caused a secondary ERR_FS_CP_EINVAL — since the rename failed, .openclaw still existed when cpSync ran, and it detected it would be copying symlink targets into themselves.

Diagnostic Evidence

Confirmed via a matrix job across 4 runners:

Runner Storage Driver renameSync cpSync
linux-amd64-cpu4 overlayfs (containerd) ❌ EXDEV ❌ ERR_FS_CP_EINVAL
linux-amd64-cpu8 overlayfs (containerd) ❌ EXDEV ❌ ERR_FS_CP_EINVAL
linux-amd64-cpu16 overlayfs (containerd) ❌ EXDEV ❌ ERR_FS_CP_EINVAL
ubuntu-latest overlay2 (legacy) ✅ ✅

Fix

Add moveSync() helper that tries renameSync first (fast same-device path), then falls back to cpSync + rmSync on EXDEV. Both cutoverHost() and rollbackFromSnapshot() now use moveSync() instead of bare renameSync().

After the fix, all runners pass:

Runner Before After
linux-amd64-cpu4 ❌ Rollback returned false ✅ PASS
linux-amd64-cpu8 ❌ Rollback returned false ✅ PASS
linux-amd64-cpu16 ❌ Rollback returned false ✅ PASS
ubuntu-latest ✅ PASS ✅ PASS

Changes

nemoclaw/src/blueprint/snapshot.ts

  • Add moveSync() — cross-device-safe move with EXDEV fallback
  • cutoverHost() — use moveSync instead of renameSync
  • rollbackFromSnapshot() — use moveSync instead of renameSync (both the archive step and the recovery path)

nemoclaw/src/blueprint/snapshot.test.ts

  • Add moveSync unit tests: same-device rename, EXDEV fallback (cpSync + rmSync), non-EXDEV re-throw
  • Add rmSync to the in-memory fs mock

.github/workflows/pr-self-hosted.yaml

Follow-up

  • Phase 4: Remove duplicate sandbox-images-and-e2e from pr.yaml (separate PR)

Type of Change

  • Code change (feature, bug fix, or refactor)

Verification

  • moveSync unit tests pass (22/22 snapshot tests green)
  • test-e2e-sandbox passes on linux-amd64-cpu4 (NVIDIA self-hosted)
  • test-e2e-gateway-isolation passes on linux-amd64-cpu4
  • All jobs pass on ubuntu-latest (no regression)
  • No secrets, API keys, or credentials committed

AI Disclosure

  • AI-assisted — tool: Claude Code (pi agent)

Signed-off-by: Julie Yaunches [email protected]

@copy-pr-bot

copy-pr-bot Bot commented Apr 23, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a GitHub Actions job that downloads and loads a sandbox image, runs host- and container-level filesystem diagnostics (including symlink/rename/copy experiments via a new shell+Node script), and executes the E2E suite inside the container while preserving diagnostic output on failure.

Changes

Cohort / File(s) Summary
Workflow: snapshot rollback diagnostics
.github/workflows/pr-self-hosted.yaml
New diagnose-snapshot-rollback job (matrix across runner types) that downloads the sandbox-test-image artifact, runs docker load, emits host/Docker/mount diagnostics, starts a container mounting the workspace, and runs the E2E suite with diagnostics preserved (continue-on-error).
Container filesystem diagnostic script
test/diag-container-fs.sh
Adds an executable Bash diagnostic script that prints OS/mount/fs info, performs controlled symlink directory experiments under /tmp using mv/cp -a, and runs an embedded Node.js snippet exercising fs.renameSync and fs.cpSync with structured error output for snapshot-rollback diagnosis.

Sequence Diagram(s)

sequenceDiagram
    participant Runner as Runner (self-hosted / github-hosted)
    participant Artifact as GitHub Artifact
    participant Host as Host Shell
    participant Container as Container Runtime
    participant Node as Node.js (in-container)

    Runner->>Artifact: download `sandbox-test-image`
    Runner->>Host: emit host & Docker diagnostics
    Runner->>Host: `docker load` image
    Host->>Container: start container (mount workspace & script)
    Runner->>Container: run shell diagnostics (`diag-container-fs.sh`)
    Container->>Node: execute embedded Node.js fs tests
    Node-->>Container: return structured success/error
    Runner->>Container: run E2E suite (continue-on-error)
    Container-->>Runner: logs and diagnostic output
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I hopped in with an image and a map,
I probed mounts, and took a nap,
I nudged symlinks, renamed with glee,
Then asked Node to cry the truth to me.
Logs saved, I munched a carrot—diagnostics free.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title states 'enable NVIDIA self-hosted runners' but the changes add a diagnostic job to investigate failures on these runners, not enable them for regular use. Update the title to reflect the actual purpose: something like 'ci: add diagnostic job for snapshot rollback on self-hosted runners' would be more accurate.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@jyaunches
jyaunches force-pushed the ci/test-self-hosted-runners branch from 7e58a6f to 239a30c Compare April 23, 2026 18:55

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pr-self-hosted.yaml:
- Around line 173-208: The repro script is copying the wrong source tree
(openclaw-data) whereas rollbackFromSnapshot() copies snapshotDir/openclaw;
update the test to copy the exact same path rollbackFromSnapshot uses—e.g., set
snapshot = base + "/openclaw-data/openclaw" (or call fs.cpSync(snapshot +
"/openclaw", ...)) so fs.cpSync copies the symlinked openclaw tree rather than
the raw openclaw-data directory; adjust the subsequent reads
(fs.readdirSync(base + "/openclaw")) expectations accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ae9c15dc-2da7-447e-ba9f-b8f487480357

📥 Commits

Reviewing files that changed from the base of the PR and between 11d6ca9 and 7e58a6f.

📒 Files selected for processing (1)
  • .github/workflows/pr-self-hosted.yaml

Comment thread .github/workflows/pr-self-hosted.yaml Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
.github/workflows/pr-self-hosted.yaml (1)

173-208: ⚠️ Potential issue | 🟠 Major

Node repro is still copying the wrong source tree for rollback simulation.

Line 200 sets snapshot to .../openclaw-data, but the rollback path being diagnosed restores from a snapshot openclaw tree. This can mask symlink-specific failures and produce false negatives in the diagnostic signal.

Align repro with real rollback path
-              const base = "/tmp/diag-node";
-              fs.mkdirSync(base + "/openclaw-data/workspace", { recursive: true });
-              fs.writeFileSync(base + "/openclaw-data/openclaw.json", JSON.stringify({ test: true }));
-              fs.writeFileSync(base + "/openclaw-data/workspace/notes.md", "hello");
-              fs.mkdirSync(base + "/openclaw", { recursive: true });
-              fs.symlinkSync(base + "/openclaw-data/openclaw.json", base + "/openclaw/openclaw.json");
-              fs.symlinkSync(base + "/openclaw-data/workspace", base + "/openclaw/workspace");
+              const base = "/tmp/diag-node";
+              const liveDir = base + "/home/.openclaw";
+              const archiveDir = base + "/home/.openclaw.archived";
+              const realData = base + "/real-data";
+              const snapshot = base + "/snapshot/openclaw";
+
+              fs.mkdirSync(realData + "/workspace", { recursive: true });
+              fs.writeFileSync(realData + "/openclaw.json", JSON.stringify({ test: true }));
+              fs.writeFileSync(realData + "/workspace/notes.md", "hello");
+
+              fs.mkdirSync(snapshot, { recursive: true });
+              fs.symlinkSync(realData + "/openclaw.json", snapshot + "/openclaw.json");
+              fs.symlinkSync(realData + "/workspace", snapshot + "/workspace");
+
+              fs.mkdirSync(liveDir, { recursive: true });
+              fs.writeFileSync(liveDir + "/stale.txt", "old");
@@
-                fs.renameSync(base + "/openclaw", base + "/openclaw.archived");
+                fs.renameSync(liveDir, archiveDir);
@@
-              const snapshot = base + "/openclaw-data";
               try {
-                fs.cpSync(snapshot, base + "/openclaw", { recursive: true });
+                fs.cpSync(snapshot, liveDir, { recursive: true });
                 console.log("PASS: cpSync succeeded");
-                const files = fs.readdirSync(base + "/openclaw");
+                const files = fs.readdirSync(liveDir);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-self-hosted.yaml around lines 173 - 208, The repro sets
snapshot to base + "/openclaw-data" but the real rollback restores from the
snapshot tree at base + "/openclaw"; update the snapshot variable (and the
subsequent fs.cpSync call that uses it) to point to base + "/openclaw" so the
cpSync in the Node script copies the same snapshot tree the real rollback uses
(preserving symlink-related behavior and avoiding false negatives).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pr-self-hosted.yaml:
- Around line 121-123: The docker info filtering command can cause the job to
fail when grep finds no matches; update the pipeline so the grep non-match is
non-fatal by appending a fallback (e.g., make the command 'docker info 2>&1 |
grep -E "Storage Driver|Server Version|Operating System|Kernel
Version|Cgroup|Runtime" || true') or temporarily disable errexit around that
command, ensuring subsequent diagnostics and E2E comparison still run; modify
the invocation of 'docker info ... | grep -E ...' accordingly.

---

Duplicate comments:
In @.github/workflows/pr-self-hosted.yaml:
- Around line 173-208: The repro sets snapshot to base + "/openclaw-data" but
the real rollback restores from the snapshot tree at base + "/openclaw"; update
the snapshot variable (and the subsequent fs.cpSync call that uses it) to point
to base + "/openclaw" so the cpSync in the Node script copies the same snapshot
tree the real rollback uses (preserving symlink-related behavior and avoiding
false negatives).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e7576003-a988-4433-ab16-d004fbcfca8f

📥 Commits

Reviewing files that changed from the base of the PR and between 7e58a6f and 239a30c.

📒 Files selected for processing (1)
  • .github/workflows/pr-self-hosted.yaml

Comment thread .github/workflows/pr-self-hosted.yaml Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
.github/workflows/pr-self-hosted.yaml (2)

199-208: ⚠️ Potential issue | 🟠 Major

The Node.js repro copies the wrong source tree.

The diagnostic copies from openclaw-data (containing regular files), but rollbackFromSnapshot() in snapshot.ts copies from snapshotDir/openclaw which preserves symlinks. If the failure is triggered specifically when copying symlink entries, this test may produce a false negative.

To match the actual rollback code path, copy the symlinked tree:

Suggested adjustment
-            const snapshot = base + "/openclaw-data";
+            const snapshot = base + "/openclaw.archived";
             try {
               fs.cpSync(snapshot, base + "/openclaw", { recursive: true });

This way cpSync copies from the renamed directory that contains the actual symlinks, mirroring what rollbackFromSnapshot() does when restoring from a snapshot.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-self-hosted.yaml around lines 199 - 208, The repro is
copying from "openclaw-data" which contains regular files, but
rollbackFromSnapshot() in snapshot.ts restores from snapshotDir/openclaw (the
symlink-preserving tree); update the test to copy from the same symlinked source
used by rollbackFromSnapshot() (use snapshot = base + "/openclaw" or otherwise
point to snapshotDir/openclaw) so cpSync exercises symlink entries the same way
the real rollback code does.

121-123: ⚠️ Potential issue | 🟡 Minor

Make Docker info filtering non-fatal to avoid losing later diagnostics.

The grep command will exit with code 1 if no lines match, which can fail this step under Actions' default bash -e behavior and skip subsequent diagnostics.

Suggested fix
-          docker info 2>&1 | grep -E "Storage Driver|Server Version|Operating System|Kernel Version|Cgroup|Runtime"
+          docker info 2>&1 | grep -E "Storage Driver|Server Version|Operating System|Kernel Version|Cgroup|Runtime" || true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-self-hosted.yaml around lines 121 - 123, The grep
filter on the docker info line is currently fatal if nothing matches; update the
pipeline so the grep failure cannot abort the step—locate the line containing
the command "docker info 2>&1 | grep -E \"Storage Driver|Server
Version|Operating System|Kernel Version|Cgroup|Runtime\"" and make it tolerant
of no matches by either allowing a non-zero exit (for example using a shell
OR-true fallback) or by temporarily disabling errexit for that command so
subsequent diagnostics still run.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/pr-self-hosted.yaml:
- Around line 199-208: The repro is copying from "openclaw-data" which contains
regular files, but rollbackFromSnapshot() in snapshot.ts restores from
snapshotDir/openclaw (the symlink-preserving tree); update the test to copy from
the same symlinked source used by rollbackFromSnapshot() (use snapshot = base +
"/openclaw" or otherwise point to snapshotDir/openclaw) so cpSync exercises
symlink entries the same way the real rollback code does.
- Around line 121-123: The grep filter on the docker info line is currently
fatal if nothing matches; update the pipeline so the grep failure cannot abort
the step—locate the line containing the command "docker info 2>&1 | grep -E
\"Storage Driver|Server Version|Operating System|Kernel
Version|Cgroup|Runtime\"" and make it tolerant of no matches by either allowing
a non-zero exit (for example using a shell OR-true fallback) or by temporarily
disabling errexit for that command so subsequent diagnostics still run.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6d7ca443-ddea-400a-b5f5-d078df2b03ca

📥 Commits

Reviewing files that changed from the base of the PR and between 239a30c and 69dc8ee.

📒 Files selected for processing (1)
  • .github/workflows/pr-self-hosted.yaml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
test/diag-container-fs.sh (1)

69-72: ⚠️ Potential issue | 🟠 Major

Use the same cp source tree as real rollback to avoid false negatives.

Line 69 sets snapshot to "/openclaw-data" (regular tree), but rollback copies snapshotDir/openclaw (symlink-containing tree). This can hide the actual failure mode you’re diagnosing.

Proposed fix
-  const snapshot = base + "/openclaw-data";
+  // Mirror rollbackFromSnapshot(): source is snapshotDir/openclaw
+  const snapshot = base + "/snapshot/openclaw";
+  fs.mkdirSync(base + "/snapshot", { recursive: true });
+  fs.cpSync(base + "/openclaw", snapshot, { recursive: true });
   try {
     fs.cpSync(snapshot, base + "/openclaw", { recursive: true });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/diag-container-fs.sh` around lines 69 - 72, The test uses the wrong
source tree for the copy: change the snapshot variable assignment so it points
to the same symlink-containing tree used by rollback (the snapshotDir/openclaw
tree) instead of base + "/openclaw-data"; update the snapshot definition (the
snapshot variable near base) so the subsequent fs.cpSync(snapshot, base +
"/openclaw", { recursive: true }) exercises the same symlinks as the real
rollback path.
.github/workflows/pr-self-hosted.yaml (1)

121-123: ⚠️ Potential issue | 🟡 Minor

Make the docker info grep non-fatal to preserve downstream diagnostics.

Line 122 can terminate this step on pattern mismatch, which skips later diagnostics on that runner.

Proposed fix
-          docker info 2>&1 | grep -E "Storage Driver|Server Version|Operating System|Kernel Version|Cgroup|Runtime"
+          docker info 2>&1 | grep -E "Storage Driver|Server Version|Operating System|Kernel Version|Cgroup|Runtime" || true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-self-hosted.yaml around lines 121 - 123, The docker
inspection step uses `docker info` piped to `grep -E` and can cause the job to
fail if the patterns don't match; make that pipeline non-fatal so downstream
diagnostics still run by altering the `docker info | grep -E "Storage
Driver|Server Version|Operating System|Kernel Version|Cgroup|Runtime"`
invocation to tolerate no matches (e.g., use a shell fallback such as appending
a true-returning fallback like "|| true" or temporarily disabling pipefail/set
-e around that command) while preserving the command's printed output.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/pr-self-hosted.yaml:
- Around line 121-123: The docker inspection step uses `docker info` piped to
`grep -E` and can cause the job to fail if the patterns don't match; make that
pipeline non-fatal so downstream diagnostics still run by altering the `docker
info | grep -E "Storage Driver|Server Version|Operating System|Kernel
Version|Cgroup|Runtime"` invocation to tolerate no matches (e.g., use a shell
fallback such as appending a true-returning fallback like "|| true" or
temporarily disabling pipefail/set -e around that command) while preserving the
command's printed output.

In `@test/diag-container-fs.sh`:
- Around line 69-72: The test uses the wrong source tree for the copy: change
the snapshot variable assignment so it points to the same symlink-containing
tree used by rollback (the snapshotDir/openclaw tree) instead of base +
"/openclaw-data"; update the snapshot definition (the snapshot variable near
base) so the subsequent fs.cpSync(snapshot, base + "/openclaw", { recursive:
true }) exercises the same symlinks as the real rollback path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: b7735d2e-78c8-4056-bdef-c9b6877d2995

📥 Commits

Reviewing files that changed from the base of the PR and between 69dc8ee and e9deeb4.

📒 Files selected for processing (2)
  • .github/workflows/pr-self-hosted.yaml
  • test/diag-container-fs.sh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
.github/workflows/pr-self-hosted.yaml (2)

121-123: ⚠️ Potential issue | 🟡 Minor

Don't let grep abort the rest of the diagnostics.

If docker info prints none of those fields, grep exits 1 and the default bash -e shell stops this matrix leg before the container repro and E2E comparison run.

Suggested hardening
-          docker info 2>&1 | grep -E "Storage Driver|Server Version|Operating System|Kernel Version|Cgroup|Runtime"
+          docker info 2>&1 | grep -E "Storage Driver|Server Version|Operating System|Kernel Version|Cgroup|Runtime" || true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-self-hosted.yaml around lines 121 - 123, The
diagnostics step uses `docker info | grep -E ...` which can return exit code 1
and abort the job under bash -e; change the pipeline so a missing match does not
cause failure — for example, ensure the `docker info`/`grep` invocation (the
line that runs docker info and pipes to grep) is made safe by appending a
no-fail fallback (e.g., using `|| true`) or by disabling `set -e` around that
command; update the command that runs `docker info 2>&1 | grep -E "Storage
Driver|Server Version|Operating System|Kernel Version|Cgroup|Runtime"` so it
never returns non-zero when there are no matches.

134-139: ⚠️ Potential issue | 🟠 Major

This job is still invoking a false-negative rollback repro.

The script mounted here (test/diag-container-fs.sh:46-107) renames the symlinked openclaw tree, but then copies back openclaw-data, which contains regular files/directories. The real rollback path copies snapshotDir/openclaw, so this matrix is not exercising the same fs.cpSync source tree and can miss the symlink-copy failure you're trying to diagnose.

Adjustment to make the repro match the production path
-  const base = "/tmp/diag-node";
-  fs.mkdirSync(base + "/openclaw-data/workspace", { recursive: true });
-  fs.writeFileSync(base + "/openclaw-data/openclaw.json", JSON.stringify({ test: true }));
-  fs.writeFileSync(base + "/openclaw-data/workspace/notes.md", "hello");
-  fs.mkdirSync(base + "/openclaw", { recursive: true });
-  fs.symlinkSync(base + "/openclaw-data/openclaw.json", base + "/openclaw/openclaw.json");
-  fs.symlinkSync(base + "/openclaw-data/workspace", base + "/openclaw/workspace");
+  const base = "/tmp/diag-node";
+  const liveDir = base + "/home/.openclaw";
+  const archiveDir = base + "/home/.openclaw.archived";
+  const realData = base + "/real-data";
+  const snapshot = base + "/snapshot/openclaw";
+
+  fs.mkdirSync(realData + "/workspace", { recursive: true });
+  fs.writeFileSync(realData + "/openclaw.json", JSON.stringify({ test: true }));
+  fs.writeFileSync(realData + "/workspace/notes.md", "hello");
+
+  fs.mkdirSync(snapshot, { recursive: true });
+  fs.symlinkSync(realData + "/openclaw.json", snapshot + "/openclaw.json");
+  fs.symlinkSync(realData + "/workspace", snapshot + "/workspace");
+
+  fs.mkdirSync(liveDir, { recursive: true });

-  fs.renameSync(base + "/openclaw", base + "/openclaw.archived");
+  fs.renameSync(liveDir, archiveDir);

-  const snapshot = base + "/openclaw-data";
-  fs.cpSync(snapshot, base + "/openclaw", { recursive: true });
+  fs.cpSync(snapshot, liveDir, { recursive: true });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-self-hosted.yaml around lines 134 - 139, The workflow
mounts and runs test/diag-container-fs.sh but that script renames the symlinked
openclaw tree and then copies back openclaw-data (regular files), so the repro
diverges from the real rollback which copies snapshotDir/openclaw; update the
job or the script so the container exercise matches production: change the
mounted script invocation or edit test/diag-container-fs.sh (around the
rename/copy section) to perform the same copy source used in rollback
(snapshotDir/openclaw) instead of openclaw-data, ensuring the fs.cpSync-like
path that handles symlinks is exercised and the symlink-copy failure can be
reproduced.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/pr-self-hosted.yaml:
- Around line 121-123: The diagnostics step uses `docker info | grep -E ...`
which can return exit code 1 and abort the job under bash -e; change the
pipeline so a missing match does not cause failure — for example, ensure the
`docker info`/`grep` invocation (the line that runs docker info and pipes to
grep) is made safe by appending a no-fail fallback (e.g., using `|| true`) or by
disabling `set -e` around that command; update the command that runs `docker
info 2>&1 | grep -E "Storage Driver|Server Version|Operating System|Kernel
Version|Cgroup|Runtime"` so it never returns non-zero when there are no matches.
- Around line 134-139: The workflow mounts and runs test/diag-container-fs.sh
but that script renames the symlinked openclaw tree and then copies back
openclaw-data (regular files), so the repro diverges from the real rollback
which copies snapshotDir/openclaw; update the job or the script so the container
exercise matches production: change the mounted script invocation or edit
test/diag-container-fs.sh (around the rename/copy section) to perform the same
copy source used in rollback (snapshotDir/openclaw) instead of openclaw-data,
ensuring the fs.cpSync-like path that handles symlinks is exercised and the
symlink-copy failure can be reproduced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c0049c6e-8570-4ad8-8bf2-bcf3a506adaa

📥 Commits

Reviewing files that changed from the base of the PR and between e9deeb4 and 0a9259f.

📒 Files selected for processing (1)
  • .github/workflows/pr-self-hosted.yaml

@wscurran wscurran added the CI/CD label Apr 23, 2026
@jyaunches
jyaunches force-pushed the ci/test-self-hosted-runners branch from 6c4f484 to 9549040 Compare April 23, 2026 22:58
@jyaunches jyaunches changed the title ci: diagnose snapshot rollback failure on NVIDIA self-hosted runners fix(ci): enable NVIDIA self-hosted runners for PR E2E tests Apr 23, 2026
Add a diagnose-snapshot-rollback matrix job that runs in parallel on
linux-amd64-cpu4, cpu8, cpu16, and ubuntu-latest. It collects:

- Host kernel, Docker storage driver, and filesystem info
- Container-internal mount table and filesystem types
- Symlink rename/copy behavior (shell and Node.js)
- The full E2E test suite (continue-on-error for diagnosis)

This will identify why rollbackFromSnapshot() fails on NVIDIA
self-hosted runners but passes on GitHub-hosted ubuntu-latest.
The root cause is suspected to be a Docker storage driver or
overlayfs behavior difference affecting renameSync/cpSync on
symlink directories.

Temporary diagnostic — will be removed once root cause is fixed.

Signed-off-by: Julie Yaunches <[email protected]>
…ine)

The inline bash -c '...' with embedded Node.js caused 'cannot execute
binary file' on all runners. Switch to writing the diagnostic script
to a temp file and mounting it into the container.

Signed-off-by: Julie Yaunches <[email protected]>
The heredoc approach failed because YAML indentation added leading
spaces to the script content, breaking the shebang. Move the
diagnostic script to test/diag-container-fs.sh and mount it into
the container as a read-only volume.

Signed-off-by: Julie Yaunches <[email protected]>
…/bash)

The test sandbox image has ENTRYPOINT ["/bin/bash"], so running
'docker run ... bash /tmp/script.sh' becomes '/bin/bash bash /tmp/script.sh'
which tries to execute the bash binary as a script. Drop the explicit
bash arg so it becomes '/bin/bash /tmp/diag-container-fs.sh'.

Signed-off-by: Julie Yaunches <[email protected]>
The isolated /tmp symlink test passes everywhere but the real E2E
rollback fails on NVIDIA runners. Add Test 4 that replicates the
exact E2E flow — createSnapshot + manual renameSync/cpSync on the
actual $HOME/.openclaw directory with full error stack capture.
This will show the exact syscall, error code, and path that fails.

Signed-off-by: Julie Yaunches <[email protected]>
NVIDIA self-hosted runners use Docker with the containerd overlayfs
snapshotter, which places directories on different overlay layers.
rename(2) returns EXDEV when source and dest span layers, breaking
rollbackFromSnapshot() and cutoverHost().

Add moveSync() helper that tries renameSync first (fast same-device
path), then falls back to cpSync + rmSync on EXDEV. This also fixes
the secondary ERR_FS_CP_EINVAL error — since the rename now succeeds,
.openclaw is fully removed before cpSync restores from the snapshot.

Both functions (cutoverHost, rollbackFromSnapshot) now use moveSync
instead of bare renameSync.

Root cause diagnosed via PR #2374 diagnostic matrix:
- NVIDIA runners: overlayfs (containerd snapshotter v1) → EXDEV
- GitHub runners: overlay2 (legacy Docker) → rename works

Signed-off-by: Julie Yaunches <[email protected]>
Now that the EXDEV cross-device rename is fixed in snapshot.ts,
move test-e2e-sandbox back to linux-amd64-cpu4 (NVIDIA self-hosted).

Remove the diagnose-snapshot-rollback matrix job and the
test/diag-container-fs.sh diagnostic script — root cause identified
and fix verified on all runner types.

All three E2E jobs now run on NVIDIA self-hosted runners:
  - build-sandbox-images: linux-amd64-cpu4
  - test-e2e-sandbox: linux-amd64-cpu4
  - test-e2e-gateway-isolation: linux-amd64-cpu4

Signed-off-by: Julie Yaunches <[email protected]>
@jyaunches
jyaunches force-pushed the ci/test-self-hosted-runners branch from 4fc8bdb to cf7d05a Compare April 23, 2026 23:37
@brandonpelfrey
brandonpelfrey enabled auto-merge (squash) April 24, 2026 00:01
@brandonpelfrey
brandonpelfrey merged commit 8f74065 into NVIDIA:main Apr 24, 2026
9 checks passed
ericksoa pushed a commit that referenced this pull request Apr 24, 2026
…ners (#2397)

## Summary

Remove duplicate sandbox image builds and E2E tests from `pr.yaml`.
These jobs now run exclusively on NVIDIA self-hosted runners via
`pr-self-hosted.yaml`, which was enabled in #2374.

## Before (duplicate work on every PR)

| Job | `pr.yaml` (GitHub-hosted) | `pr-self-hosted.yaml` (NVIDIA) |
|-----|--------------------------|-------------------------------|
| build-sandbox-images | ✅ `ubuntu-latest` ~6m | ✅ `linux-amd64-cpu4`
~3m |
| build-sandbox-images-arm64 | ✅ `ubuntu-24.04-arm` ~2m | ❌ missing |
| test-e2e-sandbox | ✅ `ubuntu-latest` ~1m | ✅ `linux-amd64-cpu4` ~1m |
| test-e2e-gateway-isolation | ✅ `ubuntu-latest` ~1m | ✅
`linux-amd64-cpu4` ~1m |
| test-e2e-port-overrides | ✅ `ubuntu-latest` ~1m | ❌ missing |

**Total: ~12m GitHub-hosted + ~5m NVIDIA = ~17m of compute per PR**

## After (single run on NVIDIA runners)

| Job | `pr.yaml` (GitHub-hosted) | `pr-self-hosted.yaml` (NVIDIA) |
|-----|--------------------------|-------------------------------|
| build-sandbox-images | ❌ removed | ✅ `linux-amd64-cpu4` ~3m |
| build-sandbox-images-arm64 | ❌ removed | ✅ `linux-arm64-cpu4` (new) |
| test-e2e-sandbox | ❌ removed | ✅ `linux-amd64-cpu4` ~1m |
| test-e2e-gateway-isolation | ❌ removed | ✅ `linux-amd64-cpu4` ~1m |
| test-e2e-port-overrides | ❌ removed | ✅ `linux-amd64-cpu4` (new) |

**Total: ~6m on NVIDIA runners only — 65% less total compute**

## Performance: build-sandbox-images

Measured across recent PRs:

| Runner | Avg duration | Samples |
|--------|-------------|---------|
| GitHub `ubuntu-latest` | **362s** (~6m) | PR 2147: 371s, PR 2328:
373s, PR 2366: 353s |
| NVIDIA `linux-amd64-cpu4` | **187s** (~3m) | PR 2147: 190s, PR 2393:
176s, PR 2328: 187s, PR 2366: 198s, PR 2113: 180s |
| **Improvement** | **48% faster** | |

## Changes

### `.github/workflows/pr.yaml`
- Remove `sandbox-images-and-e2e` reusable workflow call (was running on
GitHub-hosted runners)
- Keep: `changes`, `checks`, `test-e2e-ollama-proxy` (lightweight,
GitHub-hosted)

### `.github/workflows/pr-self-hosted.yaml`
- Add `build-sandbox-images-arm64` on `linux-arm64-cpu4`
- Add `test-e2e-port-overrides` on `linux-amd64-cpu4`

### Not deleted
- `sandbox-images-and-e2e.yaml` reusable workflow — still used by
`main.yaml` (post-merge CI)

## Type of Change
- [x] Code change (feature, bug fix, or refactor)

## AI Disclosure
- [x] AI-assisted — tool: Claude Code (pi agent)

---
Signed-off-by: Julie Yaunches <[email protected]>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
  * Reorganized CI/CD pipeline to improve build and test management.
  * Added support for arm64 Docker image builds.
  * Enhanced E2E testing coverage with port override test execution.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Julie Yaunches <[email protected]>
DemianHeyGen pushed a commit to DemianHeyGen/NemoClaw that referenced this pull request Apr 30, 2026
)

## Summary

Fix snapshot rollback failure on NVIDIA self-hosted runners and move all
E2E jobs back to self-hosted.

## Root Cause

NVIDIA self-hosted runners use Docker with the **containerd overlayfs
snapshotter** (`io.containerd.snapshotter.v1`), while GitHub-hosted
runners use the legacy **`overlay2`** driver. On the containerd
snapshotter, directories can span different overlay layers, causing
`rename(2)` to return **`EXDEV` (cross-device link not permitted)**.

`rollbackFromSnapshot()` and `cutoverHost()` in `snapshot.ts` both used
bare `renameSync()` which fails with EXDEV on these runners. The bare
`catch {}` swallowed the error and returned `false`, producing the
"Rollback returned false" failure with no diagnostic output.

This also caused a secondary **`ERR_FS_CP_EINVAL`** — since the rename
failed, `.openclaw` still existed when `cpSync` ran, and it detected it
would be copying symlink targets into themselves.

## Diagnostic Evidence

Confirmed via a matrix job across 4 runners:

| Runner | Storage Driver | `renameSync` | `cpSync` |
|--------|---------------|-------------|---------|
| `linux-amd64-cpu4` | `overlayfs` (containerd) | ❌ EXDEV | ❌
ERR_FS_CP_EINVAL |
| `linux-amd64-cpu8` | `overlayfs` (containerd) | ❌ EXDEV | ❌
ERR_FS_CP_EINVAL |
| `linux-amd64-cpu16` | `overlayfs` (containerd) | ❌ EXDEV | ❌
ERR_FS_CP_EINVAL |
| `ubuntu-latest` | `overlay2` (legacy) | ✅ | ✅ |

## Fix

Add `moveSync()` helper that tries `renameSync` first (fast same-device
path), then falls back to `cpSync` + `rmSync` on EXDEV. Both
`cutoverHost()` and `rollbackFromSnapshot()` now use `moveSync()`
instead of bare `renameSync()`.

After the fix, all runners pass:

| Runner | Before | After |
|--------|--------|-------|
| `linux-amd64-cpu4` | ❌ Rollback returned false | ✅ PASS |
| `linux-amd64-cpu8` | ❌ Rollback returned false | ✅ PASS |
| `linux-amd64-cpu16` | ❌ Rollback returned false | ✅ PASS |
| `ubuntu-latest` | ✅ PASS | ✅ PASS |

## Changes

### `nemoclaw/src/blueprint/snapshot.ts`
- Add `moveSync()` — cross-device-safe move with EXDEV fallback
- `cutoverHost()` — use `moveSync` instead of `renameSync`
- `rollbackFromSnapshot()` — use `moveSync` instead of `renameSync`
(both the archive step and the recovery path)

### `nemoclaw/src/blueprint/snapshot.test.ts`
- Add `moveSync` unit tests: same-device rename, EXDEV fallback (cpSync
+ rmSync), non-EXDEV re-throw
- Add `rmSync` to the in-memory fs mock

### `.github/workflows/pr-self-hosted.yaml`
- Move `test-e2e-sandbox` back to `linux-amd64-cpu4` (was on
`ubuntu-latest` as a workaround since PR NVIDIA#2294)
- Remove temporary diagnostic matrix job and `test/diag-container-fs.sh`

## Follow-up
- [ ] Phase 4: Remove duplicate `sandbox-images-and-e2e` from `pr.yaml`
(separate PR)

## Type of Change
- [x] Code change (feature, bug fix, or refactor)

## Verification
- [x] `moveSync` unit tests pass (22/22 snapshot tests green)
- [x] `test-e2e-sandbox` passes on `linux-amd64-cpu4` (NVIDIA
self-hosted)
- [x] `test-e2e-gateway-isolation` passes on `linux-amd64-cpu4`
- [x] All jobs pass on `ubuntu-latest` (no regression)
- [x] No secrets, API keys, or credentials committed

## AI Disclosure
- [x] AI-assisted — tool: Claude Code (pi agent)

---
Signed-off-by: Julie Yaunches <[email protected]>

---------

Signed-off-by: Julie Yaunches <[email protected]>
DemianHeyGen pushed a commit to DemianHeyGen/NemoClaw that referenced this pull request Apr 30, 2026
…ners (NVIDIA#2397)

## Summary

Remove duplicate sandbox image builds and E2E tests from `pr.yaml`.
These jobs now run exclusively on NVIDIA self-hosted runners via
`pr-self-hosted.yaml`, which was enabled in NVIDIA#2374.

## Before (duplicate work on every PR)

| Job | `pr.yaml` (GitHub-hosted) | `pr-self-hosted.yaml` (NVIDIA) |
|-----|--------------------------|-------------------------------|
| build-sandbox-images | ✅ `ubuntu-latest` ~6m | ✅ `linux-amd64-cpu4`
~3m |
| build-sandbox-images-arm64 | ✅ `ubuntu-24.04-arm` ~2m | ❌ missing |
| test-e2e-sandbox | ✅ `ubuntu-latest` ~1m | ✅ `linux-amd64-cpu4` ~1m |
| test-e2e-gateway-isolation | ✅ `ubuntu-latest` ~1m | ✅
`linux-amd64-cpu4` ~1m |
| test-e2e-port-overrides | ✅ `ubuntu-latest` ~1m | ❌ missing |

**Total: ~12m GitHub-hosted + ~5m NVIDIA = ~17m of compute per PR**

## After (single run on NVIDIA runners)

| Job | `pr.yaml` (GitHub-hosted) | `pr-self-hosted.yaml` (NVIDIA) |
|-----|--------------------------|-------------------------------|
| build-sandbox-images | ❌ removed | ✅ `linux-amd64-cpu4` ~3m |
| build-sandbox-images-arm64 | ❌ removed | ✅ `linux-arm64-cpu4` (new) |
| test-e2e-sandbox | ❌ removed | ✅ `linux-amd64-cpu4` ~1m |
| test-e2e-gateway-isolation | ❌ removed | ✅ `linux-amd64-cpu4` ~1m |
| test-e2e-port-overrides | ❌ removed | ✅ `linux-amd64-cpu4` (new) |

**Total: ~6m on NVIDIA runners only — 65% less total compute**

## Performance: build-sandbox-images

Measured across recent PRs:

| Runner | Avg duration | Samples |
|--------|-------------|---------|
| GitHub `ubuntu-latest` | **362s** (~6m) | PR 2147: 371s, PR 2328:
373s, PR 2366: 353s |
| NVIDIA `linux-amd64-cpu4` | **187s** (~3m) | PR 2147: 190s, PR 2393:
176s, PR 2328: 187s, PR 2366: 198s, PR 2113: 180s |
| **Improvement** | **48% faster** | |

## Changes

### `.github/workflows/pr.yaml`
- Remove `sandbox-images-and-e2e` reusable workflow call (was running on
GitHub-hosted runners)
- Keep: `changes`, `checks`, `test-e2e-ollama-proxy` (lightweight,
GitHub-hosted)

### `.github/workflows/pr-self-hosted.yaml`
- Add `build-sandbox-images-arm64` on `linux-arm64-cpu4`
- Add `test-e2e-port-overrides` on `linux-amd64-cpu4`

### Not deleted
- `sandbox-images-and-e2e.yaml` reusable workflow — still used by
`main.yaml` (post-merge CI)

## Type of Change
- [x] Code change (feature, bug fix, or refactor)

## AI Disclosure
- [x] AI-assisted — tool: Claude Code (pi agent)

---
Signed-off-by: Julie Yaunches <[email protected]>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
  * Reorganized CI/CD pipeline to improve build and test management.
  * Added support for arm64 Docker image builds.
  * Enhanced E2E testing coverage with port override test execution.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Julie Yaunches <[email protected]>
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions chore Build, CI, dependency, or tooling maintenance and removed CI/CD labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions chore Build, CI, dependency, or tooling maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants