Expand description
Stacks: a compose file deployed to the isb serve daemon, which keeps it
running the way docker swarm keeps a stack running, on one host.
The daemon’s desired state is a file per stack under its state directory,
and every instance it creates carries user.isb.stack, user.isb.service,
user.isb.slot and user.isb.rev. Both survive a daemon restart, so a new
daemon picks up exactly where the last one stopped. Apps never depend on
the daemon being alive: they are supervised inside their guests (see
crate::supervise) and start with the host.
- A service has
deploy.replicasslots. Each slot holds one instance, named<stack>-<service>-<slot>-<id>. - A service’s revision is a hash of everything that shapes an instance. An
instance whose revision is not the current one is replaced, in batches,
per
deploy.update_config. - Published host ports are served by the daemon’s load balancer
(
crate::balance), which only sends traffic to healthy replicas, so astart-firstrollout has no gap.
Re-exports§
pub use controller::Controller;pub use secrets::SecretBinding;
Modules§
- controller
- The reconciler behind
isb serve: one worker thread per service keeps its replicas created, current, running, healthy and in the load balancer. - deployments
- What the daemon keeps beside a compose stack’s definition: its
environment (
.envtext that${VAR}resolves against), its managed domains (domain records per service, merged in at deploy), and a record of each deploy (Deployment), kept per stack understack-meta/<stack>/in the stack’s org directory. - failure
- Why a replica did not come up.
- migrate
- Upgrading stored stacks whose definitions held secret values.
- secrets
- A stack’s secrets: references into its org’s store, by name and version.
- source
- A compose stack’s source and what the daemon adds to it at deploy: the
stack’s environment (variables
${VAR}resolves against, kept apart from the file) and its managed domains (domain records kept apart from the file, per service). The file is stored as written; these are merged into the copy that runs.
Structs§
- Stack
Def - A deployed stack, as the daemon stores it.
- Store
- Where stack definitions live:
$XDG_STATE_HOME/isb(else~/.local/state/isb), one 0600 file per stack understacks/.
Constants§
- INSTANCE_
NAME_ MAX - incus’ limit on an instance name.
- LABEL_
REV - LABEL_
SERVICE - LABEL_
SLOT - LABEL_
STACK - Instance config keys (without
user.) that tie an instance to its stack.
Functions§
- instance_
name <stack>-<service>-<slot>-<id>, within incus’ 63-character limit. A name that would be longer keeps the start of the service name plus a hash of all of it (<stack>-<svc-prefix>-<hash6>-<slot>-<id>), so two long services in one stack still differ. Nothing parses these names back: replicas are found by theiruser.isb.*labels.- instance_
name_ fits - Whether
<stack>-<service>-<slot>-<id>fits as is, without the shorteninginstance_namefalls back to. - local_
deploy_ args - Resolve the paths the local CLI sends with a deploy: the project’s own
directory, so relative binds and
file:secrets work as withisb up. - new_id
- A short random id for a new instance.
- now_
secs - pick_
stack_ name - The first valid stack name of
candidateswhose instance names ofservicefit unshortened, else the firstinstance_namecan shorten. Unshortened first, because that is how an existing stack (a running preview’s) was picked, so it keeps its name. - qualified
- A stack’s name qualified by its org:
webin the default org,alpha/webin orgalpha. The controller keys everything by it. - split_
qualified - The org and name of a qualified stack name.
- validate_
stack_ name - Valid stack name: what an instance name prefix allows.