Documentation
¶
Overview ¶
Package executor runs prompt files inside Docker containers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerChecker ¶ added in v0.65.0
type ContainerChecker interface {
IsRunning(ctx context.Context, name string) (bool, error)
// WaitUntilRunning blocks until the named container is in the running state,
// the timeout elapses, or ctx is cancelled.
WaitUntilRunning(ctx context.Context, name string, timeout time.Duration) error
}
ContainerChecker checks whether a Docker container is currently running.
func NewDockerContainerChecker ¶ added in v0.65.0
func NewDockerContainerChecker( currentDateTimeGetter libtime.CurrentDateTimeGetter, ) ContainerChecker
NewDockerContainerChecker creates a ContainerChecker backed by docker inspect.
type ContainerCounter ¶ added in v0.82.0
ContainerCounter counts running dark-factory containers system-wide.
func NewDockerContainerCounter ¶ added in v0.82.0
func NewDockerContainerCounter(runner subproc.Runner) ContainerCounter
NewDockerContainerCounter creates a ContainerCounter that uses docker ps with label filtering.
type ContainerStopper ¶ added in v0.107.0
ContainerStopper stops a running Docker container by name.
func NewDockerContainerStopper ¶ added in v0.107.0
func NewDockerContainerStopper() ContainerStopper
NewDockerContainerStopper creates a ContainerStopper backed by docker stop.
type Executor ¶ added in v0.2.0
type Executor interface {
Execute(ctx context.Context, promptContent string, logFile string, containerName string) error
// Reattach connects to a running container's output stream and waits for it to exit.
// It does not create a new container. The log file is overwritten from the beginning
// of the container's output (docker logs replays all output from container start).
// maxPromptDuration is the remaining allowed run time; 0 disables the timeout.
// Returns nil when the container exits successfully.
Reattach(
ctx context.Context,
logFile string,
containerName string,
maxPromptDuration time.Duration,
) error
StopAndRemoveContainer(ctx context.Context, containerName string)
}
Executor executes a prompt.
func NewDockerExecutor ¶ added in v0.2.0
func NewDockerExecutor( containerImage string, projectName string, model string, netrcFile string, gitconfigFile string, env map[string]string, extraMounts []config.ExtraMount, claudeDir string, maxPromptDuration time.Duration, currentDateTimeGetter libtime.CurrentDateTimeGetter, fmtr formatter.Formatter, hideGit bool, ) Executor
NewDockerExecutor creates a new Executor using Docker with the specified container image.