shim

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0, CC-BY-SA-4.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const InitPidFile = "init.pid"

InitPidFile name of the file that contains the init pid

View Source
const RuncRoot = "/run/containerd/runc"

RuncRoot is the path to the root runc state directory

Variables

This section is empty.

Functions

func NewLocal

func NewLocal(s *Service) shimapi.ShimClient

NewLocal returns a shim client implementation for issue commands to a shim

func WithLocal

func WithLocal(publisher events.Publisher) func(context.Context, Config) (shim.ShimClient, io.Closer, error)

WithLocal uses an in process shim

Types

type Client

type Client struct {
	shim.ShimClient
	// contains filtered or unexported fields
}

Client is a shim client containing the connection to a shim

func New

func New(ctx context.Context, config Config, opt ClientOpt) (*Client, error)

New returns a new shim client

func (*Client) Close

func (c *Client) Close() error

Close the cient connection

func (*Client) IsAlive

func (c *Client) IsAlive(ctx context.Context) (bool, error)

IsAlive returns true if the shim can be contacted. NOTE: a negative answer doesn't mean that the process is gone.

func (*Client) KillShim

func (c *Client) KillShim(ctx context.Context) error

KillShim kills the shim forcefully and wait for the process to disappear

func (*Client) StopShim

func (c *Client) StopShim(ctx context.Context) error

StopShim signals the shim to exit and wait for the process to disappear

type ClientOpt

type ClientOpt func(context.Context, Config) (shim.ShimClient, io.Closer, error)

ClientOpt is an option for a shim client configuration

func WithConnect

func WithConnect(address string) ClientOpt

WithConnect connects to an existing shim

func WithStart

func WithStart(binary, address, daemonAddress, cgroup string, nonewns, debug bool, exitHandler func()) ClientOpt

WithStart executes a new shim process

type Config

type Config struct {
	Path          string
	Namespace     string
	WorkDir       string
	Criu          string
	RuntimeRoot   string
	SystemdCgroup bool
}

Config contains shim specific configuration

type Service

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

Service is the shim implementation of a remote shim over GRPC

func NewService

func NewService(config Config, publisher events.Publisher) (*Service, error)

NewService returns a new shim service that can be used via GRPC

func (*Service) Checkpoint

Checkpoint the container

func (*Service) CloseIO

CloseIO of a process

func (*Service) Create

Create a new initial process and container with the underlying OCI runtime

func (*Service) Delete

Delete the initial process and container

func (*Service) DeleteProcess

DeleteProcess deletes an exec'd process

func (*Service) Exec

Exec an additional process inside the container

func (*Service) Kill

Kill a process with the provided signal

func (*Service) ListPids

ListPids returns all pids inside the container

func (*Service) Pause

Pause the container

func (*Service) ResizePty

ResizePty of a process

func (*Service) Resume

Resume the container

func (*Service) ShimInfo

ShimInfo returns shim information such as the shim's pid

func (*Service) Start

Start a process

func (*Service) State

State returns runtime state information for a process

func (*Service) Update

Update a running container

func (*Service) Wait

Wait for a process to exit

Directories

Path Synopsis
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