MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / seal_sandbox_image

Method seal_sandbox_image

libatomic/src/daemon/services_sandbox.rs:422–462  ·  view source on GitHub ↗
(
        &self,
        request: Request<SealSandboxImageRequest>,
    )

Source from the content-addressed store, hash-verified

420 }
421
422 async fn seal_sandbox_image(
423 &self,
424 request: Request<SealSandboxImageRequest>,
425 ) -> Result<Response<SealSandboxImageResponse>, Status> {
426 self.state.local_only(&request, "SealSandboxImage")?;
427 let request = request.into_inner();
428 let handle = self.state.resolve(request.repository.as_ref().unwrap())?;
429 self.state.log_rpc("SealSandboxImage", Some(&handle));
430 let gate_handle = handle.clone();
431 let _gate = gate_handle.exclusive().await;
432 let meta = request.meta.clone();
433 let view = request.name.clone();
434 let out = request.out_dir.clone();
435 let entrypoint = request.entrypoint.clone();
436 let env = request.env.clone();
437 let (image_dir, manifest_digest, files) = tokio::task::spawn_blocking(move || {
438 let repo = handle.repository()?;
439 let result = repo
440 .seal(SealOptions {
441 view,
442 out: std::path::PathBuf::from(out),
443 entrypoint,
444 env,
445 })
446 .map_err(repository_error)?;
447 Ok::<_, Status>((
448 result.out.display().to_string(),
449 result.manifest_digest,
450 result.files as u64,
451 ))
452 })
453 .await
454 .map_err(|e| Status::internal(e.to_string()))??;
455 Ok(Response::new(SealSandboxImageResponse {
456 sealed_ref: manifest_digest.clone(),
457 image_dir,
458 manifest_digest,
459 files,
460 meta: response_meta(&meta),
461 }))
462 }
463
464 type MaterializeStream = std::pin::Pin<
465 Box<dyn futures_core::Stream<Item = Result<MaterializeFrame, Status>> + Send>,

Callers

nothing calls this directly

Calls 12

response_metaFunction · 0.85
local_onlyMethod · 0.80
as_refMethod · 0.80
log_rpcMethod · 0.80
exclusiveMethod · 0.80
repositoryMethod · 0.80
sealMethod · 0.80
displayMethod · 0.80
into_innerMethod · 0.45
resolveMethod · 0.45
unwrapMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected