Repository navigation
Commit 03908a0
authored
feat(drivers): launch the VM, Podman and Docker drivers with serve and Configure (#5914)
* test(gateway): install config preflight fixtures by rename
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>
* refactor(vm): move the driver's socket and peer checks into a module
Move socket preparation, peer authorization by uid and gateway PID, and
the shutdown signal out of main.rs. No behaviour change.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
* refactor(server): hold a managed driver's process in an enum
Wrap the managed driver's child process in DriverChild so a later change
can manage a process started another way. No behaviour change.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
* feat(otel): enable driver trace export after tracing is installed
A launched driver logs first and starts OTLP export when the gateway
configures it. The deferred layer forwards downcasts to the installed
OpenTelemetry layer, so a span's parent trace context still reaches the
exporter, which a reloadable slot would drop. Export starts once and a
repeat call is a no-op.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
* feat(drivers): add the driver launch protocol
Add proto/driver_launch.proto and the openshell-driver-launch crate. A
launched driver serves GetLaunchInfo and Configure and answers UNAVAILABLE
on its other services until Configure succeeds once. Configure carries the
gateway context (including its bind address), network trust, image
overrides, telemetry, and the admission policy the gateway owns.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
* feat(drivers): add a shared SDK for launched compute drivers
Add openshell-driver-sdk with the stdin table reader, the start-up exit
codes and stdout report line, the staged network-trust loader, telemetry
and admission conversion from Configure, grpc_endpoint checks, the gateway
context, and a parent-death guard.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
* feat(vm): serve the launch protocol and read its table from stdin
Add settings_from_table as the single parse and validation point for the
vm driver table, a serve command that binds the socket and applies
Configure before serving ComputeDriver, and a preflight command. The table
holds only what the operator owns: the gateway port and CA come from
Configure, the admission policy arrives in Configure, and grpc_endpoint is
an optional override checked for syntax and scheme. A setting the table
leaves unset still falls back to the driver's environment variable. The
argv mode keeps working.
Signed-off-by: Evan Lezar <elezar@nvidia.com>
* feat(server): expose a launched driver's table, process state, and driver_dir
Let a factory read the selected driver's raw merged table, report whether
a managed driver process is running or has exited on its own
(DriverProcessState and poll_exit), manage a driver started with std,
and read driver_dir from [openshell.gateway].
Signed-off-by: Evan Lezar <elezar@nvidia.com>
* feat(gateway): launch the VM driver with serve and Configure
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>
* feat(server): detect drivers with their own table and keep the one that 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>
* feat(podman): serve the launch protocol and read its table from stdin
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>
* feat(gateway): launch the Podman driver as a subprocess
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>
* feat(docker): serve the launch protocol and read its table from stdin
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>
* feat(gateway): launch the Docker driver as a subprocess
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>
* feat(gateway): ship the Docker and Podman drivers in the gateway image
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>
* feat(drivers): release a launched driver before it stops
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>
* feat(gateway): bound a driver's Configure by the image preparation budget
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>
* feat(drivers): report a slow backend as unavailable
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>
---------
Signed-off-by: Evan Lezar <elezar@nvidia.com>1 parent 92a45c1 commit 03908a0
96 files changed
Lines changed: 9198 additions & 2260 deletions
File tree
- .github
- actions/build-docker-image
- workflows
- crates
- openshell-core/src
- openshell-driver-docker
- src
- tests
- openshell-driver-launch
- src
- openshell-driver-podman
- src
- tests
- openshell-driver-sdk
- src
- openshell-driver-vm
- src
- tests
- openshell-gateway
- src
- docker
- launcher
- podman
- vm
- tests
- openshell-otel
- src
- tests
- openshell-server/src
- compute
- deploy/docker
- docs
- extensibility
- how-it-works/gateways
- e2e
- proto
- tasks/scripts
- vm
- tests/tmachine
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
52 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
53 | 72 | | |
54 | | - | |
55 | | - | |
56 | 73 | | |
57 | | - | |
58 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
59 | 79 | | |
60 | 80 | | |
61 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | 298 | | |
307 | 299 | | |
308 | 300 | | |
| |||
541 | 533 | | |
542 | 534 | | |
543 | 535 | | |
| 536 | + | |
544 | 537 | | |
545 | 538 | | |
546 | 539 | | |
| |||
555 | 548 | | |
556 | 549 | | |
557 | 550 | | |
| 551 | + | |
558 | 552 | | |
559 | 553 | | |
560 | 554 | | |
| |||
570 | 564 | | |
571 | 565 | | |
572 | 566 | | |
| 567 | + | |
573 | 568 | | |
574 | 569 | | |
575 | 570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
131 | 163 | | |
132 | 164 | | |
133 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
93 | 105 | | |
94 | 106 | | |
95 | 107 | | |
96 | | - | |
| 108 | + | |
97 | 109 | | |
98 | 110 | | |
99 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
69 | | - | |
| 81 | + | |
70 | 82 | | |
71 | 83 | | |
72 | 84 | | |
| |||
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
| 91 | + | |
| 92 | + | |
79 | 93 | | |
80 | 94 | | |
81 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
66 | 84 | | |
67 | 85 | | |
68 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
| |||
379 | 380 | | |
380 | 381 | | |
381 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
382 | 397 | | |
383 | 398 | | |
384 | 399 | | |
| |||
449 | 464 | | |
450 | 465 | | |
451 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
452 | 473 | | |
453 | 474 | | |
454 | 475 | | |
| |||
475 | 496 | | |
476 | 497 | | |
477 | 498 | | |
478 | | - | |
| 499 | + | |
479 | 500 | | |
480 | 501 | | |
481 | 502 | | |
482 | 503 | | |
483 | 504 | | |
484 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
485 | 512 | | |
486 | 513 | | |
487 | 514 | | |
| |||
575 | 602 | | |
576 | 603 | | |
577 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
578 | 611 | | |
579 | 612 | | |
580 | 613 | | |
| |||
0 commit comments