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, whichcrates/microvms-cli/tests/dependency_direction.rsasserts along with each dependency’s features, keeps reqwest, the AWS crates, getrandom and the socket crates out; clippy.tomlbeside this crate’s manifest bans the std file, network, process, environment and clock calls, and tokio’snet,fsandprocessitems, 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
Sandboxlifecycle: 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
minimumMemoryInMiBactually 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§
- Build
Hook Timeout - A timeout for the
readyorvalidateimage-build hook: 1..=3600 seconds. - Error
- A failure, classified once at the point it is raised.
- RunHook
Timeout - A timeout for the
run,resume,suspend, orterminatehook: 1..=60 seconds.
Enums§
- Error
Kind - 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.
- Size
Class - One of the five documented size classes.
- Wire
Kind - The fine-grained taxonomy: one variant per condition the daemon or the transport distinguishes.