Skip to content

fix(e2e): make managed-image GPU builds network-independent - #8366

Closed
ericksoa wants to merge 11 commits into
mainfrom
fix/protected-gpu-build-cache
Closed

fix(e2e): make managed-image GPU builds network-independent#8366
ericksoa wants to merge 11 commits into
mainfrom
fix/protected-gpu-build-cache

Conversation

@ericksoa

@ericksoa ericksoa commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • export the exact all-agent linux/amd64 BuildKit cache from the hosted protected startup lane only after direct startup and evidence validation pass
  • make the protected GPU/local-inference lane depend on that producer, download the exact run/head artifact, and rebuild the candidate with BuildKit networking disabled
  • fail closed before GPU qualification when any OpenClaw, Hermes, or DCode cache is missing, incomplete, symlinked, or misses a build layer
  • enforce the producer/consumer/security relationship with executable workflow-boundary and shell behavior tests

Why

This is a trusted-workflow prerequisite for #8261 and the #7744 Podman epic. Protected run 31012875592 passed the all-agent amd64/arm64 startup lanes, but its GPU/local-inference job failed twice at the same 368.8-second npm install point while building exact candidate images on the GPU runner. Neither attempt reached the GPU, Ollama, NIM, or vLLM assertions.

The hosted amd64 lane already builds and directly starts the exact candidate images without credentials. Reusing its BuildKit cache removes the GPU runners broken npm-network path while preserving an exact candidate rebuild on the GPU host. The rebuild runs with network none, so any cache miss fails instead of silently reaching the network.

This PR does not activate buildless or Podman support and does not change product runtime behavior. It must land before #8261 can be rerun against the corrected trusted workflow.

Temporary handoff removal

Remove the hosted-cache handoff after three consecutive protected GPU cold builds of all three managed images reach the GPU, Ollama, NIM, and vLLM assertions without the hosted cache.

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: no-docs-needed
  • Evidence: Internal protected E2E cache handoff and its regression tests do not change a public CLI, configuration, default, or supported operator workflow. The new test title names the rejected state and Docker boundary.
  • Agent: Codex Desktop

Validation

  • all pre-commit and pre-push hooks
  • protected build script behavior: 12/12
  • protected runtime workflow boundary: 15/15
  • E2E semantic phase coverage
  • CLI build and typecheck
  • repository checks, shellcheck, source-shape, test-size, and test-conditional guardrails

Signed-off-by: Aaron Erickson aerickson@nvidia.com

Summary by CodeRabbit

  • New Features

    • Protected managed-image runtime builds now reuse the exact startup build cache.
    • Multi-architecture startup builds publish a temporary amd64 cache for offline GPU image builds.
    • Protected runtime workflows support the managed-image-protected-runtime selection.
  • Bug Fixes

    • Improved validation rejects incomplete, invalid, or incorrectly connected build-cache workflows.
    • Offline builds now verify cache completeness, reject unsafe cache contents, and prevent unintended network access.
  • Tests

    • Added coverage for cache creation, transfer, offline builds, workflow dependencies, artifact handling, and required build settings.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 5, 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 Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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

The change adds local BuildKit cache export and offline cache import for protected managed-image builds. It connects the startup and runtime workflows through a pinned amd64 cache artifact. Boundary validators and tests cover selection, dependencies, permissions, artifact handling, ordering, and build arguments.

Changes

Protected managed-image cache handoff

Layer / File(s) Summary
Offline cache build contract
scripts/checks/build-protected-managed-images.sh, test/protected-managed-image-build-script.test.ts
The builder accepts cache export and offline cache paths, validates their structure, configures local BuildKit cache arguments, and disables network access for offline builds. Tests cover valid and invalid cache inputs.
Startup cache publication
.github/workflows/e2e.yaml, tools/e2e/managed-image-multiarch-workflow-boundary.mts
The startup lane runs for protected-runtime selection, exports the amd64 cache, and publishes a pinned, short-lived artifact. Boundary checks validate environment bindings, build arguments, publication settings, and execution order.
Runtime cache consumption and validation
.github/workflows/e2e.yaml, tools/e2e/managed-image-protected-runtime-workflow-boundary.mts, tools/e2e/workflow-boundary.mts, test/e2e/support/managed-image-protected-runtime-workflow.test.ts
The GPU runtime lane depends on startup, downloads the exact cache artifact, and passes it to the offline image build. Validators and tests check dependencies, permissions, selector binding, authentication ordering, artifact handling, and offline build arguments.
Build-cache artifact upload boundary
tools/e2e/upload-e2e-artifacts-workflow-boundary.mts, test/e2e/support/upload-e2e-artifacts-workflow-boundary.test.ts
Artifact validation permits the named managed-image build-cache upload and rejects direct uploads after the step is renamed.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Selector
  participant managed-image-multiarch-startup
  participant ArtifactStore
  participant managed-image-protected-runtime
  participant BuildKit
  Selector->>managed-image-multiarch-startup: select protected-runtime lane
  managed-image-multiarch-startup->>BuildKit: export amd64 build cache
  managed-image-multiarch-startup->>ArtifactStore: publish cache artifact
  managed-image-protected-runtime->>ArtifactStore: download exact cache artifact
  managed-image-protected-runtime->>BuildKit: build image with offline cache
Loading

Possibly related PRs

  • NVIDIA/NemoClaw#8234: Extends the protected runtime workflow and build script used by this cache handoff.
  • NVIDIA/NemoClaw#7943: Modifies related E2E workflow boundary validation and artifact-upload handling.
  • NVIDIA/NemoClaw#8261: Modifies the related managed-image multi-architecture and protected-runtime workflows.

Suggested labels: area: ci, area: e2e, bug-fix, platform: container

Suggested reviewers: cv, apurvvkumaria, jyaunches

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main change: making managed-image GPU builds independent of network access.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/protected-gpu-build-cache

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

@github-code-quality

github-code-quality Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: TypeScript

TypeScript / code-coverage/plugin

The overall coverage in commit af77aa7 in the fix/protected-gpu-bu... branch remains at 96%, unchanged from commit 287e474 in the main branch.

TypeScript / code-coverage/cli

The overall coverage in commit af77aa7 in the fix/protected-gpu-bu... branch remains at 82%, unchanged from commit 6f2cab8 in the main branch.

Show a code coverage summary of the most impacted files.
File main 6f2cab8 fix/protected-gpu-bu... af77aa7 +/-
src/lib/sandbox...rce-identity.ts 87% 87% 0%
src/lib/tunnel/services.ts 80% 80% 0%
src/lib/inferen...er-discovery.ts 87% 88% +1%

Updated August 05, 2026 17:44 UTC

@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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/e2e.yaml:
- Line 1985: Replace runner.temp with github.workspace in both job-level cache
paths in .github/workflows/e2e.yaml at lines 1985 and 2592. Update the boundary
assertions in tools/e2e/managed-image-multiarch-workflow-boundary.mts lines
153-156 and tools/e2e/managed-image-protected-runtime-workflow-boundary.mts
lines 122-125 to require the workspace-based paths.
🪄 Autofix

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: 51b7d8e9-240d-401f-b6ae-a864749c9216

📥 Commits

Reviewing files that changed from the base of the PR and between cbabb66 and efb56bb.

📒 Files selected for processing (6)
  • .github/workflows/e2e.yaml
  • scripts/checks/build-protected-managed-images.sh
  • test/e2e/support/managed-image-protected-runtime-workflow.test.ts
  • test/protected-managed-image-build-script.test.ts
  • tools/e2e/managed-image-multiarch-workflow-boundary.mts
  • tools/e2e/managed-image-protected-runtime-workflow-boundary.mts

Comment thread .github/workflows/e2e.yaml Outdated
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

PR Review Advisor — No blocking findings reported

Advisor assessment: No blocking advisor findings reported
Next action: No advisor follow-up needed.
Findings: 0 blockers · 0 warnings · 0 suggestions

Model lanes

  • GPT-5.6 Terra (primary): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Nemotron 3 Ultra (second opinion): Completed · high confidence · 0 blockers · 0 warnings · 0 suggestions
  • Model comparison: normalized findings match; normalized terminology decisions differ; normalized E2E selections differ; severity counts match.
3 terminology differences from the second opinion

Advisory only. These are normalized differences from the primary terminology receipt.

  • cache handoff at test/e2e/support/managed-image-protected-runtime-workflow.test.ts:46: selected only by the second-opinion lane as define.
  • offline cache at .github/workflows/e2e.yaml:2812: selected only by the second-opinion lane as define.
  • protected cache at test/e2e/support/managed-image-protected-runtime-workflow.test.ts:168: selected only by the second-opinion lane as define.

Second-opinion terminology and E2E selections are advisory. They do not change the primary assessment or E2E / PR Gate.

Since last review: 0 prior items resolved · 0 still apply · 0 new items found

2 semantic terminology decisions

Terminology decisions are advisory. They affect the assessment only when a separate finding identifies concrete semantic impact.

  • justified — protected runtime build cache at .github/workflows/e2e.yaml:2280: Keep this term for the producer and consumer workflow steps.
  • justified — BuildKit cache at .github/workflows/e2e.yaml:2577: Keep the product name and technical noun to distinguish cache records from image artifacts.

E2E guidance

Advisory only. E2E / PR Gate selects and runs jobs independently.

Recommended E2E: cloud-inference, cloud-onboard, managed-image-multiarch-startup, security-posture

1 optional E2E recommendation
  • managed-image-protected-runtime

Workflow run details

This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tools/e2e/upload-e2e-artifacts-workflow-boundary.mts`:
- Line 37: Update the managed-image boundary around the upload step matcher so
it validates both with.name and with.path, and requires exactly one direct
upload step match instead of allowing loose or multiple matches. Adjust the test
in upload-e2e-artifacts-workflow-boundary.mts to cover changed upload inputs and
the duplicate-step case, using the existing
MANAGED_IMAGE_BUILD_CACHE_PUBLISH_STEP as the exact-step anchor.

In `@tools/e2e/workflow-boundary.mts`:
- Around line 2524-2533: Update requireOrderedSteps for the
managed-image-protected-runtime case to track the canonical protected
cache-download index and require authIndex to equal cacheDownloadIndex + 1,
rather than deriving the expected position solely from checkoutIndex. Preserve
the existing Jetson dispatch guard and standard checkout ordering behavior and
error messages.
🪄 Autofix

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: dff1c817-8b00-410f-8d8c-93ff11541982

📥 Commits

Reviewing files that changed from the base of the PR and between a837709 and d32a8a9.

📒 Files selected for processing (3)
  • test/e2e/support/upload-e2e-artifacts-workflow-boundary.test.ts
  • tools/e2e/upload-e2e-artifacts-workflow-boundary.mts
  • tools/e2e/workflow-boundary.mts

Comment thread tools/e2e/upload-e2e-artifacts-workflow-boundary.mts
Comment thread tools/e2e/workflow-boundary.mts

@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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/e2e.yaml:
- Around line 2584-2586: Remove the repository-local removalCondition comment
from the workflow. Keep only documentation describing functional workflow
behavior, and retain the migration status and completion criteria in the
associated GitHub issue or PR instead.
🪄 Autofix

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: 89d06d56-668e-496a-9db0-06d8df2ce45e

📥 Commits

Reviewing files that changed from the base of the PR and between d32a8a9 and 510c206.

📒 Files selected for processing (2)
  • .github/workflows/e2e.yaml
  • test/protected-managed-image-build-script.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/protected-managed-image-build-script.test.ts

Comment thread .github/workflows/e2e.yaml Outdated
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
@ericksoa ericksoa added area: ci CI workflows, checks, release automation, or GitHub Actions area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression platform: container Affects Docker, containerd, Podman, or images v0.0.104 Release target labels Aug 5, 2026
@ericksoa ericksoa closed this Aug 5, 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 area: e2e End-to-end tests, nightly failures, or validation infrastructure bug-fix PR fixes a bug or regression platform: container Affects Docker, containerd, Podman, or images v0.0.104 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant