Expand description
Instance type catalog and selection algorithm for cloud compute infrastructure.
This module provides:
- A static catalog of known instance types across AWS, GCP, and Azure
- Resource quantity parsing (CPU strings, Kubernetes-style memory/storage quantities)
- An algorithm to select the optimal instance type for a given workload
The catalog is the single source of truth for instance type specifications.
It is used by the preflights system to automatically populate CapacityGroup.instance_type
and CapacityGroup.profile based on the containers in a stack.
Structs§
- Catalog
Gpu - Static GPU specification for catalog entries (no heap allocation).
- Instance
Selection - Result of instance type selection.
- Instance
Type Spec - A known instance type with its hardware specifications.
- Workload
Requirements - Aggregated resource requirements from all containers in a capacity group.
Enums§
- Architecture
- CPU architecture.
- Instance
Family - Instance family classification.
Functions§
- auto_
select_ series - The series automatic selection may pick from, in catalog (preference) order.
- catalog_
for_ platform - Get all instance types for a given platform.
- default_
architecture - Default machine architecture for images built for a managed cloud.
- find_
instance_ type - Find a specific instance type by name and platform.
- is_
same_ architecture_ aws_ machine - Whether a capacity group may move from AWS machine
oldtonewwithout setup: both are catalog machines of one CPU architecture, so the stack’s images still run on the new one. - is_
same_ architecture_ machine - Whether two catalog machines belong to the given cloud and share a CPU architecture.
- max_
configurable_ ephemeral_ storage_ bytes - Maximum workload storage that the current cloud controllers can turn into their provider-backed root disk after adding 25% filesystem headroom and 12 GiB of runtime overhead. Keep these bounds in sync with the provider controller contract; rejecting here is preferable to failing after cloud resources have already been created.
- parse_
cpu - Parse a CPU quantity string to f64.
- parse_
memory_ bytes - Parse a memory or storage quantity string to bytes.
- select_
family - Select instance family based on workload characteristics.
- select_
instance_ type - Select the best instance type for a workload on a given platform.
- select_
instance_ type_ with_ room - Like
select_instance_type, but only from the series that have room formachinesmachines.has_roomanswers for one machine type of a series. The ordinary selection runs first; a pick whose series has no room removes that series and selection runs again, so every preference of the ordinary selection (local disk before a configurable one, the smallest machine that fits, catalog order between equal machines) still applies to the series that remain. When no series has room, the result is the plain selection, so the caller’s quota check reports the refusal. Pass the machines the pool launches with.