docker

package
v0.0.0-...-119c5e1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package docker provides a container-based provider for integration testing. It spawns Docker containers with SSH enabled, allowing realistic bootstrap testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Image is the Docker image to use. Must have SSH server installed.
	// Default: "navarch-ssh-test" (built from embedded Dockerfile)
	Image string

	// SSHPublicKey is the public key to authorize for SSH access.
	// If empty, reads from SSHPublicKeyPath.
	SSHPublicKey string

	// SSHPublicKeyPath is the path to the SSH public key file.
	// Default: ~/.ssh/id_rsa.pub
	SSHPublicKeyPath string

	// Network is the Docker network to attach containers to.
	// Default: "bridge"
	Network string

	// Logger for provider operations.
	Logger *slog.Logger
}

Config configures the Docker provider.

type Provider

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

Provider manages Docker containers as fake GPU nodes.

func New

func New(cfg Config) (*Provider, error)

New creates a new Docker provider.

func (*Provider) Close

func (p *Provider) Close() error

Close releases Docker client resources.

func (*Provider) EnsureImage

func (p *Provider) EnsureImage(ctx context.Context) error

EnsureImage builds or pulls the SSH test image if not present.

func (*Provider) List

func (p *Provider) List(ctx context.Context) ([]*provider.Node, error)

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Provision

func (p *Provider) Provision(ctx context.Context, req provider.ProvisionRequest) (*provider.Node, error)

func (*Provider) Terminate

func (p *Provider) Terminate(ctx context.Context, nodeID string) error

func (*Provider) TerminateAll

func (p *Provider) TerminateAll()

TerminateAll stops all containers managed by this provider.

Jump to

Keyboard shortcuts

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