Skip to content

Commit 3e96466

Browse files
committed
fix(compute): preserve driver behavior after extraction
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent 4354a60 commit 3e96466

23 files changed

Lines changed: 705 additions & 129 deletions

File tree

‎.agents/skills/build-openshell-mxc-windows/SKILL.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ crypto dependency builds.
231231
| `windows:build:arm64` | Release-builds `openshell-gateway.exe` and `openshell.exe` for ARM64. |
232232
| `windows:test:x64` | Runs native x64 workspace tests with `--no-fail-fast`, excluding unsupported Windows packages as top-level workspace targets. |
233233
| `windows:test:arm64` | Runs native ARM64 workspace tests with `--no-fail-fast` and the same package exclusions. Rejects non-ARM64 hosts. |
234-
| `windows:test:unsupported:x64` | Re-runs focused `openshell-server` tests for unsupported Windows driver behavior. |
234+
| `windows:test:unsupported:x64` | Re-runs focused `openshell-gateway` tests for unsupported Windows driver behavior. |
235235
| `windows:test:unsupported:arm64` | Re-runs the same focused contracts natively on ARM64. Rejects non-ARM64 hosts. |
236236
| `windows:artifacts` | Reports size and SHA256 for release artifacts that exist. |
237237
| `windows:ci` | Runs the full ordered x64-host Windows CI lane, plus ARM64 check/build when not skipped. |
@@ -248,10 +248,10 @@ Windows must continue to reject unsupported compute drivers clearly.
248248

249249
| Driver | Windows build behavior | Runtime behavior |
250250
|---|---|---|
251-
| Docker | Driver crate excluded; server config contract retained. | Gateway construction returns unsupported. |
252-
| Kubernetes | Driver crate excluded; server config contract retained. | Gateway construction returns unsupported. |
253-
| Podman | Driver crate excluded; server config contract retained. | Gateway construction returns unsupported. |
254-
| VM | Driver crate excluded from workspace validation. | Gateway construction returns unsupported. |
251+
| Docker | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
252+
| Kubernetes | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
253+
| Podman | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
254+
| VM | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
255255

256256
The focused contract tasks for either native architecture run:
257257

‎.agents/skills/build-openshell-mxc-windows/reference.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Windows is a build target only. These runtimes remain unsupported:
8585

8686
Rules:
8787

88-
- Keep config/library stubs where the gateway needs them.
88+
- Keep registration stubs in the gateway composition crate where the gateway needs them.
8989
- Return clear unsupported errors at runtime.
9090
- Do not build standalone Windows driver binaries.
9191
- Do not add Docker Desktop, WSL, Hyper-V, Podman machine, Podman Desktop, or
@@ -180,7 +180,7 @@ blocked dependency.
180180
### Focused tests report many filtered-out tests
181181

182182
This is expected for `windows:test:unsupported:x64`. Cargo runs one named test
183-
and filters the other `openshell-server` tests. Report these as filtered, not
183+
and filters the other `openshell-gateway` tests. Report these as filtered, not
184184
ignored.
185185

186186
## Reporting Counts

‎.github/workflows/branch-e2e.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ jobs:
166166
interpreter: /lib/ld-linux-aarch64.so.1
167167
uses: ./.github/workflows/build-binaries.yml
168168
with:
169-
package: openshell-server
169+
package: openshell-gateway
170170
binary: openshell-gateway
171171
artifact-name: openshell-gateway-plain-${{ matrix.triple }}
172172
triple: ${{ matrix.triple }}

‎.github/workflows/build-gateway-binaries.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
interpreter: ""
4444
uses: ./.github/workflows/build-binaries.yml
4545
with:
46-
package: openshell-server
46+
package: openshell-gateway
4747
binary: openshell-gateway
4848
triple: ${{ matrix.triple }}
4949
runner: ${{ matrix.runner }}

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ These pipelines connect skills into end-to-end workflows. Individual skill files
5252
| `crates/openshell-driver-db-credstore/` | Database credential driver | In-process `CredentialDriver` backend for gateway database credential storage |
5353
| `crates/openshell-driver-kubernetes/` | Kubernetes compute driver | In-process `ComputeDriver` backend for K8s sandbox pods |
5454
| `crates/openshell-driver-docker/` | Docker compute driver | In-process `ComputeDriver` backend for local Docker sandbox containers |
55+
| `crates/openshell-driver-mxc/` | MXC compute driver | Windows in-process `ComputeDriver` backend for MXC sandbox execution |
5556
| `crates/openshell-driver-podman/` | Podman compute driver | In-process `ComputeDriver` backend for local Podman sandbox containers |
5657
| `crates/openshell-driver-vm/` | VM compute driver | Standalone libkrun-backed `ComputeDriver` subprocess (embeds its own rootfs + runtime) |
5758
| `crates/openshell-prover/` | Policy prover | Policy verification and proof generation |

‎Cargo.lock‎

Lines changed: 25 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎architecture/windows-msvc-build.md‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ driver. It does not make Windows a Docker, Kubernetes, Podman, or VM runtime hos
2323

2424
## Unsupported Driver Strategy
2525

26-
The gateway uses platform-specific configuration contracts on Windows. These
27-
contracts preserve config-file parsing and reject unsupported driver selection
28-
with a clear error without depending on the runtime driver crates.
26+
The gateway composition crate installs platform-specific registration stubs on
27+
Windows. These registrations preserve config-file selection and reject
28+
unsupported drivers with a clear error without depending on their runtime
29+
crates.
2930

3031
The Windows lane does not build, release, package, or smoke-test standalone
3132
driver binaries for Docker, Kubernetes, Podman, or VM. Those binaries are Linux
@@ -39,10 +40,10 @@ on Windows.
3940

4041
| Driver | Windows build behavior | Runtime behavior |
4142
|---|---|---|
42-
| Docker | Driver crate excluded; server config contract retained. | Gateway construction returns unsupported. |
43-
| Kubernetes | Driver crate excluded; server config contract retained. | Gateway construction returns unsupported. |
44-
| Podman | Driver crate excluded; server config contract retained. | Gateway construction returns unsupported. |
45-
| VM | Driver crate excluded from workspace validation. | Gateway construction returns unsupported. |
43+
| Docker | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
44+
| Kubernetes | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
45+
| Podman | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
46+
| VM | Driver crate excluded; gateway registration stub retained. | Gateway construction returns unsupported. |
4647
| MXC | Driver links into the native gateway and runs in Windows validation. | `process_container` is default-deny; grant-only `isolation_session` requires explicit configuration. |
4748

4849
This keeps Windows behavior explicit without carrying runtime dependencies or
@@ -66,7 +67,7 @@ Windows validation is exposed through `tasks/windows.toml`:
6667
| `windows:build:arm64` | Build release ARM64 `openshell-gateway.exe` and `openshell.exe`. |
6768
| `windows:test:x64` | Run native x64 workspace tests, including MXC mapper and lifecycle tests, while excluding unsupported Windows packages as top-level test targets. |
6869
| `windows:test:arm64` | Run native ARM64 workspace tests with the same package exclusions. |
69-
| `windows:test:unsupported:x64` | Run focused server/runtime tests for unsupported driver contracts. |
70+
| `windows:test:unsupported:x64` | Run focused gateway-composition tests for unsupported driver contracts. |
7071
| `windows:test:unsupported:arm64` | Run the same focused contracts natively on ARM64. |
7172
| `windows:ci` | Run check, build, test, unsupported-contract tests, and artifact reporting. |
7273

‎crates/openshell-driver-docker/src/main.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use std::path::PathBuf;
66

77
use clap::Parser;
88
use miette::{IntoDiagnostic, Result};
9-
use openshell_core::proto::compute::v1::compute_driver_server::ComputeDriverServer;
109
use openshell_core::VERSION;
10+
use openshell_core::proto::compute::v1::compute_driver_server::ComputeDriverServer;
1111
use openshell_driver_docker::otel_tracing::compute_driver_rpc_layer;
1212
use openshell_driver_docker::{ComputeDriverService, DockerComputeConfig, DockerComputeDriver};
1313
use tracing::info;

‎crates/openshell-driver-podman/src/driver.rs‎

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -314,28 +314,7 @@ fn podman_gpu_selection_error(err: CdiGpuSelectionError) -> ComputeDriverError {
314314
/// Return the first responsive local Podman API socket.
315315
#[must_use]
316316
pub fn detect_socket() -> Option<PathBuf> {
317-
let mut candidates = Vec::new();
318-
if let Ok(path) = std::env::var("OPENSHELL_PODMAN_SOCKET")
319-
&& !path.trim().is_empty()
320-
{
321-
candidates.push(PathBuf::from(path));
322-
}
323-
if let Some(runtime_dir) = std::env::var_os("XDG_RUNTIME_DIR") {
324-
candidates.push(PathBuf::from(runtime_dir).join("podman/podman.sock"));
325-
}
326-
#[cfg(target_os = "linux")]
327-
candidates.push(PathBuf::from(format!(
328-
"/run/user/{}/podman/podman.sock",
329-
rustix::process::geteuid().as_raw()
330-
)));
331-
if let Some(home) = std::env::var_os("HOME") {
332-
candidates
333-
.push(PathBuf::from(home).join(".local/share/containers/podman/machine/podman.sock"));
334-
}
335-
openshell_core::local_api_socket::first_responsive_socket(&candidates, |response| {
336-
openshell_core::local_api_socket::http_response_is_success(response)
337-
&& openshell_core::local_api_socket::contains_ascii(response, b"Libpod-Api-Version:")
338-
})
317+
crate::socket_discovery::detect_socket()
339318
}
340319

341320
#[must_use]

‎crates/openshell-driver-podman/src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub(crate) mod container;
77
pub mod driver;
88
pub mod grpc;
99
pub mod otel_tracing;
10+
mod socket_discovery;
1011
#[cfg(test)]
1112
pub(crate) mod test_utils;
1213
pub(crate) mod watcher;

0 commit comments

Comments
 (0)