Versions in this module Expand all Collapse all v1 v1.0.1 Apr 30, 2024 Changes in this version + const AllGPUCapabilities + var ErrNoIP = errors.New("no IP available") + func EnsureDockerExperimentalEnabled() + func EnsureSupportedDockerVersion() + func IsGVisorRuntime(ctx context.Context, t *testing.T) (bool, error) + func NumGPU() int + func PrintDockerConfig() + func Runtime() string + func RuntimePath() (string, error) + func Save(logger testutil.Logger, image string, w io.Writer) error + func UsingSystemdCgroup() (bool, error) + type Container struct + Name string + func MakeContainer(ctx context.Context, logger testutil.Logger) *Container + func MakeContainerWithRuntime(ctx context.Context, logger testutil.Logger, suffix string) *Container + func MakeNativeContainer(ctx context.Context, logger testutil.Logger) *Container + func (c *Container) Checkpoint(ctx context.Context, name string) error + func (c *Container) CheckpointResume(ctx context.Context, name string) error + func (c *Container) CleanUp(ctx context.Context) + func (c *Container) ConfigsFrom(r RunOpts, args ...string) (*container.Config, *container.HostConfig, *network.NetworkingConfig) + func (c *Container) CopyFiles(opts *RunOpts, target string, sources ...string) + func (c *Container) Create(ctx context.Context, r RunOpts, args ...string) error + func (c *Container) CreateFrom(ctx context.Context, profileImage string, conf *container.Config, ...) error + func (c *Container) Exec(ctx context.Context, opts ExecOpts, args ...string) (string, error) + func (c *Container) ExecProcess(ctx context.Context, opts ExecOpts, args ...string) (Process, error) + func (c *Container) FindIP(ctx context.Context, ipv6 bool) (net.IP, error) + func (c *Container) FindPort(ctx context.Context, sandboxPort int) (int, error) + func (c *Container) ID() string + func (c *Container) Kill(ctx context.Context) error + func (c *Container) Logs(ctx context.Context) (string, error) + func (c *Container) MakeLink(target string) string + func (c *Container) Pause(ctx context.Context) error + func (c *Container) Remove(ctx context.Context) error + func (c *Container) Restore(ctx context.Context, name string) error + func (c *Container) RootDirectory() (string, error) + func (c *Container) Run(ctx context.Context, r RunOpts, args ...string) (string, error) + func (c *Container) SandboxPid(ctx context.Context) (int, error) + func (c *Container) Spawn(ctx context.Context, r RunOpts, args ...string) error + func (c *Container) SpawnProcess(ctx context.Context, r RunOpts, args ...string) (Process, error) + func (c *Container) Start(ctx context.Context) error + func (c *Container) Stats(ctx context.Context) (*types.StatsJSON, error) + func (c *Container) Status(ctx context.Context) (types.ContainerState, error) + func (c *Container) Stop(ctx context.Context) error + func (c *Container) Unpause(ctx context.Context) error + func (c *Container) Wait(ctx context.Context) error + func (c *Container) WaitForOutput(ctx context.Context, pattern string, timeout time.Duration) (string, error) + func (c *Container) WaitForOutputSubmatch(ctx context.Context, pattern string, timeout time.Duration) ([]string, error) + func (c *Container) WaitTimeout(ctx context.Context, timeout time.Duration) error + type ContainerPool struct + func NewContainerPool(containers []*Container) *ContainerPool + func (cp *ContainerPool) CleanUp(ctx context.Context) + func (cp *ContainerPool) Get(ctx context.Context) (*Container, func(), error) + func (cp *ContainerPool) GetExclusive(ctx context.Context) (*Container, func(), error) + func (cp *ContainerPool) SetContainerLabel(c *Container, label string) + func (cp *ContainerPool) String() string + func (cp *ContainerPool) Utilization() float64 + type ExecError struct + ExitStatus int + func (ee *ExecError) Error() string + type ExecOpts struct + Env []string + Privileged bool + UseTTY bool + User string + WorkDir string + type Network struct + Name string + Subnet *net.IPNet + func NewNetwork(ctx context.Context, logger testutil.Logger) *Network + func (n *Network) Cleanup(ctx context.Context) error + func (n *Network) Connect(ctx context.Context, container *Container, ipv4, ipv6 string) error + func (n *Network) Create(ctx context.Context) error + func (n *Network) Inspect(ctx context.Context) (types.NetworkResource, error) + type Process struct + func (p *Process) ExitCode(ctx context.Context) (int, error) + func (p *Process) IsRunning(ctx context.Context) (bool, error) + func (p *Process) Logs() (string, error) + func (p *Process) Read() (string, string, error) + func (p *Process) WaitExitStatus(ctx context.Context) (int, error) + func (p *Process) Write(timeout time.Duration, buf []byte) (int, error) + type RunOpts struct + CapAdd []string + CapDrop []string + CpusetCpus string + DeviceRequests []container.DeviceRequest + Devices []container.DeviceMapping + Entrypoint []string + Env []string + Image string + Links []string + Memory int + Mounts []mount.Mount + NetworkMode string + Ports []int + Privileged bool + ReadOnly bool + User string + WorkDir string + func GPURunOpts() RunOpts