Skip to main content

Module stack_authoring

Module stack_authoring 

Source
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§

AuthorableType
One resource type a stack file can declare.
AuthoredAutoscaling
Machine counts an autoscaling pool moves between.
AuthoredEnvMapping
One environment variable an input is delivered as.
AuthoredInput
A stack input as written in a stack file.
AuthoredPool
A pool of machines: what each needs, and how many run.
ComputePool
A compute pool as a developer declares it: what the machines need and how many run.
PoolRequirements
Hardware a pool’s machines must have.
ResourceBodyError
A resource body that does not deserialize into its alien-core type.

Enums§

ComputeChoice
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").
DataDiskSize
The extra empty data disk each machine must provide.
InputValue
A stack input value as written: a default, or a numeric constraint.
PoolScale
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-when gate: build, artifact-registry and service-account are derived from the stack by Alien, and key is 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 with value.
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, min or max), 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 name can be an environment variable an input is delivered as.
is_repository_name
Whether repository is a fully qualified OCI repository such as ghcr.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_bytes without a field name; the error is what is wrong with value.
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.