Skip to main content

Crate microvms_app

Crate microvms_app 

Source
Expand description

The MicroVMs client’s use cases, written only against ports (ARCH-7).

The control-plane client, sandbox::Sandbox, session::Session, ensure_image, the agent recipes and the daemon release’s verification policy are here. Everything they do outside the process goes through a trait this crate declares: control::transport::Transport for the control plane, control::BuildServices for STS and S3, session::HttpBackend for the daemon, session::TokenMinter for proxy tokens, names::NameStore for the name registry, clock::Clock for time, entropy::Entropy for randomness, adapters::Adapters for the pieces a use case builds partway through, and provision::ReleaseSource and provision::AttestationVerifier for the daemon release a fetch proves.

§What this crate can’t do

Reach the network, AWS, the filesystem, a subprocess, the wall clock or the OS random pool. A use case that did one of those directly couldn’t be tested without the real thing, and it would bypass the port a test replaces. These checks hold that:

  • the exact dependency set in verify/arch/placement.toml, which crates/microvms-cli/tests/dependency_direction.rs asserts along with each dependency’s features, keeps reqwest, the AWS crates, getrandom and the socket crates out;
  • clippy.toml beside this crate’s manifest bans the std file, network, process, environment and clock calls, and tokio’s net, fs and process items, which feature unification would otherwise let this crate name;
  • the crate root below forbids both lints, so a hit fails the build and an inner #[allow] or #[expect] is itself an error.

The production implementations are in microvms-edges. microvms-core wires them into the constructors a caller has always used (ControlPlane::new, Sandbox::new, Session::connect) and re-exports every item here at its microvms_core:: path, so a consumer names these types through core and never depends on this crate.

The shared test doubles are in testing, behind the test-support feature.

Re-exports§

pub use protocol;

Modules§

adapters
The adapters port: the production pieces a use case builds for itself partway through.
agents
Agent VMs: the L3 helpers over the lifecycle (docs/AGENT-VMS.md).
clock
The one clock port: monotonic time, sleeping, and the wall time since the epoch.
constants
Every hardcoded service constraint, and the JSON the build gate checks them with.
control
The control-plane client: SigV4-signed rest-json, and every trap closed before the request leaves the process.
cost
What a run cost, and what a plan will cost, with every figure labelled.
defaults
The client’s defaults, by name: what every surface uses when its caller leaves a value out (#300).
duration
Seconds that arrive as a float, as a Duration.
entropy
The entropy port: where idempotency nonces, agent tokens and identity seeds come from.
error
One error type, two granularities.
hooks
The two hook-timeout ceilings, as two types that cannot be swapped.
identity
The host’s half of the tunnel identity proof: derivation and the pin.
names
Named MicroVMs: records that let a later process find a VM by name and adopt it.
preflight
preflight: whether a harness can launch here, checked before it queues work (#223).
provision
How a fetched daemon release is proven (BIND-18): which checks, in what order, and which failures stop the fetch.
region
The five regions that carry MicroVMs, as a closed enum (TRAP-6).
sandbox
The Sandbox lifecycle: one VM’s whole life, with the state machine the symspec model describes made true of the code.
session
The in-VM client: one MicroVM’s control API, with the proxy auth handled for you.
sizing
Size classes: what minimumMemoryInMiB actually buys, and what it bills.
workspace
A project directory moved between a host and a VM: the manifest, the diff, one incremental sync pass, and the guarded download of a remote tree (#260).

Structs§

BuildHookTimeout
A timeout for the ready or validate image-build hook: 1..=3600 seconds.
Error
A failure, classified once at the point it is raised.
RunHookTimeout
A timeout for the run, resume, suspend, or terminate hook: 1..=60 seconds.

Enums§

ErrorKind
The coarse failure classes, one per non-zero row of the CLI’s exit table.
Region
An AWS region, closed over the five that run MicroVMs plus a named escape hatch.
SizeClass
One of the five documented size classes.
WireKind
The fine-grained taxonomy: one variant per condition the daemon or the transport distinguishes.