package v2
import "github.com/containerd/containerd/runtime/v2"
Index ¶
- func NewTaskClient(client interface{}) (v2.TaskService, error)
- type Bundle
- func LoadBundle(ctx context.Context, root, id string) (*Bundle, error)
- func NewBundle(ctx context.Context, root, state, id string, spec typeurl.Any) (b *Bundle, err error)
- func (b *Bundle) Delete() error
- type Config
- type ManagerConfig
- type ShimInstance
- type ShimManager
- func NewShimManager(ctx context.Context, config *ManagerConfig) (*ShimManager, error)
- func (m *ShimManager) Delete(ctx context.Context, id string) error
- func (m *ShimManager) Get(ctx context.Context, id string) (ShimInstance, error)
- func (m *ShimManager) ID() string
- func (m *ShimManager) Start(ctx context.Context, id string, opts runtime.CreateOpts) (_ ShimInstance, retErr error)
- type TaskManager
- func NewTaskManager(shims *ShimManager) *TaskManager
- func (m *TaskManager) Create(ctx context.Context, taskID string, opts runtime.CreateOpts) (runtime.Task, error)
- func (m *TaskManager) Delete(ctx context.Context, taskID string) (*runtime.Exit, error)
- func (m *TaskManager) Get(ctx context.Context, id string) (runtime.Task, error)
- func (m *TaskManager) ID() string
- func (m *TaskManager) Tasks(ctx context.Context, all bool) ([]runtime.Task, error)
Functions ¶
func NewTaskClient ¶
func NewTaskClient(client interface{}) (v2.TaskService, error)
NewTaskClient returns a new task client interface which handles both GRPC and TTRPC servers depending on the client object type passed in.
Supported client types are: - *ttrpc.Client - grpc.ClientConnInterface
In 1.7 we support TaskService v2 (for backward compatibility with existing shims) and GRPC TaskService v3. In 2.0 we'll switch to TaskService v3 only for both TTRPC and GRPC, which will remove overhead of mapping v2 structs to v3 structs.
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 ¶
LoadBundle loads an existing bundle from disk
func NewBundle ¶
func NewBundle(ctx context.Context, root, state, id string, spec typeurl.Any) (b *Bundle, err error)
NewBundle returns a new bundle on disk
func (*Bundle) Delete ¶
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 SandboxStore sandbox.Store }
type ShimInstance ¶
type ShimInstance interface { io.Closer // ID of the shim. ID() string // Namespace of this shim. Namespace() string // Bundle is a file system path to shim's bundle. Bundle() string // Client returns the underlying TTRPC or GRPC client object for this shim. // The underlying object can be either *ttrpc.Client or grpc.ClientConnInterface. Client() any // Delete will close the client and remove bundle from disk. Delete(ctx context.Context) error }
ShimInstance represents running shim process managed by ShimManager.
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) (ShimInstance, 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) (_ ShimInstance, retErr error)
Start launches a new shim instance
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 ¶
Delete deletes the task and shim instance
func (*TaskManager) Get ¶
Get a specific task
func (*TaskManager) ID ¶
func (m *TaskManager) ID() string
ID of the task manager
func (*TaskManager) Tasks ¶
Tasks lists all tasks
Source Files ¶
binary.go bridge.go bundle.go bundle_default.go manager.go manager_windows.go process.go shim.go shim_load.go shim_windows.go
Directories ¶
Path | Synopsis |
---|---|
runtime/v2/logging | |
runtime/v2/runc | |
runtime/v2/runc/options | |
runtime/v2/shim |
- Version
- v1.7.14
- Published
- Mar 11, 2024
- Platform
- windows/amd64
- Imports
- 48 packages
- Last checked
- 1 minute ago –
Tools for package owners.