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

Function configured_compute_driver

crates/openshell-server/src/lib.rs:836–857  ·  view source on GitHub ↗
(
    config: &Config,
    driver_startup: compute::driver_config::DriverStartupContext<'_>,
)

Source from the content-addressed store, hash-verified

834}
835
836fn configured_compute_driver(
837 config: &Config,
838 driver_startup: compute::driver_config::DriverStartupContext<'_>,
839) -> Result<ConfiguredComputeDriver> {
840 match config.compute_drivers.as_slice() {
841 [] => match openshell_core::config::detect_driver() {
842 Some(ComputeDriverKind::Vm) => Err(Error::config(
843 "vm compute driver is opt-in only; set --drivers vm or OPENSHELL_DRIVERS=vm",
844 )),
845 Some(driver) => Ok(ConfiguredComputeDriver::Builtin(driver)),
846 None => Err(Error::config(
847 "no compute driver configured and auto-detection found no suitable driver; \
848 set --drivers or OPENSHELL_DRIVERS to kubernetes, podman, docker, or vm",
849 )),
850 },
851 [driver] => resolve_configured_compute_driver(driver, driver_startup),
852 drivers => Err(Error::config(format!(
853 "multiple compute drivers are not supported yet; configured drivers: {}",
854 drivers.join(",")
855 ))),
856 }
857}
858
859fn resolve_configured_compute_driver(
860 driver_name: &str,

Calls 4

detect_driverFunction · 0.85
configFunction · 0.85
as_sliceMethod · 0.80