Expand description
Authoring conveniences shared by stack frontends.
A serialized Stack is precise but unpleasant to write: memory in bytes,
CPU as { min, desired }, scale policies spelled out in full. Frontends let developers
write memory = "16Gi" or machines = 2 instead and resolve it here, so every frontend
produces the same Stack from the same intent.
The TypeScript SDK (packages/core) predates this module and still carries its own
copy of these rules. The alien.toml differential tests resolve the same stacks through
both and require identical JSON, which keeps the two copies from drifting.
Structs§
- Authorable
Type - One resource type a stack file can declare.
- Authored
Autoscaling - Machine counts an autoscaling pool moves between.
- Authored
EnvMapping - One environment variable an input is delivered as.
- Authored
Input - A stack input as written in a stack file.
- Authored
Pool - A pool of machines: what each needs, and how many run.
- Compute
Pool - A compute pool as a developer declares it: what the machines need and how many run.
- Pool
Requirements - Hardware a pool’s machines must have.
- Resource
Body Error - A resource body that does not deserialize into its alien-core type.
Enums§
- Compute
Choice - A machine count: one exact number, or a range a deployment chooses from.
- CpuAmount
- A CPU amount written as a number of cores (
2,0.5) or a quantity string ("500m"). - Data
Disk Size - The extra empty data disk each machine must provide.
- Input
Value - A stack input value as written: a default, or a numeric constraint.
- Pool
Scale - How many machines a pool runs.
Constants§
- AUTHORABLE_
TYPES_ NOT_ IN_ MANIFEST - Authorable types that are not in the gateability manifest, because they cannot carry an
enabled-whengate:build,artifact-registryandservice-accountare derived from the stack by Alien, andkeyis a plain customer-managed key. - DEFAULT_
EPHEMERAL_ STORAGE - Root disk size a pool asks for when it does not say.
- MANIFEST_
TYPES_ NOT_ AUTHORABLE - Resource types in the generated gateability manifest that are not declared in a file.
- MAX_
DYNAMIC_ CONTAINER_ REPOSITORIES - Most repositories a stack may approve for containers created after installation.
- MAX_
STOP_ GRACE_ PERIOD_ SECONDS - Largest stop grace period a daemon accepts, in seconds (24 hours).
Statics§
- AUTHORABLE_
TYPES - Every resource type a stack file can declare, in the order the documentation lists them.
Functions§
- authorable_
type_ by_ table - The authorable type with this table name.
- custom_
plugin - A published custom plugin written as
name@version. - duration_
millis - A duration such as
"90s","250ms"or"1h30m"in milliseconds; the error is what is wrong withvalue. - failure_
domain_ spread - Validates a pool’s failure-domain spread: an integer from 1 to 255.
- input_
default - The default value of an input of
kind, typed the way the stack stores it. - input_
number - A number for a number or integer input (a default,
minormax), as the stack stores it: decimal text printed the way JavaScript prints numbers. Integer inputs take whole numbers only. - input_
validation - The validation block a stack input carries.
- is_
input_ env_ name - Whether
namecan be an environment variable an input is delivered as. - is_
repository_ name - Whether
repositoryis a fully qualified OCI repository such asghcr.io/acme/tools: a registry host (with an optional port) followed by at least one lowercase path segment. - memory_
resource_ spec - A workload memory request that asks for exactly
size(for example"4Gi"). - normalize_
inputs - Turns the inputs of a stack file, in file order, into definitions.
- operations_
config - The operations a stack declares, from its built-in and custom plugins.
- parse_
duration_ seconds - Parses a duration such as
"90s","10m","24h"or"1h30m"into whole seconds. - parse_
quantity_ bytes - Parses a memory or storage quantity such as
"16Gi","500M"or"1024"into bytes. - quantity_
bytes parse_quantity_byteswithout a field name; the error is what is wrong withvalue.- stop_
grace_ period_ seconds - Validates a daemon stop grace period: 1 second through 24 hours.
- validate_
dynamic_ container_ image_ resources - Checks the IDs of the container resources whose images a stack approves: non-empty and distinct. The error field names the offending entry when one entry is at fault.
- validate_
dynamic_ container_ repositories - Checks the OCI repositories a stack approves for containers created after installation:
1 to 16 distinct, fully qualified names. The error field names the offending entry
(
dynamicContainerRepositories.2) when one entry is at fault. - validate_
input_ env_ name - Checks the name of an environment variable delivered from input
input_id. - validate_
resource_ id - Validates a resource ID against the common cloud naming constraints.