Documentation ¶
Index ¶
- Variables
- func Metrics() map[string]interface{}
- type AddProcessTask
- type CreateCheckpointTask
- type DeleteCheckpointTask
- type DeleteTask
- type Event
- type ExecExitTask
- type ExitTask
- type GetContainersTask
- type Machine
- type OOMTask
- type SignalTask
- type StartResponse
- type StartTask
- type StatsTask
- type Supervisor
- type Task
- type UpdateProcessTask
- type UpdateTask
- type Worker
Constants ¶
This section is empty.
Variables ¶
var ( // External errors ErrTaskChanNil = errors.New("containerd: task channel is nil") ErrBundleNotFound = errors.New("containerd: bundle not found") ErrContainerNotFound = errors.New("containerd: container not found") ErrContainerExists = errors.New("containerd: container already exists") ErrProcessNotFound = errors.New("containerd: processs not found for container") ErrUnknownContainerStatus = errors.New("containerd: unknown container status ") ErrUnknownTask = errors.New("containerd: unknown task type") )
var ( ContainerCreateTimer = metrics.NewTimer() ContainerDeleteTimer = metrics.NewTimer() ContainerStartTimer = metrics.NewTimer() ContainerStatsTimer = metrics.NewTimer() ContainersCounter = metrics.NewCounter() EventSubscriberCounter = metrics.NewCounter() TasksCounter = metrics.NewCounter() ExecProcessTimer = metrics.NewTimer() ExitProcessTimer = metrics.NewTimer() EpollFdCounter = metrics.NewCounter() )
Functions ¶
Types ¶
type AddProcessTask ¶
type AddProcessTask struct { ID string PID string Stdout string Stderr string Stdin string ProcessSpec *specs.ProcessSpec StartResponse chan StartResponse // contains filtered or unexported fields }
type CreateCheckpointTask ¶
type CreateCheckpointTask struct { ID string Checkpoint *runtime.Checkpoint // contains filtered or unexported fields }
type DeleteCheckpointTask ¶
type DeleteCheckpointTask struct { ID string Checkpoint *runtime.Checkpoint // contains filtered or unexported fields }
type DeleteTask ¶
type ExecExitTask ¶
type GetContainersTask ¶
type SignalTask ¶
type StartResponse ¶
StartResponse is the response containing a started container
type StartTask ¶
type StatsTask ¶
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
func New ¶
func New(stateDir string, runtimeName string) (*Supervisor, error)
New returns an initialized Process supervisor.
func (*Supervisor) Close ¶
func (s *Supervisor) Close() error
Close closes any open files in the supervisor but expects that Stop has been callsed so that no more containers are started.
func (*Supervisor) Events ¶
func (s *Supervisor) Events(from time.Time) chan Event
Events returns an event channel that external consumers can use to receive updates on container events
func (*Supervisor) Machine ¶
func (s *Supervisor) Machine() Machine
Machine returns the machine information for which the supervisor is executing on.
func (*Supervisor) SendTask ¶
func (s *Supervisor) SendTask(evt Task)
SendTask sends the provided event the the supervisors main event loop
func (*Supervisor) Start ¶
func (s *Supervisor) Start() error
Start is a non-blocking call that runs the supervisor for monitoring contianer processes and executing new containers.
This event loop is the only thing that is allowed to modify state of containers and processes therefore it is save to do operations in the handlers that modify state of the system or state of the Supervisor
func (*Supervisor) Stop ¶
func (s *Supervisor) Stop()
Stop closes all startTasks and sends a SIGTERM to each container's pid1 then waits for they to terminate. After it has handled all the SIGCHILD events it will close the signals chan and exit. Stop is a non-blocking call and will return after the containers have been signaled
func (*Supervisor) Unsubscribe ¶
func (s *Supervisor) Unsubscribe(sub chan Event)
Unsubscribe removes the provided channel from receiving any more events
type Task ¶
type Task interface { // ErrorCh returns a channel used to report and error from an async task ErrorCh() chan error }
Task executes an action returning an error chan with either nil or the error from executing the task