docker

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildContainerEnv

func BuildContainerEnv(cfg *EnvConfig) []string

BuildContainerEnv assembles the environment variables for a container This function is pure and deterministic - no Docker client interaction

func BuildContainerMounts

func BuildContainerMounts(cfg *MountConfig) []mount.Mount

BuildContainerMounts assembles the Docker mounts configuration This function is pure and deterministic - no Docker client interaction

func ValidateMountTargets

func ValidateMountTargets(cfg *MountConfig) error

ValidateMountTargets validates that all mount sources exist This function is pure and deterministic - no Docker client interaction

func ValidateRequiredArtifacts

func ValidateRequiredArtifacts(outDir string, requiredArtifacts []v1.Artifact) error

ValidateRequiredArtifacts checks that all required artifacts are present This function is pure and deterministic - no Docker client interaction

Types

type AgentConfigMode

type AgentConfigMode string

AgentConfigMode represents the mode for mounting agent-specific configuration from the host into the container. This replaces the boolean UseLocalClaudeConfig with more flexible behavior.

const (
	// AgentConfigModeAuto automatically mounts host config if it exists
	// and appears compatible (not headless/container Claude),
	// and silently skips if it doesn't exist or is incompatible.
	AgentConfigModeAuto AgentConfigMode = "auto"

	// AgentConfigModeYes always attempts to mount the host config,
	// and emits a warning if the config directory doesn't exist.
	// Use with caution as it may mount incompatible configs.
	AgentConfigModeYes AgentConfigMode = "yes"

	// AgentConfigModeNo never mounts the host config.
	// This is the default behavior to prevent accidental credential exposure.
	AgentConfigModeNo AgentConfigMode = "no"
)

func ParseAgentConfigMode

func ParseAgentConfigMode(s string) (AgentConfigMode, error)

ParseAgentConfigMode parses a string into an AgentConfigMode. Case-insensitive. Returns error for invalid values.

func (AgentConfigMode) ShouldMount

func (m AgentConfigMode) ShouldMount(dirExists bool) bool

ShouldMount determines whether to mount the config based on the mode and whether the config directory exists.

func (AgentConfigMode) String

func (m AgentConfigMode) String() string

String returns the string representation of the mode.

func (AgentConfigMode) WarnIfMissing

func (m AgentConfigMode) WarnIfMissing() bool

WarnIfMissing returns true if a warning should be emitted when the config directory doesn't exist.

type ContainerConfig

type ContainerConfig struct {
	BaseImage   string // e.g., golang:1.22 (The toolchain)
	AgentBundle string // Required path to agent bundle archive (.tar.gz)
	Workspace   string
	InputPath   string // Path to input directory (contains spec.yaml, context/, prompts/)
	OutDir      string
	Env         map[string]string
	Cmd         []string // Optional command override

	// Workspace preparation options
	WorkspaceStrategy    string                // Workspace preparation strategy (e.g., "git-clone", "snapshot")
	WorkspaceHistory     workspace.HistoryMode // How much git history to include
	WorkspaceRef         string                // Git ref to checkout (optional)
	WorkspaceIsTemporary bool                  // true if workspace is a temporary directory (vs user-provided)

	// Agent config mount mode
	AgentConfigMode string // Agent config mount mode: "auto", "yes", "no"
}

type EnvConfig

type EnvConfig struct {
	UserEnv map[string]string
	HostUID int
	HostGID int
}

EnvConfig represents the environment configuration for a container

type MountConfig

type MountConfig struct {
	SnapshotDir          string
	InputPath            string // Path to input directory (contains spec.yaml, context/, prompts/)
	OutDir               string
	LocalClaudeConfigDir string // Path to host ~/.claude directory (optional, for mounting)
}

MountConfig represents the mount configuration for a container

type Runtime

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

func NewRuntime

func NewRuntime() (*Runtime, error)

func (*Runtime) RunHolon

func (r *Runtime) RunHolon(ctx context.Context, cfg *ContainerConfig) (string, error)

Jump to

Keyboard shortcuts

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