Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlkioThrottleDevice ¶
BlkioThrottleDevice defines a block I/O throttle setting.
type ContainerExitInfo ¶
ContainerExitInfo contains information about a container's exit status.
type ContainerInfo ¶
ContainerInfo contains information about a container for cleanup.
type ContainerSpec ¶
type ContainerSpec struct {
Name string
Image string
Entrypoint []string
Command []string
Env map[string]string
Mounts []Mount
NetworkName string
Labels map[string]string
ResourceLimits *ResourceLimits
}
ContainerSpec defines container configuration.
type Manager ¶
type Manager interface {
Start(ctx context.Context) error
Stop() error
// Network operations.
EnsureNetwork(ctx context.Context, name string) error
RemoveNetwork(ctx context.Context, name string) error
// Container operations.
CreateContainer(ctx context.Context, spec *ContainerSpec) (string, error)
StartContainer(ctx context.Context, containerID string) error
StopContainer(ctx context.Context, containerID string) error
RemoveContainer(ctx context.Context, containerID string) error
// Init container support.
RunInitContainer(ctx context.Context, spec *ContainerSpec, stdout, stderr io.Writer) error
// Log streaming.
StreamLogs(ctx context.Context, containerID string, stdout, stderr io.Writer) error
// Image operations.
PullImage(ctx context.Context, imageName string, policy string) error
GetImageDigest(ctx context.Context, imageName string) (string, error)
// Container info.
GetContainerIP(ctx context.Context, containerID, networkName string) (string, error)
// Volume operations.
CreateVolume(ctx context.Context, name string, labels map[string]string) error
RemoveVolume(ctx context.Context, name string) error
// Cleanup operations.
ListContainers(ctx context.Context) ([]ContainerInfo, error)
ListVolumes(ctx context.Context) ([]VolumeInfo, error)
// GetClient returns the underlying Docker client for direct API access.
GetClient() *client.Client
// WaitForContainerExit returns channels that signal when a container exits.
// The statusCh receives exit info (code + OOM status), errCh receives any wait errors.
WaitForContainerExit(ctx context.Context, containerID string) (<-chan ContainerExitInfo, <-chan error)
}
Manager handles Docker operations for benchmarkoor.
func NewManager ¶
func NewManager(log logrus.FieldLogger) (Manager, error)
NewManager creates a new Docker manager.
type Mount ¶
type Mount struct {
Source string
Target string
ReadOnly bool
Type string // "bind", "volume", "tmpfs"
Content []byte // For in-memory content to be written to a temp file
}
Mount defines a volume mount.
type ResourceLimits ¶
type ResourceLimits struct {
CpusetCpus string // Comma-separated CPU IDs (e.g., "0,1,2")
MemoryBytes int64 // Memory limit in bytes
MemorySwapBytes int64 // Memory+swap limit (-1 = unlimited, same as MemoryBytes = no swap)
MemorySwappiness *int64 // 0-100, controls swappiness
// Blkio throttling.
BlkioDeviceReadBps []BlkioThrottleDevice
BlkioDeviceWriteBps []BlkioThrottleDevice
BlkioDeviceReadIOps []BlkioThrottleDevice
BlkioDeviceWriteIOps []BlkioThrottleDevice
}
ResourceLimits defines container resource constraints.
type VolumeInfo ¶
VolumeInfo contains information about a volume for cleanup.
Click to show internal directories.
Click to hide internal directories.