Expand description
Declarative, service-centric deploy engine for XBP.
Purity rule: the engine depends only on:
- project config (view types)
- OCI resolver/promoter traits
- Kubernetes adapter traits
- optional Cloudflare deploy adapter trait (CLI-injected)
No CLI I/O, no Athena product islands, no implicit runtime state.
Kubernetes apply/rollout behaviour is unchanged for
kubernetes / kubernetes-operator services. Cloudflare providers are
additive and never populate k8s_plan.services.
Structs§
- Classified
Deploy Outcome - Classified outcome used when writing history.
- Cloudflare
Service Deploy Request - Request to deploy one service via Cloudflare Worker / Containers.
- Composed
Runtime - Result of composing env + config for one service in one deploy env.
- Config
File Mount - One file composed into the workload (ConfigMap mount for k8s bootstrap).
- Default
Deploy Planner - Default
Deploy Runner - Default
Deploy Verifier - Default
Promoter - Deploy
Context - Everything the engine needs; built by CLI, consumed by planner/runner/verifier.
- Deploy
Flags - Deploy
Group View - Deploy
History Index - Deploy
History Record - Deploy
History Secret - One secret extracted from deploy history before writing redacted JSON.
- Deploy
History Stats - Deploy
History Store - Deploy
Lock File - Deploy
Lock Image - Deploy
Plan - Deploy
Result - Expose
Result - History
Entry - K8sPlan
View - Kubernetes
Defaults - OciBuild
Request - OciBuild
Result - Result of a successful (or dry-run) build/push.
- OciImage
Plan - OciPlan
- Project
Config - Project config view (CLI maps XbpConfig → this). Pure data, no clap.
- Sanitized
History Record - Result of building a history record with secrets stripped for disk.
- Service
Config View - Service
Deploy Destination View - One named deploy destination under
services[].deploy.destinations.<name>. - Service
Deploy EnvView - Service
Deploy Plan - Service
Deploy View - Service
Expose View - Public / local routing for a bootstrap Service + post-deploy access.
- Service
Graph - Service
K8sView - Service
Node - Service
OciView - Service
Plan - Target
Resolution - Verify
Result
Enums§
- Deploy
Error - Deploy
Failure Class - Stable failure class for deploy attempts.
- Deploy
Mode - Exactly one deploy mode (CLI must enforce exclusivity).
- Deploy
Phase - Coarse phase of a deploy attempt (for history + metrics).
- Deploy
Target - Resolved deploy target kind.
Constants§
- DEPLOY_
SECRET_ PLACEHOLDER_ PREFIX - Prefix for redacted runtime_env placeholders written to disk.
Format:
xbp:deploy:{deployment_id}:{SECRET_NAME}:{hash12} - DESTINATION_
ALL - Sentinel destination: expand to every enabled destination on the service.
Traits§
- Cloudflare
Deploy Adapter - Pluggable Cloudflare deploy backend.
- Deploy
Planner - Deploy
Runner - Deploy
Verifier - OciBuild
Adapter - Build and push (or load locally) service images before apply/rollout.
Functions§
- bootstrap_
manifest_ yaml - Generate Deployment + Service YAML for a service with image + namespace + workload.
- bootstrap_
manifest_ yaml_ with_ pull_ policy - Like
bootstrap_manifest_yaml, but setimagePullPolicy(e.g.Neverfor local-only images). - classify_
deploy_ error - Best-effort classification from free-text deploy error/summary lines.
- compose_
service_ runtime - Compose env maps and config mounts for a service deploy environment.
- compose_
service_ runtime_ with_ opts - Same as
compose_service_runtime, with control over auto dotenv strictness. - compute_
plan_ hash - Deterministic hash of plan identity (order, digests, images, env, target).
- deploy_
secret_ placeholder - Build on-disk placeholder for a secret.
Example:
xbp:deploy:20260722T052353Z-production-athena:ATHENA_DB_URL:a1b2c3d4e5f6 - destination_
to_ provider - Map a destination id to the engine provider string.
- effective_
expose - Resolve expose config: explicit
deploy.envs.*.expose, or automatic local defaults when deploying with--local-image(docker-desktop / kind). - ensure_
hosts_ entries - Ensure each host maps to
ipin the OS hosts file under an xbp marker block. - env_
key_ looks_ secret - True if a key name looks secret (for plan redaction).
- expose_
service - After k8s rollout: optional port-forward + hosts DNS entries.
- expose_
service_ with_ auto - Like
expose_service, but whenauto_localis true and no expose config is set, synthesize a localhost port-forward (used with--local-image). - filter_
deploy_ plan - Apply optional
--only/--excludefilters to a plan. - is_
all_ destinations - True when the user asked for every configured destination (
--to all). - is_
cloudflare_ provider - Providers that deploy via the Cloudflare Worker / Containers workflow.
- is_
kubernetes_ provider - Providers that use the Kubernetes adapter (apply / rollout / k8s verify).
- is_
local_ provider - Local preflight-only provider (commands / scripts; no remote apply).
- is_
oci_ provider - is_
railway_ provider - k8s_
verify_ line_ is_ failure - Whether a kubectl verify log line indicates a real cluster failure.
- known_
destinations - Short help list of supported
--todestinations. - load_
lock - lock_
from_ plan - logical_
service_ name - Logical service name from a plan step or order entry (
svcorsvc@destination). - normalize_
destination - Well-known destination aliases → canonical destination id.
- order_
services - Compute apply order for
selectedservice names. - parse_
deploy_ secret_ placeholder - Parse
xbp:deploy:{id}:{NAME}:{hash}placeholders. - parse_
destinations - Parse CLI
--tovalues (comma-separated and/or repeated) into canonical destinations. - parse_
dotenv_ file - Minimal dotenv parser (KEY=VALUE, # comments, optional export, quoted values).
- parse_
dotenv_ str - parse_
index_ raw - Parse index JSON; strip common merge-conflict noise when possible.
- provider_
priority - Canonical priority for stable ordering (lower runs first).
- provider_
to_ destination - Infer destination label from a stored provider string (config / plan).
- record_
from_ plan - record_
from_ plan_ with_ classification - record_
from_ plan_ with_ version - redact_
plan_ runtime_ env - Replace secret runtime_env values on a plan with placeholders; return extracted secrets.
- resolve_
target - Resolve target with priority:
- retain_
services_ in_ plan - Keep only plan steps whose logical service name is in
keep. - revitalize_
record_ runtime_ env - Restore placeholders in a history record using a name→plaintext map from D1. Returns how many placeholders were filled.
- runtime_
env_ value_ should_ redact - Whether this env entry should leave the on-disk history file.
- secret_
value_ hash - sha256 hex truncated to 12 chars for short integrity stubs in placeholders.
- service_
plan_ labels - Build MultiSelect-style labels for plan services (unique names).
- should_
expose - Whether expose should run for this service after rollout.
- unique_
service_ names - Unique logical service names in plan order (first appearance wins).
- validate_
project_ config - Validate project config before planning.
- validate_
project_ config_ for_ target - Like
validate_project_config, with optional deploy target scope. - workload_
name - Parse workload strings like
deployment/athena,deploy/athena, or bareathena. - write_
lock