Skip to content

Commit f0d5b27

Browse files
committed
docs(compute): document the External runtime row and supervisor cell
Adds the External row to the runtime summary and supervisor delivery tables: activated by --compute-driver-socket, GetCapabilities driver_name logged for diagnostics, operator owns process and socket lifecycle, trust boundary is the socket's filesystem permissions. Also picks up rustfmt's normalization of the new imports and helper signatures introduced in the previous two commits. Signed-off-by: st-gr <38470677+st-gr@users.noreply.github.com>
1 parent 836fef1 commit f0d5b27

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

architecture/compute-runtimes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ when a sandbox create request asks for GPU resources.
3434
| Podman | Rootless or single-machine deployments. | Container plus nested sandbox namespace. | Uses the Podman REST API, OCI image volumes, and CDI GPU devices when available. |
3535
| Kubernetes | Cluster deployment through Helm. | Pod plus nested sandbox namespace. | Uses Kubernetes API objects, service accounts, secrets, PVC-backed workspace storage, and GPU resources. |
3636
| VM | Experimental microVM isolation. | Per-sandbox libkrun VM. | Gateway spawns `openshell-driver-vm` as a subprocess over a private, state-local Unix socket. The VM driver boots a cached bootstrap `rootfs.ext4`, prepares requested OCI images inside a bootstrap VM with `umoci`, attaches the prepared image disk read-only, and gives each sandbox a writable `overlay.ext4` for merged-root changes and runtime material. The driver persists each accepted launch request beside the overlay and restarts those VMs on driver startup without recreating the overlay. |
37+
| External | Out-of-tree drivers operated alongside the gateway. | Whatever boundary the driver implements. | Activated by `--compute-driver-socket=<path>` (env `OPENSHELL_COMPUTE_DRIVER_SOCKET`). The gateway connects to a UDS the operator already provisioned, runs `GetCapabilities`, logs the advertised `driver_name`, and dispatches all sandbox lifecycle calls through the same `compute_driver.proto` surface as the in-tree drivers. The driver process and socket lifecycle are operator-owned; the gateway does not spawn, supervise, or remove the driver. The trust boundary is the socket's filesystem permissions — the operator must ensure only the gateway uid can read/write it. |
3738

3839
Per-sandbox CPU and memory values currently enter the driver layer through
3940
template resource limits. Docker and Podman apply them as runtime limits.
@@ -68,6 +69,7 @@ The supervisor must be available inside each sandbox workload:
6869
| Podman | Read-only OCI image volume containing the supervisor binary. |
6970
| Kubernetes | Sandbox pod image or pod template configuration. |
7071
| VM | Embedded in the guest rootfs bundle. |
72+
| External | Defined by the out-of-tree driver. |
7173

7274
Driver-controlled environment variables must override sandbox image or template
7375
values for sandbox ID, sandbox name, gateway endpoint, relay socket path, TLS

crates/openshell-server/src/cli.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,9 +1515,7 @@ ssh_session_ttl_secs = 1234
15151515
let (args, _) = parse_with_args(&["openshell-gateway", "--db-url", "sqlite::memory:"]);
15161516
assert_eq!(
15171517
args.compute_driver_socket.as_deref(),
1518-
Some(std::path::Path::new(
1519-
"/var/run/openshell/external.sock"
1520-
))
1518+
Some(std::path::Path::new("/var/run/openshell/external.sock"))
15211519
);
15221520
}
15231521

crates/openshell-server/src/compute/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::sandbox_watch::SandboxWatchBus;
1515
use crate::supervisor_session::SupervisorSessionRegistry;
1616
use crate::tracing_bus::TracingLogBus;
1717
use futures::{Stream, StreamExt};
18+
use hyper_util::rt::TokioIo;
1819
use openshell_core::ComputeDriverKind;
1920
use openshell_core::proto::compute::v1::{
2021
CreateSandboxRequest, DeleteSandboxRequest, DriverCondition, DriverPlatformEvent,
@@ -35,17 +36,16 @@ use openshell_driver_kubernetes::{
3536
use openshell_driver_podman::{
3637
ComputeDriverService as PodmanDriverService, PodmanComputeConfig, PodmanComputeDriver,
3738
};
38-
use hyper_util::rt::TokioIo;
3939
use prost::Message;
4040
use std::fmt;
4141
use std::net::SocketAddr;
4242
use std::path::{Path, PathBuf};
4343
use std::pin::Pin;
4444
use std::sync::Arc;
4545
use std::time::Duration;
46-
use tokio::sync::Mutex;
4746
#[cfg(unix)]
4847
use tokio::net::UnixStream;
48+
use tokio::sync::Mutex;
4949
use tonic::transport::{Channel, Endpoint};
5050
use tonic::{Code, Request, Status};
5151
use tower::service_fn;

0 commit comments

Comments
 (0)