pub struct Machine {Show 35 fields
pub networks: IndexMap<String, u8>,
pub more_addresses: IndexMap<String, Vec<u8>>,
pub count: Option<u8>,
pub aliases: Vec<String>,
pub os: Option<String>,
pub arch: Arch,
pub rate_limit: Option<String>,
pub privileged: bool,
pub nested_virtualization: bool,
pub gpus: Option<Gpus>,
pub devices: Vec<Device>,
pub read_only: bool,
pub tmpfs: Vec<Tmpfs>,
pub shm_size: Option<String>,
pub dns: Option<Dns>,
pub environment: IndexMap<String, String>,
pub sysctls: IndexMap<String, String>,
pub ulimits: IndexMap<String, Ulimit>,
pub ports: Vec<Port>,
pub inputs: Vec<String>,
pub secrets: Vec<MachineSecret>,
pub resources: Option<Resources>,
pub command: Option<CommandLine>,
pub working_dir: Option<String>,
pub healthcheck: Option<Healthcheck>,
pub depends_on: Vec<String>,
pub volumes: IndexMap<String, Mount>,
pub files: Vec<MachineFile>,
pub disks: IndexMap<String, Disk>,
pub access: bool,
pub docker: Option<DockerImpl>,
pub vm: Option<VmImpl>,
pub external: Option<External>,
pub supplied: bool,
pub configuration: Option<Configuration>,
}Expand description
A machine of the environment: where it sits on the networks, what it serves, and how each
kind of target produces it (docker:, vm:, external:).
Fields§
§networks: IndexMap<String, u8>Network name -> last octet of the machine’s address on it. Every machine has one, but a
LAN’s switch, whose ports the LAN gives it. A list (lan: [10, 11, 12]) gives the
machine several addresses on the network: the first is its primary one, the one its name
resolves to, and the others are on the same interface.
more_addresses: IndexMap<String, Vec<u8>>The addresses after the first of each network written as a list, split from networks
by lowering: not a field a spec writes.
count: Option<u8>How many of this machine (2 to 99): clones named <name>-01, <name>-02, …, each one
address further along on every network. Where the spec names this machine, it means
every clone. Expanded before anything else reads the spec.
aliases: Vec<String>More DNS names the machine answers to besides its own (a fully qualified name an
application has baked in, like api.example.com), on every network it is on.
os: Option<String>The machine’s OS as <family>@<version> (debian@12, windows-server@2022), or the
family alone for its pinned default version (debian is debian@12). vm.os defaults
to it, and a machine with neither docker: nor vm: runs as a VM of this OS
(vm: { os }).
arch: ArchThe machine’s CPU architecture (amd64 or arm64). Defaults to amd64.
rate_limit: Option<String>A bandwidth cap on each of the machine’s network links, in both directions, as tc
writes a rate (10mbit, 512kbit): a machine on a slow line, while networks.*.tc
slows a whole network down on its router.
privileged: boolThe machine needs kernel-level access (nested containers, loading kernel modules, raw
devices). A container runs privileged; a VM already has it (its workload is root). VMs
inside a VM need nested_virtualization.
nested_virtualization: boolThe machine runs VMs of its own: its VM gets the CPU’s virtualization extensions (each
hypervisor’s nested virtualization). A VM only: a container can’t, so the machine needs
a vm:. Targets whose VMs can’t nest refuse it.
gpus: Option<Gpus>GPUs for the machine: a count (1), all, or { count, ids, driver, capabilities, options }. A container gets the host’s (Docker, Kubernetes); a VM gets them passed
through (Proxmox, by ids) or sized with them (a cloud’s GPU instance type). Other
targets refuse it.
devices: Vec<Device>The host’s devices given to the machine: /dev/fuse, host:guest[:permissions], or
{ host, guest, permissions } (r, w, m). A container on the user’s own Docker
host only: a VM has its own devices (a GPU reaches a VM through gpus).
read_only: boolThe machine’s root filesystem is read-only (hardening): nothing can be written outside
its declared volumes. Applies to containers; a VM’s root stays writable.
tmpfs: Vec<Tmpfs>Memory-backed (tmpfs) mounts inside the machine, for scratch space that never touches
disk: a path (/tmp), or a path with a size and a mode ({ path: /run, size: 64m, mode: "1777" }). A VM sets these up in its own provisioning (fstab).
shm_size: Option<String>The size of /dev/shm (shared memory), e.g. 256m or 1g, for workloads that need more
than the small default (browsers, some databases). A VM sizes it in its own provisioning.
dns: Option<Dns>How the machine resolves names: which DNS servers to use, search domains, and its own domain. Useful to point a Linux box at the lab’s domain controller. A VM sets its resolver in its own provisioning (resolv.conf).
environment: IndexMap<String, String>Environment variables with fixed values: a container’s environment; on a VM, every
service’s (systemd’s default environment) and every login’s (/etc/environment).
sysctls: IndexMap<String, String>Kernel parameters, e.g. net.core.somaxconn: 1024. A container can only set the ones
the kernel keeps per network or IPC namespace (net.*, kernel.shm*, kernel.msg*,
kernel.sem, fs.mqueue.*); a VM sets any (/etc/sysctl.d).
ulimits: IndexMap<String, Ulimit>Process limits, by name (nofile, nproc, memlock…): one value for both, or
{ soft, hard }. A container’s ulimits; on a VM, every service’s (systemd) and every
login’s (limits.d). Kubernetes has none per container.
ports: Vec<Port>The ports the machine answers on, each with its protocol, an HTTP probe and whether it
is published or dormant: what is published, opened by reach, waited for and checked.
inputs: Vec<String>The spec’s inputs this machine receives, by name: only these reach it.
secrets: Vec<MachineSecret>The secrets this machine gets, as files (never environment variables): a name from the
top-level secrets (/run/secrets/<name>), or { source, target, uid, gid, mode }.
Delivered by isoloom run when the machine starts.
resources: Option<Resources>CPUs, memory and disk for the machine (a VM’s size, a container’s limits). Default: 1 CPU, 1024 MB, 20 GB.
command: Option<CommandLine>The machine’s own command, instead of its image’s (CMD; the image’s entrypoint still
runs it). A text runs in the shell, a list as it is. On a VM it runs as a service
(systemd, OpenRC on Alpine; a startup task on Windows), restarted when it fails.
working_dir: Option<String>The directory the command and the healthcheck run in (an absolute
path). Default: the image’s WORKDIR; on a VM, the project folder (/opt/isoloom).
healthcheck: Option<Healthcheck>When the machine counts as healthy beyond its ports answering: a command or a page, with its pace. Checked beside the port probe, never instead of it.
depends_on: Vec<String>Machines that must be ready (their ports answering) before this one starts.
volumes: IndexMap<String, Mount>Data that survives restarts and re-creation of the machine, until the environment is
destroyed: a name -> an absolute path in the machine. On the container targets a volume
starts with the image’s files at that path (Docker’s named volumes; Kubernetes seeds
its claim from the image while it is empty), so init jobs can add to them. A shared
volume’s user may take one folder of it: { path: /srv/www, subpath: www }.
files: Vec<MachineFile>Files placed at a path on the machine (a configuration the image doesn’t carry), from the project or written inline, with their owner and mode: on every target.
disks: IndexMap<String, Disk>Data disks beside the machine’s own, by name (kebab-case, at most 12 characters: the
filesystem’s label): { size_gb: 50, fs: xfs, mount: /data }. A VM gets an empty disk
of that size, formatted and mounted at boot; a container gets a volume at the mount. The
disks go with the machine.
access: boolThe machine the user lands on. It may have no implementation: the runner supplies it.
docker: Option<DockerImpl>How a container produces this machine: an image or a build, and what only a container
has (init jobs, appliances). A machine with docker: can run on the container targets.
vm: Option<VmImpl>How a VM produces this machine (services installed natively, no Docker inside).
external: Option<External>Where this machine already exists (the external target): Isoloom creates nothing and
reaches it over SSH to provision, check and connect.
supplied: boolFilled by the runner’s image table (an access machine the spec leaves to the runner): a stock image, kept running idle for the user to work from. Never in a spec file.
configuration: Option<Configuration>What configures it (an app’s steps), in the configuration model, for every form: the plan resolves it into the recipe a container’s build and a VM’s set-up render. Set by lowering, never written in a spec.
Implementations§
Source§impl Machine
impl Machine
Sourcepub fn port_label(&self, s: &Port) -> String
pub fn port_label(&self, s: &Port) -> String
How outputs name one of its ports (published outputs, Compose labels): its name,
else its port. A UDP port is <port>-udp, and <name>-udp when a TCP port of the
machine has the same name (DNS’s dns over both protocols), so the two never share a key.
Sourcepub fn ready_ports(&self) -> Vec<u16>
pub fn ready_ports(&self) -> Vec<u16>
The ports Isoloom waits for before the machine counts as ready: its TCP ports but the dormant ones (UDP has no handshake to probe). Empty: nothing to probe (no healthcheck, no readiness probe).
Sourcepub fn has_readiness(&self) -> bool
pub fn has_readiness(&self) -> bool
Whether anything says when the machine is ready: a port to probe or a healthcheck of its own. Without either, the machine is ready once started.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Machine
impl<'de> Deserialize<'de> for Machine
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Machine
impl JsonSchema for Machine
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more