Skip to content

Commit e884958

Browse files
committed
fix(providers): preserve stable placeholders in split supervisor
Reconcile the stable-placeholder branch with the separate supervisor and workload boundary. Keep stable delivery metadata and capability checks on startup, refresh, failure recovery, rotation, and detach. Transfer only the prepared environment to workload processes. Adapt the persistent-process E2E fixture to install its backend trust root in the supervisor image, run its backend on the private Docker bridge, and restore the wrapper-owned gateway configuration. Preserve archive ownership and use host-visible TLS fixture paths for containerized CI. Regenerate the merged public bindings and retain stored-data compatibility coverage for both branches. Signed-off-by: Shiju <shiju@nvidia.com>
2 parents 0328b36 + b3e4ad4 commit e884958

430 files changed

Lines changed: 70719 additions & 33855 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/build-openshell-mxc-windows/SKILL.md‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The lane targets a Windows host with Visual Studio Build Tools and rustup.
115115
| Visual C++ ARM64 tools | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.ARM64 -property installationPath` | Required for native ARM64 check, build, and tests and for x64-to-ARM64 check/build. Tests always require a native runner. |
116116
| Visual C++ ARM64 Spectre-mitigated libraries | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre -property installationPath` | Required by `regorus` through `msvc_spectre_libs`; the build fails when the selected MSVC toolset lacks `lib\spectre\arm64`. |
117117
| Visual C++ Clang tools | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Llvm.Clang -property installationPath` | Provides host-native `libclang.dll` for `bindgen` and `clang-cl.exe` for ARM64 crypto dependencies such as `aws-lc-sys`. On ARM64, the wrapper uses `VC\Tools\Llvm\Arm64\bin`. |
118-
| Visual C++ CMake tools | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.CMake.Project -property installationPath` | Provides CMake and Ninja for bundled Z3 and other native dependencies. The x64-to-ARM64 path adds Ninja to `PATH`; Z3 uses MSVC's Visual Studio generator. |
118+
| Visual C++ CMake tools | `vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.CMake.Project -property installationPath` | Provides CMake and Ninja for native dependencies. The x64-to-ARM64 path adds Ninja to `PATH`; Z3 uses an architecture-specific prebuilt release. |
119119
| Windows SDK | `where.exe rc.exe` from a Developer PowerShell | Install an SDK containing target libraries and ARM64 tools. |
120120
| Rust via rustup | `rustc --version` | Add each target being validated: `x86_64-pc-windows-msvc` and/or `aarch64-pc-windows-msvc`. The wrapper also adds the selected target. |
121121
| mise | `mise --version` | Used as a task runner only. |
@@ -135,6 +135,8 @@ from this skill.
135135
| `CARGO_TARGET_DIR` | `target` under repo root | Override Cargo output location. Use a short absolute path when x64-to-ARM64 builds approach Windows path-length limits. |
136136
| `Z3_LIBRARY_PATH_OVERRIDE` | unset | Directory containing an x64 system `libz3.lib`; not valid for ARM64. |
137137
| `Z3_SYS_Z3_HEADER` | unset | Full `z3.h` path required with a system Z3 library. |
138+
| `Z3_SYS_Z3_VERSION` | `4.16.0` | Pinned official prebuilt Z3 release selected by the wrapper. |
139+
| `READ_ONLY_GITHUB_TOKEN` | unset | Optional token for the Z3 release lookup; GitHub Actions supplies `github.token`. |
138140
| `RUSTC_WRAPPER` | inherited | The wrapper resolves an available command to an absolute path. If it is unavailable, the wrapper warns and continues without compiler caching. |
139141

140142
Legacy fork variables such as `OPENSHELL_UPSTREAM`,
@@ -203,8 +205,7 @@ jobs in the current mirror push run, or push a new mirrored commit. The binaries
203205
The ARM64 check/build steps in this x64-host contract are cross-builds. The
204206
wrapper discovers and adds host-native LLVM and Ninja to `PATH`, requires the
205207
ARM64 compiler and Spectre-mitigated libraries, lets ARM64 crypto crates select
206-
`clang-cl`, and builds bundled Z3 with native MSVC `cl.exe` and the Visual
207-
Studio generator.
208+
`clang-cl`, and downloads the official prebuilt ARM64 Z3 static library.
208209

209210
On ARM64 hosts, validate the native ARM64 check, build, and test path. The
210211
wrapper rejects test targets that do not match the host architecture, so x64
@@ -213,6 +214,10 @@ compatibility under emulation is not part of these tasks. The aggregate
213214
commands above on an ARM64 host.
214215

215216
The repository-wide `mise run pre-commit` task is also supported on Windows.
217+
Run `rust:lockfiles:check`, `sdk:ts:ci`, `go:ci`, and `test:e2e-parity` through
218+
the Windows-aware tasks when validating those surfaces. Do not count the Go
219+
Windows ARM64 race-detector exclusion or POSIX permission-bit skips as security
220+
coverage. SDK test dependencies must remain at their lockfile versions.
216221
Its Rust check, Clippy, and test dependencies enter the same MSVC environment
217222
for the native host target and use an inherited compiler wrapper when it is
218223
available. Linux glibc
@@ -311,12 +316,13 @@ Useful log files:
311316
| `test-x86_64-pc-windows-msvc-unsupported-*.log` | Focused unsupported-driver contract output. |
312317
| `test-aarch64-pc-windows-msvc-unsupported-*.log` | Focused native ARM64 contract output. |
313318

314-
The first check builds bundled Z3 from source through `z3-sys`. Cargo stores the
315-
native build output in its target tree, so the Windows target cache reuses it.
316-
The resulting release executables do not require `libz3.dll`. The artifact
317-
report computes SHA256 through .NET directly and does not rely on the
318-
`Get-FileHash` module being available inside the mise-launched Windows
319-
PowerShell process.
319+
The first check downloads the pinned official Z3 archive for the target
320+
architecture through `z3-sys`. GitHub Actions authenticates the lookup with its
321+
read-only workflow token; local users can set `READ_ONLY_GITHUB_TOKEN` if an
322+
unauthenticated lookup is rate-limited. Cargo stores the extracted library in
323+
its target tree, so the Windows target cache reuses it. The artifact report
324+
computes SHA256 through .NET directly and does not rely on the `Get-FileHash`
325+
module being available inside the mise-launched Windows PowerShell process.
320326

321327
## Common Fix Patterns
322328

‎.agents/skills/build-openshell-mxc-windows/reference.md‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ file.
6868
For ARM64, verify the Visual Studio instance contains the ARM64 MSVC tools,
6969
ARM64 Spectre-mitigated libraries, Clang tools, CMake tools, and a Windows SDK.
7070
Clang supplies host-native `libclang.dll` for `bindgen` and `clang-cl.exe` for
71-
ARM64 crypto dependencies such as `aws-lc-sys`. Native builds use the normal
72-
bundled-Z3 CMake path. An x64-to-ARM64 check/build discovers and adds
73-
host-native Ninja to `PATH`, builds bundled Z3 with native MSVC `cl.exe` and
74-
the Visual Studio generator, and lets the crypto crates select `clang-cl`. Use
75-
a short `CARGO_TARGET_DIR` if Windows path-length limits are reached.
71+
ARM64 crypto dependencies such as `aws-lc-sys`. Native and
72+
x64-to-ARM64 builds use the official prebuilt Z3 4.16.0 static library for the
73+
target architecture. An x64-to-ARM64 check/build discovers and adds host-native
74+
Ninja to `PATH`, while the crypto crates select `clang-cl`. Use a short
75+
`CARGO_TARGET_DIR` if Windows path-length limits are reached.
7676

7777
## Unsupported Driver Rules
7878

@@ -112,16 +112,18 @@ top-level workspace targets for check/test:
112112
--exclude openshell-driver-vault
113113
--exclude openshell-driver-vm
114114
--exclude openshell-sandbox
115-
--exclude openshell-supervisor-network
115+
--exclude openshell-supervisor
116116
--exclude openshell-supervisor-process
117117
--exclude openshell-vfio
118118
```
119119

120120
The gateway keeps platform configuration and unsupported-operation contracts
121-
without depending on the Docker, Kubernetes, Podman, sandbox supervisor,
122-
process supervisor, VM, or VFIO runtime crates. The Kubernetes Secrets and
123-
Vault libraries still compile as gateway dependencies; only their standalone
124-
Unix-socket binaries and package-level tests are excluded as top-level targets.
121+
without depending on the Docker, Kubernetes, Podman, sandbox runtime,
122+
standalone supervisor, supervisor process runtime, VM, or VFIO crates. The MXC
123+
driver does depend on the cross-platform supervisor network library for its host
124+
egress proxy. The Kubernetes Secrets and Vault libraries still compile as
125+
gateway dependencies; only their standalone Unix-socket binaries and
126+
package-level tests are excluded as top-level targets.
125127

126128
## Common Errors
127129

‎.agents/skills/helm-dev-environment/SKILL.md‎

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,15 @@ mise run helm:skaffold:dev
6969
mise run helm:skaffold:run
7070
```
7171

72-
**Supervisor sidecar topology** (build once and leave running):
73-
```bash
74-
mise run helm:skaffold:run:sidecar
75-
```
76-
77-
**Supervisor sidecar topology with TLS/mTLS enabled** (build once and leave running):
78-
```bash
79-
mise run helm:skaffold:run:sidecar-mtls
80-
```
81-
82-
Both commands build the `gateway` and `supervisor` images and deploy the OpenShell Helm
83-
chart. The sidecar profile renders an `openshell-network-init` init container for
84-
nftables setup and an `openshell-supervisor-network` runtime sidecar for proxying.
85-
Binary-aware policy mode runs that sidecar as UID 0 with `SYS_PTRACE` and
86-
`DAC_READ_SEARCH`; relaxed mode can run it as the configured proxy UID, which
87-
must be at least `1000` and distinct from the workload UID. The
88-
sidecar-mTLS profile reuses `ci/values-sidecar.yaml` and restores
89-
`server.disableTls=false` inline for Skaffold. The `pkiInitJob` hook (a pre-install
90-
Job that runs `openshell-gateway generate-certs`) generates mTLS secrets on first
91-
install. The default Skaffold values export gateway and Kubernetes-driver traces to
92-
the collector service installed by `helm:k3s:create`. Envoy Gateway opt-in; see the
93-
Optional Add-ons section below.
72+
The Skaffold flow builds distinct `gateway`, `sandbox`, and `supervisor` images
73+
and deploys the OpenShell Helm chart. The Kubernetes driver creates a
74+
capability-free workload Pod and a directly managed capability-free supervisor
75+
Pod. One namespace-wide NetworkPolicy denies direct egress from every OpenShell
76+
workload Pod. The
77+
`pkiInitJob` hook (a pre-install Job that runs `openshell-gateway generate-certs`)
78+
generates mTLS secrets on first install. The default Skaffold values export
79+
gateway and Kubernetes-driver traces to the collector service installed by
80+
`helm:k3s:create`. Envoy Gateway is opt-in; see the Optional Add-ons section.
9481

9582
The gateway Service uses ClusterIP. Access is via Envoy Gateway (port `8080`) or
9683
the unified local forwarding task:
@@ -102,9 +89,9 @@ mise run helm:k3s:forward
10289
The task forwards OTLP/gRPC to `http://127.0.0.1:4317` and the trace UI to
10390
`http://127.0.0.1:18888`. When Skaffold has deployed a Kubernetes gateway, it
10491
also forwards the gateway to `http://127.0.0.1:8090`; otherwise it continues
105-
with the collector ports only. A successful plaintext `helm:skaffold:run` or
106-
`helm:skaffold:run:sidecar` registers the gateway under the worktree-specific
107-
k3d cluster name and selects it as the active gateway. Keep the forwarding
92+
with the collector ports only. A successful plaintext `helm:skaffold:run`
93+
registers the gateway under the worktree-specific k3d
94+
cluster name and selects it as the active gateway. Keep the forwarding
10895
task running while using those endpoints.
10996

11097
### Viewing local traces
@@ -134,8 +121,7 @@ create the Secret named `openshell-ha-pg` with a `uri` key, then run
134121
### TLS behaviour
135122

136123
`ci/values-skaffold.yaml` sets `server.disableTls: true`, so Skaffold-based deploys run
137-
plaintext by default. To test sidecar topology with TLS enabled, use
138-
`mise run helm:skaffold:run:sidecar-mtls`.
124+
plaintext by default. Override `server.disableTls=false` to exercise TLS/mTLS.
139125

140126
| Mode | `server.disableTls` | Gateway scheme |
141127
|------|---------------------|----------------|
@@ -188,12 +174,6 @@ openshell sandbox list --gateway-endpoint https://localhost:8090
188174
mise run helm:skaffold:delete
189175
```
190176

191-
For a sidecar-profile deployment:
192-
193-
```bash
194-
mise run helm:skaffold:delete:sidecar
195-
```
196-
197177
### Delete the cluster entirely
198178

199179
```bash
@@ -256,15 +236,19 @@ Key Helm values:
256236

257237
### Keycloak OIDC
258238

259-
One-time setup — only needed once per cluster lifetime:
239+
Initial setup — rerun it whenever you want to rotate the development CA:
260240

261241
```bash
262242
mise run keycloak:k8s:setup
263243
```
264244

265245
This deploys Keycloak (`quay.io/keycloak/keycloak:24.0`) into the `keycloak` namespace,
266-
imports the openshell realm from `scripts/keycloak-realm.json`, and prints a port-forward
267-
command for acquiring tokens from the CLI.
246+
imports the openshell realm from `scripts/keycloak-realm.json`, generates a short-lived
247+
development TLS certificate, and publishes its trust anchor as the
248+
`openshell-keycloak-ca` ConfigMap in the OpenShell namespace. The command prints a
249+
port-forward command for acquiring tokens from the CLI. Rerunning setup rotates the
250+
development certificate and trust anchor; redeploy the gateway afterward so it reloads
251+
the mounted CA bundle.
268252

269253
Then activate OIDC in the OpenShell Helm chart:
270254
1. Uncomment `#- ci/values-keycloak.yaml` in `skaffold.yaml`
@@ -288,12 +272,31 @@ SPIFFE JWT-SVIDs for dynamic provider token grants:
288272
`openshell.local` and adds a `ClusterSPIFFEID` that maps sandbox pod
289273
annotations to `spiffe://openshell.local/openshell/sandbox/<sandbox-id>`.
290274
OpenShell mounts the SPIFFE CSI Workload API socket at
291-
`/spiffe-workload-api/spire-agent.sock` into sandbox pods for provider token
275+
`/spiffe-workload-api/spire-agent.sock` only into supervisor Pods for provider token
292276
grants. Supervisor-to-gateway authentication remains on the Kubernetes
293277
ServiceAccount bootstrap and gateway-minted sandbox JWT path; the selected
294278
Kubernetes compute driver validates the projected token before the gateway
295279
mints its JWT.
296280

281+
### Vault Credential Driver
282+
283+
The `credential-driver-vault` Skaffold profile applies
284+
`ci/values-credential-driver-vault.yaml`. Its external OpenBao/Vault backend
285+
must expose HTTPS at the configured service DNS name and publish the issuing CA
286+
certificate as the `ca.crt` key in the `openbao-ca` ConfigMap. Local e2e uses
287+
OpenBao dev TLS and an `openbao-0` DNS alias matching its generated certificate.
288+
The Helm value
289+
`server.credentialDrivers.vault.caConfigMapName` mounts that key into the
290+
gateway and renders the driver's `ca_bundle` setting. Non-loopback HTTP
291+
addresses fail gateway startup, and hostname verification requires the service
292+
DNS name in the server certificate SANs.
293+
294+
```bash
295+
cd deploy/helm/openshell
296+
skaffold run -p credential-driver-vault
297+
kubectl -n openshell logs statefulset/openshell -c openshell-gateway --tail=200
298+
```
299+
297300
---
298301

299302
## Cluster Lifecycle (stop/start)
@@ -349,10 +352,10 @@ for dependencies still declared in `Chart.yaml`.
349352
| `deploy/helm/openshell/ci/values-gateway.yaml` | Envoy Gateway GRPCRoute + Gateway overlay |
350353
| `deploy/helm/openshell/ci/values-high-availability.yaml` | HA test overlay (`replicaCount: 2` with external PostgreSQL Secret) |
351354
| `deploy/helm/openshell/ci/values-keycloak.yaml` | Keycloak OIDC overlay |
352-
| `deploy/helm/openshell/ci/values-sidecar.yaml` | Supervisor sidecar topology overlay for Kubernetes e2e/dev |
353355
| `deploy/helm/openshell/ci/values-spire.yaml` | SPIFFE/SPIRE provider token grant overlay |
354356
| `deploy/helm/openshell/ci/values-spire-stack.yaml` | SPIRE hardened chart values for local dev |
355357
| `deploy/helm/openshell/ci/values-tls-disabled.yaml` | Lint-only: TLS + auth disabled (reverse-proxy edge termination) |
358+
| `deploy/helm/openshell/ci/values-credential-driver-vault.yaml` | Vault credential-driver validation overlay with HTTPS and private-CA trust |
356359
| `deploy/kube/manifests/envoy-gateway-openshell.yaml` | GatewayClass for Envoy Gateway (`mise run helm:gateway:apply`) |
357360
| `tasks/scripts/helm-k3s-local.sh` | k3d cluster create/delete/start/stop/status |
358-
| `tasks/scripts/keycloak-k8s-setup.sh` | Keycloak deploy + realm import |
361+
| `tasks/scripts/keycloak-k8s-setup.sh` | Keycloak deploy, realm import, and development TLS trust anchor |

0 commit comments

Comments
 (0)