package v2

import "github.com/containerd/containerd/runtime/v2"

Index

Types

type Bundle

type Bundle struct {
	// ID of the bundle
	ID string
	// Path to the bundle
	Path string
	// Namespace of the bundle
	Namespace string
}

Bundle represents an OCI bundle

func LoadBundle

func LoadBundle(ctx context.Context, root, id string) (*Bundle, error)

LoadBundle loads an existing bundle from disk

func NewBundle

func NewBundle(ctx context.Context, root, state, id string, spec []byte) (b *Bundle, err error)

NewBundle returns a new bundle on disk

func (*Bundle) Delete

func (b *Bundle) Delete() error

Delete a bundle atomically

type Config

type Config struct {
	// Supported platforms
	Platforms []string `toml:"platforms"`
	// SchedCore enabled linux core scheduling
	SchedCore bool `toml:"sched_core"`
}

Config for the v2 runtime

type ManagerConfig

type ManagerConfig struct {
	Root         string
	State        string
	Store        containers.Store
	Events       *exchange.Exchange
	Address      string
	TTRPCAddress string
	SchedCore    bool
}

type ShimManager

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

ShimManager manages currently running shim processes. It is mainly responsible for launching new shims and for proper shutdown and cleanup of existing instances. The manager is unaware of the underlying services shim provides and lets higher level services consume them, but don't care about lifecycle management.

func NewShimManager

func NewShimManager(ctx context.Context, config *ManagerConfig) (*ShimManager, error)

NewShimManager creates a manager for v2 shims

func (*ShimManager) Delete

func (m *ShimManager) Delete(ctx context.Context, id string) error

Delete a runtime task

func (*ShimManager) Get

func (m *ShimManager) Get(ctx context.Context, id string) (ShimProcess, error)

func (*ShimManager) ID

func (m *ShimManager) ID() string

ID of the shim manager

func (*ShimManager) Start

func (m *ShimManager) Start(ctx context.Context, id string, opts runtime.CreateOpts) (_ ShimProcess, retErr error)

Start launches a new shim instance

type ShimProcess

type ShimProcess interface {
	runtime.Process

	// ID of the shim.
	ID() string
	// Namespace of this shim.
	Namespace() string
}

ShimProcess represents a shim instance managed by the shim service.

type TaskManager

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

TaskManager wraps task service client on top of shim manager.

func NewTaskManager

func NewTaskManager(shims *ShimManager) *TaskManager

NewTaskManager creates a new task manager instance.

func (*TaskManager) Create

func (m *TaskManager) Create(ctx context.Context, taskID string, opts runtime.CreateOpts) (runtime.Task, error)

Create launches new shim instance and creates new task

func (*TaskManager) Delete

func (m *TaskManager) Delete(ctx context.Context, taskID string) (*runtime.Exit, error)

Delete deletes the task and shim instance

func (*TaskManager) Get

func (m *TaskManager) Get(ctx context.Context, id string) (runtime.Task, error)

Get a specific task

func (*TaskManager) ID

func (m *TaskManager) ID() string

ID of the task manager

func (*TaskManager) Tasks

func (m *TaskManager) Tasks(ctx context.Context, all bool) ([]runtime.Task, error)

Tasks lists all tasks

Source Files

binary.go bundle.go bundle_linux.go manager.go manager_unix.go process.go shim.go shim_load.go shim_unix.go

Directories

PathSynopsis
runtime/v2/example
runtime/v2/example/cmd
runtime/v2/logging
runtime/v2/runc
runtime/v2/runc/manager
runtime/v2/runc/options
runtime/v2/runc/task
runtime/v2/runc/task/plugin
runtime/v2/runc/v1
runtime/v2/runc/v2
runtime/v2/shim
runtime/v2/task
Version
v1.6.12
Published
Dec 7, 2022
Platform
linux/amd64
Imports
39 packages
Last checked
1 minute ago

Tools for package owners.