You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2de7d99
Browse filesBrowse the repository at this point in the historyBrowse files
Document how the gateway finds, trusts, starts, and validates the VM and Podman driver binaries, including probe and preflight, and note that guest_tls_ca belongs at gateway scope.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
Copy file name to clipboardExpand all lines: crates/openshell-driver-vm/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,7 +174,7 @@ Select the VM driver with `--compute-driver vm`, `OPENSHELL_COMPUTE_DRIVER=vm`,
174
174
|`mem_mib`|`2048`| Memory per sandbox, in MiB. |
175
175
|`overlay_disk_mib`|`4096`| Sparse writable overlay disk size per sandbox, in MiB. |
176
176
|`krun_log_level`|`1`| libkrun verbosity (0-5). |
177
-
|`guest_tls_ca`|unset|Historical key name forthe host supervisor's gateway CA certificate. Required when `grpc_endpoint` uses `https://`; never copied into the guest. |
177
+
|`guest_tls_ca`|rejected|Not accepted in this table. Set `guest_tls_ca` under `[openshell.gateway]`;the gateway passes it to the driver, which uses it as the host supervisor's gateway CA certificatewhen the endpoint is `https://`. It is never copied into the guest. |
178
178
| `https_proxy` | unset | Corporate forward proxy (`http://host:port` or `https://host:port`) that host control chains policy-approved TLS CONNECT egress through. Host-loopback proxy URLs work because control runs on the gateway host. |
179
179
| `no_proxy` | unset | Comma-separated bypass list for the corporate proxy only. OpenShell policy evaluation still applies. |
180
180
| `proxy_auth_file` | unset | Gateway-host path to a validated `user:pass` credential file. Staged root-only into the per-sandbox overlay and removed with the sandbox; credentials never enter logs or process arguments. |
@@ -339,5 +339,5 @@ so driver choice remains automatic unless the user explicitly overrides it.
339
339
340
340
## TODOs
341
341
342
-
- The gateway still configures the driver via CLI args; this will move to a gRPC bootstrap call so the driver interface is uniform across backends. See the `TODO(driver-abstraction)` note in`crates/openshell-gateway/src/vm.rs`.
342
+
- The gateway configures the driver with a startup document passed as `--config <path>`; see `crates/openshell-driver-sdk`. The driver validates its own `[openshell.drivers.vm]` table. `openshell-driver-vm preflight --config <path>` validates a document without starting the driver.
343
343
- macOS local builds are codesigned by `tasks/scripts/gateway-vm.sh`; the generated Homebrew formula signs the release tarball driver forlocal installs.
Copy file name to clipboardExpand all lines: docs/how-it-works/gateways/configuration.mdx
+25-3Lines changed: 25 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -961,7 +961,7 @@ Each enabled signal needs an endpoint, either in its own table or from `endpoint
961
961
962
962
`protocol` selects the transport to a collector: `grpc`, the default, or `http/protobuf`. With `http/protobuf`, the endpoint is a base URL and each signal is posted to its path under it, `/v1/traces`, `/v1/logs`, or `/v1/metrics`, as with `OTEL_EXPORTER_OTLP_ENDPOINT`. HTTP/JSON is not supported. Point a `grpc` endpoint at a collector's gRPC receiver, conventionally port `4317`, and an `http/protobuf` endpoint at its HTTP receiver, conventionally port `4318`. A URI alone cannot distinguish the two, so a mismatched endpoint is accepted at startup and then fails on export. Sandbox supervisors and standalone compute drivers must come from the same release as the gateway to use `http/protobuf`: an older supervisor exports over gRPC, and an older driver rejects the protocol setting.
963
963
964
-
`headers` sets request headers sent with every export to a collector, as gRPC metadata or HTTP headers, such as an authorization token or a backend's routing header. Each name must be a valid HTTP header name set once, ignoring case; names the exporters set themselves, such as `content-type`, `host`, and `grpc-*`, and binary gRPC names ending in `-bin` are rejected. Each value must be non-empty printable ASCII; spaces are allowed. The gateway's exporters also read their signal's `OTEL_EXPORTER_OTLP_TRACES_HEADERS`, `OTEL_EXPORTER_OTLP_LOGS_HEADERS`, or `OTEL_EXPORTER_OTLP_METRICS_HEADERS`, or else `OTEL_EXPORTER_OTLP_HEADERS`, and a header set there replaces a configured header of the same name. In-process compute drivers and the VM driver send the gateway's trace headers, including those from the environment, with their own spans. A standalone compute driver sends only the headers in its own `OTEL_EXPORTER_OTLP_*HEADERS` variables. Supervisors send their trace collector's `headers` with their own spans, and the gateway's OCSF headers, including those from the environment, with their OCSF records. Trace headers from the gateway's environment do not reach supervisors, so set `headers` or `headers_file` on the trace collector when supervisor spans need them. The agent trace relay sends only its collector's `headers`, never ones from the environment, so its credentials can only be set with `headers` or `headers_file`. A changed header takes effect when the gateway restarts, and reaches a running sandbox only after that sandbox restarts.
964
+
`headers` sets request headers sent with every export to a collector, as gRPC metadata or HTTP headers, such as an authorization token or a backend's routing header. Each name must be a valid HTTP header name set once, ignoring case; names the exporters set themselves, such as `content-type`, `host`, and `grpc-*`, and binary gRPC names ending in `-bin` are rejected. Each value must be non-empty printable ASCII; spaces are allowed. The gateway's exporters also read their signal's `OTEL_EXPORTER_OTLP_TRACES_HEADERS`, `OTEL_EXPORTER_OTLP_LOGS_HEADERS`, or `OTEL_EXPORTER_OTLP_METRICS_HEADERS`, or else `OTEL_EXPORTER_OTLP_HEADERS`, and a header set there replaces a configured header of the same name. In-process compute drivers and launched compute drivers (VM and Podman) send the gateway's trace headers, including those from the environment, with their own spans. A standalone compute driver sends only the headers in its own `OTEL_EXPORTER_OTLP_*HEADERS` variables. Supervisors send their trace collector's `headers` with their own spans, and the gateway's OCSF headers, including those from the environment, with their OCSF records. Trace headers from the gateway's environment do not reach supervisors, so set `headers` or `headers_file` on the trace collector when supervisor spans need them. The agent trace relay sends only its collector's `headers`, never ones from the environment, so its credentials can only be set with `headers` or `headers_file`. A changed header takes effect when the gateway restarts, and reaches a running sandbox only after that sandbox restarts.
965
965
966
966
Put credentials in `headers_file` rather than `headers`. It reads a collector's headers from a file instead, such as a mounted Kubernetes Secret, so credentials stay out of the configuration file. The file holds one `name=value` header per line. Blank lines are skipped, and whitespace around each name and value is trimmed. The headers are validated like `headers`, the file must be UTF-8 and at most 64 KiB, and setting both `headers` and `headers_file` in one table is a configuration error. A relative path uses the gateway's working directory. The gateway reads the file at startup and fails to start if it is missing or invalid, so a changed file takes effect as a changed header does.
967
967
@@ -1066,7 +1066,7 @@ gateway under the worktree-specific k3d cluster name; select it with
1066
1066
tasks export spans and OCSF log records to the forwarded receiver
1067
1067
automatically.
1068
1068
1069
-
In-process compute drivers read their backend-specific settings from `[openshell.drivers.<name>]`. An external driver's gateway table supplies only its `socket_path`; configure the external driver process itself through that binary's flags or environment variables. A driver that advertises `supports_sandbox_authentication` may authenticate an opaque bootstrap credential through the compute-driver protocol. It must return the same non-empty runtime identity from sandbox creation and credential authentication. Start requests include the previously recorded opaque identity so the driver can preserve the stable resource while rotating generation-specific compute. For `IssueSandboxToken`, the gateway verifies the sandbox exists and the driver/runtime identity matches the durable provisioning record before returning a generation-bound session JWT. The in-process Kubernetes driver reads `service_account_name`, `workspace_mode`, and namespace discovery from `[openshell.drivers.kubernetes]`; an external Kubernetes driver receives the equivalent values through its own CLI or environment contract.
1069
+
Built-in compute drivers read their backend-specific settings from `[openshell.drivers.<name>]`. The gateway passes the table of a launched driver (VM or Podman) through unchanged, and the driver validates it. An external driver's gateway table supplies only its `socket_path`; configure the external driver process itself through that binary's flags or environment variables. A driver that advertises `supports_sandbox_authentication` may authenticate an opaque bootstrap credential through the compute-driver protocol. It must return the same non-empty runtime identity from sandbox creation and credential authentication. Start requests include the previously recorded opaque identity so the driver can preserve the stable resource while rotating generation-specific compute. For `IssueSandboxToken`, the gateway verifies the sandbox exists and the driver/runtime identity matches the durable provisioning record before returning a generation-bound session JWT. The in-process Kubernetes driver reads `service_account_name`, `workspace_mode`, and namespace discovery from `[openshell.drivers.kubernetes]`; an external Kubernetes driver receives the equivalent values through its own CLI or environment contract.
1070
1070
1071
1071
### OTLP Metrics
1072
1072
@@ -1405,6 +1405,26 @@ The gateway refuses to start when a peer endpoint is configured on a multi-repli
1405
1405
1406
1406
## Driver References
1407
1407
1408
+
### Launched Compute Drivers
1409
+
1410
+
The VM and Podman drivers run as separate binaries that the gateway launches: `openshell-driver-vm`and `openshell-driver-podman`. Docker and Kubernetes still run inside the gateway process.
1411
+
1412
+
When `driver_dir` is set in `[openshell.drivers.vm]`, the gateway searches only that directory for the VM driver, then the directory that holds the gateway binary. Otherwise it searches these locations in order:
1413
+
1414
+
1. `libexec` and `libexec/openshell` under the gateway's install prefix.
1415
+
2. `~/.local/libexec/openshell`, `/usr/libexec/openshell`, `/usr/local/libexec/openshell`, and `/usr/local/libexec`.
1416
+
3. The directory that holds the gateway binary.
1417
+
1418
+
The Podman driver has no `driver_dir` setting.
1419
+
1420
+
The gateway refuses a driver binary, or the directory that holds it, that is not owned by the gateway's user or root, or that is writable by its group or by other users. It fails with an error naming the driver when no binary is found.
1421
+
1422
+
The gateway writes a startup document to a private `run/` directory under the driver's state directory and starts the driver with `--config <path>`. The document holds the gateway's resolved values, such as its name, port, TLS CA, telemetry settings, and the staged network trust artifact. It also holds the driver's `[openshell.drivers.<name>]` table, which the gateway does not interpret. The gateway removes the file once the driver is ready or has failed. OTLP headers stay in the driver's environment and never enter the document.
1423
+
1424
+
The driver validates its own table at startup and exits when it is invalid. The gateway then reports that the driver exited before it was ready. If a driver exits after it was ready, the gateway logs an error naming the driver and exits with a nonzero status so a service manager can restart it. A driver that ends during a gateway shutdown is not reported.
1425
+
1426
+
Podman auto-detection runs `openshell-driver-podman probe` with a five-second limit. A missing, untrusted, failing, slow, or malformed probe counts as Podman not being available. `openshell-gateway config preflight` runs the driver's `preflight` command for the selected driver, and for each auto-detectable driver that has a table in the configuration, so the binary must be installed on the host where you run it. Each driver gets ten seconds. Preflight does not see the gateway's TLS CA or the network trust bundle, because the gateway has not created them yet.
1427
+
1408
1428
### External Resource Admission
1409
1429
1410
1430
Every compute driver disables caller-supplied `template.driver_config` by
@@ -2112,7 +2132,7 @@ gateway_id = "openshell"
2112
2132
2113
2133
[openshell.drivers.vm]
2114
2134
state_dir = "/var/lib/openshell/vm"
2115
-
# Where the gateway looks for the openshell-driver-vm subprocess binary.
2135
+
# Where the gateway looks for the openshell-driver-vm binary it launches.
The command also installs local CLI mTLS credentials. For explicit signing configuration, set the example's signing paths to `jwt/signing.pem`, `jwt/public.pem`, and `jwt/kid` under that directory. The gateway loads those paths in preference to local discovery.
2193
2213
2214
+
Configure the guest TLS CA only under `[openshell.gateway]`. The VM driver rejects a `guest_tls_ca` key in `[openshell.drivers.vm]`.
2215
+
2194
2216
Rootfs tar staging requires the gateway and the VM driver to share a filesystem
2195
2217
and run as the same user. That holds for the managed VM driver, which the
2196
2218
gateway starts as a subprocess. If you point `compute_driver_endpoints` at an
0 commit comments