Deployment lifecycle
The deployment lifecycle turns project and environment intent into a hosted workload and keeps that workload safe after release. It covers configuration, build or artifact delivery, node placement, runtime access, health observation, data protection, and managed-service setup. A deployment becomes current only after the platform confirms that its candidate is usable.
Deployment model
A project defines the application and its release rules. An environment supplies the target context. A deployment records one attempt and its artifact lineage. The current environment deployment is the release that has passed the platform's completion gates.
| Concern | Role in the lifecycle |
|---|---|
| Project and environment | Define source, build, runtime, release, route, and resource intent. |
| Deployment | Records the selected source, effective values, progress, result, and artifact identity. |
| Workload | Runs as an image, Compose stack, or static content. |
| Managed service | Supplies persistent data and connection values. |
| Route | Connects the current environment to an address. |
| Protected data | Preserves state for restore and recovery. |
The projects and environments page covers project context and environment settings. The project groups and templates page covers shared composition. The deployment orchestration page covers job planning and state control. The domains and networking page covers reachability. The backup and recovery page covers data protection. The managed services and data import page covers linked data services and imports.
Installation configuration
Installation configuration gives the control plane a stable identity and the shared settings that deployment and runtime services use. It also defines how a local instance or stateless group obtains the secrets needed to keep sessions and encrypted data valid.
Installation identity and secrets
An installation uses an authentication secret and an encryption key for shared security state. In local mode the platform loads or creates these values in the data directory. In stateless mode the operator must provide both values through direct environment settings or secret files, while the database records the durable installation mode after bootstrap.
The bootstrap TEMPS_STATELESS value requests a mode during startup. It does not override the mode stored in the database. Secret sources cannot be mixed, and invalid or missing values stop startup rather than producing a partly configured installation.
References: crates/…/installation_secrets.rs• L35-57 crates/…/installation_secrets.rs• L72-160 crates/…/service.rs• L749-802
Shared settings propagation
The platform keeps instance settings as shared state for the control plane and proxy. A short-lived cache avoids a database read on every request, while writes and database notifications publish new values to active services. Build limits reach the running build gate through the same update path, so a limit change can affect later work without a process restart.
Project creation also validates new global delivery defaults before saving them. Cloudflare and Bunny cannot both be the default, and a newly enabled provider must have a usable configuration.
References: crates/…/handler.rs• L571-633 crates/…/service.rs• L915-949 crates/…/service.rs• L952-965 crates/…/service.rs• L984-1027
Lifecycle stages
The platform records a deployment before it starts work. It resolves the effective settings, checks that the request is still valid, prepares source or artifacts, builds or selects an image, starts a candidate workload, confirms readiness, and then publishes the route. A failed or stale candidate does not replace the last usable deployment.
This diagram shows how a release moves from intent to live traffic and where the platform stops promotion.
flowchart LR
A[Project and environment intent] --> B[Record deployment]
B --> C[Resolve effective settings]
C --> D[Admit and plan work]
D --> E[Prepare source or artifact]
E --> F[Build or select artifact]
F --> G[Place candidate workload]
G --> H[Check runtime readiness]
H -->|Pass| I[Select current deployment]
I --> J[Publish route and run follow-up setup]
H -->|Fail or stale| K[Record failure and keep prior route]
Effective configuration
Effective configuration is the single view of the values used by one deployment. Environment values refine project defaults. Group values, managed-service bindings, secrets, and platform policy complete the view. The deployment keeps the resolved result so later promotion or rollback can use the same contract for that attempt.
The same resolution rules apply to normal deploys, rollback, promotion, and builds sent to another node. Missing required service or secret values stop the deployment before an incomplete workload starts.
References: crates/…/plugin.rs• L500-511 crates/…/workflow_execution_service.rs• L1411-1431 crates/…/service.rs• L1011-1063
Deployment admission
Deployment admission separates a recorded request from work that may change runtime state. The platform checks that the project and environment are still active. It also keeps one ordered generation per environment so newer work supersedes older work.
The deployment queue can retry durable work after a restart. A request that becomes stale, cancelled, or invalid is fenced before it can publish traffic. The queue starts only after its gate, secret resolver, audit path, and worker services are ready.
References: crates/…/plugin.rs• L574-595 crates/…/plugin.rs• L669-799 crates/…/workflow_execution_service.rs• L1416-1526
Source and artifact delivery
Source and artifact delivery makes the selected release available to the deployment workflow. The platform can build source, use a registry image, use an image built by a remote CI runner, publish static output, or start a Compose stack. The selected platform and artifact identity remain part of the deployment record.
Remote CI builds use a short-lived build identity and a build-scoped credential. The control plane verifies the runner identity, provider run, image digest, and image platform before it transfers the result to the deployment target. Build inputs that contain secrets or private package credentials do not cross that boundary.
References: crates/…/ci_dispatch.rs• L608-724 crates/…/ci_dispatch.rs• L858-922 crates/…/ci_dispatch.rs• L1016-1083 crates/…/workflow_execution_service.rs• L1416-1526
Workload placement
Workload placement chooses where each replica can run. The scheduler considers node health, reported platform, labels, resources, placement intent, and project access needs. A build-only node creates artifacts but does not host application replicas. A dedicated node accepts only explicitly pinned workloads.
In a multi-node installation, the selected worker receives the workload through the node link. In a single-node installation, the control plane's local runtime remains the target. The resulting container records retain the node, image, port, and replica relationship needed by later routing, health checks, cleanup, and failover.
References: crates/…/node_scheduler.rs• L16-34 crates/…/node_scheduler.rs• L61-116 crates/…/mark_deployment_complete.rs• L494-580 crates/…/nodes.rs• L192-220
Readiness and promotion
Readiness separates a started candidate from a live deployment. The platform checks the workload's configured health behavior and confirms the runtime and route acknowledgements needed for delivery. It registers the actual replicas only as part of successful completion.
Runtime health begins with the effective probe revision captured for the deployment. Current replicas receive leases for observation only after the deployment becomes current. Reports carry session, assignment, epoch, and sequence data so an old worker or stale report cannot change current health.
References: crates/…/deploy_image.rs• L4573-4623 crates/…/mark_deployment_complete.rs• L457-624 crates/…/runtime_health.rs• L123-161 crates/…/runtime_health.rs• L675-755
Runtime delivery
Runtime delivery starts after promotion selects the completed deployment. The proxy maps environment and preview addresses to the selected image, Compose service, or static content. Worker addresses and the managed network let workloads reach remote runtimes and linked services.
Deployment tokens provide a workload with TEMPS_API_URL and TEMPS_API_TOKEN for selected Temps APIs. The token's permissions cannot exceed those of the principal that creates or edits it. This keeps application access useful without turning deployment configuration into a privilege escalation path.
The platform keeps deployment-scoped identity for workload records and static assets. This allows old clients to finish loading an older asset set while new requests use the current deployment. Deployment views also expose each configured public Compose service port through its corresponding route. The domains and networking page explains host names, certificates, DNS, proxy behavior, and worker links.
References: crates/…/deployment_tokens.rs• L4-7 crates/…/deployment_tokens.rs• L53-103 crates/…/deployments.rs• L92-183 crates/…/node_scheduler.rs• L61-116 crates/…/wireguard_mesh.rs• L31-66
Post-deployment follow-up
Post-deployment follow-up applies source-defined and platform-owned behavior after the workload passes readiness. It can update schedules, alert rules, agents, workflows, vulnerability results, and retained static assets. These actions do not make an unhealthy candidate current.
The platform also exposes runtime health as an environment view. Operators can enable or pause monitoring and set how many healthy replicas are required. The service reports replica state, coverage, history, and alarms while avoiding interactive workload execution.
References: crates/…/mark_deployment_complete.rs• L608-635 crates/…/runtime_health.rs• L57-145 crates/…/runtime_health.rs• L780-877 crates/…/runtime_health.rs• L948-989
Deployment controls
Operators can change a deployment after it is recorded. Rollback returns an environment to an earlier deployment, promotion creates a deployment in another environment from a validated source, and pause, resume, cancel, and teardown control work or remove its runtime state.
These actions remain subject to project access and deployment state rules. Local hosting and host Docker access add stronger checks, while destructive environment removal requires a sensitive-action step and is audited.
References: crates/…/deployments.rs• L793-930 crates/…/deployments.rs• L932-1234
Node availability and recovery
Worker availability affects placement and recovery but does not make every short network break a deployment failure. The control plane marks a node offline after stale heartbeats, alerts operators, and waits for the configured failover grace period before it moves affected replicas.
When failover is needed, the platform removes unavailable replicas from routing and queues recovery work. It preserves the distinction between confirmed removal, uncertain cleanup, and failed-over replicas so a returning node can be reconciled without deleting a workload that may still exist.
The managed WireGuard mesh provides a private path for nodes that cannot share a local network with the control plane. Its status describes whether links are connected, stale, or unreachable. A hub can relay traffic for member pairs that cannot connect directly.
References: crates/…/node_health_check.rs• L4-16 crates/…/node_health_check.rs• L98-175 crates/…/node_service.rs• L19-43 crates/…/wireguard_mesh.rs• L31-66 crates/…/wireguard_mesh.rs• L124-160
Data protection and managed data
Deployment replacement changes the workload that receives traffic. It does not replace persistent application data or the data held by managed services. Backup and recovery protect that state across deployment changes, while service bindings make the restored or imported data reachable by the target environment.
Backup and recovery
Backup and recovery provide an independent lifecycle for control-plane and managed-service data. Backup records show what was protected and retained. Restore validates its source, target, format, and recovery mode before it changes data.
Read backup and recovery for backup schedules, retention, restore modes, and recovery boundaries.
References: crates/…/runtime_health.rs• L948-989
Managed-service data import
Managed-service import brings existing service data into a service that the target environment can use. The import path must keep the service identity, credentials, runtime bindings, and deployment context aligned.
Read managed services and data import for service creation, bindings, import flow, and service-specific limits.
References: crates/…/workflow_execution_service.rs• L1416-1431 crates/…/plugin.rs• L500-511
Observability and operator control
The platform exposes deployment state, job logs, runtime health, node state, audit events, and failure classes so operators can follow a release without treating raw process output as the product contract. CI runner actions use a separate one-build identity and are recorded in the audit trail.
The server's own traces can be exported through OTLP. Export is disabled by default. Bootstrap configuration resolves command-line, environment, and data-directory settings without putting header credentials in the unencrypted file or in diagnostic output.
Failure reporting
Failure reporting turns a failed job trace into a redacted, editable report for operator review. Sending is an explicit write action that uses the reviewed text, records an audit event, and respects the instance's telemetry opt-out.
The preview and send paths remain project-scoped. An empty report is rejected, and a disabled reporting capability returns a clear refusal instead of inviting a retry.
References: crates/…/failure_report.rs• L4-10 crates/…/failure_report.rs• L27-61 crates/…/failure_report.rs• L64-117 crates/…/failure_report.rs• L149-168
Related pages
- Deployment orchestration — workflow planning, admission, queue delivery, and deployment state.
- Projects and environments — project setup, environment context, and configuration inheritance.
- Project groups and templates — shared values, composition, and service templates.
- Domains and networking — routes, domains, DNS, proxy delivery, and worker connectivity.
- Backup and recovery — protected data, restore plans, and recovery boundaries.
- Managed services and data import — linked services, runtime bindings, and import from existing services.
Change checklist
When these files or sections are changed, remember to consider these:
- Keep effective configuration rules aligned across deploy, rollback, promotion, remote builds, managed-service bindings, and secret resolution.
- Keep installation mode, secret-source precedence, persisted identity, and encryption behavior aligned across single-instance and stateless startup.
- Keep CI provider identity, build-scoped credentials, runner verification, registry digest checks, and platform checks aligned.
- Keep deployment token injection aligned with token permission ceilings, project scope, secret handling, and workload startup.
- Keep node roles and placement rules aligned with platform compatibility, Docker access, worker health, and failover behavior.
- Keep deployment completion aligned with container records, runtime-health revisions, route publication, and current-deployment selection.
- Keep runtime-health lease and report fencing aligned with deployment activation, node changes, paused monitoring, and history accounting.
- Keep WireGuard mesh status aligned with node addresses, worker transport, DNS, and public or private ingress behavior.
- Keep failure-report redaction, telemetry opt-out, project authorization, outbound delivery, and audit records aligned.
- Keep observability configuration aligned with bootstrap order, secret redaction, trace retention, and operator-facing failure logs.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A stale deployment reaches completion | It cannot replace the current release. | Generation and completion checks fence superseded work. |
| A CI runner claims the wrong provider run or image | The build is rejected and has no local fallback. | Provider identity, run identity, digest, and platform are verified. |
| A candidate starts but does not pass readiness | The previous route can remain active. | Promotion requires runtime and route completion checks. |
| A deployment targets a build-only, dedicated, offline, or incompatible node | Placement fails or excludes the node. | Scheduler role, health, platform, labels, and target-node rules are checked. |
| A runtime report is old or belongs to another session | Current health is not changed. | Leases, epochs, sequences, assignments, and freshness are validated. |
| A worker stops sending heartbeats | Its replicas can leave routing after the failover grace period. | Health checks, alarms, bounded recovery, and cleanup states separate outage from confirmed removal. |
| The mesh is enabled but a link never handshakes | Cross-node traffic remains unreachable or uses no valid path. | Mesh status reports link state and hub or endpoint fixes. |
| Stateless mode starts without both installation secrets | Startup fails before the installation can serve workloads. | Secret values or files are required and conflicting sources are rejected. |
| Both delivery providers are enabled as new-project defaults | Settings are rejected and no partial save occurs. | The settings handler rejects conflicting defaults and checks provider availability. |
| A caller grants a deployment token more permission than it holds | Token creation or widening is refused. | Permission ceilings compare requested grants with the caller's permissions. |
| A failure report is empty or reporting is disabled | No report is sent and the operator receives a non-retryable response. | Preview redaction, text validation, and the telemetry opt-out guard run before delivery. |
| OTLP configuration contains an invalid endpoint or secret-bearing value | Trace export is disabled or the bad value is ignored. | Layered parsing, endpoint validation, and secret redaction prevent startup or log leakage. |
Key files
| File | Why to read it |
|---|---|
| crates/…/installation_secrets.rs | Shows how local and stateless installations obtain and validate shared secrets. |
| crates/…/service.rs | Shows installation mode, settings propagation, effective runtime configuration, and internal service URLs. |
| crates/…/handler.rs | Shows validation of instance-wide delivery defaults and the safe settings view. |
| crates/…/workflow_execution_service.rs | Shows how deployment intent selects build location, workers, and execution paths. |
| crates/…/deploy_image.rs | Shows candidate startup, readiness inputs, runtime probe capture, and replica outputs. |
| crates/…/mark_deployment_complete.rs | Shows how successful workload output becomes deployment and runtime-health records. |
| crates/…/node_scheduler.rs | Shows the high-level node eligibility and placement rules. |
| crates/…/ci_dispatch.rs | Shows the remote CI build lifecycle and artifact verification boundary. |
| crates/…/deployment_tokens.rs | Shows how workload API credentials are scoped, managed, and rotated. |
| crates/…/deployments.rs | Shows deployment URLs, lifecycle controls, and operator-facing deployment actions. |
| crates/…/failure_report.rs | Shows the reviewed failure-report flow and its authorization and opt-out boundaries. |
| crates/…/runtime_health.rs | Shows durable runtime observation, fencing, coverage, and health policy behavior. |
| crates/…/node_health_check.rs | Shows node outage detection and failover timing. |
| crates/…/node_service.rs | Shows replica retirement, failed-over state, and cleanup boundaries. |
| crates/…/wireguard_mesh.rs | Shows the managed network view used for cross-node connectivity. |
| crates/…/plugin.rs | Shows service wiring and why deployment processing starts only after required services are ready. |
| crates/…/otel_export.rs | Shows bootstrap trace-export precedence and secret-safe configuration handling. |