Skip to content

Commit bb6f185

Browse files
committed
refactor(compute): remove driver feature negotiation
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
1 parent 680d1c2 commit bb6f185

13 files changed

Lines changed: 67 additions & 270 deletions

File tree

.agents/skills/debug-openshell-cluster/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ running intent should stop before the gateway exits and restart after it
199199
returns. Check for `Stopped sandbox during gateway shutdown` and `Started
200200
sandbox during gateway startup` in gateway logs. A sandbox explicitly stopped
201201
through the CLI remains stopped. Kubernetes sandboxes are cluster-owned and do
202-
not follow this local gateway lifecycle. An external driver follows it only
203-
when `GetCapabilities` advertises `GATEWAY_MANAGED_LIFECYCLE`.
202+
not follow this local gateway lifecycle. An external driver configured under a
203+
different name is not included in the local gateway lifecycle sweep.
204204

205205
### Step 5: Check Podman-Backed Gateways
206206

architecture/compute-runtimes.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,11 @@ references to gateway-internal types. The gateway owns the public
2424
implementing `ComputeDriver` out of tree.
2525

2626
`compute_driver.proto` is the supported gateway/driver extension boundary.
27-
At initialization the gateway snapshots additive feature values from
28-
`GetCapabilities`; unknown values are ignored. Post-initialization lifecycle
29-
and policy behavior does not depend on the configured or advertised driver
30-
name. Gateway-managed shutdown/start lifecycle and native process-identity
31-
defaults are enabled only by their corresponding features. Driver-requested
32-
listeners are structurally validated and remain restricted to sandbox callback
33-
RPCs.
27+
At initialization the gateway snapshots the driver's identity, version, and
28+
default image from `GetCapabilities`. Process-identity omissions are preserved
29+
across this boundary so every driver can apply its native image or runtime
30+
defaults. Driver-requested listeners are structurally validated and remain
31+
restricted to sandbox callback RPCs.
3432

3533
Drivers own runtime-specific platform event interpretation. When an event should
3634
drive client provisioning UI, the driver attaches the shared

crates/openshell-core/src/driver_utils.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
use std::path::{Path, PathBuf};
77

8-
use crate::proto::compute::v1::{ComputeDriverFeature, DriverSandbox, GetCapabilitiesResponse};
8+
use crate::proto::compute::v1::{DriverSandbox, GetCapabilitiesResponse};
99

1010
pub use crate::container_paths::{
1111
SANDBOX_TOKEN_MOUNT_PATH, SUPERVISOR_CONTAINER_BINARY, SUPERVISOR_CONTAINER_DIR,
@@ -380,13 +380,11 @@ pub fn build_capabilities_response(
380380
driver_name: &str,
381381
driver_version: impl Into<String>,
382382
default_image: impl Into<String>,
383-
features: impl IntoIterator<Item = ComputeDriverFeature>,
384383
) -> GetCapabilitiesResponse {
385384
GetCapabilitiesResponse {
386385
driver_name: driver_name.to_string(),
387386
driver_version: driver_version.into(),
388387
default_image: default_image.into(),
389-
features: features.into_iter().map(i32::from).collect(),
390388
}
391389
}
392390

@@ -582,27 +580,6 @@ pub fn validate_linux_elf_binary(path: &Path) -> Result<(), String> {
582580
mod tests {
583581
use super::*;
584582

585-
#[test]
586-
fn capabilities_encode_additive_features() {
587-
let capabilities = build_capabilities_response(
588-
"external",
589-
"1.0.0",
590-
"sandbox:latest",
591-
[
592-
ComputeDriverFeature::GatewayManagedLifecycle,
593-
ComputeDriverFeature::PreserveUnspecifiedProcessIdentity,
594-
],
595-
);
596-
597-
assert_eq!(
598-
capabilities.features,
599-
vec![
600-
i32::from(ComputeDriverFeature::GatewayManagedLifecycle),
601-
i32::from(ComputeDriverFeature::PreserveUnspecifiedProcessIdentity),
602-
]
603-
);
604-
}
605-
606583
#[test]
607584
fn upstream_proxy_url_accepts_http_with_port() {
608585
let addr = parse_upstream_proxy_url("http://proxy.corp.com:8080").unwrap();

crates/openshell-driver-docker/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,6 @@ impl DockerComputeDriver {
494494
"docker",
495495
&self.config.daemon_version,
496496
&self.config.default_image,
497-
[
498-
openshell_core::proto::compute::v1::ComputeDriverFeature::GatewayManagedLifecycle,
499-
openshell_core::proto::compute::v1::ComputeDriverFeature::PreserveUnspecifiedProcessIdentity,
500-
],
501497
)
502498
}
503499

crates/openshell-driver-kubernetes/src/driver.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,6 @@ impl KubernetesComputeDriver {
548548
"kubernetes",
549549
openshell_core::VERSION,
550550
&self.config.default_image,
551-
[],
552551
))
553552
}
554553

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,6 @@ impl PodmanComputeDriver {
468468
"podman",
469469
openshell_core::VERSION,
470470
&self.config.default_image,
471-
[
472-
openshell_core::proto::compute::v1::ComputeDriverFeature::GatewayManagedLifecycle,
473-
openshell_core::proto::compute::v1::ComputeDriverFeature::PreserveUnspecifiedProcessIdentity,
474-
],
475471
))
476472
}
477473

crates/openshell-driver-vm/src/driver.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ use openshell_core::progress::{
3737
format_bytes, mark_progress_active, mark_progress_complete, mark_progress_detail,
3838
};
3939
use openshell_core::proto::compute::v1::{
40-
ComputeDriverFeature, CreateSandboxRequest, CreateSandboxResponse, DeleteSandboxRequest,
41-
DeleteSandboxResponse, DeleteWorkspaceRequest, DeleteWorkspaceResponse,
42-
DriverCondition as SandboxCondition, DriverPlatformEvent as PlatformEvent,
43-
DriverSandbox as Sandbox, DriverSandboxStatus as SandboxStatus,
44-
DriverSandboxTemplate as SandboxTemplate, EnsureWorkspaceRequest, EnsureWorkspaceResponse,
45-
GetCapabilitiesRequest, GetCapabilitiesResponse, GetGatewayListenerRequirementsRequest,
40+
CreateSandboxRequest, CreateSandboxResponse, DeleteSandboxRequest, DeleteSandboxResponse,
41+
DeleteWorkspaceRequest, DeleteWorkspaceResponse, DriverCondition as SandboxCondition,
42+
DriverPlatformEvent as PlatformEvent, DriverSandbox as Sandbox,
43+
DriverSandboxStatus as SandboxStatus, DriverSandboxTemplate as SandboxTemplate,
44+
EnsureWorkspaceRequest, EnsureWorkspaceResponse, GetCapabilitiesRequest,
45+
GetCapabilitiesResponse, GetGatewayListenerRequirementsRequest,
4646
GetGatewayListenerRequirementsResponse, GetSandboxRequest, GetSandboxResponse,
4747
ListSandboxesRequest, ListSandboxesResponse, StartSandboxRequest, StartSandboxResponse,
4848
StopSandboxRequest, StopSandboxResponse, ValidateSandboxCreateRequest,
@@ -520,7 +520,6 @@ impl VmDriver {
520520
driver_name: DRIVER_NAME.to_string(),
521521
driver_version: openshell_core::VERSION.to_string(),
522522
default_image: self.config.default_image.clone(),
523-
features: vec![ComputeDriverFeature::GatewayManagedLifecycle.into()],
524523
}
525524
}
526525

0 commit comments

Comments
 (0)