package shim
import "github.com/containerd/containerd/runtime/v1/shim"
Index ¶
- Variables
- func NewLocal(s *Service) shimapi.ShimService
- func Reap() error
- type Config
- type Monitor
- func (m *Monitor) Start(c *exec.Cmd) (chan runc.Exit, error)
- func (m *Monitor) Subscribe() chan runc.Exit
- func (m *Monitor) Unsubscribe(c chan runc.Exit)
- func (m *Monitor) Wait(c *exec.Cmd, ec chan runc.Exit) (int, error)
- type Service
- func NewService(config Config, publisher events.Publisher) (*Service, error)
- func (s *Service) Checkpoint(ctx context.Context, r *shimapi.CheckpointTaskRequest) (*ptypes.Empty, error)
- func (s *Service) CloseIO(ctx context.Context, r *shimapi.CloseIORequest) (*ptypes.Empty, error)
- func (s *Service) Create(ctx context.Context, r *shimapi.CreateTaskRequest) (_ *shimapi.CreateTaskResponse, err error)
- func (s *Service) Delete(ctx context.Context, r *ptypes.Empty) (*shimapi.DeleteResponse, error)
- func (s *Service) DeleteProcess(ctx context.Context, r *shimapi.DeleteProcessRequest) (*shimapi.DeleteResponse, error)
- func (s *Service) Exec(ctx context.Context, r *shimapi.ExecProcessRequest) (*ptypes.Empty, error)
- func (s *Service) Kill(ctx context.Context, r *shimapi.KillRequest) (*ptypes.Empty, error)
- func (s *Service) ListPids(ctx context.Context, r *shimapi.ListPidsRequest) (*shimapi.ListPidsResponse, error)
- func (s *Service) Pause(ctx context.Context, r *ptypes.Empty) (*ptypes.Empty, error)
- func (s *Service) ResizePty(ctx context.Context, r *shimapi.ResizePtyRequest) (*ptypes.Empty, error)
- func (s *Service) Resume(ctx context.Context, r *ptypes.Empty) (*ptypes.Empty, error)
- func (s *Service) ShimInfo(ctx context.Context, r *ptypes.Empty) (*shimapi.ShimInfoResponse, error)
- func (s *Service) Start(ctx context.Context, r *shimapi.StartRequest) (*shimapi.StartResponse, error)
- func (s *Service) State(ctx context.Context, r *shimapi.StateRequest) (*shimapi.StateResponse, error)
- func (s *Service) Update(ctx context.Context, r *shimapi.UpdateTaskRequest) (*ptypes.Empty, error)
- func (s *Service) Wait(ctx context.Context, r *shimapi.WaitRequest) (*shimapi.WaitResponse, error)
Variables ¶
Default is the default monitor initialized for the package
ErrNoSuchProcess is returned when the process no longer exists
Functions ¶
func NewLocal ¶
func NewLocal(s *Service) shimapi.ShimService
NewLocal returns a shim client implementation for issue commands to a shim
func Reap ¶
func Reap() error
Reap should be called when the process receives an SIGCHLD. Reap will reap all exited processes and close their wait channels
Types ¶
type Config ¶
type Config struct { Path string Namespace string WorkDir string Criu string RuntimeRoot string SystemdCgroup bool }
Config contains shim specific configuration
type Monitor ¶
Monitor monitors the underlying system for process status changes
func (*Monitor) Start ¶
Start starts the command a registers the process with the reaper
func (*Monitor) Subscribe ¶
Subscribe to process exit changes
func (*Monitor) Unsubscribe ¶
Unsubscribe to process exit changes
func (*Monitor) Wait ¶
Wait blocks until a process is signal as dead. User should rely on the value of the exit status to determine if the command was successful or not.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the shim implementation of a remote shim over GRPC
func NewService ¶
NewService returns a new shim service that can be used via GRPC
func (*Service) Checkpoint ¶
func (s *Service) Checkpoint(ctx context.Context, r *shimapi.CheckpointTaskRequest) (*ptypes.Empty, error)
Checkpoint the container
func (*Service) CloseIO ¶
CloseIO of a process
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, r *shimapi.CreateTaskRequest) (_ *shimapi.CreateTaskResponse, err error)
Create a new initial process and container with the underlying OCI runtime
func (*Service) Delete ¶
Delete the initial process and container
func (*Service) DeleteProcess ¶
func (s *Service) DeleteProcess(ctx context.Context, r *shimapi.DeleteProcessRequest) (*shimapi.DeleteResponse, error)
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 ¶
func (s *Service) ListPids(ctx context.Context, r *shimapi.ListPidsRequest) (*shimapi.ListPidsResponse, error)
ListPids returns all pids inside the container
func (*Service) Pause ¶
Pause the container
func (*Service) ResizePty ¶
func (s *Service) ResizePty(ctx context.Context, r *shimapi.ResizePtyRequest) (*ptypes.Empty, error)
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 ¶
func (s *Service) Start(ctx context.Context, r *shimapi.StartRequest) (*shimapi.StartResponse, error)
Start a process
func (*Service) State ¶
func (s *Service) State(ctx context.Context, r *shimapi.StateRequest) (*shimapi.StateResponse, error)
State returns runtime state information for a process
func (*Service) Update ¶
Update a running container
func (*Service) Wait ¶
func (s *Service) Wait(ctx context.Context, r *shimapi.WaitRequest) (*shimapi.WaitResponse, error)
Wait for a process to exit
Source Files ¶
local.go reaper.go service.go service_unix.go
Directories ¶
Path | Synopsis |
---|---|
runtime/v1/shim/client | |
runtime/v1/shim/v1 | Package shim is a generated protocol buffer package. |
- Version
- v1.2.1-rc.0
- Published
- Nov 21, 2018
- Platform
- js/wasm
- Imports
- 34 packages
- Last checked
- 14 minutes ago –
Tools for package owners.