Documentation ¶
Index ¶
- Constants
- Variables
- func Metrics() map[string]interface{}
- type AddProcessEvent
- type CreateCheckpointEvent
- type DeleteCheckpointEvent
- type DeleteEvent
- type Event
- type EventType
- type ExecExitEvent
- type ExitEvent
- type GetContainersEvent
- type Handler
- type Machine
- type SignalEvent
- type StartEvent
- type StartResponse
- type StartTask
- type StatsEvent
- type StopStatsEvent
- type Supervisor
- type UnsubscribeStatsEvent
- type UpdateEvent
- type Worker
Constants ¶
const DefaultBufferSize = 2048
DefaultBufferSize is the default size for a channel's buffer
const Version = "0.0.4"
Variables ¶
var ( // External errors ErrEventChanNil = errors.New("containerd: event 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 ") ErrUnknownEvent = errors.New("containerd: unknown event type") )
var ( ContainerStartTimer = metrics.NewTimer() ContainersCounter = metrics.NewCounter() EventsCounter = metrics.NewCounter() EventSubscriberCounter = metrics.NewCounter() )
Functions ¶
Types ¶
type AddProcessEvent ¶
type AddProcessEvent struct {
// contains filtered or unexported fields
}
func (*AddProcessEvent) Handle ¶
func (h *AddProcessEvent) Handle(e *Event) error
TODO: add this to worker for concurrent starts??? maybe not because of races where the container could be stopped and removed...
type CreateCheckpointEvent ¶
type CreateCheckpointEvent struct {
// contains filtered or unexported fields
}
func (*CreateCheckpointEvent) Handle ¶
func (h *CreateCheckpointEvent) Handle(e *Event) error
type DeleteCheckpointEvent ¶
type DeleteCheckpointEvent struct {
// contains filtered or unexported fields
}
func (*DeleteCheckpointEvent) Handle ¶
func (h *DeleteCheckpointEvent) Handle(e *Event) error
type DeleteEvent ¶
type DeleteEvent struct {
// contains filtered or unexported fields
}
func (*DeleteEvent) Handle ¶
func (h *DeleteEvent) Handle(e *Event) error
type Event ¶
type Event struct { Type EventType Timestamp time.Time ID string BundlePath string Stdout string Stderr string Stdin string Console string Pid int Status int Signal os.Signal Process *specs.Process State *runtime.State Containers []runtime.Container Checkpoint *runtime.Checkpoint Err chan error StartResponse chan StartResponse Stats chan interface{} }
type EventType ¶
type EventType string
const ( ExecExitEventType EventType = "execExit" ExitEventType EventType = "exit" StartContainerEventType EventType = "startContainer" DeleteEventType EventType = "deleteContainerEvent" GetContainerEventType EventType = "getContainer" SignalEventType EventType = "signal" AddProcessEventType EventType = "addProcess" UpdateContainerEventType EventType = "updateContainer" CreateCheckpointEventType EventType = "createCheckpoint" DeleteCheckpointEventType EventType = "deleteCheckpoint" StatsEventType EventType = "events" UnsubscribeStatsEventType EventType = "unsubscribeStats" StopStatsEventType EventType = "stopStats" OOMEventType EventType = "oom" )
type ExecExitEvent ¶
type ExecExitEvent struct {
// contains filtered or unexported fields
}
func (*ExecExitEvent) Handle ¶
func (h *ExecExitEvent) Handle(e *Event) error
type GetContainersEvent ¶
type GetContainersEvent struct {
// contains filtered or unexported fields
}
func (*GetContainersEvent) Handle ¶
func (h *GetContainersEvent) Handle(e *Event) error
type Machine ¶
type SignalEvent ¶
type SignalEvent struct {
// contains filtered or unexported fields
}
func (*SignalEvent) Handle ¶
func (h *SignalEvent) Handle(e *Event) error
type StartEvent ¶
type StartEvent struct {
// contains filtered or unexported fields
}
func (*StartEvent) Handle ¶
func (h *StartEvent) Handle(e *Event) error
type StartResponse ¶
type StartResponse struct {
Pid int
}
type StatsEvent ¶
type StatsEvent struct {
// contains filtered or unexported fields
}
func (*StatsEvent) Handle ¶
func (h *StatsEvent) Handle(e *Event) error
type StopStatsEvent ¶
type StopStatsEvent struct {
// contains filtered or unexported fields
}
func (*StopStatsEvent) Handle ¶
func (h *StopStatsEvent) Handle(e *Event) error
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
func NewSupervisor ¶
func NewSupervisor(id, stateDir string, tasks chan *StartTask, oom bool) (*Supervisor, error)
NewSupervisor 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() 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) SendEvent ¶
func (s *Supervisor) SendEvent(evt *Event)
SendEvent 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(sig chan os.Signal)
Stop closes all tasks 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 UnsubscribeStatsEvent ¶
type UnsubscribeStatsEvent struct {
// contains filtered or unexported fields
}
func (*UnsubscribeStatsEvent) Handle ¶
func (h *UnsubscribeStatsEvent) Handle(e *Event) error
type UpdateEvent ¶
type UpdateEvent struct {
// contains filtered or unexported fields
}
func (*UpdateEvent) Handle ¶
func (h *UpdateEvent) Handle(e *Event) error
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
api
|
|
grpc/types
Package types is a generated protocol buffer package.
|
Package types is a generated protocol buffer package. |
single app that will run containers in containerd and output the total time in seconds that it took for the execution.
|
single app that will run containers in containerd and output the total time in seconds that it took for the execution. |
http://man7.org/linux/man-pages/man2/prctl.2.html
|
http://man7.org/linux/man-pages/man2/prctl.2.html |