runc

package
v0.2.4-0...-e476a30 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTopic

func GetTopic(e interface{}) string

GetTopic converts an event from an interface type to the specific event topic id

func NewPlatform

func NewPlatform() (rproc.Platform, error)

NewPlatform returns a linux platform for use with I/O operations

func ReadRuntime

func ReadRuntime(path string) (string, error)

ReadRuntime reads the runtime information from the path

func WriteRuntime

func WriteRuntime(path, runtime string) error

WriteRuntime writes the runtime information into the path

Types

type Container

type Container struct {

	// ID of the container
	ID string
	// Bundle path
	Bundle string
	// contains filtered or unexported fields
}

Container for operating on a runc container and its processes

func NewContainer

func NewContainer(ctx context.Context, platform rproc.Platform, r *task.CreateTaskRequest) (*Container, error)

NewContainer returns a new runc container

func (*Container) All

func (c *Container) All() (o []rproc.Process)

All processes in the container

func (*Container) Cgroup

func (c *Container) Cgroup() cgroups.Cgroup

Cgroup of the container

func (*Container) CgroupSet

func (c *Container) CgroupSet(cg cgroups.Cgroup)

CgroupSet sets the cgroup to the container

func (*Container) Checkpoint

func (c *Container) Checkpoint(ctx context.Context, r *task.CheckpointTaskRequest) error

Checkpoint the container

func (*Container) CloseIO

func (c *Container) CloseIO(ctx context.Context, r *task.CloseIORequest) error

CloseIO of a process

func (*Container) Delete

func (c *Container) Delete(ctx context.Context, r *task.DeleteRequest) (rproc.Process, error)

Delete the container or a process by id

func (*Container) Exec

Exec an additional process

func (*Container) ExecdProcesses

func (c *Container) ExecdProcesses() (o []rproc.Process)

ExecdProcesses added to the container

func (*Container) HasPid

func (c *Container) HasPid(pid int) bool

HasPid returns true if the container owns a specific pid

func (*Container) Kill

func (c *Container) Kill(ctx context.Context, r *task.KillRequest) error

Kill a process

func (*Container) Pause

func (c *Container) Pause(ctx context.Context) error

Pause the container

func (*Container) Pid

func (c *Container) Pid() int

Pid of the main process of a container

func (*Container) Process

func (c *Container) Process(id string) (rproc.Process, error)

Process returns the process by id

func (*Container) ProcessAdd

func (c *Container) ProcessAdd(process rproc.Process)

ProcessAdd adds a new process to the container

func (*Container) ProcessExists

func (c *Container) ProcessExists(id string) bool

ProcessExists returns true if the process by id exists

func (*Container) ProcessRemove

func (c *Container) ProcessRemove(id string)

ProcessRemove removes the process by id from the container

func (*Container) ResizePty

func (c *Container) ResizePty(ctx context.Context, r *task.ResizePtyRequest) error

ResizePty of a process

func (*Container) Resume

func (c *Container) Resume(ctx context.Context) error

Resume the container

func (*Container) Start

Start a container process

func (*Container) Update

func (c *Container) Update(ctx context.Context, r *task.UpdateTaskRequest) error

Update the resource information of a running container

type Epoller

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

Epoller implementation for handling OOM events from a container's cgroup

func NewOOMEpoller

func NewOOMEpoller(publisher events.Publisher) (*Epoller, error)

NewOOMEpoller returns an epoll implementation that listens to OOM events from a container's cgroups.

func (*Epoller) Add

func (e *Epoller) Add(id string, cg cgroups.Cgroup) error

Add the cgroup to the epoll monitor

func (*Epoller) Close

func (e *Epoller) Close() error

Close the epoll fd

func (*Epoller) Run

func (e *Epoller) Run(ctx context.Context)

Run the epoll loop

Directories

Path Synopsis
Package options is a generated protocol buffer package.
Package options is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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