Skip to main content

Crate microvms_domain

Crate microvms_domain 

Source
Expand description

The MicroVMs client’s rules and values, with no I/O (ARCH-6).

Every surface has to agree on these: the size classes, the cost engine and its rate table, region parsing, the service constraints, VM name validation, the error kinds, and the tunnel identity’s derivation and pin. A rule that read ambient state would give different answers on different machines, and it couldn’t be tested without faking that state globally. So nothing here reads the network, the filesystem, the environment, the clock or the OS random pool, or starts a subprocess; each input a rule needs is a parameter. region::Region::from_env takes a lookup, cost::CalendarDate::from_unix_secs takes the time, and identity::LaunchIdentity::from_seeds takes the seeds.

Two checks hold that. clippy.toml beside this crate’s manifest bans the std calls and the clock and entropy calls of the crates this one uses, and the crate root below forbids both lints. The crates that could do I/O through a dependency (tokio, getrandom, reqwest) are kept out by the exact dependency set in verify/arch/placement.toml, which crates/microvms-cli/tests/dependency_direction.rs asserts along with each dependency’s features.

microvms-core re-exports every module here at its old path (ARCH-1), so a consumer names these items as microvms_core::cost::CalendarDate and never depends on this crate. Core’s prelude supplies the clock and entropy reads these types used to do themselves.

Re-exports§

pub use error::Error;
pub use error::ErrorKind;
pub use error::WireKind;
pub use hooks::BuildHookTimeout;
pub use hooks::RunHookTimeout;
pub use region::Region;
pub use sizing::SizeClass;

Modules§

constants
Every hardcoded service constraint, and the JSON the build gate checks them with.
cost
What a run cost, and what a plan will cost, with every figure labelled.
duration
Seconds that arrive as a float, as a Duration.
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: the record that lets a later process find a VM by name and adopt it.
preflight
The lines of a preflight or doctor report, and the region line’s rule (#223).
provision
The checks over a daemon binary’s bytes: is it an aarch64 ELF (#234).
region
An AWS region: any well-formed name, plus the regions AWS was measured running MicroVMs in (TRAP-6).
sizing
Size classes: what minimumMemoryInMiB actually buys, and what it bills.