Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1133edf
fix(portable): preflight CPU delegation
prekshivyas Aug 15, 2026
068edc4
merge: update branch from main
cv Aug 15, 2026
a5fd107
fix(ci): run CPU delegation proof through Vitest
cv Aug 15, 2026
a55ddba
test(e2e): declare CPU delegation proof phases
cv Aug 15, 2026
bd8d014
fix(ci): run CPU delegation through live E2E
prekshivyas Aug 15, 2026
f158149
fix(ci): start proof after delegation setup
prekshivyas Aug 15, 2026
cf23f62
fix(ci): complete CPU delegation proof gates
prekshivyas Aug 15, 2026
6918d55
fix(ci): build shared contract before live proof
prekshivyas Aug 15, 2026
f943a48
fix(ci): activate CPU controller for proof user
prekshivyas Aug 15, 2026
34e0ffb
fix(ci): inspect the managed application slice
prekshivyas Aug 15, 2026
8b206d8
fix(ci): configure active proof user slice
prekshivyas Aug 15, 2026
f821404
merge: reconcile CPU delegation proof fixes
prekshivyas Aug 15, 2026
1f2a666
merge: preserve reviewed CPU delegation proof
prekshivyas Aug 15, 2026
7e20cb2
fix(ci): activate proof slice CPU controller
prekshivyas Aug 15, 2026
34e0800
fix(portable): harden CPU delegation recovery
prekshivyas Aug 15, 2026
8da8055
merge: combine protected CPU proof fixes
prekshivyas Aug 15, 2026
b0d5812
fix(ci): grant proof user checkout traversal
prekshivyas Aug 15, 2026
38e045b
fix(ci): stabilize CPU delegation proof
prekshivyas Aug 15, 2026
e756155
merge: preserve reviewed CPU proof
prekshivyas Aug 15, 2026
282fb72
merge: update branch from main
cv Aug 15, 2026
9c5a106
fix(ci): prepare writable CPU proof cache
cv Aug 15, 2026
afc0aec
docs(portable): stop failed delegation sequences
cv Aug 15, 2026
cd20a45
docs(portable): define rollback verification path
cv Aug 15, 2026
6d303ef
fix(portable): activate app slice CPU controller
cv Aug 15, 2026
5a50252
docs(portable): describe default CPU weight
cv Aug 15, 2026
4e458a9
fix(portable): complete CPU recovery guidance
cv Aug 15, 2026
decacce
merge(main): incorporate current CI requirements
cv Aug 15, 2026
7fc0121
merge(main): incorporate current CI requirements
cv Aug 15, 2026
527672c
fix(portable): create delegation drop-ins exclusively
cv Aug 15, 2026
b921d44
fix(portable): preserve drop-in failure boundaries
cv Aug 15, 2026
fee1582
fix(portable): publish delegation drop-ins atomically
cv Aug 15, 2026
c3c53cc
test(portable): keep drop-in helper linear
cv Aug 15, 2026
d83a458
merge(main): incorporate current CI requirements
prekshivyas Aug 15, 2026
775edee
merge: preserve reviewed CPU proof
prekshivyas Aug 15, 2026
9295c16
merge(main): incorporate current CI requirements
prekshivyas Aug 15, 2026
36ae5d1
merge: restore passing CPU delegation proof
prekshivyas Aug 15, 2026
03061bf
fix(ci): harden CPU proof cleanup receipts
prekshivyas Aug 15, 2026
97b2588
fix(ci): retain workspace mode receipts
prekshivyas Aug 15, 2026
e88c573
test(portable): execute rollback guidance
cv Aug 15, 2026
2e6770c
Merge branch 'codex/replace-pr9195-cpu-delegation' of github.com:NVID…
cv Aug 15, 2026
4286eb8
test(portable): cite CPU delegation issue
cv Aug 15, 2026
dfdcf71
test(docs): emulate Linux rollback tools
prekshivyas Aug 15, 2026
1c533a5
fix(portable): complete CPU delegation recovery
prekshivyas Aug 15, 2026
b47894a
test(docs): keep replaced inode allocated
prekshivyas Aug 15, 2026
3428aaa
ci(portable): extract CPU proof preparation
prekshivyas Aug 15, 2026
e820630
fix(onboard): harden portable CPU delegation admission
senthilr-nv Aug 16, 2026
c401745
fix(portable): activate the per-user CPU controller
senthilr-nv Aug 16, 2026
fc3e321
docs(portable): clarify CPU hierarchy verification
senthilr-nv Aug 16, 2026
3f053be
docs(portable): isolate CPU delegation guidance
senthilr-nv Aug 16, 2026
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
147 changes: 147 additions & 0 deletions .github/workflows/podman-cpu-proof.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ on:
- "src/lib/adapters/podman/**"
- "src/lib/onboard/docker-driver-gateway-*.ts"
- "src/lib/onboard/managed-bootstrap/podman-*.ts"
- "src/lib/onboard/experimental/portable-cpu-delegation-preflight*.ts"
- "src/lib/onboard/experimental/portable-demo-lifecycle.ts"
- "src/lib/onboard/runtime-provider/container-state-mutation.ts"
- "src/lib/onboard/runtime-provider/docker-state-mutation.ts"
- "src/lib/onboard/experimental/portable-host-preparation*.ts"
- "src/lib/onboard/runtime-provider/podman*.ts"
- "scripts/install-openshell.sh"
- "test/e2e/live/podman-cpu-lifecycle-artifacts.ts"
Expand All @@ -25,6 +27,7 @@ on:
- "test/e2e/live/podman-cpu-lifecycle.test.ts"
- "test/e2e/registry/native-runtime-qualification.ts"
- "test/e2e/support/native-runtime-qualification.test.ts"
- "test/e2e/live/portable-cpu-delegation-proof.test.ts"
- "src/lib/onboard/experimental/portable-demo-lifecycle.test.ts"
- "test/e2e/support/podman-cpu-proof-workflow.test.ts"

Expand All @@ -36,6 +39,150 @@ concurrency:
cancel-in-progress: true

jobs:
portable-cpu-delegation:
name: Portable CPU delegation admission on clean Ubuntu
runs-on: ubuntu-22.04
timeout-minutes: 15
env:
E2E_ARTIFACT_DIR: ${{ github.workspace }}/e2e-artifacts/portable-cpu-delegation
E2E_CPU_DELEGATION_USER: nemoclaw-e2e
E2E_SOURCE_REVISION: ${{ github.event.pull_request.head.sha }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22.19.0
cache: npm

- name: Install locked test dependencies
run: npm ci --ignore-scripts

- name: Prepare the clean user manager boundary
shell: bash
run: |
Comment thread
senthilr-nv marked this conversation as resolved.
Resolved
set -euo pipefail
if id "$E2E_CPU_DELEGATION_USER" >/dev/null 2>&1; then
printf 'Proof user already exists: %s\n' "$E2E_CPU_DELEGATION_USER" >&2
exit 1
fi
sudo useradd --create-home --shell /bin/bash "$E2E_CPU_DELEGATION_USER"
uid="$(id -u "$E2E_CPU_DELEGATION_USER")"
gid="$(id -g "$E2E_CPU_DELEGATION_USER")"
home="/home/${E2E_CPU_DELEGATION_USER}"
sudo loginctl enable-linger "$E2E_CPU_DELEGATION_USER"
sudo systemctl start "user@${uid}.service"
sudo install -d -m 0700 -o "$uid" -g "$gid" "$E2E_ARTIFACT_DIR"
{
printf 'E2E_CPU_DELEGATION_UID=%s\n' "$uid"
printf 'E2E_CPU_DELEGATION_HOME=%s\n' "$home"
printf 'E2E_CPU_DELEGATION_RUNTIME_DIR=/run/user/%s\n' "$uid"
} >>"$GITHUB_ENV"

- name: Prove missing delegation fails before effects
shell: bash
run: |
set -euo pipefail
drop_in_dir="/etc/systemd/system/user@.service.d"
sudo install -d -m 0755 "$drop_in_dir"
printf '[Service]\nDelegate=memory pids\n' \
| sudo tee "$drop_in_dir/90-nemoclaw-cpu-delegation.conf" >/dev/null
sudo systemctl daemon-reload
if ! sudo systemctl restart "user@${E2E_CPU_DELEGATION_UID}.service"; then
{
sudo systemctl --no-pager --full status \
"user@${E2E_CPU_DELEGATION_UID}.service" || true
sudo journalctl --no-pager --unit \
"user@${E2E_CPU_DELEGATION_UID}.service" --lines 200 || true
} | python3 test/e2e/lib/redact-text.py >&2
exit 1
fi
sudo --user "$E2E_CPU_DELEGATION_USER" env \
XDG_RUNTIME_DIR="$E2E_CPU_DELEGATION_RUNTIME_DIR" \
systemctl --user start app.slice
sudo --user "$E2E_CPU_DELEGATION_USER" env \
HOME="$E2E_CPU_DELEGATION_HOME" \
XDG_RUNTIME_DIR="$E2E_CPU_DELEGATION_RUNTIME_DIR" \
PATH="$PATH" \
E2E_ARTIFACT_DIR="$E2E_ARTIFACT_DIR" \
E2E_CPU_DELEGATION_STATE=missing \
E2E_CPU_DELEGATION_UID="$E2E_CPU_DELEGATION_UID" \
E2E_SOURCE_REVISION="$E2E_SOURCE_REVISION" \
E2E_TARGET_ID=portable-cpu-delegation \
sh -c 'cd "$1" && NEMOCLAW_RUN_LIVE_E2E=1 npx vitest run --project e2e-live test/e2e/live/portable-cpu-delegation-proof.test.ts' \
sh "$GITHUB_WORKSPACE"

- name: Apply administrator delegation and prove admission
shell: bash
run: |
set -euo pipefail
drop_in="/etc/systemd/system/user@.service.d/90-nemoclaw-cpu-delegation.conf"
printf '[Service]\nDelegate=cpu memory pids\n' | sudo tee "$drop_in" >/dev/null
sudo systemctl daemon-reload
if ! sudo systemctl restart "user@${E2E_CPU_DELEGATION_UID}.service"; then
{
sudo systemctl --no-pager --full status \
"user@${E2E_CPU_DELEGATION_UID}.service" || true
sudo journalctl --no-pager --unit \
"user@${E2E_CPU_DELEGATION_UID}.service" --lines 200 || true
} | python3 test/e2e/lib/redact-text.py >&2
exit 1
fi
sudo --user "$E2E_CPU_DELEGATION_USER" env \
XDG_RUNTIME_DIR="$E2E_CPU_DELEGATION_RUNTIME_DIR" \
systemctl --user start app.slice
sudo --user "$E2E_CPU_DELEGATION_USER" env \
HOME="$E2E_CPU_DELEGATION_HOME" \
XDG_RUNTIME_DIR="$E2E_CPU_DELEGATION_RUNTIME_DIR" \
PATH="$PATH" \
E2E_ARTIFACT_DIR="$E2E_ARTIFACT_DIR" \
E2E_CPU_DELEGATION_STATE=delegated \
E2E_CPU_DELEGATION_UID="$E2E_CPU_DELEGATION_UID" \
E2E_SOURCE_REVISION="$E2E_SOURCE_REVISION" \
E2E_TARGET_ID=portable-cpu-delegation \
sh -c 'cd "$1" && NEMOCLAW_RUN_LIVE_E2E=1 npx vitest run --project e2e-live test/e2e/live/portable-cpu-delegation-proof.test.ts' \
sh "$GITHUB_WORKSPACE"

- name: Restore the user manager boundary
if: always()
shell: bash
run: |
set -euo pipefail
cleanup_status=0
sudo rm -f /etc/systemd/system/user@.service.d/90-nemoclaw-cpu-delegation.conf
sudo systemctl daemon-reload
if id "$E2E_CPU_DELEGATION_USER" >/dev/null 2>&1; then
uid="$(id -u "$E2E_CPU_DELEGATION_USER")"
if ! sudo systemctl stop "user@${uid}.service"; then
{
sudo systemctl --no-pager --full status "user@${uid}.service" || true
sudo journalctl --no-pager --unit "user@${uid}.service" --lines 200 || true
} | python3 test/e2e/lib/redact-text.py >&2
cleanup_status=1
fi
sudo loginctl disable-linger "$E2E_CPU_DELEGATION_USER" || cleanup_status=1
sudo userdel --remove "$E2E_CPU_DELEGATION_USER" || cleanup_status=1
fi
if [ -d "$E2E_ARTIFACT_DIR" ]; then
sudo chown -R "$(id -u):$(id -g)" "$E2E_ARTIFACT_DIR" || cleanup_status=1
fi
exit "$cleanup_status"

- name: Upload CPU delegation evidence
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: portable-cpu-delegation-${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}
path: e2e-artifacts/portable-cpu-delegation/
include-hidden-files: false
if-no-files-found: error
retention-days: 14

podman-cpu-lifecycle:
name: Rootless Podman CPU lifecycle with Docker disabled
runs-on: ubuntu-26.04
Expand Down
84 changes: 84 additions & 0 deletions docs/reference/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3329,6 +3329,90 @@ Then rerun portable onboarding:
$$nemoclaw onboard --experimental-profile portable
```

### Portable CPU Delegation Preflight Fails

The portable experimental profile requires the current user's systemd hierarchy to expose the `cpu` cgroup controller to `app.slice`.
NemoClaw checks this requirement before it writes portable configuration, activates services, starts the registry, builds an image, or creates a sandbox.
The credential-free preflight reads only `cgroup.controllers` files under `/sys/fs/cgroup`.

The error identifies the hierarchy boundary that failed:

| Reported condition | Meaning | Recovery |
| --- | --- | --- |
| cgroups v2 is unavailable | `/sys/fs/cgroup/cgroup.controllers` is missing or unreadable. | Ask an administrator to boot a Linux host with a readable cgroups v2 mount. |
| The kernel hierarchy does not expose `cpu` | The root `cgroup.controllers` file does not contain the `cpu` controller. | Ask an administrator to enable the `cpu` controller in the host's kernel cgroup hierarchy. |
| systemd did not delegate `cpu` to the current user's manager | The user manager's `cgroup.controllers` file is missing, unreadable, or does not contain `cpu`. | Apply the `user@.service` delegation procedure below. |
| `cpu` is unavailable to the current user's `app.slice` | The `app.slice` `cgroup.controllers` file is missing, unreadable, or does not contain `cpu` for this boot. | Restart the current user's manager or reboot the host, then verify all three boundaries below. |

The systemd delegation change requires administrator access.
NemoClaw does not edit `/etc/systemd/system`, invoke `sudo`, remove the sandbox CPU limit, or continue with weaker resource isolation.

<Warning>
The `user@.service` template applies to every user manager on the host.
Restarting `user@<uid>.service` stops and starts the current user's systemd services, including rootless Podman and other user services.
Plan this interruption with the host administrator before applying the change.
</Warning>

Record the affected user's numeric ID:

```bash
uid="$(id -u)"
printf 'Current user ID: %s\n' "$uid"
```

Ask an administrator to open a systemd drop-in for the user-manager template:

```bash
sudo systemctl edit user@.service
```

Add this exact content, then save and close the editor:

```ini
[Service]
Delegate=cpu memory pids
```

Reload systemd and restart the affected user's manager:

```bash
sudo systemctl daemon-reload
sudo systemctl restart "user@${uid}.service"
systemctl --user start app.slice
```

`daemon-reload` makes the drop-in visible, but it does not update an existing user manager.
The `user@<uid>.service` restart or a host reboot is required before `app.slice` can receive the new controller delegation.
The administrator's `sudo` policy can request authentication, but NemoClaw never receives that credential.

Verify the root hierarchy, current user manager, and `app.slice`:

```bash
uid="$(id -u)"
user_manager="/sys/fs/cgroup/user.slice/user-${uid}.slice/user@${uid}.service"

for controllers in \
/sys/fs/cgroup/cgroup.controllers \
"${user_manager}/cgroup.controllers" \
"${user_manager}/app.slice/cgroup.controllers"
do
printf '%s: ' "$controllers"
if grep -qw cpu "$controllers"; then
echo cpu
else
echo missing
fi
done
```

Continue only when all three lines end in `: cpu`.
This verification reads no credentials.
Then rerun portable onboarding:

```bash
$$nemoclaw onboard --experimental-profile portable
```

### Portable Podman Readiness Fails

Portable commands use the current user's rootless Podman socket authority recorded in NemoClaw state.
Expand Down
Loading
Loading