Skip to content

Commit b74144e

Browse files
committed
refactor(compute): decouple gateway driver composition
Move first-party composition and VM process ownership into openshell-gateway, leaving openshell-server backend-independent. Update packaging and build references with the new crate, simplify the compiled-driver boundary, and keep the driver-free gateway path buildable with bundled Z3 tooling. Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent 02f11e2 commit b74144e

64 files changed

Lines changed: 1538 additions & 2025 deletions

Some content is hidden

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

‎.agents/skills/debug-openshell-cluster/SKILL.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ The target deployment flow is:
1919
4. The CLI registers a reachable gateway endpoint with `openshell gateway add`.
2020
5. The gateway creates sandboxes through the selected compute driver.
2121

22-
The standard gateway binary explicitly installs its compiled Docker, Podman,
23-
Kubernetes, and VM registrations at startup. With no configured driver, the
22+
The `openshell-gateway` composition crate explicitly installs its compiled
23+
Docker, Podman, Kubernetes, and VM registrations at startup; `openshell-server`
24+
does not link compute-driver crates. With no configured driver, the
2425
gateway probes only installed registrations in priority order (Kubernetes,
2526
Podman, then Docker); VM has no probe and remains opt-in. A custom gateway
2627
binary may install a different set, so confirm the binary's registered drivers

‎.github/workflows/release-dev.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ jobs:
442442
run: |
443443
set -euo pipefail
444444
mise x -- rustup target add ${{ matrix.target }}
445-
mise x -- cargo zigbuild --release --target ${{ matrix.zig_target }} -p openshell-server --bin openshell-gateway --features bundled-z3
445+
mise x -- cargo zigbuild --release --target ${{ matrix.zig_target }} -p openshell-gateway --bin openshell-gateway --features bundled-z3
446446
mkdir -p artifacts/bin
447447
install -m 0755 target/${{ matrix.target }}/release/openshell-gateway artifacts/bin/openshell-gateway
448448

‎.github/workflows/release-tag.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ jobs:
478478
run: |
479479
set -euo pipefail
480480
mise x -- rustup target add ${{ matrix.target }}
481-
mise x -- cargo zigbuild --release --target ${{ matrix.zig_target }} -p openshell-server --bin openshell-gateway --features bundled-z3
481+
mise x -- cargo zigbuild --release --target ${{ matrix.zig_target }} -p openshell-gateway --bin openshell-gateway --features bundled-z3
482482
mkdir -p artifacts/bin
483483
install -m 0755 target/${{ matrix.target }}/release/openshell-gateway artifacts/bin/openshell-gateway
484484

‎.github/workflows/rust-native-build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
124124
case "$COMPONENT" in
125125
gateway)
126-
crate=openshell-server
126+
crate=openshell-gateway
127127
binary=openshell-gateway
128128
zig_target=
129129
;;

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ These pipelines connect skills into end-to-end workflows. Individual skill files
4040
| `crates/openshell-otel/` | OpenTelemetry support | Shared OTLP trace provider, resource, and tracing-layer construction |
4141
| `crates/openshell-core/` | Shared core | Common types, configuration, error handling |
4242
| `crates/openshell-extension-core/` | Extension core | Shared extension identity, JWT claims, bearer-token rotation, and TLS transport primitives |
43+
| `crates/openshell-gateway/` | Gateway binary composition | Links selected first-party compute drivers into the backend-agnostic server registry |
4344
| `crates/openshell-sdk/` | Shared client SDK | Async Rust gateway client (gRPC transport, TLS, OIDC refresh, edge tunnel); consumed by CLI, TUI, and `@openshell/sdk` |
4445
| `crates/openshell-providers/` | Provider management | Credential provider backends |
4546
| `crates/openshell-tui/` | Terminal UI | Ratatui-based dashboard for monitoring |

‎Cargo.lock‎

Lines changed: 23 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ OpenShell collects anonymous telemetry to help improve the project for developer
258258

259259
Disable telemetry at runtime by setting `OPENSHELL_TELEMETRY_ENABLED=false` on the gateway deployment. For Helm installs, set `server.telemetryEnabled=false`. OpenShell propagates this deployment setting into sandbox supervisor environments so sandbox-side telemetry collection is disabled as well.
260260

261-
You can also compile telemetry out entirely. Telemetry support is a default-on `telemetry` Cargo feature; building with `--no-default-features` produces binaries that contain no telemetry endpoint, no telemetry HTTP client, and no emission code. Build telemetry-free artifacts with, for example, `cargo build --release -p openshell-server --no-default-features` (gateway) and the equivalent for `openshell-sandbox` and `openshell-driver-vm`. With telemetry compiled out, the gateway emits nothing and reports telemetry disabled to the sandboxes it launches.
261+
You can also compile telemetry out entirely. Telemetry support is a default-on `telemetry` Cargo feature; building with `--no-default-features` produces binaries that contain no telemetry endpoint, no telemetry HTTP client, and no emission code. Build a telemetry-free gateway with `cargo build --release -p openshell-gateway --no-default-features --features in-tree-compute-drivers`, and use the equivalent feature selection for `openshell-sandbox` and `openshell-driver-vm`. With telemetry compiled out, the gateway emits nothing and reports telemetry disabled to the sandboxes it launches.
262262

263263
Telemetry events are limited to anonymous operational categories and counts, such as sandbox lifecycle outcomes, provider profile buckets, policy decision counts, and aggregate network activity denial categories. OpenShell telemetry does not collect sandbox names or IDs, hostnames, file paths, binary paths, prompts, credentials, provider names, model names, or user content.
264264

‎architecture/build.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Sandbox community images are built outside this repository.
2626
Anonymous telemetry emission is gated behind a default-on `telemetry` Cargo
2727
feature. It is defined in `openshell-core` (where the emission code, HTTP
2828
client, and endpoint live) and forwarded by the binary crates that emit or
29-
collect telemetry: `openshell-server` (gateway), `openshell-sandbox`
29+
collect telemetry: `openshell-gateway`, `openshell-sandbox`
3030
(supervisor), and `openshell-driver-vm`. Every crate depends on
3131
`openshell-core` with `default-features = false`, so the binary crate's feature
3232
is the single switch that enables `openshell-core/telemetry` for its build

‎architecture/compute-runtimes.md‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ of re-querying drivers on each request.
9696
The gateway binary explicitly installs the compute drivers compiled into that
9797
binary before entering server startup. The server selects a configured driver
9898
by normalized registry name. When no driver is configured, it evaluates only
99-
the installed drivers' probes in registered priority order, records every
100-
available registration, and selects the first. Drivers without a probe,
101-
including VM, remain opt-in.
99+
the installed drivers' probes and chooses the lowest registered priority.
100+
Drivers without a probe, including VM, remain opt-in.
102101

103102
Startup computes this selection once after merging configuration. The same
104103
selection drives authentication defaults and runtime construction, so a probe
@@ -110,17 +109,18 @@ registry. Adding or removing a compiled driver therefore changes registration
110109
rather than the server's selection flow. Alternate gateway binaries can install
111110
their own `ComputeDriverFactory` registrations and hand the completed registry
112111
to `run_cli_with_compute_drivers`; factories receive merged driver config and
113-
finish through the same in-process runtime adapter. A configured UDS endpoint
114-
still takes precedence over a compiled registration with the same name.
115-
116-
The standard server crate groups first-party registrations behind the
117-
`in-tree-compute-drivers` feature. Protocol-only gateway builds disable that
118-
feature and link no compute-driver crates. E2E lanes compose that gateway with
119-
Docker, Podman, Kubernetes, and VM driver executables over the public UDS gRPC
120-
contract so an in-tree driver cannot silently depend on a server-only API.
121-
External Kubernetes drivers support shared and managed workspace modes.
122-
Operator mode requires an in-process dynamic namespace allowlist and is
123-
rejected when Kubernetes is configured through an external endpoint.
112+
return either an in-process driver or a gateway-managed remote endpoint. The
113+
server constructs the common runtime adapter and snapshots `GetCapabilities`
114+
for either result. A configured UDS endpoint still takes precedence over a
115+
compiled registration with the same name.
116+
117+
The `openshell-gateway` composition crate groups first-party registrations
118+
behind the `in-tree-compute-drivers` feature. `openshell-server` has no compute
119+
driver dependencies or backend-name dispatch. Protocol-only gateway builds
120+
disable the composition feature and link no compute-driver crates. E2E lanes
121+
compose that gateway with Docker, Podman, Kubernetes, and VM driver executables
122+
over the public UDS gRPC contract so an in-tree driver cannot silently depend
123+
on a server-only API.
124124

125125
## Stop and Start Lifecycle
126126

@@ -419,13 +419,13 @@ image-pull Secrets in every operator-managed namespace.
419419

420420
**Operator** uses pre-provisioned namespaces discovered through two optional
421421
sources: a K8s label selector (`operator_namespace_label`) and a drop-in
422-
allowlist file (`operator_namespace_file`). At least one must be configured.
423-
The `OperatorNamespaceAllowlist` (`Arc<RwLock<BTreeSet<String>>>`) is populated
424-
at runtime by background watchers and read by the namespace resolver. Sandbox
425-
creation fails closed if the workspace is not in the current allowlist. Platform
426-
teams manage namespace lifecycle externally. RBAC uses the same ClusterRole as
427-
managed mode but without namespace `create`/`delete` or ServiceAccount
428-
permissions.
422+
allowlist file (`operator_namespace_file`). Exactly one must be configured.
423+
The compute driver and the gateway's ServiceAccount authenticator independently
424+
watch that public config source; no in-process driver state crosses into the
425+
server. Sandbox creation and token bootstrap fail closed if the workspace is
426+
not in the current allowlist. Platform teams manage namespace lifecycle
427+
externally. RBAC uses the same ClusterRole as managed mode but without namespace
428+
`create`/`delete` or ServiceAccount permissions.
429429

430430
### Watching and Querying
431431

0 commit comments

Comments
 (0)