Repository navigation
feat(drivers): launch the VM, Podman and Docker drivers with serve and Configure - #5914
Conversation
|
🌿 Preview your docs: https://nvidia-preview-pr-5914.docs.buildwithfern.com/openshell |
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. cli — No explicit risk acceptance foundopenshell-gateway --compute-driver podman previously ran in-process but now requires openshell-driver-podman serve, which the gateway image, Snap and Homebrew packages do not install.
2. configuration — No explicit risk acceptance found[openshell.drivers.podman].gateway_port was always overwritten by the gateway's listening port but now overrides it when explicitly present.
Review details
Advisory review; publication gates are unchanged. |
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. configuration — No explicit risk acceptance found
2. configuration — No explicit risk acceptance found
Review details
Advisory review; publication gates are unchanged. |
matthewgrossman
left a comment
There was a problem hiding this comment.
The shared launcher looks like the right direction for moving the desktop drivers out of core. The follow-up commits address the ownership split and separate startup output from logs. The main remaining concern is preserving existing installs when Podman stops being linked into the gateway.
Can we ship the matching Podman executable through the existing macOS install paths (Homebrew and install.sh) and provision it for mise run gateway:podman and the managed Podman E2E lanes? The Linux deb/RPM/Nix paths stage it, but the branch workflow also has two producers for the same x86-64 Podman artifact. Please clarify the migration for Podman-backed snap installs. Before merge, I’d like to see a clean-install smoke test and real managed VM and Podman E2E, including additional CA coverage; those lanes were skipped on this revision.
6d8bed5 to
72babe8
Compare
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. cli — No explicit risk acceptance found
2. configuration — No explicit risk acceptance found
Review details
Advisory review; publication gates are unchanged. |
3511196 to
cf4f426
Compare
Compatibility review (advisory)New or updated breaking changes; see the full report for all findings. 1. configuration — No explicit risk acceptance foundOPENSHELL_PODMAN_SOCKET previously overrode [openshell.drivers.podman].socket_path, but now the TOML value wins and the environment variable is consulted only during fallback discovery.
Review details
Advisory review; publication gates are unchanged. |
7a62274 to
e5ae9cd
Compare
e5ae9cd to
c23213a
Compare
|
On:
This is not the case. The podman driver still respects the |
2f20f10 to
980f828
Compare
matthewgrossman
left a comment
There was a problem hiding this comment.
A few smaller follow-ups, separate from the inline findings:
- Keep the per-launch socket directory under RAII from creation.
prepare_socket()calls.keep()before stdin staging and spawn, so an error in either step leaves an empty directory behind. - In the launch proto, distinguish a retryable
ConfigureRPC from the current gateway policy of failing the launch rather than retrying. The VM README also still describes the old CLI bootstrap and fixed socket path. - Before release, smoke-test driver discovery and sandbox creation from clean installs, especially the snap and Homebrew packages. Their libexec layouts differ from the packaged deb path that already passed conformance.
Write each fixture script to a temporary file, close it, and rename it into place. A script another test's fork still holds open for writing fails to execute with ETXTBSY. Signed-off-by: Evan Lezar <elezar@nvidia.com>
Add a generic subprocess launcher: it resolves and trust-checks the driver binary, gives each launch its own private socket directory, starts serve with the table on stdin, reads GetLaunchInfo, sends Configure, and reports an unexpected exit. The exit status decides the result and the JSON line only explains it. The VM driver is launched through it, the VM argv builder and OTLP flags are removed, and config preflight runs the driver's preflight command. The gateway owns the admission policy and driver_dir: it strips the admission keys from the forwarded table and reads driver_dir from [openshell.gateway], warning about the old driver-table location. Signed-off-by: Evan Lezar <elezar@nvidia.com>
…at starts Let a registration detect its driver with the operator's merged table instead of an environment probe. A probe returns whether the driver is available, unavailable, has an invalid table, or failed outright. The first available driver's running process is stashed for the factory's build step, so detection never starts a driver it then stops; an unused one is stopped when dropped. An invalid table or unreachable backend falls through to the next candidate, a crash or timeout stops startup, and the no-driver error lists each candidate's reason. Legacy keys are normalized in a copy of the configuration for each candidate. Signed-off-by: Evan Lezar <elezar@nvidia.com>
Add settings_from_table as the single parse and validation point for the podman driver table, a serve command that checks the Podman socket (honouring socket_path and OPENSHELL_PODMAN_SOCKET) before it binds and applies Configure before serving ComputeDriver, and a preflight command. The table holds only what the operator owns: the gateway port, the CA and the admission policy come from Configure, and grpc_endpoint is an optional override checked for syntax and scheme. The standalone flags still work. Signed-off-by: Evan Lezar <elezar@nvidia.com>
Launch openshell-driver-podman through the shared launcher and stop linking it into the gateway. Auto-detection starts the driver with the operator's table, so a configured socket_path is honoured, and keeps the first driver that binds its socket. An invalid table or unreachable socket falls through to the next candidate; a crash stops startup. A named Podman is started again while its socket is unreachable, as the in-process driver retried. The gateway drops a legacy gateway_port from the table with a warning, so the driver can stay strict. config preflight runs the driver's preflight command. Ship the driver: build it for both Linux targets and macOS, install it in /usr/libexec/openshell through the deb, RPM and Nix packages and the Homebrew formula, publish its release assets, and provision it for the dev gateway task and the managed Podman E2E lanes. Signed-off-by: Evan Lezar <elezar@nvidia.com>
Add settings_from_table as the single parse and validation point for the docker driver table, a serve command that checks the Docker socket before it binds and applies Configure before serving both ComputeDriver and ComputeDriverConfigurationUpdates, and a preflight command. The table holds only what the operator owns: the CA and the admission policy come from Configure, and grpc_endpoint is an optional override checked for syntax and scheme. The standalone flags still work. Signed-off-by: Evan Lezar <elezar@nvidia.com>
Launch openshell-driver-docker through the shared launcher and stop linking it into the gateway, replacing the in-process Docker driver. The driver's ComputeDriverConfigurationUpdates service is served through the same launched process. Auto-detection starts the driver with the operator's table and keeps the first one that binds its socket, as for Podman, and config preflight runs the driver's preflight command. Move the detect, launch and preflight logic Podman and Docker share into one module. The gateway keeps checking its own bind port and the admission policy. Ship the driver: build it for both Linux targets and macOS, install it in /usr/libexec/openshell through the deb, RPM and Nix packages, in libexec/openshell in the snap, and through the Homebrew formula, publish its release assets, and provision it for the dev gateway task and the Docker E2E lanes. Signed-off-by: Evan Lezar <elezar@nvidia.com>
The gateway launches these drivers as subprocesses, so an image that runs the Docker or Podman driver needs their binaries. Stage them beside the gateway, install them under /usr/libexec/openshell, one of the directories the gateway searches, and build them in the image workflow and the local image tasks. Signed-off-by: Evan Lezar <elezar@nvidia.com>
A service manager signals every process of the gateway's unit when it stops the unit, so a launched driver received SIGTERM at the same time as the gateway. The driver could stop serving before the gateway had stopped the sandboxes through it, leaving Docker, Podman or VM sandboxes running after the service stopped. Add a Shutdown call to the launch protocol. A driver now defers a stop signal that reaches it from elsewhere until the gateway releases it, its gateway exits, or 30 seconds pass. The gateway stops sandboxes through the driver first, then releases it with Shutdown, waits for it to exit, and falls back to SIGTERM and kill as before. A driver whose gateway is gone now stops through the same path, so it also finishes in-flight calls and flushes telemetry. Signed-off-by: Evan Lezar <elezar@nvidia.com>
…dget Constructing a launched driver can pull its supervisor and runtime images, and that happens inside Configure. A fixed two-minute deadline on the call could end a normal first start on a slow network, where the in-process drivers had no deadline. Use the gateway's image_preparation_timeout_seconds as the Configure deadline, with a floor of two minutes so a very small value cannot make the call fail at once. The launcher applies the value it is given, and the gateway's configuration decides it. Signed-off-by: Evan Lezar <elezar@nvidia.com>
A Podman driver pinged its backend for up to a minute, and a Docker driver for up to 30 seconds, before it bound its socket. The gateway waits 30 seconds for a driver to start and then kills it, so a daemon that answered slowly ended the start with a crash instead of an unavailable backend. The gateway retries an explicitly selected Podman driver only when the backend is unavailable, and tries the next candidate in auto mode only then. Give the ping 20 seconds and report a backend that has not answered as unavailable, with its exit status and reason, so the gateway can retry or move on. Signed-off-by: Evan Lezar <elezar@nvidia.com>
980f828 to
4f7a592
Compare
Summary
The gateway launches the VM, Podman, and Docker compute drivers as subprocesses through one contract: a fixed bootstrap command line, the driver's own table on stdin, and gateway metadata in a versioned
ConfigureRPC. A launched driver stops only when the gateway releases it. This is an alternative to #5838, which writes a startup document instead. It follows the design discussed on #5384, including its answers on settings ownership.Related Issue
Closes #5385. Related: #5384, #5200.
Follow-ups: #5933 (one upstream proxy configuration for all drivers), #5934 (a gateway test with a fake driver), #6006 (an e2e suite for driver trace propagation), #5935 (socket paths over the Unix limit), #5936 (driver binary trust), #5940 (non-blocking detection), #5941 (gateway-level, typed admission), #5965 (remove the per-driver launcher Cargo features), #5998 (retry an explicitly selected Docker driver), #6002 (one precedence rule for boolean-like table and environment settings).
Changes
The commits are grouped so each group can be reviewed on its own.
proto/driver_launch.protoandopenshell-driver-launch:GetLaunchInfo,Configure(once only; a failed call leaves the driver running, and the current gateway fails the launch instead of retrying) andShutdown, with a generic wrapper that answersUNAVAILABLEuntil configured.openshell-driver-sdk: stdin table reader, start-up exit codes (69, 78) with one JSON line on stdout, staged network-trust loader, telemetry and admission conversion, gateway context, and a parent guard that stops a driver when its gateway is gone (by PID, and by a changed parent when the gateway started it directly).serve,preflightandConfigure(strict table, environment fallbacks kept); server plumbing (raw driver table,driver_dir, process state,poll_exit); the generic gateway launcher and VM launch. Each launch gets its own private socket directory under RAII until the launch owns it. The exit status decides the result and the JSON line only explains it. The driver is spawned from one long-lived thread, because a driver may arm a parent-death signal that Linux ties to the spawning thread, and a Tokio blocking-pool thread exits after ten idle seconds. The gRPC connection andGetLaunchInfoeach have a 10 second deadline.openshell-driver-dockerandopenshell-driver-podmanunder/usr/libexec/openshell, because the container deployment docs run the gateway with those drivers.Shutdown. A driver defers an outside SIGTERM or SIGINT until the gateway releases it, the gateway exits, or 30 seconds pass. The gateway stops sandboxes, releases the driver, waits for it to exit, and falls back to SIGTERM and kill. A cancelled or failed stop still kills and reaps the process.Configurebudget: constructing a driver can pull its images, so theConfiguredeadline is the gateway'simage_preparation_timeout_seconds(default 30 minutes), passed to the launcher with the request.Settings ownership: the gateway supplies the port and CA through
Configure;gateway_port,guest_tls_caand the admission keys are rejected in driver tables so the drivers stay strict. The gateway already read the admission keys from every driver table onmainand gave the VM its policy as--admission-config-json; it now sends the same JSON inConfigureasresource_admission_policy_json(the valueGetCapabilitiesreports, without itsv1:prefix) and strips the keys from the forwarded table.driver_dirmoves to[openshell.gateway]; the gateway searches it first, then the standard locations, then next to the gateway binary. The gateway drops a legacy Podmangateway_portwith a warning.grpc_endpointstays an optional override checked bypreflight.Environment: a driver does not inherit the collector header variables (
OTEL_EXPORTER_OTLP_*HEADERS); the gateway resolves the trace headers and sends them inConfigure. For the VM driver's two proxy acknowledgements, an environmentfalsemeans unset, as onmain. Other table and environment precedence is unchanged frommainand tracked in #6002.Sockets: Docker and Podman launch from
<state>/openshell/run/<driver>/<random>/driver.sock; the VM driver keeps its own<state_dir>/run.Driver binaries: the gateway runs the first driver binary it finds and checks neither its owner nor its mode, as
maindid. Two checks were tried and removed: an owner check broke packaged installs, because root-owned files appear under another uid in the packaged unit's user namespace, and a mode check rejected locally built drivers under umask0002. Trust checks are tracked in #5936.Builds: the drivers use the same
*-unknown-linux-gnutargets, toolchain and glibc floor as the gateway. Nothing about how they are built changes; Docker and Podman are now separate artifacts instead of being compiled into the gateway.Known limits:
#[serde(skip)]runtime fields, set inapply_configure, instead of a separateGatewayContextargument.Box<dyn Any>; a typed handoff would be clearer but is a larger refactor.cfggates (chore(gateway): remove the per-driver launcher Cargo features #5965).--configis not changed.proxy_config_preflighttest is removed because the drivers validate their own tables. test: add a gateway integration test for launched-driver failures #5934 adds a gateway-level test with a fake driver.Release Notes
VM, Podman, and Docker sandboxes run through separately launched driver binaries, which the packages and the gateway image install next to the gateway. Existing driver tables keep working, except that
gateway_port(Podman) andguest_tls_caare rejected in driver tables; the gateway drops a legacygateway_portwith a warning. Movedriver_dirto[openshell.gateway]; the old location still works with a deprecation warning. Stopping the gateway under a service manager now stops sandboxes through the driver before the driver exits.Testing
Run locally: gateway, server, VM, Podman, Docker, SDK, launch, core socket and OTel crate tests (the driver integration tests run the real binaries; Podman and Docker use a fake API socket), workspace fmt and clippy on the tip, every Cargo feature subset of the gateway that CI builds,
test-packaging-assets.sh, the Homebrew formula tests, andtest-install-sh.sh. The full conformance family (77 tests) passes against the Docker driver in a tmachine VM with the packaged gateway (ubuntu-docker-rootful,deb).CI: on earlier heads of this branch, Branch E2E Checks passed in full, including the VM, Podman and Docker conformance lanes, the additional-CA lanes, and the continuity lanes with the
test:e2e:continuitylabel (a gateway restart and an upgrade from the latest published release, both with the Docker driver). The continuity gateway-restart lane failed once, on a head without the shutdown contract, because the gateway's stop sweep found the driver already gone. CI is running on the current head.Not verified: the release workflow changes (
release-devandrelease-publishdo not run on pull requests), the snap build, the Homebrew formula andinstall.shagainst real release assets, a clean-install smoke test of driver discovery and sandbox creation from the snap and Homebrew layouts, a Windows build of the SDK, a gateway-to-driver RPC captured end to end by a collector (the deferred layer is tested against a collector for trace and parent span IDs, but not through a real gateway and driver), a real systemd stop of the packaged unit with running sandboxes, and the Podman conformance family run locally.Checklist