orchestration

package
v0.0.0-...-3d21586 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package orchestration provides Docker SDK-backed stack lifecycle management. It implements the Orchestrator contract expected by internal/api/stacksvc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigProvider

type ConfigProvider func(ctx context.Context, workspaceID, profileName string) (*Setup, error)

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

EnsureStack starts the compose stack and optionally waits for all services to report healthy before returning.

func (*DockerOrchestrator) GetStackLogs

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL