Expand description
Manifest to deployment artifact transpilation for LightShuttle.
§Position in the crate graph
lightshuttle-export sits above lightshuttle-manifest (the parsed
YAML representation) and lightshuttle-spec (the canonical resource
specification). It depends on both; the CLI crate depends on this one
to write the produced files to disk.
§Pipeline: manifest -> IR -> artifacts
The export pipeline follows a compiler shape:
- Lowering (
lower): alightshuttle_manifest::Manifestis lowered into a target-agnosticExportModel(the IR). Every resource is resolved throughlightshuttle-specso the model inherits the same image, port, environment, and healthcheck defaults that the runtime applies - no drift betweenlightshuttle upandlightshuttle export. - Emission (
Emitter): a target-specific emitter consumes theExportModeland producesExportArtifacts, a list of named files whose textual contents are ready to write. Three emitters ship out of the box:ComposeEmitter,KubernetesEmitter, andHelmEmitter. - Resolution (
resolve): pure helpers that turn the optionalexport:manifest section into concrete per-target values (namespace, replica count, image pull policy, chart name). All emitters share this module so defaults are defined and tested in one place.
§No daemon dependency
This crate carries no container daemon dependency. It only reads the manifest and the resolved specification, so it transpiles identically on a developer machine or in CI without Docker.
§Quick start
use lightshuttle_export::{lower, ComposeEmitter, Emitter};
use lightshuttle_manifest::Manifest;
// Load a manifest from disk (I/O, so no_run).
let manifest: Manifest = todo!("parse from YAML");
// Lower the manifest into the neutral IR.
let model = lower(&manifest)?;
// Emit Docker Compose artifacts.
let emitter = ComposeEmitter;
let artifacts = emitter.emit(&model)?;
for file in &artifacts.files {
println!("{}: {} bytes", file.path.display(), file.contents.len());
}Modules§
- resolve
- Pure resolution of per-target defaults and overrides.
Structs§
- Compose
Emitter - Emits a single
docker-compose.ymlfrom the export model. - Export
Artifacts - A set of named files produced by an emitter, ready to be written to disk by the CLI layer.
- Export
File - A single emitted file: a relative path and its textual contents.
- Export
Model - Target-agnostic model of a stack ready to be emitted.
- Export
Project - Project metadata relevant to an export.
- Export
Service - One service in the export model: a resolved container specification plus the resources it depends on.
- Helm
Emitter - Emits a Helm chart from the export model.
- Kubernetes
Emitter - Emits plain Kubernetes manifests from the export model.
Enums§
- Export
Error - Errors raised while lowering a manifest or emitting artifacts.
- Target
- Supported export targets.
Traits§
- Emitter
- Transpiles an
ExportModelinto the files of a single deployment target.
Functions§
- lower
- Lowers a
lightshuttle_manifest::Manifestinto anExportModel.
Type Aliases§
- Result
- Shorthand
Resulttype that pins the error toExportError.