MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / validated_sandbox_create

Method validated_sandbox_create

crates/openshell-driver-podman/src/driver.rs:361–382  ·  view source on GitHub ↗
(
        &self,
        sandbox: &'a DriverSandbox,
    )

Source from the content-addressed store, hash-verified

359 }
360
361 async fn validated_sandbox_create<'a>(
362 &self,
363 sandbox: &'a DriverSandbox,
364 ) -> Result<ValidatedPodmanSandbox<'a>, ComputeDriverError> {
365 let gpu_requirements = sandbox
366 .spec
367 .as_ref()
368 .and_then(|spec| spec.resource_requirements.as_ref())
369 .and_then(|requirements| driver_gpu_requirements(Some(requirements)));
370 let driver_config = PodmanSandboxDriverConfig::from_sandbox(sandbox)?;
371 Self::validate_gpu_request(gpu_requirements, &driver_config)?;
372 self.validate_user_volume_mounts_available(sandbox).await?;
373 let _ = self.resolve_gpu_cdi_devices(
374 gpu_requirements,
375 &driver_config,
376 CdiGpuDefaultSelector::peek_device_ids,
377 )?;
378 Ok(ValidatedPodmanSandbox {
379 driver_config,
380 gpu_requirements,
381 })
382 }
383
384 fn validate_gpu_request(
385 gpu_requirements: Option<&GpuResourceRequirements>,

Callers 2

create_sandboxMethod · 0.80

Tested by

no test coverage detected