Skip to main content

Spec

Struct Spec 

Source
pub struct Spec {
Show 21 fields pub version: u32, pub name: String, pub networks: IndexMap<String, Network>, pub reach: Vec<Reach>, pub dns: Option<EnvironmentDns>, pub inputs: Vec<String>, pub plain_inputs: Vec<String>, pub secrets: IndexMap<String, SecretSource>, pub machines: IndexMap<String, Machine>, pub cloud: Option<CloudServices>, pub volumes: IndexMap<String, SharedVolume>, pub constraints: Option<Constraints>, pub common: Option<Shared>, pub groups: IndexMap<String, Group>, pub provision: Vec<Provision>, pub controller: Option<Controller>, pub checks: Vec<Check>, pub targets: Option<Vec<Target>>, pub message: Option<String>, pub tools: IndexMap<String, Tool>, pub clones: IndexMap<String, Vec<String>>,
}
Expand description

An environment spec. Field order in the file is kept (machines start in the order written).

Fields§

§version: u32

The version of the isoloom.yml format the file is written in: 1, the only one so far.

§name: String

The environment’s id, in kebab case (supplier-portal): it names its containers, VMs, networks and cloud resources, and the environment in isoloom status.

§networks: IndexMap<String, Network>

The environment’s networks, by name: each an address block the machines on it share.

§reach: Vec<Reach>

Allowed traffic between networks; everything else between networks is blocked.

§dns: Option<EnvironmentDns>

The environment’s names in a private DNS zone: off unless private: true. See EnvironmentDns.

§inputs: Vec<String>

Names of the values a runner provides at launch (a token, a licence key): from the environment of isoloom run, or a profile’s inputs. A machine receives the ones its own inputs lists. Never baked into images.

§plain_inputs: Vec<String>

The inputs the authored spec marks sensitive: false (an URL, a mode): shown in a runner’s events and logs. Every other input is masked. Set by lowering only.

§secrets: IndexMap<String, SecretSource>

Secrets, by kebab-case name: where isoloom run reads each value on the runner (env, file, vault, sops). A machine lists the ones it gets in its own secrets, as files. Values never reach a generated file, the resolved snapshot or a log.

§machines: IndexMap<String, Machine>

The environment’s machines, by name, started in the order written (after their depends_on).

§cloud: Option<CloudServices>

An environment of cloud services rather than machines (IAM users and roles, functions, buckets, queues…): a Terraform module in the project, applied into the user’s own cloud account. A spec has either cloud: or machines.

§volumes: IndexMap<String, SharedVolume>

Volumes shared between machines: a machine volume with one of these names is this volume, wherever it mounts it. One declared here can also outlive isoloom down (persistent: true) or be one that exists already (external: <name>).

§constraints: Option<Constraints>

What the place it runs in imposes: an HTTP proxy, registry and package mirrors, time servers. Usually set by a profile, one customer’s network at a time.

§common: Option<Shared>

Machine fields shared by every machine (a machine’s own value wins). docker: and vm: here only complete an implementation a machine declares itself.

§groups: IndexMap<String, Group>

Named sets of machines sharing fields (over common:, under the machine’s own; the most specific group wins). They also become Ansible inventory groups, and isoloom exec targets.

§provision: Vec<Provision>

Provisioning across machines, once every machine is up: Ansible playbooks run from a controller on the environment’s networks, with an inventory Isoloom writes.

§controller: Option<Controller>

The controller Isoloom adds for provision: (and checks run from it): a small VM, sized and boxed like a machine. By default 1 CPU, 512 MB and a minimal Alpine box on Vagrant.

§checks: Vec<Check>

Black-box checks that prove the behavior on every target: scripts, or declared probes (http, tcp, exec, script) run from a machine of the environment. Isoloom adds derived checks of its own from ports and reach.

§targets: Option<Vec<Target>>

Narrows the targets derived from the implementations (e.g. not tested on Proxmox yet).

§message: Option<String>

Shown once the environment is up (isoloom run, isoloom message): how to start, in Markdown. {{ machines.web.addresses.front }}-style placeholders take any value of the resolved snapshot (isoloom inspect shows the paths).

§tools: IndexMap<String, Tool>

Observers beside the environment, on every network, that aren’t machines of it (not in reach, resources or the derived checks): a toolbox to look from (shell), or any container image.

§clones: IndexMap<String, Vec<String>>

Base machine name -> its clones, for machines that had a count. Filled when parsing.

Implementations§

Source§

impl Spec

Source

pub fn private_domain(&self) -> Option<String>

The private DNS zone’s domain, when dns.private is on.

Source

pub fn volume_key(&self, machine: &str, volume: &str) -> String

The storage behind machine machine’s volume volume: the shared volume’s own name, else one of its own (<machine>-<volume>).

Source

pub fn volume_users(&self, volume: &str) -> Vec<&str>

The machines that mount shared volume volume, in spec order.

Source

pub fn volume_owner(&self, volume: &str) -> Option<&str>

The machine holding shared volume volume: its owner, else its first user.

Source

pub fn with_cloud_outputs(&self, outputs: &IndexMap<String, String>) -> Spec

The spec with {{ cloud.outputs.<name> }} filled in (checks and message), from a deployed cloud-services environment’s outputs.

Source

pub fn cloud_message( &self, outputs: &IndexMap<String, String>, ) -> Option<String>

The message of a cloud-services environment, its outputs filled in.

Trait Implementations§

Source§

impl Clone for Spec

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Spec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Spec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Spec

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Spec

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Spec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Spec

Auto Trait Implementations§

§

impl Freeze for Spec

§

impl RefUnwindSafe for Spec

§

impl Send for Spec

§

impl Sync for Spec

§

impl Unpin for Spec

§

impl UnsafeUnpin for Spec

§

impl UnwindSafe for Spec

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.