Expand description
Container runtime backends and lifecycle manager for LightShuttle.
This crate provides:
- A narrow
ContainerRuntimetrait that the lifecycle manager targets and that hides the daemon-specific surface. - A first concrete implementation
DockerRuntimebacked by thebollardcrate. - A
ContainerSpecvalue built from alightshuttle-manifestresource declaration, with the v0 defaults already applied (image expansion, database name derivation, random password generation, healthcheck materialisation). - A
LifecycleManagerthat consumes aLifecyclePlanand a runtime, then orchestrates startup (topological, parallel where possible, gated on healthchecks), supervises the running stack and rolls everything down on signal.
See docs/spec/manifest-v0.md in the main repository for the
manifest specification this runtime consumes.
Modules§
- testkit
- Test helpers for downstream crates and integration tests.
Structs§
- Container
Id - Opaque identifier for a container managed by the runtime.
- Container
Spec - Self-contained description of a container to start, derived from a manifest resource.
- Docker
Runtime - Docker container runtime backed by the
bollardcrate. - Healthcheck
Spec - Healthcheck resolved from the manifest, with manifest-side durations already parsed.
- Lifecycle
Manager - Coordinates the startup, supervision and shutdown of every resource
declared in a
LifecyclePlan. - Lifecycle
Plan - Topologically sorted execution plan.
- LogChunk
- One chunk of streamed log output.
- Managed
Container - One entry returned by
DockerRuntime::list_managed. - Manager
Handle - Newtype adapter turning an
Arc<LifecycleManager<R>>into aLifecycleHandle. - Plan
Node - A single resource to manage, with its resolved
ContainerSpec, its exposed outputs and its explicit dependencies. - Port
Binding - Port mapping resolved from the manifest.
- Resolved
Resource - A
ContainerSpectogether with the outputs the resource exposes to its dependents at runtime. - Resource
View - Dashboard-friendly view of a single managed resource.
- Volume
Binding - Volume mapping resolved from the manifest.
Enums§
- Container
Status - Lifecycle status reported by the runtime when inspecting a container.
- Image
Source - How the container image is obtained.
- Lifecycle
Error - Errors raised by the lifecycle layer.
- Lifecycle
Event - Event emitted by
crate::LifecycleManagerfor consumption by a CLI, dashboard or test harness. - Lifecycle
Handle Error - Errors returned by
LifecycleHandleoperations. - LogStream
- Which stream a log chunk came from.
- Node
Status - Lifecycle status of a single managed resource.
- Resource
Status - Coarse-grained resource status, derived from
NodeStatusand flattened for UI consumption. - Runtime
Error - Errors raised by a
crate::ContainerRuntimeimplementation. - Volume
Source - Where the volume content lives.
Constants§
- LABEL_
PROJECT - Docker label key set on every container managed by LightShuttle to carry the manifest project name.
- LABEL_
RESOURCE - Docker label key set on every container to carry the manifest resource name.
Traits§
- Container
Runtime - Container runtime abstraction.
- Lifecycle
Handle - Control-plane facing view of a running stack.
Functions§
- from_
resource - Build a
ContainerSpecfrom a manifest resource declaration.
Type Aliases§
- LogChunk
Stream - Boxed stream of log chunks for a single container.
- Resource
Outputs - Properties a managed resource exposes to its dependents.
- Result
- Shorthand alias for
std::result::Result<T, RuntimeError>.