Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
26 changes: 25 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5213,6 +5213,7 @@ jobs:
timeout-minutes: 75
permissions:
contents: read
pull-requests: read
env:
CHECKOUT_SHA: ${{ inputs.checkout_sha || github.sha }}
E2E_ARTIFACT_DIR: ${{ github.workspace }}/e2e-artifacts/live/managed-image-protected-runtime
Expand Down Expand Up @@ -5361,10 +5362,22 @@ jobs:
- id: openshell-projection
name: Bind reviewed candidate OpenShell runtime
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
UPGRADE_PR_NUMBER: ${{ inputs.pr_number }}
run: |
set -euo pipefail
node tools/e2e/protected-openshell-workspace.mts prepare > "$E2E_ARTIFACT_DIR/openshell-projection.json"

- name: Verify reviewed candidate OpenShell runtime before consumption
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
UPGRADE_PR_NUMBER: ${{ inputs.pr_number }}
run: |
set -euo pipefail
node tools/e2e/protected-openshell-workspace.mts verify > "$E2E_ARTIFACT_DIR/openshell-projection-initially-verified.json"

- name: Download reviewed OpenShell SDK archive
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
Expand Down Expand Up @@ -5500,6 +5513,15 @@ jobs:
shell: bash
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

- name: Verify reviewed candidate OpenShell runtime
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
UPGRADE_PR_NUMBER: ${{ inputs.pr_number }}
run: |
set -euo pipefail
node tools/e2e/protected-openshell-workspace.mts verify > "$E2E_ARTIFACT_DIR/openshell-projection-verified.json"

- name: Run all-agent GPU, local inference, rollback, and cleanup qualification
env:
NVIDIA_API_KEY: ${{ github.repository == 'NVIDIA/NemoClaw' && (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && (inputs.checkout_sha == '' || needs.generate-matrix.outputs.e2e_credentials_allowed == 'true') && secrets.NVIDIA_API_KEY || '' }}
Expand All @@ -5510,7 +5532,6 @@ jobs:
echo "::error::Protected NIM qualification must execute trusted workflow code" >&2
exit 1
}
node tools/e2e/protected-openshell-workspace.mts verify > "$E2E_ARTIFACT_DIR/openshell-projection-verified.json"
export PATH="$HOME/.local/bin:$HOME/.npm-global/bin:$PATH"
OPENSHELL_BIN="$(command -v openshell)"
export OPENSHELL_BIN
Expand Down Expand Up @@ -5546,6 +5567,9 @@ jobs:
- name: Restore trusted OpenShell sources
if: ${{ always() && steps.openshell-projection.outcome == 'success' }}
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
UPGRADE_PR_NUMBER: ${{ inputs.pr_number }}
run: |
set -euo pipefail
node tools/e2e/protected-openshell-workspace.mts restore > "$E2E_ARTIFACT_DIR/openshell-projection-restored.json"
Expand Down
22 changes: 16 additions & 6 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,10 @@ The API credential is limited to trusted preparation and removed before npm runs
If CI starts before the approved artifact exists, wait for the admission workflow's
SDK job, then rerun CI. Changed or revoked approval cannot reuse the older artifact.

This does not yet extend the protected runtime's source projection, permit a new
SDK graph on protected E2E hosts, qualify Pi, or pass candidate catalogs to the Jetson operator. A data-admission
comment is not permission to execute arbitrary candidate code on a protected
host. Those boundaries require their own supported implementation and validation;
passing the hash check is not full E2E qualification.
The protected runtime controller uses candidate approval for source projection as described under [Push and Manual PR E2E](#push-and-manual-pr-e2e).
Approval does not permit a new SDK dependency graph on protected E2E hosts, qualify Pi, or pass candidate catalogs to the Jetson operator.
Those boundaries require their own supported implementation and validation.
Passing the hash check is not full E2E qualification.

Unchanged runs pass the selected base revision and complete cohort receipt to every stock-onboarding consumer.
Changed-input runs pass the authenticated candidate catalog separately to those consumers.
Expand Down Expand Up @@ -2274,9 +2273,20 @@ Leave `targets` empty.
Keep `include_staging_brev_launchable=false`.
The candidate must contain `ci/protected-managed-image-multiarch-activation-v1.json` and `ci/protected-managed-image-runtime-activation-v1.json`.
The GPU job reads OpenShell sources from the candidate commit as data, then validates their pins and operational templates.
When the candidate needs trust absent from the controller's registry, preparation, both verifications, and restoration recheck the [candidate approval](#candidate-openshell-release-admission).
The approval must match the open PR, candidate commit, and base commit.
The approved registry and installer sources must match the candidate's committed files.
Candidates covered by the controller's registry need no additional approval.
The job exposes its GitHub token as `GITHUB_TOKEN` only to the four trusted source-projection steps, with `contents: read` and `pull-requests: read` permissions.
The token exists in those step environments and is absent from the live qualification environment.
It projects only the reviewed installer, supervisor and feature-check modules, plus version literals, into the trusted controller checkout.
It builds that controller after projection and verifies the projected sources before qualification.
It verifies the projected sources before installing the SDK or building the controller, then rechecks them before qualification.
The job restores the trusted sources after qualification and retains source-digest records with its artifacts.
An admission rejection changes no files.
A failed verification blocks qualification.
A failed restoration fails the job.
If admission fails after preparation, the projected checkout remains for diagnosis.
Inspect the job log and projection artifacts before recovering the runner or dispatching another run.
Those records identify tested inputs; they do not prove live E2E success.
The job also selects the candidate OpenShell SDK from the controller's reviewed current or replacement archives.
It projects the SDK identity into the trusted manifest and lockfile, then installs the verified archive before building the CLI.
Expand Down
50 changes: 35 additions & 15 deletions test/e2e/support/managed-image-protected-runtime-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,27 +118,47 @@ describe("protected managed-image runtime workflow", () => {
expect(validateManagedImageProtectedRuntimeWorkflow(value)).not.toEqual([]);
});

it("rejects missing source verification", () => {
it.each([
["Verify reviewed candidate OpenShell runtime before consumption", "run", "echo bypass"],
["Verify reviewed candidate OpenShell runtime before consumption", "if", "false"],
["Verify reviewed candidate OpenShell runtime before consumption", "continue-on-error", true],
["Verify reviewed candidate OpenShell runtime before consumption", "env", {}],
["Verify reviewed candidate OpenShell runtime", "run", "echo bypass"],
["Verify reviewed candidate OpenShell runtime", "if", "false"],
["Verify reviewed candidate OpenShell runtime", "continue-on-error", true],
["Verify reviewed candidate OpenShell runtime", "env", {}],
[
"Run all-agent GPU, local inference, rollback, and cleanup qualification",
"env",
{ GITHUB_TOKEN: "${{ github.token }}" },
],
])("rejects admission step %s with altered %s", (name, field, replacement) => {
const value = workflow();
namedStep(value, String(name))[String(field)] = replacement;
expect(validateManagedImageProtectedRuntimeWorkflow(value)).not.toEqual([]);
});

it("rejects consuming projected sources before verifying approval", () => {
const value = workflow();
const step = namedStep(
const job = runtimeJob(value);
const steps = job.steps as Array<Record<string, unknown>>;
const verify = namedStep(
value,
"Run all-agent GPU, local inference, rollback, and cleanup qualification",
"Verify reviewed candidate OpenShell runtime before consumption",
);
const command =
'node tools/e2e/protected-openshell-workspace.mts verify > "$E2E_ARTIFACT_DIR/openshell-projection-verified.json"';
step.run = String(step.run).replace(command, "");
const install = namedStep(value, "Install reviewed OpenShell SDK from trusted controller");
const withoutVerify = steps.filter((step) => step !== verify);
const index = withoutVerify.indexOf(install);
job.steps = [...withoutVerify.slice(0, index + 1), verify, ...withoutVerify.slice(index + 1)];
expect(validateManagedImageProtectedRuntimeWorkflow(value)).not.toEqual([]);
});

it("rejects source verification after qualification", () => {
const value = workflow();
const step = namedStep(
value,
"Run all-agent GPU, local inference, rollback, and cleanup qualification",
);
const command =
'node tools/e2e/protected-openshell-workspace.mts verify > "$E2E_ARTIFACT_DIR/openshell-projection-verified.json"';
step.run = `${String(step.run).replace(command, "")}\n${command}\n`;
const job = runtimeJob(value);
const steps = job.steps as Array<Record<string, unknown>>;
const verify = namedStep(value, "Verify reviewed candidate OpenShell runtime");
job.steps = [...steps.filter((step) => step !== verify), verify];
expect(validateManagedImageProtectedRuntimeWorkflow(value)).not.toEqual([]);
});

Expand Down Expand Up @@ -793,12 +813,12 @@ describe("protected managed-image runtime workflow", () => {
);
});

it("rejects protected runtime permissions beyond same-run artifact access", () => {
it("rejects protected runtime permissions beyond source and approval reads", () => {
const value = workflow();
runtimeJob(value).permissions = { actions: "read", contents: "read" };

expect(validateManagedImageProtectedRuntimeWorkflow(value)).toContain(
"managed-image-protected-runtime permissions must be exactly contents: read",
"managed-image-protected-runtime permissions must be exactly contents: read and pull-requests: read",
);
});

Expand Down
Loading