compose

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package compose is the compose-runtime backend: one adapter driving a compose CLI, with docker-compose and podman-compose as thin constructors over the same code. Podman goes through `podman compose`, the engine's own wrapper, never the third-party podman-compose tool.

The connection is the compose CLI itself. A rootless socket may be pointed at with DOCKER_HOST/CONTAINER_HOST; a socket resolving to the privileged docker socket is refused at config load, not here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter is the compose-runtime backend.

func NewDocker

func NewDocker(settings config.EngineSettings, options ...Option) *Adapter

NewDocker builds the Docker Compose adapter.

func NewPodman

func NewPodman(settings config.EngineSettings, options ...Option) *Adapter

NewPodman builds the Podman Compose adapter.

func (*Adapter) Backend

func (a *Adapter) Backend() domain.Backend

Backend reports which backend this adapter serves.

func (*Adapter) Deploy

func (a *Adapter) Deploy(state backend.StackState, compose string, repull bool) error

Deploy writes the Compose document and brings the project up. The file is replaced atomically and always before the engine is asked to converge, so a rollback restores the previous bytes even if the engine call then fails.

func (*Adapter) Observe

func (a *Adapter) Observe(stack config.StackPolicy) (backend.StackState, error)

Observe reads the stack's current state: the Compose document on disk, the resolved services, and the digests actually running.

func (*Adapter) Preflight

func (a *Adapter) Preflight() error

Preflight probes the engine. There is no identity to check: the compose CLI acts as whoever runs Ripen.

func (*Adapter) RunningDigests

func (a *Adapter) RunningDigests(state backend.StackState) (map[string]string, error)

RunningDigests re-reads which digests the project is running.

func (*Adapter) ServicesRunning

func (a *Adapter) ServicesRunning(state backend.StackState) (bool, string, error)

ServicesRunning reports whether every service of the project is running, and healthy wherever the engine tracks a healthcheck. It is conjunctive by design: one stopped sibling blocks the Transaction.

func (*Adapter) WithContext added in v1.2.0

func (a *Adapter) WithContext(ctx context.Context) backend.Port

WithContext returns a backend bound to the caller lifetime.

type Handle

type Handle struct {
	File     string
	Project  string
	EnvFiles []string
}

Handle is the compose adapter's stack identity, carried on StackState from Observe into Deploy.

type Option

type Option func(*Adapter)

Option adjusts an Adapter.

func WithRunner

func WithRunner(runner Runner) Option

WithRunner replaces the command runner.

func WithTimeouts

func WithTimeouts(command, deploy time.Duration) Option

WithTimeouts sets the per-command and deployment timeouts.

type Runner

type Runner interface {
	Run(ctx context.Context, binary string, args, env []string) ([]byte, error)
}

Runner runs one engine command. Production runs a subprocess; tests answer from a script.

Jump to

Keyboard shortcuts

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