Skip to main content

Crate arcbox_computer_runtime

Crate arcbox_computer_runtime 

Source
Expand description

arcbox-computer-runtime — guest-side sandbox orchestration.

§Scope

This crate runs inside the Linux guest VM, managing nested microVMs for workload isolation (sandboxes) through a VmDriver (arcbox_vm_driver) — the reference driver is arcbox-fc-driver, Firecracker. It is consumed exclusively by arcbox-agent.

The host-side VMM that boots the guest is [arcbox-vmm], which sits on top of arcbox-hypervisor (Virtualization.framework on macOS, KVM on Linux). These two crates serve fundamentally different layers and should not be confused:

CrateRuns onPurposeBackend
arcbox-vmmhostboot + manage the guest VMVirtualization.framework / KVM
arcbox-computer-runtimeguestnested sandbox microVMsa VmDriver (Firecracker via arcbox-fc-driver)

The vm-agent binary that becomes PID 1 inside each sandbox is a separate crate, arcbox-vm-agent, and the wire vocabulary the two sides share (boot parameters, exec and file frames) is arcbox-vm-proto. Both this manager and the agent link the proto crate; neither links the other, so the crate graph — not a convention — keeps the agent (cross-compiled to static musl and staged into every sandbox rootfs) free of the manager and its dependencies. boot_proto and file_proto remain reachable through this crate as re-exports.

§Public API

  • SandboxManager — top-level sandbox orchestrator
  • NodeEnvironment — the four environment-specific components a composer supplies, all required: the VM driver, the guest network, the guest-agent factory, and the copy-on-write rootfs manager
  • agent — the guest-agent port: how the runtime reaches the agent inside a Computer (exec, files, clock, readiness), with the arcbox-vm-proto vsock client as its one implementation
  • RootfsBuilder — OCI/overlay2 → ext4 with /sbin/vm-agent injected, and the default busybox image; the composer supplies RootfsPaths
  • SandboxState — a computer’s public lifecycle state
  • RuntimeConfig / SandboxSpec — configuration types

This crate names no VMM and no network implementation. Sandboxes reach both only through arcbox-vm-driver’s ports, and the composer supplies the implementations as a NodeEnvironment; a consumer that needs an adapter’s own vocabulary depends on that adapter itself.

Snapshot lineage — the checkpoint catalog, the copy-on-write rootfs manager, and the template catalog — lives in arcbox-snapshot in the engine layer. The crate::{snapshot, snapshot_cow, template_catalog} paths are re-exports of it so existing imports keep resolving; name arcbox_snapshot directly in new code.

Re-exports§

pub use agent::ExecInputMsg;
pub use agent::ExitStatus;
pub use agent::OutputChunk;
pub use agent::PortWait;
pub use config::DefaultVmConfig;
pub use config::FirecrackerConfig;
pub use config::GrpcConfig;
pub use config::NetworkConfig;
pub use config::RuntimeConfig;
pub use environment::NodeEnvironment;
pub use error::Result;
pub use error::VmmError;
pub use rootfs::RootfsBuilder;
pub use rootfs::RootfsPaths;
pub use sandbox::pause_reason;
pub use sandbox::CheckpointInfo;
pub use sandbox::CheckpointSummary;
pub use sandbox::IdleAction;
pub use sandbox::LifecycleUpdate;
pub use sandbox::RestoreSandboxSpec;
pub use sandbox::SandboxEvent;
pub use sandbox::SandboxId;
pub use sandbox::SandboxInfo;
pub use sandbox::SandboxManager;
pub use sandbox::SandboxMountSpec;
pub use sandbox::SandboxNetworkIdentity;
pub use sandbox::SandboxNetworkInfo;
pub use sandbox::SandboxNetworkSpec;
pub use sandbox::SandboxSpec;
pub use sandbox::SandboxState;
pub use sandbox::SandboxSummary;
pub use sandbox::TemplateWarmRef;
pub use sandbox::ExecutionChannel;
pub use sandbox::ExecutionOutput;
pub use sandbox::ExecutionSnapshot;
pub use sandbox::ExecutionSpec;
pub use sandbox::StdinState;

Modules§

agent
The guest-agent port: how the runtime reaches the agent inside a Computer.
boot_proto
Boot-parameter vocabulary shared with vm-agent (arcbox_vm_proto::boot). Boot protocol types shared between the host-side sandbox orchestrator and the guest-side vm-agent.
config
Runtime configuration types.
environment
Environment-specific components a composer supplies to the sandbox stack.
error
file_proto
File-channel vocabulary shared with vm-agent (arcbox_vm_proto::file): the stat/event DTOs and the size caps a caller validates against. File channel: the guest vsock port the agent serves file I/O on.
rootfs
Build bootable ext4 rootfs images for sandboxes.
sandbox
SandboxManager — orchestrates sandbox microVM lifecycle.
snapshot
snapshot_cow
Block-level copy-on-write for sandbox rootfs via dm-snapshot.
template_catalog
On-disk template catalog (CORE-107).

Structs§

SnapshotCatalog
Manages the on-disk snapshot catalog for all VMs.
SnapshotInfo
Info returned to callers / gRPC layer.
StartCommand
The command vocabulary the guest agent starts processes from, shared with vm-agent through arcbox-vm-proto. Parameters forwarded to the guest agent as the session-start frame.