Add pid and stdio to process state

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-02-03 14:30:45 -08:00
parent 36eb83cb99
commit 01176f2d7f
8 changed files with 163 additions and 111 deletions

View file

@ -185,12 +185,17 @@ func (s *apiServer) State(ctx context.Context, r *types.StateRequest) (*types.St
var procs []*types.Process var procs []*types.Process
for _, p := range processes { for _, p := range processes {
oldProc := p.Spec() oldProc := p.Spec()
stdio := p.Stdio()
procs = append(procs, &types.Process{ procs = append(procs, &types.Process{
Pid: p.ID(), Pid: p.ID(),
SystemPid: uint32(p.SystemPid()),
Terminal: oldProc.Terminal, Terminal: oldProc.Terminal,
Args: oldProc.Args, Args: oldProc.Args,
Env: oldProc.Env, Env: oldProc.Env,
Cwd: oldProc.Cwd, Cwd: oldProc.Cwd,
Stdin: stdio.Stdin,
Stdout: stdio.Stdout,
Stderr: stdio.Stderr,
User: &types.User{ User: &types.User{
Uid: oldProc.User.UID, Uid: oldProc.User.UID,
Gid: oldProc.User.GID, Gid: oldProc.User.GID,

View file

@ -275,6 +275,10 @@ type Process struct {
Args []string `protobuf:"bytes,4,rep,name=args" json:"args,omitempty"` Args []string `protobuf:"bytes,4,rep,name=args" json:"args,omitempty"`
Env []string `protobuf:"bytes,5,rep,name=env" json:"env,omitempty"` Env []string `protobuf:"bytes,5,rep,name=env" json:"env,omitempty"`
Cwd string `protobuf:"bytes,6,opt,name=cwd" json:"cwd,omitempty"` Cwd string `protobuf:"bytes,6,opt,name=cwd" json:"cwd,omitempty"`
SystemPid uint32 `protobuf:"varint,7,opt,name=systemPid" json:"systemPid,omitempty"`
Stdin string `protobuf:"bytes,8,opt,name=stdin" json:"stdin,omitempty"`
Stdout string `protobuf:"bytes,9,opt,name=stdout" json:"stdout,omitempty"`
Stderr string `protobuf:"bytes,10,opt,name=stderr" json:"stderr,omitempty"`
} }
func (m *Process) Reset() { *m = Process{} } func (m *Process) Reset() { *m = Process{} }
@ -1135,99 +1139,100 @@ var _API_serviceDesc = grpc.ServiceDesc{
} }
var fileDescriptor0 = []byte{ var fileDescriptor0 = []byte{
// 1493 bytes of a gzipped FileDescriptorProto // 1509 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0xd9, 0x72, 0x1b, 0x45, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x58, 0xd9, 0x72, 0x1b, 0x45,
0x17, 0xb6, 0xa4, 0xd1, 0x76, 0xb4, 0xd8, 0x1e, 0x2f, 0x91, 0x95, 0x3f, 0x7f, 0xc2, 0x10, 0x48, 0x17, 0xb6, 0xa4, 0x91, 0x2c, 0x1d, 0x2d, 0xb6, 0xc7, 0x4b, 0x64, 0xe5, 0xcf, 0x9f, 0x30, 0x04,
0x8a, 0x4a, 0xb9, 0x82, 0xc3, 0x12, 0xc2, 0x05, 0x04, 0x27, 0x95, 0x40, 0x25, 0xe0, 0x8a, 0x6d, 0x92, 0xa2, 0x52, 0xae, 0xe0, 0xb0, 0x84, 0x70, 0x01, 0xc1, 0x49, 0x25, 0x50, 0x09, 0xb8, 0x62,
0xaa, 0xb8, 0x41, 0x35, 0x9e, 0x69, 0xa4, 0x46, 0xa3, 0x99, 0x61, 0xa6, 0xc7, 0x4b, 0xf1, 0x06, 0x9b, 0x2a, 0x6e, 0x50, 0x8d, 0x67, 0x1a, 0xa9, 0xf1, 0x6c, 0xcc, 0xf4, 0x78, 0x29, 0xde, 0x80,
0xdc, 0xf2, 0x22, 0x5c, 0xf1, 0x00, 0x3c, 0x01, 0xcf, 0xc1, 0x53, 0x70, 0x7a, 0x9b, 0x4d, 0x8b, 0x5b, 0x9e, 0x83, 0x2a, 0xae, 0x78, 0x00, 0x9e, 0x80, 0xe7, 0xe0, 0x29, 0x38, 0xbd, 0xcd, 0xa6,
0xe1, 0x82, 0x1b, 0x55, 0x75, 0xf7, 0x59,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x4f, 0x47, 0xbd, 0xe2, 0xae, 0xb5,
0x57, 0x39, 0x6b, 0x88, 0xff, 0x33, 0x1e, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x8d, 0xe9, 0x72, 0xbf, 0x86, 0x33, 0xaf, 0xfd, 0x8c, 0x30, 0xd9, 0x1d, 0x45, 0x57, 0x33, 0x2a, 0x62, 0x93,
0x67, 0xdc, 0x10, 0x00, 0x00, 0xab, 0x9c, 0xb6, 0xc4, 0x5f, 0x22, 0x0f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x20, 0x9e, 0x7a,
0x04, 0x1f, 0x11, 0x00, 0x00,
} }

View file

@ -116,6 +116,10 @@ message Process {
repeated string args = 4; // Arguments for process, first is binary path itself repeated string args = 4; // Arguments for process, first is binary path itself
repeated string env = 5; // List of environment variables for process repeated string env = 5; // List of environment variables for process
string cwd = 6; // Workind directory of process string cwd = 6; // Workind directory of process
uint32 systemPid = 7;
string stdin = 8; // path to the file where stdin will be read (optional)
string stdout = 9; // path to file where stdout will be written (optional)
string stderr = 10; // path to file where stderr will be written (optional)
} }
message Container { message Container {

View file

@ -61,6 +61,7 @@ func main() {
logrus.WithField("error", err).Fatal("shim: create new process") logrus.WithField("error", err).Fatal("shim: create new process")
} }
if err := p.start(); err != nil { if err := p.start(); err != nil {
p.delete()
logrus.WithField("error", err).Fatal("shim: start process") logrus.WithField("error", err).Fatal("shim: start process")
} }
go func() { go func() {

View file

@ -54,6 +54,23 @@ var containersCommand = cli.Command{
Action: listContainers, Action: listContainers,
} }
var stateCommand = cli.Command{
Name: "state",
Usage: "get a raw dump of the containerd state",
Action: func(context *cli.Context) {
c := getClient(context)
resp, err := c.State(netcontext.Background(), &types.StateRequest{})
if err != nil {
fatal(err.Error(), 1)
}
data, err := json.Marshal(resp)
if err != nil {
fatal(err.Error(), 1)
}
fmt.Print(string(data))
},
}
var listCommand = cli.Command{ var listCommand = cli.Command{
Name: "list", Name: "list",
Usage: "list all running containers", Usage: "list all running containers",

View file

@ -31,6 +31,7 @@ func main() {
checkpointCommand, checkpointCommand,
containersCommand, containersCommand,
eventsCommand, eventsCommand,
stateCommand,
} }
app.Before = func(context *cli.Context) error { app.Before = func(context *cli.Context) error {
if context.GlobalBool("debug") { if context.GlobalBool("debug") {

View file

@ -34,6 +34,10 @@ type Process interface {
Signal(os.Signal) error Signal(os.Signal) error
// Container returns the container that the process belongs to // Container returns the container that the process belongs to
Container() Container Container() Container
// Stdio of the container
Stdio() Stdio
// SystemPid is the pid on the system
SystemPid() int
} }
func newProcess(root, id string, c *container, s specs.Process, stdio Stdio) (*process, error) { func newProcess(root, id string, c *container, s specs.Process, stdio Stdio) (*process, error) {
@ -82,6 +86,9 @@ func loadProcess(root, id string, c *container, s *ProcessState) (*process, erro
Stderr: s.Stderr, Stderr: s.Stderr,
}, },
} }
if _, err := p.getPid(); err != nil {
return nil, err
}
if _, err := p.ExitStatus(); err != nil { if _, err := p.ExitStatus(); err != nil {
if err == ErrProcessNotExited { if err == ErrProcessNotExited {
exit, err := getExitPipe(filepath.Join(root, ExitFile)) exit, err := getExitPipe(filepath.Join(root, ExitFile))
@ -131,6 +138,10 @@ func (p *process) Container() Container {
return p.container return p.container
} }
func (p *process) SystemPid() int {
return p.pid
}
// ExitFD returns the fd of the exit pipe // ExitFD returns the fd of the exit pipe
func (p *process) ExitFD() int { func (p *process) ExitFD() int {
return int(p.exitPipe.Fd()) return int(p.exitPipe.Fd())
@ -169,6 +180,10 @@ func (p *process) Spec() specs.Process {
return p.spec return p.spec
} }
func (p *process) Stdio() Stdio {
return p.stdio
}
// Close closes any open files and/or resouces on the process // Close closes any open files and/or resouces on the process
func (p *process) Close() error { func (p *process) Close() error {
return p.exitPipe.Close() return p.exitPipe.Close()

View file

@ -17,16 +17,20 @@ func (p *testProcess) ID() string {
return p.id return p.id
} }
func (p *testProcess) Stdin() string { func (p *testProcess) CloseStdin() error {
return "" return nil
} }
func (p *testProcess) Stdout() string { func (p *testProcess) Resize(w, h int) error {
return "" return nil
} }
func (p *testProcess) Stderr() string { func (p *testProcess) Stdio() runtime.Stdio {
return "" return runtime.Stdio{}
}
func (p *testProcess) SystemPid() int {
return -1
} }
func (p *testProcess) ExitFD() int { func (p *testProcess) ExitFD() int {