docker

package
v0.3.11-0...-4fdaadb Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: BSD-3-Clause Imports: 27 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ContainerStopTimeout is the maximum amount of time given to a container
	// to stop.
	ContainerStopTimeout = 10 * time.Second

	// ExecWaitTimeout is the maximum amount of time given to an exec to end.
	ExecWaitTimeout = 10 * time.Second

	// ImageBaseURL is the origin where the images will be pulled.
	ImageBaseURL = "docker.io"
	// ImageMonitor is the path to the docker image that contains the network
	// emulator tool.
	ImageMonitor = "dedis/simnet-monitor"

	// ContainerLabelKey is the label key assigned to every application
	// container.
	ContainerLabelKey = "go.dedis.ch.simnet.container"
	// ContainerLabelValue is the value for application containers.
	ContainerLabelValue = "app"

	// DefaultContainerNetwork is the default network used by Docker when no
	// additionnal network is required when creating the container.
	// This should be different whatsoever the Docker environment settings.
	DefaultContainerNetwork = "bridge"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Status   string `json:"status"`
	Error    string `json:"error"`
	Progress string `json:"progress"`
}

Event is the json encoded events sent when pulling an image.

type IO

type IO interface {
	sim.IO
	// contains filtered or unexported methods
}

IO is an extension of sim.IO.

type Strategy

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

Strategy implements the strategy interface for running simulations inside a Docker environment.

func NewStrategy

func NewStrategy(opts ...sim.Option) (*Strategy, error)

NewStrategy creates a docker strategy for simulations.

func (*Strategy) Clean

func (s *Strategy) Clean(ctx context.Context) error

Clean stops and removes all the containers created by the simulation.

func (*Strategy) Deploy

func (s *Strategy) Deploy(ctx context.Context, round sim.Round) error

Deploy pulls the application image and starts a container per node.

func (*Strategy) Execute

func (s *Strategy) Execute(ctx context.Context, round sim.Round) error

Execute takes the round and execute it against the context created from the options.

func (*Strategy) Option

func (s *Strategy) Option(opt sim.Option)

Option allows to change the options defined at the creation of the strategy.

func (*Strategy) String

func (s *Strategy) String() string

func (*Strategy) WriteStats

func (s *Strategy) WriteStats(ctx context.Context, filename string) error

WriteStats writes the statistics of the nodes to the file.

type VPN

type VPN interface {
	Deploy() error
	Clean() error
}

VPN is the interface to deploy and connect to a VPN inside the Docker private network area.

Jump to

Keyboard shortcuts

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