linux

package
v1.0.2-rc.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2018 License: Apache-2.0, CC-BY-4.0 Imports: 35 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ic *plugin.InitContext) (interface{}, error)

New returns a configured runtime

Types

type Config

type Config struct {
	// Shim is a path or name of binary implementing the Shim GRPC API
	Shim string `toml:"shim"`
	// Runtime is a path or name of an OCI runtime used by the shim
	Runtime string `toml:"runtime"`
	// RuntimeRoot is the path that shall be used by the OCI runtime for its data
	RuntimeRoot string `toml:"runtime_root"`
	// NoShim calls runc directly from within the pkg
	NoShim bool `toml:"no_shim"`
	// Debug enable debug on the shim
	ShimDebug bool `toml:"shim_debug"`
}

Config options for the runtime

type Process

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

Process implements a linux process

func (*Process) CloseIO

func (p *Process) CloseIO(ctx context.Context) error

CloseIO closes the provided IO pipe for the process

func (*Process) ID

func (p *Process) ID() string

ID of the process

func (*Process) Kill

func (p *Process) Kill(ctx context.Context, signal uint32, _ bool) error

Kill sends the provided signal to the underlying process

Unable to kill all processes in the task using this method on a process

func (*Process) ResizePty

func (p *Process) ResizePty(ctx context.Context, size runtime.ConsoleSize) error

ResizePty changes the side of the process's PTY to the provided width and height

func (*Process) Start

func (p *Process) Start(ctx context.Context) error

Start the process

func (*Process) State

func (p *Process) State(ctx context.Context) (runtime.State, error)

State of process

func (*Process) Wait

func (p *Process) Wait(ctx context.Context) (*runtime.Exit, error)

Wait on the process to exit and return the exit status and timestamp

type Runtime

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

Runtime for a linux based system

func (*Runtime) Create

func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts) (_ runtime.Task, err error)

Create a new task

func (*Runtime) Delete

func (r *Runtime) Delete(ctx context.Context, c runtime.Task) (*runtime.Exit, error)

Delete a task removing all on disk state

func (*Runtime) Get

func (r *Runtime) Get(ctx context.Context, id string) (runtime.Task, error)

Get a specific task by task id

func (*Runtime) ID

func (r *Runtime) ID() string

ID of the runtime

func (*Runtime) Tasks

func (r *Runtime) Tasks(ctx context.Context) ([]runtime.Task, error)

Tasks returns all tasks known to the runtime

type ShimOpt

type ShimOpt func(*bundle, string, *runctypes.RuncOptions) (shim.Config, client.Opt)

ShimOpt specifies shim options for initialization and connection

func ShimConnect

func ShimConnect() ShimOpt

ShimConnect is a ShimOpt for connecting to an existing remote shim

func ShimLocal

func ShimLocal(exchange *exchange.Exchange) ShimOpt

ShimLocal is a ShimOpt for using an in process shim implementation

func ShimRemote

func ShimRemote(shimBinary, daemonAddress, cgroup string, debug bool, exitHandler func()) ShimOpt

ShimRemote is a ShimOpt for connecting and starting a remote shim

type Task

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

Task on a linux based system

func (*Task) Cgroup

func (t *Task) Cgroup() (cgroups.Cgroup, error)

Cgroup returns the underlying cgroup for a linux task

func (*Task) Checkpoint

func (t *Task) Checkpoint(ctx context.Context, path string, options *types.Any) error

Checkpoint creates a system level dump of the task and process information that can be later restored

func (*Task) CloseIO

func (t *Task) CloseIO(ctx context.Context) error

CloseIO closes the provided IO on the task

func (*Task) DeleteProcess

func (t *Task) DeleteProcess(ctx context.Context, id string) (*runtime.Exit, error)

DeleteProcess removes the provided process from the task and deletes all on disk state

func (*Task) Exec

func (t *Task) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (runtime.Process, error)

Exec creates a new process inside the task

func (*Task) ID

func (t *Task) ID() string

ID of the task

func (*Task) Info

func (t *Task) Info() runtime.TaskInfo

Info returns task information about the runtime and namespace

func (*Task) Kill

func (t *Task) Kill(ctx context.Context, signal uint32, all bool) error

Kill the task using the provided signal

Optionally send the signal to all processes that are a child of the task

func (*Task) Metrics

func (t *Task) Metrics(ctx context.Context) (interface{}, error)

Metrics returns runtime specific system level metric information for the task

func (*Task) Pause

func (t *Task) Pause(ctx context.Context) error

Pause the task and all processes

func (*Task) Pids

func (t *Task) Pids(ctx context.Context) ([]runtime.ProcessInfo, error)

Pids returns all system level process ids running inside the task

func (*Task) Process

func (t *Task) Process(ctx context.Context, id string) (runtime.Process, error)

Process returns a specific process inside the task by the process id

func (*Task) ResizePty

func (t *Task) ResizePty(ctx context.Context, size runtime.ConsoleSize) error

ResizePty changes the side of the task's PTY to the provided width and height

func (*Task) Resume

func (t *Task) Resume(ctx context.Context) error

Resume the task and all processes

func (*Task) Start

func (t *Task) Start(ctx context.Context) error

Start the task

func (*Task) State

func (t *Task) State(ctx context.Context) (runtime.State, error)

State returns runtime information for the task

func (*Task) Update

func (t *Task) Update(ctx context.Context, resources *types.Any) error

Update changes runtime information of a running task

func (*Task) Wait

func (t *Task) Wait(ctx context.Context) (*runtime.Exit, error)

Wait for the task to exit returning the status and timestamp

Directories

Path Synopsis
Package runctypes is a generated protocol buffer package.
Package runctypes is a generated protocol buffer package.
v1
Package shim is a generated protocol buffer package.
Package shim is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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