fe38efda50
Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Remove runtime files from containerd Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Update supervisor for orphaned containers Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Remove ctr/container.go back to rpc calls Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Add attach to loaded container Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Add monitor based on epoll for process exits Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Convert pids in containerd to string This is so that we no longer care about linux or system level pids and processes in containerd have user defined process id(pid) kinda like the exec process ids that docker has today. Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Add reaper back to containerd Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Implement list containers with new process model Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Implement restore of processes Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Add NONBLOCK to exit fifo open Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Implement tty reattach Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Fix race in exit pipe creation Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Add delete to shim Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Update shim to use pid-file and not stdout Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
38 lines
948 B
Go
38 lines
948 B
Go
package supervisor
|
|
|
|
type AddProcessEvent struct {
|
|
s *Supervisor
|
|
}
|
|
|
|
// TODO: add this to worker for concurrent starts??? maybe not because of races where the container
|
|
// could be stopped and removed...
|
|
func (h *AddProcessEvent) Handle(e *Event) error {
|
|
/*
|
|
start := time.Now()
|
|
ci, ok := h.s.containers[e.ID]
|
|
if !ok {
|
|
return ErrContainerNotFound
|
|
}
|
|
p, io, err := h.s.runtime.StartProcess(ci.container, *e.Process, e.Console)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if e.Pid, err = p.Pid(); err != nil {
|
|
return err
|
|
}
|
|
h.s.processes[e.Pid] = &containerInfo{
|
|
container: ci.container,
|
|
}
|
|
l, err := h.s.copyIO(e.Stdin, e.Stdout, e.Stderr, io)
|
|
if err != nil {
|
|
// log the error but continue with the other commands
|
|
logrus.WithFields(logrus.Fields{
|
|
"error": err,
|
|
"id": e.ID,
|
|
}).Error("log stdio")
|
|
}
|
|
h.s.processes[e.Pid].copier = l
|
|
ExecProcessTimer.UpdateSince(start)
|
|
*/
|
|
return nil
|
|
}
|