Repository navigation
Duplicate
Labels
area:driversCompute and secret drivers, host OS/architecture support, backend isolation, and lifecycle.topic:apiPublic APIs, gRPC/protobuf, SDK interfaces, versioning, compatibility, and API design standards.topic:architectureSystem design, component boundaries, data/control flow, architectural decisions, and RFCs.topic:extensionsExtension APIs and integration points, consistent design, and external use cases.
Description
User Story
The gateway needs to launch the Docker, Podman, and VM compute drivers as separate processes through one contract so the desktop drivers can move to ai-openshell/desktop (#5200) without the gateway linking driver crates or translating driver config tables into CLI flags.
Description
Replace VM's flag-based subprocess launch and Docker/Podman's in-process loading with a single launch contract split by owner:
- Bootstrap (
argv, gateway-owned): fixed CLI interface for all managed drivers:openshell-driver-<name> serve --bind-socket <path> --expected-peer-pid <pid> --log-level <level>openshell-driver-<name> preflight
- Driver table (
stdin, driver-owned): raw[openshell.drivers.<name>]TOML forwarded unparsed by the gateway (after stripping gateway-owned keys likedriver_dir). Empty stdin uses driver defaults. Bothserveandpreflightvalidate the table through one side-effect-freesettings_from_tablefunction that rejects unknown keys. - Gateway metadata (
DriverLaunchgRPC service, gateway-owned):openshell.driver.launch.v1.DriverLaunchwithGetLaunchInfo(driver name/version, supported protocol versions, features) andConfigure(max 1 MiB, succeeds at most once, retryable on failure).Configurecarries protocol version, required features,GatewayContext(gateway_port,tls_ca_path,gateway_name), stagedNetworkTrust(path, digest, cert count),ImageOverrides, andTelemetry(OTLP exports, collector TLS, secret trace headers). All other services (including Docker'sComputeDriverConfigurationUpdates) returnUNAVAILABLEuntilConfiguresucceeds, andservecreates no persistent state beforeConfigure.
Detection, preflight, and security
- Detection: the gateway launches each candidate's
servein priority order with its stdin table. Before binding the socket, the driver validates the table and checks its backend (honoring settings likesocket_path). Before exiting on failure,serveandpreflightwrite one JSON reason line to stderr and exit withEX_UNAVAILABLE(69) for an unavailable backend,EX_CONFIG(78) for an invalid table, or another non-zero code on error. Auto-detection falls through on 69 (and warns + falls through on 78); explicit driver selection fails startup on any non-zero exit. - Preflight:
openshell-gateway config preflightruns each candidate'spreflightsubcommand without contacting the backend. - Telemetry:
servestarts with stderr tracing at--log-leveland an empty reloadable OTLP layer, then attaches OTLP export duringConfigure. - Security: resolve binaries from
driver_diror packagedlibexec(owned by root or gateway user, not group/world-writable), bind sockets under a0700directory, and keep secrets offargvand env.
Scope
- Drops in-process mode for Docker and Podman. Keeps the
ComputeDrivergRPC API, driver names, detection order, operator config files, and standalone operator-run drivers unchanged. - Out of scope: launching third-party external drivers, cross-version negotiation between unpaired releases, restarting crashed drivers, shared peer-PID enforcement beyond VM, and removing remaining core Rust dependencies (refactor(driver-sdk): carve out the driver SDK and container-runtime crate #5405, refactor(driver-contract): move the driver contract types into a contract crate #5488).
Related: #5200, #5384, #5385, #5838 (based on @elezar's draft proposal).
Definition of Done
- Support deferred OTLP export in
openshell-otel(stderr tracing at startup, OTLP layer enabled onConfigure). - Add
openshell.driver.launch.v1.DriverLaunch(GetLaunchInfo,Configure) and a core-freeopenshell-driver-launchcrate with theConfigurestate machine, genericUNAVAILABLEwrapper, and 1 MiB request limit. - Add driver SDK launch helpers: stdin table reader, exit-code + stderr JSON startup result, network-trust loader,
Telemetry-to-OTLP conversion, and parent-death guard. - Split driver config into
DriverSettings(operator keys) and sharedGatewayContext, migrating VM tosettings_from_table,serve,preflight, and the generic gateway launcher. - Migrate Podman and Docker to the launch contract, stop linking them in-process (covering
ComputeDriverConfigurationUpdateson Docker), and route detection andconfig preflightthroughserve/preflight. - Add real-binary integration tests per driver (
GetLaunchInfo, pre-ConfigureUNAVAILABLE,Configureversion checks/retry, startup exit codes, side-effect-freepreflight) and fake-binary gateway tests (trust checks, exit-code mapping, detection fallback, unexpected exit). - Ship driver binaries in Debian, RPM, and snap packages with a CI packaging check, and update gateway config and driver extensibility docs.
Open Questions
- Keep
gateway_port,grpc_endpoint, andguest_tls_caas optional operator overrides in driver tables? (Default: yes.) - Keep
allow_driver_configandresource_admissionin the driver table enforced by the driver? (Default: yes.) - Keep startup availability as exit codes + one stderr JSON line, or report over the socket instead?
- Move gateway-owned keys like
driver_dirto[openshell.compute.<name>]and deprecate the old location?
Metadata
Metadata
Assignees
Labels
area:driversCompute and secret drivers, host OS/architecture support, backend isolation, and lifecycle.topic:apiPublic APIs, gRPC/protobuf, SDK interfaces, versioning, compatibility, and API design standards.topic:architectureSystem design, component boundaries, data/control flow, architectural decisions, and RFCs.topic:extensionsExtension APIs and integration points, consistent design, and external use cases.
Activity
drew commentedon Nov 23, 2026
Drop
guest_tls_caandgateway_portfromDriverSettings; the gateway supplies both throughConfigure'sGatewayContext. (mainalready rejectsguest_tls_cain[openshell.drivers.*]and overwritesgateway_port.) Keepgrpc_endpointas an optional override inDriverSettingsfor custom network/NAT setups, defaulting fromGatewayContextwhen unset.preflightchecks URL syntax and scheme;Configurechecks thathttps://has a CA path. Standalone operator-run drivers keep their existing CLI flags.The gateway should own and enforce admission policy. Remove
allow_driver_configandresource_admissionfromDriverSettingsso[openshell.drivers.<name>]stays opaque to the gateway. The gateway enforcesallow_driver_configdirectly at the API boundary; moving backend-native label evaluation forresource_admissionfully into the gateway requires extendingComputeDriverto report resolved resource metadata/labels (track as a follow-up if#5901keepsComputeDriverunchanged, passing the gateway's policy inConfigurein the meantime).Keep
EX_UNAVAILABLE(69) andEX_CONFIG(78) exit codes, and write the single JSON reason line to stdout instead of stderr. Keep stderr for tracing, panics, and native library output so logs never collide with the startup result parser. This works the same way for bothserveandpreflightwithout spinning up a socket for unavailable drivers.Put
driver_dirunder[openshell.gateway]instead of adding[openshell.compute.<name>]. The gateway ownsdriver_dir(and gateway-owned admission settings); any legacy driver-table location such as[openshell.drivers.vm].driver_diris deprecated and stripped with a warning during transition.drew commentedon Nov 23, 2026
Duplicate of #5384 — moved the launch contract plan and Q&A responses there.