Skip to content

Commit cd6c738

Browse files
committed
refactor(driver): trim compute capability response
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent be6ac9e commit cd6c738

8 files changed

Lines changed: 5 additions & 24 deletions

File tree

‎architecture/compute-runtimes.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ drive client provisioning UI, the driver attaches the shared
2222
clients to parse Kubernetes reasons, VM cache states, or other driver-local
2323
reason strings.
2424

25+
The capability RPC reports driver identity, version, and the default sandbox
26+
image used by the gateway. GPU availability stays driver-local and is validated
27+
when a sandbox create request asks for GPU resources.
28+
2529
## Runtime Summary
2630

2731
| Runtime | Best fit | Sandbox boundary | Notes |

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,6 @@ impl DockerComputeDriver {
336336
driver_name: "docker".to_string(),
337337
driver_version: self.config.daemon_version.clone(),
338338
default_image: self.config.default_image.clone(),
339-
supports_gpu: self.config.supports_gpu,
340-
gpu_count: 0,
341339
}
342340
}
343341

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,11 @@ impl KubernetesComputeDriver {
157157
})
158158
}
159159

160-
pub async fn capabilities(&self) -> Result<GetCapabilitiesResponse, String> {
160+
pub fn capabilities(&self) -> Result<GetCapabilitiesResponse, String> {
161161
Ok(GetCapabilitiesResponse {
162162
driver_name: "kubernetes".to_string(),
163163
driver_version: openshell_core::VERSION.to_string(),
164164
default_image: self.config.default_image.clone(),
165-
supports_gpu: self.has_gpu_capacity().await.unwrap_or(false),
166-
gpu_count: 0,
167165
})
168166
}
169167

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ impl ComputeDriver for ComputeDriverService {
3636
) -> Result<Response<GetCapabilitiesResponse>, Status> {
3737
self.driver
3838
.capabilities()
39-
.await
4039
.map(Response::new)
4140
.map_err(Status::internal)
4241
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,10 @@ impl PodmanComputeDriver {
169169

170170
/// Report driver capabilities.
171171
pub fn capabilities(&self) -> Result<GetCapabilitiesResponse, ComputeDriverError> {
172-
let supports_gpu = Self::has_gpu_capacity();
173172
Ok(GetCapabilitiesResponse {
174173
driver_name: "podman".to_string(),
175174
driver_version: openshell_core::VERSION.to_string(),
176175
default_image: self.config.default_image.clone(),
177-
supports_gpu,
178-
gpu_count: 0,
179176
})
180177
}
181178

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,17 +372,10 @@ impl VmDriver {
372372

373373
#[must_use]
374374
pub fn capabilities(&self) -> GetCapabilitiesResponse {
375-
let gpu_count = self
376-
.gpu_inventory
377-
.as_ref()
378-
.and_then(|inv| inv.lock().ok())
379-
.map_or(0, |inv| inv.gpu_count());
380375
GetCapabilitiesResponse {
381376
driver_name: DRIVER_NAME.to_string(),
382377
driver_version: openshell_core::VERSION.to_string(),
383378
default_image: self.config.default_image.clone(),
384-
supports_gpu: self.gpu_inventory.is_some(),
385-
gpu_count,
386379
}
387380
}
388381

‎crates/openshell-server/src/compute/mod.rs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,8 +1639,6 @@ impl ComputeDriver for NoopTestDriver {
16391639
driver_name: "noop-test-driver".to_string(),
16401640
driver_version: "test".to_string(),
16411641
default_image: "openshell/sandbox:test".to_string(),
1642-
supports_gpu: false,
1643-
gpu_count: 0,
16441642
},
16451643
))
16461644
}
@@ -1788,8 +1786,6 @@ mod tests {
17881786
driver_name: "test-driver".to_string(),
17891787
driver_version: "test".to_string(),
17901788
default_image: "openshell/sandbox:test".to_string(),
1791-
supports_gpu: true,
1792-
gpu_count: 0,
17931789
}))
17941790
}
17951791

‎proto/compute_driver.proto‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ message GetCapabilitiesResponse {
5151
string driver_version = 2;
5252
// Default sandbox image recommended by the driver.
5353
string default_image = 3;
54-
// True when the driver can provision GPU-backed sandboxes.
55-
bool supports_gpu = 4;
56-
// Number of GPUs available for sandbox assignment.
57-
uint32 gpu_count = 5;
5854
}
5955

6056
// Driver-owned sandbox model used for create requests and platform observations.

0 commit comments

Comments
 (0)