Skip to content

ci: enable copy-pr-bot and add self-hosted runner PR workflow - #2121

Merged
brandonpelfrey merged 2 commits into
NVIDIA:mainfrom
jyaunches:ci/copy-pr-bot-self-hosted-runners
Apr 20, 2026
Merged

brandonpelfrey merged 2 commits into
NVIDIA:mainfrom
jyaunches:ci/copy-pr-bot-self-hosted-runners

Conversation

@jyaunches

@jyaunches jyaunches commented Apr 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Enable NVIDIA GHA self-hosted runners for PR testing by adding:

  1. .github/copy-pr-bot.yaml — activates copy-pr-bot on this repo
  2. .github/workflows/pr-self-hosted.yaml — runs heavier CI jobs on self-hosted runners

How it works

  • Lightweight checks (lint, unit tests) continue to run on GitHub-hosted runners via pr.yaml, triggered by pull_request events — unchanged, runs for all PRs
  • Heavier jobs (sandbox image builds, E2E sandbox tests, gateway isolation tests) now run on NVIDIA self-hosted runners (linux-amd64-cpu4), triggered only when copy-pr-bot pushes to pull-request/* branches

Security model (copy-pr-bot)

PR author What happens
NVIDIA employee with signed commits Auto-synced to pull-request/<number> → self-hosted CI runs
Community contributor copy-pr-bot does NOT sync → self-hosted CI never runs
After maintainer comments /ok to test <SHA> copy-pr-bot syncs → self-hosted CI runs

This ensures community PRs never execute on self-hosted runners without explicit maintainer approval.

copy-pr-bot config

enabled: true
auto_sync_draft: false    # don't sync draft PRs
auto_sync_ready: true     # auto-sync ready-for-review PRs from trusted users

Onboarding checklist

Per GHA Runners onboarding guide:

  • Step 1: Review Before You Begin
  • Step 2: Fill out intake form
  • Step 3: copy-pr-bot config (this PR)
  • Step 4: Install nvidia-runner-mgmt GitHub app (org-level, separate from this PR)
  • Step 5: Request runner group access in nv-gha-runners/enterprise-runner-configuration

Testing

This PR is additive-only — no existing workflows are modified. The new pr-self-hosted.yaml workflow will only activate once copy-pr-bot is installed and this config is merged to main.

Summary by CodeRabbit

  • Chores
    • Added CI configuration to enable a pull-request copy bot with draft/ready sync controls.
    • Added a self-hosted CI workflow that fetches PR metadata, builds and uploads container images, and runs end-to-end sandbox and isolation tests.

@coderabbitai

coderabbitai Bot commented Apr 20, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Added two GitHub Actions YAMLs: a copy-pr-bot config enabling the bot (auto-sync ready PRs, drafts disabled) and a new self-hosted workflow pr-self-hosted that builds Docker images and runs two e2e test jobs using uploaded image artifacts.

Changes

Cohort / File(s) Summary
Copy-PR-Bot Configuration
\.github/copy-pr-bot.yaml
New configuration with SPDX headers; bot enabled, auto_sync_draft: false, auto_sync_ready: true.
Self-Hosted PR Workflow
\.github/workflows/pr-self-hosted.yaml
New pr-self-hosted workflow triggered on push to pull-request/[0-9]+. Adds jobs: get-pr-info (fetch PR metadata), build-sandbox-images (pull or build base image, build production and sandbox images, save gzipped tar artifacts), test-e2e-sandbox (load sandbox artifact and run /opt/test/e2e-test.sh), test-e2e-gateway-isolation (load isolation artifact and run gateway isolation script). Uses self-hosted runners and sets job timeouts where specified.

Sequence Diagram(s)

sequenceDiagram
    participant GH as GitHub Actions
    participant Runner as Self-hosted Runner
    participant Docker as Docker Engine
    participant Artifact as Actions Artifact Storage
    participant Repo as Repository (test/)
    GH->>Runner: trigger `pr-self-hosted` on push to pull-request/* 
    Runner->>GH: run `get-pr-info` job (fetch PR metadata)
    Runner->>Docker: check GHCR base image
    alt base missing
        Runner->>Docker: build `Dockerfile.base`
    end
    Runner->>Docker: build production image
    Runner->>Docker: build sandbox test image (`test/Dockerfile.sandbox`)
    Runner->>Artifact: upload gzipped images (`sandbox-test-image`, `isolation-image`)
    par e2e jobs
        Runner->>Artifact: download relevant image artifact
        Runner->>Docker: load image tarball
        Runner->>Repo: mount `test/` at `/opt/test`
        Runner->>Docker: run `/opt/test/e2e-test.sh` or `bash test/e2e-gateway-isolation.sh`
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through YAML, neat and bright,

Images bundled, runners take flight,
PRs sync when ready, drafts stay calm,
Tests spin up like a tiny charm,
A rabbit cheers: "CI, you delight!"

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: enable copy-pr-bot and add self-hosted runner PR workflow' directly and accurately describes both main changes: enabling copy-pr-bot configuration and adding a self-hosted runner workflow file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

@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.

🧹 Nitpick comments (1)
.github/workflows/pr-self-hosted.yaml (1)

37-37: Pin external action to an immutable ref.

Line 37 references nv-gha-runners/get-pr-info@main; mutable refs can change behavior unexpectedly and weaken supply-chain guarantees. Prefer a commit SHA (or immutable release tag).

🔒 Suggested change
-      - id: get-pr-info
-        uses: nv-gha-runners/get-pr-info@main
+      - id: get-pr-info
+        uses: nv-gha-runners/get-pr-info@<pinned-commit-sha>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-self-hosted.yaml at line 37, The workflow currently
uses the external action reference "nv-gha-runners/get-pr-info@main" which is
mutable; update that reference to an immutable ref (a specific commit SHA or an
immutable release tag) by replacing "@main" with the chosen commit SHA or tag
for the nv-gha-runners/get-pr-info action, and ensure any other occurrences are
updated consistently so the workflow always runs against a fixed, auditable
version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/pr-self-hosted.yaml:
- Line 37: The workflow currently uses the external action reference
"nv-gha-runners/get-pr-info@main" which is mutable; update that reference to an
immutable ref (a specific commit SHA or an immutable release tag) by replacing
"@main" with the chosen commit SHA or tag for the nv-gha-runners/get-pr-info
action, and ensure any other occurrences are updated consistently so the
workflow always runs against a fixed, auditable version.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 08b622d6-4cfe-45e6-98ca-ab353794cc83

📥 Commits

Reviewing files that changed from the base of the PR and between a7dca9c and 7b5a05b.

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

Comment thread .github/workflows/pr-self-hosted.yaml Outdated
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6

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.

All actions/docker images/etc. should pin to a specific SHA rather than tag.

Comment thread .github/workflows/pr-self-hosted.yaml Outdated
needs: build-sandbox-images
steps:
- name: Checkout
uses: actions/checkout@v6

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.

Same here

Comment thread .github/workflows/pr-self-hosted.yaml Outdated
uses: actions/checkout@v6

- name: Download image artifact
uses: actions/download-artifact@v4

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.

And here

@brandonpelfrey brandonpelfrey 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.

Minor requests, otherwise looks good

@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.

🧹 Nitpick comments (1)
.github/workflows/pr-self-hosted.yaml (1)

31-38: get-pr-info is currently dead code and can fail the workflow for no benefit.

Line 31-Line 38 defines pr-info, but nothing consumes it. If this job fails, the workflow turns red even when build/test jobs are fine. Either wire it into dependent jobs or remove it.

♻️ Proposed simplification
 jobs:
-  get-pr-info:
-    runs-on: ubuntu-latest
-    outputs:
-      pr-info: ${{ steps.get-pr-info.outputs.pr-info }}
-    steps:
-      - id: get-pr-info
-        uses: nv-gha-runners/get-pr-info@090577647b8ddc4e06e809e264f7881650ecdccf # main
-
   build-sandbox-images:
     runs-on: linux-amd64-cpu4
🤖 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 31 - 38, The get-pr-info
job is unused and can fail CI; either delete the entire job block named
get-pr-info (including its step id get-pr-info and output pr-info) or make
downstream jobs declare needs: get-pr-info and reference its output via
needs.get-pr-info.outputs.pr-info so the output is actually consumed; pick one
approach and update the workflow to remove dead code or wire the pr-info output
into dependent jobs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/pr-self-hosted.yaml:
- Around line 31-38: The get-pr-info job is unused and can fail CI; either
delete the entire job block named get-pr-info (including its step id get-pr-info
and output pr-info) or make downstream jobs declare needs: get-pr-info and
reference its output via needs.get-pr-info.outputs.pr-info so the output is
actually consumed; pick one approach and update the workflow to remove dead code
or wire the pr-info output into dependent jobs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e1a6ba7d-f567-48fd-86ee-cfcbaabf3b66

📥 Commits

Reviewing files that changed from the base of the PR and between 7b5a05b and 98d0692.

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

Enable copy-pr-bot on this repo so that PR code is only pushed to
pull-request/* branches after maintainer vetting (trusted NVIDIA
employees with signed commits auto-sync; community PRs require
an explicit '/ok to test <SHA>' from a maintainer).

Add pr-self-hosted.yaml which triggers on push to pull-request/*
branches and runs the heavier sandbox image builds and E2E tests
on NVIDIA self-hosted runners (linux-amd64-cpu4). The existing
pr.yaml workflow continues to run lightweight lint and unit tests
on GitHub-hosted runners for all PRs.

Refs: https://docs.gha-runners.nvidia.com/platform/onboarding/overview/
Address review feedback from brandonpelfrey — pin all
actions/checkout, actions/upload-artifact, actions/download-artifact,
and nv-gha-runners/get-pr-info to their commit SHAs with the
human-readable tag retained as a trailing comment.
@jyaunches
jyaunches force-pushed the ci/copy-pr-bot-self-hosted-runners branch from 98d0692 to 53ca97b Compare April 20, 2026 23:26

@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

🧹 Nitpick comments (2)
.github/workflows/pr-self-hosted.yaml (2)

31-38: get-pr-info is currently unused and adds avoidable failure surface.

Lines [31-38] define outputs that no downstream job consumes. Consider removing this job (or wiring it into needs/conditions) to reduce workflow flakiness and runtime.

🤖 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 31 - 38, The workflow
defines an unused job "get-pr-info" (job id: get-pr-info) that exposes output
"pr-info" from the step with id "get-pr-info" (uses
nv-gha-runners/get-pr-info@0905776...), which no downstream job consumes; either
remove the entire "get-pr-info" job block to eliminate the unused output and
reduce failure surface, or wire its output into consumers by adding appropriate
"needs: get-pr-info" references and using "${{ needs.get-pr-info.outputs.pr-info
}}" in downstream job conditions/steps so the output is actually consumed.

48-53: Prefer digest pinning over :latest for base image reproducibility.

Line [48] pulls a mutable tag. A digest-pinned reference avoids nondeterministic CI behavior and strengthens supply-chain guarantees.

Suggested direction
-          if docker pull ghcr.io/nvidia/nemoclaw/sandbox-base:latest 2>/dev/null; then
-            echo "BASE_IMAGE=ghcr.io/nvidia/nemoclaw/sandbox-base:latest" >> "$GITHUB_ENV"
+          # Use an immutable digest published by your image pipeline
+          if docker pull ghcr.io/nvidia/nemoclaw/sandbox-base@sha256:<digest> 2>/dev/null; then
+            echo "BASE_IMAGE=ghcr.io/nvidia/nemoclaw/sandbox-base@sha256:<digest>" >> "$GITHUB_ENV"
🤖 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 48 - 53, The workflow
currently pulls the mutable tag "ghcr.io/nvidia/nemoclaw/sandbox-base:latest"
and writes BASE_IMAGE with that tag; change this to use a digest-pinned
reference instead: obtain the image digest (e.g., via `docker pull` + `docker
inspect --format='{{index .RepoDigests 0}}'` or `docker manifest inspect` /
registry API) and write BASE_IMAGE using the digest form
"ghcr.io/nvidia/nemoclaw/sandbox-base@sha256:<digest>"; update the conditional
that sets BASE_IMAGE (the docker pull/echo lines) so the fallback/local build
still sets BASE_IMAGE to the digest-pinned name (or to a clearly named local
image like "nemoclaw-sandbox-base-local") to ensure reproducible CI runs.
🤖 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:
- Line 21: The branch filter string "pull-request/[0-9]+" is using a regex-style
quantifier that doesn't work in GitHub Actions glob syntax; update the branch
filter pattern to "pull-request/*" so branches like pull-request/123 will match
(replace the existing "pull-request/[0-9]+" entry with "pull-request/*").

---

Nitpick comments:
In @.github/workflows/pr-self-hosted.yaml:
- Around line 31-38: The workflow defines an unused job "get-pr-info" (job id:
get-pr-info) that exposes output "pr-info" from the step with id "get-pr-info"
(uses nv-gha-runners/get-pr-info@0905776...), which no downstream job consumes;
either remove the entire "get-pr-info" job block to eliminate the unused output
and reduce failure surface, or wire its output into consumers by adding
appropriate "needs: get-pr-info" references and using "${{
needs.get-pr-info.outputs.pr-info }}" in downstream job conditions/steps so the
output is actually consumed.
- Around line 48-53: The workflow currently pulls the mutable tag
"ghcr.io/nvidia/nemoclaw/sandbox-base:latest" and writes BASE_IMAGE with that
tag; change this to use a digest-pinned reference instead: obtain the image
digest (e.g., via `docker pull` + `docker inspect --format='{{index .RepoDigests
0}}'` or `docker manifest inspect` / registry API) and write BASE_IMAGE using
the digest form "ghcr.io/nvidia/nemoclaw/sandbox-base@sha256:<digest>"; update
the conditional that sets BASE_IMAGE (the docker pull/echo lines) so the
fallback/local build still sets BASE_IMAGE to the digest-pinned name (or to a
clearly named local image like "nemoclaw-sandbox-base-local") to ensure
reproducible CI runs.
🪄 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: Pro Plus

Run ID: 5455002b-0b7f-441e-86bf-93233dbd58f3

📥 Commits

Reviewing files that changed from the base of the PR and between 98d0692 and 53ca97b.

📒 Files selected for processing (2)
  • .github/copy-pr-bot.yaml
  • .github/workflows/pr-self-hosted.yaml
✅ Files skipped from review due to trivial changes (1)
  • .github/copy-pr-bot.yaml

on:
push:
branches:
- "pull-request/[0-9]+"

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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

In GitHub Actions, does on.push.branchesuse glob patterns or regex? Willpull-request/[0-9]+match a branch namedpull-request/123?

💡 Result:

In GitHub Actions, on.push.branches uses glob patterns, not regex. The pattern pull-request/[0-9]+ will not match the branch named pull-request/123 because + in glob patterns matches one or more of the preceding character (here, the literal /), not one or more digits as in regex. To match branches like pull-request/123, use the glob pattern pull-request/[0-9]* (matches zero or more digits) or pull-request/[1-9][0-9]* (matches one or more digits, avoiding leading zero).

Citations:


Fix branch filter syntax; current pattern won't match mirrored PR branches.

Line 21 uses glob-style syntax [0-9]+, but in GitHub Actions glob patterns, + matches one or more of the preceding character (the /), not digits. This prevents the workflow from triggering on pull-request/123 branches.

Use the glob pattern pull-request/* to match numeric PR branches:

Suggested fix
-      - "pull-request/[0-9]+"
+      - "pull-request/*"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- "pull-request/[0-9]+"
- "pull-request/*"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-self-hosted.yaml at line 21, The branch filter string
"pull-request/[0-9]+" is using a regex-style quantifier that doesn't work in
GitHub Actions glob syntax; update the branch filter pattern to "pull-request/*"
so branches like pull-request/123 will match (replace the existing
"pull-request/[0-9]+" entry with "pull-request/*").

@brandonpelfrey
brandonpelfrey merged commit 1d4b973 into NVIDIA:main Apr 20, 2026
13 checks passed
@wscurran wscurran added CI/CD github_actions Pull requests that update GitHub Actions code labels Apr 21, 2026
@jyaunches

Copy link
Copy Markdown
Contributor Author

Re: CodeRabbit's comment about [0-9]+ branch filter syntax — this is a false positive.

GitHub Actions filter patterns support + as "one or more of the preceding character class," so pull-request/[0-9]+ correctly matches pull-request/123, pull-request/2121, etc.

This is confirmed by:

  • The copy-pr-bot official docs which recommend exactly this pattern
  • NVIDIA/cuda-python using the identical pattern in production ("pull-request/[0-9]+") with dozens of active pull-request branches and passing CI
  • The GitHub Actions filter pattern docs which document + as matching one or more of the preceding pattern

No change needed.

brandonpelfrey pushed a commit that referenced this pull request Apr 22, 2026
…flow (#2294)

## Summary

Switch `test-e2e-sandbox` from `linux-amd64-cpu4` (NVIDIA self-hosted)
to `ubuntu-latest` (GitHub-hosted) in the `pr-self-hosted` workflow. The
snapshot rollback test fails 100% on the self-hosted runner but passes
reliably on GitHub-hosted runners.

## Related Issue

Unblocks all PRs gated on `pr-self-hosted` — the workflow has never had
a passing run since it was added in #2121.

## Changes

- **`.github/workflows/pr-self-hosted.yaml`**: Change `test-e2e-sandbox`
`runs-on` from `linux-amd64-cpu4` to `ubuntu-latest`
- Other E2E jobs (`build-sandbox-images`, `test-e2e-gateway-isolation`)
remain on `linux-amd64-cpu4` since they pass there

### Diagnosis

The `rollbackFromSnapshot()` function in
`nemoclaw/src/blueprint/snapshot.ts` does `renameSync` + `cpSync` on
`/sandbox/.openclaw` (which contains symlinks to `.openclaw-data`). On
the self-hosted runner's Docker environment, one of these operations
throws — but the bare `catch {}` swallows the error and returns `false`,
producing the "Rollback returned false" failure with no diagnostic
output.

Confirmed in PR #2288 by temporarily switching the runner —
`test-e2e-sandbox` passed immediately on `ubuntu-latest`.

## Type of Change
- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)

## Verification
- [ ] `npx prek run --all-files` passes
- [ ] `npm test` passes
- [x] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [ ] Docs updated for user-facing behavior changes

## 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**
* Updated test environment configuration for improved compatibility and
reliability of end-to-end snapshot tests.

<!-- 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 github_actions Pull requests that update GitHub Actions code 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