docker

package
v0.0.0-...-2b6d021 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient() (*client.Client, error)

NewClient returns a new docker client

func NewProvider

func NewProvider(req *pb.CreateRequest) providers.Provider

NewProvider initializes a Provider with defaults

func NewProviderWithConfig

func NewProviderWithConfig(cfg Config) providers.Provider

Types

type Config

type Config struct {
	Target target.Target

	// Name is the name of the container
	Name string

	// Version is the version of the image or container
	Version string

	// Image is hte image name of the docker image
	Image string

	// Tag is the docker tag, defaults to :latest
	Tag string

	// ID is the id of the running container
	ID string
}

Config holds allowed values for an implemented resource provider. Any value outside of this config is unable to be modified during an experiment

type Provider

type Provider struct {
	// Config holds our internal configuration options
	// for the instance of the Provider
	Config Config

	// RemoteConfig identifies the remote config
	RemoteConfig Config
}

Provider implements an docker Provider

func (*Provider) Annotate

func (p *Provider) Annotate(id string, l labels.Labels) error

Annotate should implement applying labels or tags for a given resource type

func (*Provider) Apply

func (p *Provider) Apply() error

Apply runs the Provider end to end, so calls read and clone

func (*Provider) AwaitReadiness

func (p *Provider) AwaitReadiness() chan error

AwaitReadiness should be implemented to detect when a Provider has finished setting up a variant and can begin using it in an experiment

func (*Provider) Cancel

func (p *Provider) Cancel() error

Cancel will abort and running or submitted Provider

func (*Provider) Clone

func (p *Provider) Clone() error

Clone creates a modified variant

func (*Provider) ImageName

func (p *Provider) ImageName() string

ImageName is the complete resource identifier to pull an image from a registry by name, and tag

func (*Provider) ProbeReadiness

func (p *Provider) ProbeReadiness() (bool, error)

ProbeReadiness checks that the provisioned resource is available and ready to be included in a live experiment

func (*Provider) Read

func (p *Provider) Read() error

Pull will pull an image from a registry, if the image is already pulled, it'll verify this and just return. TODO: add a 'force pull' and support options

func (*Provider) Running

func (p *Provider) Running() ([]types.Container, error)

Running returns a list of all running versions of a resource

func (*Provider) Select

func (p *Provider) Select() (target.Selection, error)

Select lists all pulled images of the repo

func (*Provider) Start

func (p *Provider) Start() (string, error)

Start a specific resource

func (*Provider) Stop

func (p *Provider) Stop() error

Stop will stop any running Provider

func (*Provider) TaggedImage

func (p *Provider) TaggedImage() (*types.ImageSummary, error)

TaggedImage list any image that matches the image and version/tag

func (*Provider) Teardown

func (p *Provider) Teardown() error

Teardown eradicates any resource that has been provisioned as part of a variant

func (*Provider) UniqueContainerName

func (p *Provider) UniqueContainerName() string

UniqueContainerName creates a unique name for running the image as a container

Jump to

Keyboard shortcuts

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