Skip to main content

Crate lightshuttle_runtime

Crate lightshuttle_runtime 

Source
Expand description

Container runtime backends and lifecycle manager for LightShuttle.

This crate provides:

  • A narrow ContainerRuntime trait that the lifecycle manager targets and that hides the daemon-specific surface.
  • A first concrete implementation DockerRuntime backed by the bollard crate.
  • A ContainerSpec value built from a lightshuttle-manifest resource declaration, with the v0 defaults already applied (image expansion, database name derivation, random password generation, healthcheck materialisation).
  • A LifecycleManager that consumes a LifecyclePlan and 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§

ContainerId
Opaque identifier for a container managed by the runtime.
ContainerSpec
Self-contained description of a container to start, derived from a manifest resource.
DockerRuntime
Docker container runtime backed by the bollard crate.
EnvReport
Report over every ${env.*} reference found in a plan’s environment values and command arguments, with one entry per distinct variable, sorted by name.
EnvVarReport
One referenced variable together with its resolution status.
HealthcheckSpec
Healthcheck resolved from the manifest, with manifest-side durations already parsed.
LifecycleManager
Coordinates the startup, supervision and shutdown of every resource declared in a LifecyclePlan.
LifecyclePlan
Topologically sorted execution plan.
LogChunk
One chunk of streamed log output.
ManagedContainer
One entry returned by DockerRuntime::list_managed.
ManagerHandle
Newtype adapter turning an Arc<LifecycleManager<R>> into a LifecycleHandle.
PlanNode
A single resource to manage, with its resolved ContainerSpec, its exposed outputs and its explicit dependencies.
PortBinding
Port mapping resolved from the manifest.
ResolvedResource
A ContainerSpec together with the outputs the resource exposes to its dependents at runtime.
ResourceView
Dashboard-friendly view of a single managed resource.
VolumeBinding
Volume mapping resolved from the manifest.

Enums§

ContainerStatus
Lifecycle status reported by the runtime when inspecting a container.
EnvSource
Where a resolved variable’s effective value comes from.
EnvVarStatus
Resolution status of a single referenced environment variable.
ImageSource
How the container image is obtained.
LifecycleError
Errors raised by the lifecycle layer.
LifecycleEvent
Event emitted by crate::LifecycleManager for consumption by a CLI, dashboard or test harness.
LifecycleHandleError
Errors returned by LifecycleHandle operations.
LogStream
Which stream a log chunk came from.
NodeStatus
Lifecycle status of a single managed resource.
ResourceStatus
Coarse-grained resource status, derived from NodeStatus and flattened for UI consumption.
RuntimeError
Errors raised by a crate::ContainerRuntime implementation.
SpecError
Errors raised while building a crate::ContainerSpec from a manifest resource declaration.
VolumeSource
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§

ContainerRuntime
Container runtime abstraction.
LifecycleHandle
Control-plane facing view of a running stack.

Functions§

from_resource
Build a ContainerSpec from a manifest resource declaration.

Type Aliases§

LogChunkStream
Boxed stream of log chunks for a single container.
ResourceOutputs
Properties a managed resource exposes to its dependents.
Result
Shorthand alias for std::result::Result<T, RuntimeError>.