Documentation
¶
Index ¶
- func RunShell(ctx context.Context, cli *client.Client, cfg *config.Config, ...) error
- type ConfigAdapter
- type ContainerManager
- func (c *ContainerManager) AttachLogger(ctx context.Context, containerID string, options container.AttachOptions) (types.HijackedResponse, error)
- func (c *ContainerManager) CopyToContainer(ctx context.Context, containerID string, dest string, content io.Reader, ...) error
- func (c *ContainerManager) CreateContainer(ctx context.Context, job config.JobConfig, netCfg *network.NetworkingConfig) (container.CreateResponse, error)
- func (c *ContainerManager) CreateNetwork(ctx context.Context, name, scope string) (string, error)
- func (c *ContainerManager) ExecProbe(ctx context.Context, containerID, cmd string) (int, error)
- func (c *ContainerManager) InspectContainer(ctx context.Context, containerID string) (container.InspectResponse, error)
- func (c *ContainerManager) ListContainers(ctx context.Context, options container.ListOptions) ([]container.Summary, error)
- func (c *ContainerManager) ListNetworks(ctx context.Context, options network.ListOptions) ([]network.Summary, error)
- func (c *ContainerManager) RemoveContainer(ctx context.Context, containerID string, options container.RemoveOptions) error
- func (c *ContainerManager) RemoveContainerForce(ctx context.Context, containerID string) error
- func (c *ContainerManager) RemoveNetwork(ctx context.Context, networkID string) error
- func (c *ContainerManager) StartContainer(ctx context.Context, containerID string, options container.StartOptions) error
- func (c *ContainerManager) StopContainer(ctx context.Context, containerID string, options container.StopOptions) error
- func (c *ContainerManager) WaitForContainer(ctx context.Context, containerID string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)
- type Executor
- type ImageManager
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunShell ¶ added in v0.2.2
func RunShell(ctx context.Context, cli *client.Client, cfg *config.Config, job config.JobConfig, logger *log.Logger) error
RunShell drops the user into an interactive /bin/sh inside the job's exact environment: same image, variables, workdir, cache mounts, copied workspace, and — when the job declares services — the same sidecars on the same network. Status chatter goes to stderr; stdout stays clean for the TTY.
Types ¶
type ConfigAdapter ¶
type ConfigAdapter interface {
ToContainerConfig(job config.JobConfig) *container.Config
ToHostConfig(job config.JobConfig) *container.HostConfig
ToImageHostConfig(image string) string
}
func NewConfigAdapter ¶
func NewConfigAdapter(cfg *config.Config, logger *log.Logger) ConfigAdapter
type ContainerManager ¶
type ContainerManager struct {
// contains filtered or unexported fields
}
func NewContainerManager ¶
func NewContainerManager(cli *client.Client, adapter ConfigAdapter, logger *log.Logger) *ContainerManager
func (*ContainerManager) AttachLogger ¶
func (c *ContainerManager) AttachLogger(ctx context.Context, containerID string, options container.AttachOptions) (types.HijackedResponse, error)
func (*ContainerManager) CopyToContainer ¶
func (c *ContainerManager) CopyToContainer(ctx context.Context, containerID string, dest string, content io.Reader, options container.CopyToContainerOptions) error
func (*ContainerManager) CreateContainer ¶
func (c *ContainerManager) CreateContainer(ctx context.Context, job config.JobConfig, netCfg *network.NetworkingConfig) (container.CreateResponse, error)
CreateContainer creates the job's container. netCfg is non-nil only when the job declares services, attaching it to the per-job service network.
func (*ContainerManager) CreateNetwork ¶ added in v0.2.1
CreateNetwork creates the per-job bridge network services and the job attach to. The created_by label (scope) lets run-level cleanup sweep its own leftovers without touching other sessions'.
func (*ContainerManager) ExecProbe ¶ added in v0.2.1
ExecProbe runs `/bin/sh -c cmd` inside a running container and returns its exit code. It backs service readiness checks (e.g. pg_isready).
func (*ContainerManager) InspectContainer ¶ added in v0.2.1
func (c *ContainerManager) InspectContainer(ctx context.Context, containerID string) (container.InspectResponse, error)
func (*ContainerManager) ListContainers ¶ added in v0.0.13
func (c *ContainerManager) ListContainers(ctx context.Context, options container.ListOptions) ([]container.Summary, error)
func (*ContainerManager) ListNetworks ¶ added in v0.2.1
func (c *ContainerManager) ListNetworks(ctx context.Context, options network.ListOptions) ([]network.Summary, error)
func (*ContainerManager) RemoveContainer ¶
func (c *ContainerManager) RemoveContainer(ctx context.Context, containerID string, options container.RemoveOptions) error
func (*ContainerManager) RemoveContainerForce ¶ added in v0.2.1
func (c *ContainerManager) RemoveContainerForce(ctx context.Context, containerID string) error
RemoveContainerForce force-removes a container regardless of state.
func (*ContainerManager) RemoveNetwork ¶ added in v0.2.1
func (c *ContainerManager) RemoveNetwork(ctx context.Context, networkID string) error
func (*ContainerManager) StartContainer ¶
func (c *ContainerManager) StartContainer(ctx context.Context, containerID string, options container.StartOptions) error
func (*ContainerManager) StopContainer ¶
func (c *ContainerManager) StopContainer(ctx context.Context, containerID string, options container.StopOptions) error
func (*ContainerManager) WaitForContainer ¶
func (c *ContainerManager) WaitForContainer(ctx context.Context, containerID string, condition container.WaitCondition) (<-chan container.WaitResponse, <-chan error)
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewDockerExecutor ¶
type ImageManager ¶
type ImageManager struct {
// contains filtered or unexported fields
}
func NewImageManager ¶
func NewImageManager(cli *client.Client, adapter ConfigAdapter, logger *log.Logger) *ImageManager
func (*ImageManager) PullImage ¶
func (i *ImageManager) PullImage(ctx context.Context, image string, options image.PullOptions) (io.ReadCloser, error)
type Status ¶ added in v0.2.0
type Status struct {
Ready bool `json:"ready"`
Provider string `json:"provider"`
Version string `json:"version"`
}
Status reports whether a local container engine is reachable and which one.
func Probe ¶ added in v0.2.0
Probe checks the local container engine: it connects using the standard environment (DOCKER_HOST etc.), asks the daemon for info, and identifies the provider (Docker, Docker Desktop, OrbStack, …). Ready is false — with the best guess at a provider name — when no daemon answers within a short timeout.