container

package
v0.0.0-...-9de8873 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XSNone        ExecutionState = "xs.none"
	XSCreated                    = "xs.created"
	XSStarted                    = "xs.started"
	XSStopping                   = "xs.stopping"
	XSStopped                    = "xs.stopped"
	XSRemoved                    = "xs.removed"
	XSExited                     = "xs.exited"
	XSExitedCrash                = "xs.exited.crash"
	XSError                      = "xs.error"
)
View Source
const (
	XECreated     ExecutionEvent = "xe.container.created"
	XEStarted                    = "xe.container.started"
	XEStopping                   = "xe.container.stopping"
	XEStopped                    = "xe.container.stopped"
	XERemoved                    = "xe.container.removed"
	XEExited                     = "xe.container.exited"
	XEExitedCrash                = "xe.container.exited.crash"
	XEAPIError                   = "xe.api.error"
	XEInterrupt                  = "xe.interrupt"
)
View Source
const (
	ContainerNamePat = "ds.run_%v_%v"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Execution

type Execution struct {
	ContainerInfo *dockerapi.Container
	ContainerName string
	ContainerID   string
	State         ExecutionState
	Crashed       bool
	StopTimeout   uint

	/// the following fields are forwarded to dockerapi.HostConfig and take
	/// the same parameters as docker's `--pid`, `--network` and `--ipc` CLI
	/// flags
	PidMode     string
	NetworkMode string
	IpcMode     string

	APIClient *dockerapi.Client
	// contains filtered or unexported fields
}

func NewExecution

func NewExecution(
	xc *app.ExecutionContext,
	logger *log.Entry,
	client *dockerapi.Client,
	imageRef string,
	options *ExecutionOptions,
	eventCh chan *ExecutionEvenInfo,
	cleanupOnSysExit bool,
	printState bool) (*Execution, error)

func (*Execution) Cleanup

func (ref *Execution) Cleanup() error

Cleanup removes stopped container for the execution

func (*Execution) ShowContainerLogs

func (ref *Execution) ShowContainerLogs()

func (*Execution) Start

func (ref *Execution) Start() error

Start starts a new container execution

func (*Execution) Stop

func (ref *Execution) Stop() error

Stop stops the container execution

func (*Execution) Wait

func (ref *Execution) Wait() (int, error)

Wait waits the container execution

type ExecutionEvenInfo

type ExecutionEvenInfo struct {
	Event ExecutionEvent
	Data  map[string]string
}

type ExecutionEvent

type ExecutionEvent string

type ExecutionIO

type ExecutionIO struct {
	Input  io.Reader
	Output io.Writer
	Error  io.Writer
}

type ExecutionOptions

type ExecutionOptions struct {
	ContainerName string
	Entrypoint    []string
	Cmd           []string
	PublishPorts  map[dockerapi.Port][]dockerapi.PortBinding
	EnvVars       []string
	Volumes       []config.VolumeMount
	LiveLogs      bool
	Terminal      bool
	IO            ExecutionIO
}

type ExecutionState

type ExecutionState string

type VolumeInfo

type VolumeInfo struct {
	Source      string
	Destination string
	Options     string
}

Jump to

Keyboard shortcuts

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