Documentation
¶
Overview ¶
Package orchestration provides Docker SDK-backed stack lifecycle management. It implements the Orchestrator contract expected by internal/api/stacksvc.
Index ¶
- type ConfigProvider
- type DockerOrchestrator
- func (o *DockerOrchestrator) Close() error
- func (o *DockerOrchestrator) EnsureStack(ctx context.Context, req *stackv1.EnsureStackRequest) (*stackv1.EnsureStackResponse, error)
- func (o *DockerOrchestrator) GetStackLogs(req *stackv1.GetStackLogsRequest, ...) error
- func (o *DockerOrchestrator) TeardownStack(ctx context.Context, req *stackv1.TeardownStackRequest) (*stackv1.TeardownStackResponse, error)
- type Setup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigProvider ¶
ConfigProvider resolves compose setup for a workspace and optional profile. workspaceID and profileName come directly from the RPC request.
type DockerOrchestrator ¶
type DockerOrchestrator struct {
// contains filtered or unexported fields
}
DockerOrchestrator implements the stacksvc.Orchestrator interface using the Docker Engine API. Container lifecycle uses Compose-compatible label semantics so containers appear correctly in docker-compose tooling.
func New ¶
func New(dockerHost string, cfgFn ConfigProvider) (*DockerOrchestrator, error)
New creates a DockerOrchestrator. Set dockerHost to "" to inherit DOCKER_HOST from the environment. cfgFn resolves compose setup for each workspace+profile.
func (*DockerOrchestrator) Close ¶
func (o *DockerOrchestrator) Close() error
Close releases the underlying Docker client connection.
func (*DockerOrchestrator) EnsureStack ¶
func (o *DockerOrchestrator) EnsureStack(ctx context.Context, req *stackv1.EnsureStackRequest) (*stackv1.EnsureStackResponse, error)
EnsureStack starts the compose stack and optionally waits for all services to report healthy before returning.
func (*DockerOrchestrator) GetStackLogs ¶
func (o *DockerOrchestrator) GetStackLogs(req *stackv1.GetStackLogsRequest, stream stackv1.StackService_GetStackLogsServer) error
GetStackLogs multiplexes container logs from all project services (or a single service if service_name is set) onto the gRPC server stream.
func (*DockerOrchestrator) TeardownStack ¶
func (o *DockerOrchestrator) TeardownStack(ctx context.Context, req *stackv1.TeardownStackRequest) (*stackv1.TeardownStackResponse, error)
TeardownStack stops and removes all containers belonging to the project, then removes the project network.
type Setup ¶
type Setup struct {
// ComposeFiles is the ordered list of Compose YAML file paths.
// Later files merge over earlier files (last-wins on simple fields).
ComposeFiles []string
// ProjectName is the Compose project name used to namespace containers
// and networks. Falls back to the workspace ID when empty.
ProjectName string
// WaitTimeout is the upper bound for readiness polling when
// EnsureStack is called with wait_for_readiness=true.
WaitTimeout time.Duration
// Profiles is the list of Compose profiles to activate.
Profiles []string
// EnvFiles is an ordered list of dotenv files to load before compose
// variable substitution. Variables are set in the process environment
// so ${VAR} references in compose files expand correctly. Later files
// override earlier ones; existing process env variables are not overwritten.
EnvFiles []string
}
Setup holds the resolved compose configuration for a stack.