Documentation
¶
Index ¶
- func LoadShim(ctx context.Context, bundle *Bundle, onClose func()) (_ *shimTask, err error)
- func SaveContainerState(ctx sctx.Context, taskID string, status runtime.Status, pid uint32) error
- type Bundle
- type ManagerConfig
- type ShimManager
- type ShimProcess
- type State
- type 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) Tasks(ctx context.Context, all bool) ([]runtime.Task, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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
type ManagerConfig ¶
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) 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 // Bundle is a file system path to shim's bundle. Bundle() string // Client returns the underlying TTRPC client for this shim. Client() *ttrpc.Client }
ShimProcess represents a shim instance managed by the shim service.
type State ¶
type State struct { // InitProcessPid is the init process id in the parent namespace InitProcessPid int `json:"pid"` // Status is the current status of the container Status runtime.Status // Bundle is the path on the filesystem to the bundle Bundle string `json:"bundle"` // Created is the unix timestamp for the creation time of the container in UTC Created time.Time `json:"created"` }
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