Repository navigation
Commit 653842b
committed
feat(driver-native): add containerd-backed native compute driver
Adds openshell-driver-native, a fifth compute driver that constructs
sandboxes from Linux kernel primitives (namespaces, cgroups v2) by
driving a system-provided containerd instead of a container engine
daemon, a hypervisor, or a bundled/hand-invoked low-level runtime.
This implements two amendments to the originally filed issue #2255
proposal, agreed with the issue author outside the issue thread:
- The low-level OCI runtime is never bundled. It is configurable
(default `runc`, override to `crun` or any other OCI-runtime-spec
binary already installed on the host) and is invoked only by
containerd's own shim via `containerd.runc.v1.Options.binary_name`.
- The driver talks to containerd's gRPC API (Transfer/Images/Content/
Snapshots/Containers/Tasks services) rather than generating an OCI
bundle and shelling out to the low-level runtime directly.
Key pieces:
- openshell-driver-native: image pull + chain-ID resolution + snapshot
management against containerd (image.rs), OCI runtime-spec
generation from OpenShell policy (spec.rs), per-sandbox network
namespace + veth + nftables networking (network.rs), GPU kernel
device-node passthrough (gpu.rs), and the ComputeDriver gRPC service
(driver.rs/grpc.rs), running in-process in the gateway like the
Docker/Podman/Kubernetes drivers.
- openshell-nft-ruleset: the VM driver's nftables ruleset generator
extracted into a shared crate (table-prefix-parameterized) so the
native driver reuses the same NAT + default-deny shape without a
behavior change to the VM driver's existing tables.
- ComputeDriverKind::Native wired through openshell-core config,
telemetry, and every openshell-server compute-driver selection path
(driver_config.rs, compute/mod.rs, lib.rs, cli.rs, config_file.rs).
The full pull -> chain-ID resolve -> snapshot prepare -> container/
task create/start/stop/delete flow, plus network-namespace isolation
and the configurable-runtime option, were verified against a real
containerd 2.x + runc/crun install during development (see
tests/containerd_integration.rs, #[ignore]d by default since CI has
no containerd).
Known gaps, documented in the driver README and user-facing docs:
rootless mode (Linux user namespace) is implemented but not yet
functional (containerd's prepared snapshot isn't remapped to match,
so it defaults off); the supervisor binary is bind-mounted from a
host path rather than sourced from an image like the other drivers;
GPU support is kernel-device-node passthrough only, not full CDI
injection; WatchSandboxes polls rather than subscribing to
containerd's event stream.
Related: #2255
Signed-off-by: Eric Curtin <eric.curtin@docker.com>1 parent 8029321 commit 653842b
30 files changed
Lines changed: 3854 additions & 65 deletions
File tree
- architecture
- crates
- openshell-core/src
- openshell-driver-native
- src
- tests
- openshell-driver-vm
- src
- openshell-nft-ruleset
- src
- openshell-server
- src
- compute
- docs/reference
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| |||
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
| 143 | + | |
141 | 144 | | |
142 | | - | |
| 145 | + | |
143 | 146 | | |
144 | 147 | | |
145 | 148 | | |
| |||
990 | 993 | | |
991 | 994 | | |
992 | 995 | | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
993 | 1000 | | |
994 | 1001 | | |
995 | 1002 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| |||
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| 176 | + | |
175 | 177 | | |
176 | 178 | | |
177 | 179 | | |
| |||
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
| 188 | + | |
186 | 189 | | |
187 | 190 | | |
188 | 191 | | |
| |||
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
| 200 | + | |
197 | 201 | | |
198 | 202 | | |
199 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments