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

Method publish_pulled_event

crates/openshell-driver-vm/src/driver.rs:3599–3614  ·  view source on GitHub ↗

Emit a `Pulled` platform event with progress metadata for the CLI.

(&self, sandbox_id: &str, image_ref: &str, image_path: &Path)

Source from the content-addressed store, hash-verified

3597
3598 /// Emit a `Pulled` platform event with progress metadata for the CLI.
3599 async fn publish_pulled_event(&self, sandbox_id: &str, image_ref: &str, image_path: &Path) {
3600 let mut metadata = HashMap::from([("image_ref".to_string(), image_ref.to_string())]);
3601 let size_suffix = tokio::fs::metadata(image_path).await.map_or_else(
3602 |_| String::new(),
3603 |meta| {
3604 metadata.insert("image_size_bytes".to_string(), meta.len().to_string());
3605 format!(" Image size: {} bytes.", meta.len())
3606 },
3607 );
3608 self.publish_vm_progress(
3609 sandbox_id,
3610 "Pulled",
3611 format!("Successfully pulled image \"{image_ref}\".{size_suffix}"),
3612 metadata,
3613 );
3614 }
3615}
3616
3617struct DownloadedRegistryLayer {

Calls 2

lenMethod · 0.80
publish_vm_progressMethod · 0.80

Tested by

no test coverage detected