Skip to main content

Crate xbp_deploy

Crate xbp_deploy 

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

ClassifiedDeployOutcome
Classified outcome used when writing history.
CloudflareServiceDeployRequest
Request to deploy one service via Cloudflare Worker / Containers.
ComposedRuntime
Result of composing env + config for one service in one deploy env.
ConfigFileMount
One file composed into the workload (ConfigMap mount for k8s bootstrap).
DefaultDeployPlanner
DefaultDeployRunner
DefaultDeployVerifier
DefaultPromoter
DeployContext
Everything the engine needs; built by CLI, consumed by planner/runner/verifier.
DeployFlags
DeployGroupView
DeployHistoryIndex
DeployHistoryRecord
DeployHistorySecret
One secret extracted from deploy history before writing redacted JSON.
DeployHistoryStats
DeployHistoryStore
DeployLockFile
DeployLockImage
DeployPlan
DeployResult
ExposeResult
HistoryEntry
K8sPlanView
KubernetesDefaults
OciBuildRequest
OciBuildResult
Result of a successful (or dry-run) build/push.
OciImagePlan
OciPlan
ProjectConfig
Project config view (CLI maps XbpConfig → this). Pure data, no clap.
SanitizedHistoryRecord
Result of building a history record with secrets stripped for disk.
ServiceConfigView
ServiceDeployDestinationView
One named deploy destination under services[].deploy.destinations.<name>.
ServiceDeployEnvView
ServiceDeployPlan
ServiceDeployView
ServiceExposeView
Public / local routing for a bootstrap Service + post-deploy access.
ServiceGraph
ServiceK8sView
ServiceNode
ServiceOciView
ServicePlan
TargetResolution
VerifyResult

Enums§

DeployError
DeployFailureClass
Stable failure class for deploy attempts.
DeployMode
Exactly one deploy mode (CLI must enforce exclusivity).
DeployPhase
Coarse phase of a deploy attempt (for history + metrics).
DeployTarget
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§

CloudflareDeployAdapter
Pluggable Cloudflare deploy backend.
DeployPlanner
DeployRunner
DeployVerifier
OciBuildAdapter
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 set imagePullPolicy (e.g. Never for 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 ip in 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 when auto_local is true and no expose config is set, synthesize a localhost port-forward (used with --local-image).
filter_deploy_plan
Apply optional --only / --exclude filters 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 --to destinations.
load_lock
lock_from_plan
logical_service_name
Logical service name from a plan step or order entry (svc or svc@destination).
normalize_destination
Well-known destination aliases → canonical destination id.
order_services
Compute apply order for selected service names.
parse_deploy_secret_placeholder
Parse xbp:deploy:{id}:{NAME}:{hash} placeholders.
parse_destinations
Parse CLI --to values (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 bare athena.
write_lock

Type Aliases§

Result