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

Function container_engine_info

e2e/rust/tests/gpu/device_selection.rs:120–144  ·  view source on GitHub ↗
(engine: &ContainerEngine)

Source from the content-addressed store, hash-verified

118}
119
120fn container_engine_info(engine: &ContainerEngine) -> Value {
121 let output = engine
122 .command()
123 .args(["info", "--format", "json"])
124 .output()
125 .unwrap_or_else(|err| panic!("failed to run {} info: {err}", engine.name()));
126
127 let stdout = String::from_utf8_lossy(&output.stdout);
128 let stderr = String::from_utf8_lossy(&output.stderr);
129 let combined = format!("{stdout}{stderr}");
130 assert!(
131 output.status.success(),
132 "{} info --format json failed with status {:?}:\n{}",
133 engine.name(),
134 output.status.code(),
135 combined
136 );
137
138 serde_json::from_slice(&output.stdout).unwrap_or_else(|err| {
139 panic!(
140 "failed to parse {} info JSON: {err}\n{combined}",
141 engine.name()
142 )
143 })
144}
145
146fn info_string<'a>(info: &'a Value, keys: &[&str]) -> Option<&'a str> {
147 keys.iter()

Callers 2

all_gpu_default_allowedFunction · 0.85

Calls 1

commandMethod · 0.80

Tested by

no test coverage detected