diff --git a/api/next.pb.txt b/api/next.pb.txt index 858db1c64..5a6d182d1 100755 --- a/api/next.pb.txt +++ b/api/next.pb.txt @@ -2956,6 +2956,7 @@ file { package: "containerd.v1.types" dependency: "gogoproto/gogo.proto" dependency: "google/protobuf/timestamp.proto" + dependency: "google/protobuf/any.proto" message_type { name: "Process" field { @@ -3035,6 +3036,24 @@ file { json_name: "exitedAt" } } + message_type { + name: "ProcessInfo" + field { + name: "pid" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_UINT32 + json_name: "pid" + } + field { + name: "info" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_MESSAGE + type_name: ".google.protobuf.Any" + json_name: "info" + } + } enum_type { name: "Status" value { @@ -3490,11 +3509,12 @@ file { message_type { name: "ListPidsResponse" field { - name: "pids" + name: "processes" number: 1 label: LABEL_REPEATED - type: TYPE_UINT32 - json_name: "pids" + type: TYPE_MESSAGE + type_name: ".containerd.v1.types.ProcessInfo" + json_name: "processes" } } message_type { diff --git a/api/services/tasks/v1/tasks.pb.go b/api/services/tasks/v1/tasks.pb.go index 47a1dce7c..0f587685b 100644 --- a/api/services/tasks/v1/tasks.pb.go +++ b/api/services/tasks/v1/tasks.pb.go @@ -268,7 +268,8 @@ func (*ListPidsRequest) ProtoMessage() {} func (*ListPidsRequest) Descriptor() ([]byte, []int) { return fileDescriptorTasks, []int{18} } type ListPidsResponse struct { - Pids []uint32 `protobuf:"varint,1,rep,packed,name=pids" json:"pids,omitempty"` + // Processes includes the process ID and additional process information + Processes []*containerd_v1_types.ProcessInfo `protobuf:"bytes,1,rep,name=processes" json:"processes,omitempty"` } func (m *ListPidsResponse) Reset() { *m = ListPidsResponse{} } @@ -1646,22 +1647,17 @@ func (m *ListPidsResponse) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Pids) > 0 { - dAtA7 := make([]byte, len(m.Pids)*10) - var j6 int - for _, num := range m.Pids { - for num >= 1<<7 { - dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j6++ + if len(m.Processes) > 0 { + for _, msg := range m.Processes { + dAtA[i] = 0xa + i++ + i = encodeVarintTasks(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - dAtA7[j6] = uint8(num) - j6++ + i += n } - dAtA[i] = 0xa - i++ - i = encodeVarintTasks(dAtA, i, uint64(j6)) - i += copy(dAtA[i:], dAtA7[:j6]) } return i, nil } @@ -1697,11 +1693,11 @@ func (m *CheckpointTaskRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x1a i++ i = encodeVarintTasks(dAtA, i, uint64(m.Options.Size())) - n8, err := m.Options.MarshalTo(dAtA[i:]) + n6, err := m.Options.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n8 + i += n6 } return i, nil } @@ -1761,11 +1757,11 @@ func (m *UpdateTaskRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintTasks(dAtA, i, uint64(m.Resources.Size())) - n9, err := m.Resources.MarshalTo(dAtA[i:]) + n7, err := m.Resources.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n7 } return i, nil } @@ -1886,11 +1882,11 @@ func (m *WaitResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintTasks(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt))) - n10, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) + n8, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) if err != nil { return 0, err } - i += n10 + i += n8 return i, nil } @@ -2213,12 +2209,11 @@ func (m *ListPidsRequest) Size() (n int) { func (m *ListPidsResponse) Size() (n int) { var l int _ = l - if len(m.Pids) > 0 { - l = 0 - for _, e := range m.Pids { - l += sovTasks(uint64(e)) + if len(m.Processes) > 0 { + for _, e := range m.Processes { + l = e.Size() + n += 1 + l + sovTasks(uint64(l)) } - n += 1 + sovTasks(uint64(l)) + l } return n } @@ -2551,7 +2546,7 @@ func (this *ListPidsResponse) String() string { return "nil" } s := strings.Join([]string{`&ListPidsResponse{`, - `Pids:` + fmt.Sprintf("%v", this.Pids) + `,`, + `Processes:` + strings.Replace(fmt.Sprintf("%v", this.Processes), "ProcessInfo", "containerd_v1_types.ProcessInfo", 1) + `,`, `}`, }, "") return s @@ -4868,67 +4863,36 @@ func (m *ListPidsResponse) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTasks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Processes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTasks } - m.Pids = append(m.Pids, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTasks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTasks - } - postIndex := iNdEx + packedLen - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTasks - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Pids = append(m.Pids, v) + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Pids", wireType) } + if msglen < 0 { + return ErrInvalidLengthTasks + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Processes = append(m.Processes, &containerd_v1_types.ProcessInfo{}) + if err := m.Processes[len(m.Processes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTasks(dAtA[iNdEx:]) @@ -5761,88 +5725,88 @@ func init() { } var fileDescriptorTasks = []byte{ - // 1313 bytes of a gzipped FileDescriptorProto + // 1317 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x5b, 0x6f, 0x1b, 0x45, - 0x14, 0xee, 0xfa, 0xee, 0xe3, 0xa4, 0x4d, 0x86, 0x34, 0x98, 0xa5, 0x8a, 0xc3, 0x22, 0x21, 0x13, - 0xe8, 0x2e, 0x75, 0x51, 0x85, 0x68, 0x85, 0xd4, 0x5c, 0x88, 0x2c, 0xa8, 0x9a, 0x6e, 0xcb, 0x45, - 0x95, 0x50, 0xd8, 0xee, 0x4e, 0x9c, 0x51, 0xec, 0xdd, 0xed, 0xce, 0x38, 0x6d, 0xe0, 0x01, 0x7e, - 0x42, 0x5f, 0x79, 0xe1, 0xf7, 0xe4, 0x91, 0x47, 0x84, 0xaa, 0x40, 0xfd, 0x2f, 0x78, 0x43, 0x73, - 0xd9, 0xcd, 0xc6, 0x8e, 0xbd, 0x4e, 0xd3, 0xf0, 0xd2, 0xce, 0xcc, 0x7e, 0xe7, 0xcc, 0x99, 0x6f, - 0xce, 0x9c, 0xf3, 0x39, 0xb0, 0xda, 0x21, 0x6c, 0xb7, 0xff, 0xc4, 0x74, 0x83, 0x9e, 0xe5, 0x06, - 0x3e, 0x73, 0x88, 0x8f, 0x23, 0x2f, 0x3d, 0x74, 0x42, 0x62, 0x51, 0x1c, 0xed, 0x13, 0x17, 0x53,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9a, 0xfe, 0xd7, 0x51, 0x63, 0x25, 0xa5, 0xa0, 0x82, - 0x10, 0xfb, 0x89, 0x39, 0xb5, 0x3a, 0xc1, 0x75, 0x8f, 0x74, 0x30, 0x65, 0xe6, 0xba, 0xf8, 0xcf, - 0x9e, 0x93, 0xce, 0xd6, 0x4e, 0xd5, 0x01, 0xf9, 0x69, 0x74, 0xc0, 0xf7, 0xb0, 0x38, 0x7c, 0x3a, - 0x45, 0xc6, 0x17, 0x50, 0x3b, 0x56, 0x77, 0xa7, 0x56, 0xbd, 0x11, 0x41, 0x92, 0x36, 0x30, 0x7e, - 0x86, 0xf9, 0x6f, 0x42, 0xef, 0x0d, 0x68, 0xb5, 0x16, 0x54, 0x23, 0x4c, 0x83, 0x7e, 0xe4, 0x62, - 0x2a, 0xb8, 0x1a, 0x77, 0xa8, 0x63, 0x98, 0xb1, 0x02, 0x97, 0xef, 0x49, 0x51, 0x1b, 0xef, 0x5c, - 0x87, 0xb2, 0xac, 0xee, 0xf2, 0x28, 0x55, 0x3b, 0x9e, 0xf2, 0x84, 0x4a, 0xb0, 0x49, 0xad, 0x2f, - 0x2b, 0x4d, 0xac, 0xce, 0x5d, 0x3f, 0x45, 0x1f, 0x0a, 0x80, 0x1d, 0x03, 0x8d, 0x1d, 0xa8, 0x7d, - 0xe7, 0x90, 0x8b, 0xef, 0x87, 0x11, 0xcc, 0xc8, 0x7d, 0x54, 0xac, 0x43, 0xda, 0x42, 0x9b, 0xac, - 0x2d, 0x72, 0xaf, 0xa3, 0x2d, 0x5a, 0x2f, 0x67, 0xa0, 0x28, 0xba, 0x21, 0xda, 0x83, 0x92, 0xd4, - 0x8d, 0xc8, 0x32, 0x27, 0xfd, 0x0a, 0x32, 0x47, 0x74, 0xba, 0xfe, 0xc9, 0xf4, 0x06, 0xea, 0x68, - 0x3f, 0x42, 0x51, 0xe8, 0x3b, 0xb4, 0x32, 0xd9, 0x34, 0xad, 0x36, 0xf5, 0x8f, 0xa6, 0xc2, 0xaa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, 0x35, 0xad, + 0xb8, 0xca, 0xa8, 0x17, 0x00, 0xa9, 0x79, 0x79, 0x3b, 0x03, 0xe2, 0xd3, 0x26, 0xbf, 0xf1, 0xc9, + 0xd9, 0x94, 0x94, 0xe3, 0x47, 0x50, 0x92, 0x03, 0x31, 0x0b, 0xb6, 0x91, 0xb1, 0x39, 0x16, 0xb6, + 0x1d, 0x28, 0xab, 0xd1, 0x95, 0x95, 0x2b, 0x27, 0xa7, 0xa1, 0x71, 0x73, 0x4a, 0x69, 0x15, 0xfa, + 0xf7, 0x50, 0xe0, 0x33, 0x27, 0xab, 0x0a, 0x53, 0xf3, 0xcf, 0x58, 0x99, 0x46, 0x54, 0x9a, 0x5f, + 0xfd, 0xe6, 0xf0, 0xcd, 0xd2, 0x95, 0x3f, 0xde, 0x2c, 0x5d, 0xf9, 0x65, 0xb0, 0xa4, 0x1d, 0x0e, + 0x96, 0xb4, 0xdf, 0x07, 0x4b, 0xda, 0xdf, 0x83, 0x25, 0xed, 0xe9, 0xbd, 0xf3, 0xfd, 0x65, 0xef, + 0xae, 0x58, 0x3c, 0x2b, 0x09, 0xb8, 0x6e, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x67, 0xc5, 0x63, + 0x32, 0x20, 0x14, 0x00, 0x00, } diff --git a/api/services/tasks/v1/tasks.proto b/api/services/tasks/v1/tasks.proto index 622e2bd5a..eb373185e 100644 --- a/api/services/tasks/v1/tasks.proto +++ b/api/services/tasks/v1/tasks.proto @@ -170,8 +170,9 @@ message ListPidsRequest { string container_id = 1; } -message ListPidsResponse{ - repeated uint32 pids = 1; +message ListPidsResponse { + // Processes includes the process ID and additional process information + repeated containerd.v1.types.ProcessInfo processes = 1; } message CheckpointTaskRequest { diff --git a/api/types/task/task.pb.go b/api/types/task/task.pb.go index d84f3e510..ccc230ae7 100644 --- a/api/types/task/task.pb.go +++ b/api/types/task/task.pb.go @@ -10,6 +10,7 @@ It has these top-level messages: Process + ProcessInfo */ package task @@ -18,6 +19,7 @@ import fmt "fmt" import math "math" import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/gogo/protobuf/types" +import google_protobuf2 "github.com/gogo/protobuf/types" import time "time" @@ -90,8 +92,22 @@ func (m *Process) Reset() { *m = Process{} } func (*Process) ProtoMessage() {} func (*Process) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{0} } +type ProcessInfo struct { + // PID is the process ID. + Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` + // Info contains additional process information. + // + // Info varies by platform. + Info *google_protobuf2.Any `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` +} + +func (m *ProcessInfo) Reset() { *m = ProcessInfo{} } +func (*ProcessInfo) ProtoMessage() {} +func (*ProcessInfo) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{1} } + func init() { proto.RegisterType((*Process)(nil), "containerd.v1.types.Process") + proto.RegisterType((*ProcessInfo)(nil), "containerd.v1.types.ProcessInfo") proto.RegisterEnum("containerd.v1.types.Status", Status_name, Status_value) } func (m *Process) Marshal() (dAtA []byte, err error) { @@ -175,6 +191,39 @@ func (m *Process) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ProcessInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessInfo) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Pid != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintTask(dAtA, i, uint64(m.Pid)) + } + if m.Info != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintTask(dAtA, i, uint64(m.Info.Size())) + n2, err := m.Info.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + return i, nil +} + func encodeFixed64Task(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) @@ -242,6 +291,19 @@ func (m *Process) Size() (n int) { return n } +func (m *ProcessInfo) Size() (n int) { + var l int + _ = l + if m.Pid != 0 { + n += 1 + sovTask(uint64(m.Pid)) + } + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovTask(uint64(l)) + } + return n +} + func sovTask(x uint64) (n int) { for { n++ @@ -274,6 +336,17 @@ func (this *Process) String() string { }, "") return s } +func (this *ProcessInfo) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ProcessInfo{`, + `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, + `Info:` + strings.Replace(fmt.Sprintf("%v", this.Info), "Any", "google_protobuf2.Any", 1) + `,`, + `}`, + }, "") + return s +} func valueToStringTask(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -584,6 +657,108 @@ func (m *Process) Unmarshal(dAtA []byte) error { } return nil } +func (m *ProcessInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProcessInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProcessInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) + } + m.Pid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Pid |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTask + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Info == nil { + m.Info = &google_protobuf2.Any{} + } + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTask(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTask + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTask(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 @@ -694,37 +869,39 @@ func init() { } var fileDescriptorTask = []byte{ - // 503 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x3d, 0x6f, 0xd3, 0x40, - 0x1c, 0xc6, 0x73, 0x6e, 0xe3, 0x24, 0x97, 0xb6, 0x98, 0xa3, 0xaa, 0x2c, 0x83, 0x6c, 0x8b, 0x29, - 0x62, 0xb0, 0x45, 0xba, 0xb1, 0xe5, 0x4d, 0x28, 0x42, 0x72, 0xa3, 0x4b, 0x22, 0xc6, 0xc8, 0xc9, - 0x1d, 0xe6, 0xd4, 0xe6, 0xce, 0xb2, 0xcf, 0xbc, 0x6c, 0x8c, 0xa8, 0x13, 0x5f, 0xa0, 0x13, 0x7c, - 0x0a, 0x3e, 0x41, 0x46, 0x26, 0xc4, 0x14, 0xa8, 0x3f, 0x09, 0x3a, 0xdb, 0x09, 0x19, 0x58, 0xac, - 0x7b, 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, 0xed, 0xf5, 0xc3, - 0xdb, 0x0a, 0x33, 0x1e, 0x59, 0x67, 0x9f, 0xbf, 0xda, 0xb5, 0xef, 0xdf, 0xec, 0xea, 0x35, 0x7d, - 0x73, 0x73, 0x6f, 0xd7, 0x7e, 0xdd, 0xdb, 0xb5, 0x4f, 0xb9, 0x0d, 0x36, 0xb9, 0x0d, 0x7e, 0xe4, - 0x36, 0xf8, 0x93, 0xdb, 0x60, 0xa9, 0x17, 0xab, 0xb9, 0xfc, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x14, - 0xf3, 0xee, 0x85, 0xe8, 0x02, 0x00, 0x00, + // 543 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xcf, 0x6e, 0xd3, 0x4c, + 0x14, 0xc5, 0x33, 0x6e, 0xe3, 0x24, 0xe3, 0xb6, 0x9f, 0x3f, 0x13, 0x55, 0xc6, 0x20, 0xdb, 0xea, + 0xca, 0x62, 0x61, 0x8b, 0x74, 0xc7, 0x2e, 0xff, 0x84, 0x2c, 0x24, 0x37, 0x72, 0x12, 0xb1, 0x8c, + 0x9c, 0x78, 0x62, 0x46, 0x6d, 0x66, 0x2c, 0x7b, 0x0c, 0x64, 0xc7, 0x12, 0x75, 0xc5, 0x0b, 0x74, + 0x05, 0x4f, 0xc1, 0x13, 0x64, 0xc9, 0x0a, 0xb1, 0x0a, 0xd4, 0x4f, 0x82, 0xc6, 0x76, 0xd2, 0x08, + 0xd8, 0x8c, 0xee, 0x3d, 0xbf, 0x33, 0x77, 0xee, 0x1c, 0xf8, 0x22, 0xc2, 0xec, 0x4d, 0x36, 0xb7, + 0x17, 0x74, 0xe5, 0x2c, 0x28, 0x61, 0x01, 0x26, 0x28, 0x09, 0x0f, 0xcb, 0x20, 0xc6, 0x0e, 0x5b, + 0xc7, 0x28, 0x75, 0x58, 0x90, 0x5e, 0x17, 0x87, 0x1d, 0x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xa7, 0xd7, 0x0f, 0x6f, 0x73, 0x8c, 0x49, 0xa4, 0x9d, 0x7d, 0xfc, + 0xac, 0xd7, 0xbe, 0x7e, 0xd1, 0xab, 0xdf, 0xf4, 0xd4, 0xcd, 0xbd, 0x5e, 0xfb, 0x71, 0xaf, 0xd7, + 0x3e, 0xe4, 0x3a, 0xd8, 0xe4, 0x3a, 0xf8, 0x96, 0xeb, 0xe0, 0x57, 0xae, 0x83, 0xb9, 0x58, 0xc4, + 0x70, 0xf9, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x19, 0xf7, 0x5b, 0x8f, 0x4e, 0x03, 0x00, 0x00, } diff --git a/api/types/task/task.proto b/api/types/task/task.proto index 4833d12a5..5845edf29 100644 --- a/api/types/task/task.proto +++ b/api/types/task/task.proto @@ -4,6 +4,7 @@ package containerd.v1.types; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; +import "google/protobuf/any.proto"; enum Status { option (gogoproto.goproto_enum_prefix) = false; @@ -29,3 +30,12 @@ message Process { uint32 exit_status = 9; google.protobuf.Timestamp exited_at = 10 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; } + +message ProcessInfo { + // PID is the process ID. + uint32 pid = 1; + // Info contains additional process information. + // + // Info varies by platform. + google.protobuf.Any info = 2; +} diff --git a/cmd/ctr/ps.go b/cmd/ctr/ps.go index e5a668f9e..9538acc19 100644 --- a/cmd/ctr/ps.go +++ b/cmd/ctr/ps.go @@ -5,6 +5,7 @@ import ( "os" "text/tabwriter" + "github.com/containerd/containerd/windows/hcsshimopts" "github.com/pkg/errors" "github.com/urfave/cli" ) @@ -41,10 +42,19 @@ var taskPsCommand = cli.Command{ return err } w := tabwriter.NewWriter(os.Stdout, 10, 1, 3, ' ', 0) - fmt.Fprintln(w, "PID") + fmt.Fprintln(w, "PID\tINFO") for _, ps := range processes { - if _, err := fmt.Fprintf(w, "%d\n", ps); err != nil { - return err + if ps.Info != nil { + var details hcsshimopts.ProcessDetails + if err := details.Unmarshal(ps.Info.Value); err == nil { + if _, err := fmt.Fprintf(w, "%d\t%+v\n", ps.Pid, details); err != nil { + return err + } + } + } else { + if _, err := fmt.Fprintf(w, "%d\t-\n", ps.Pid); err != nil { + return err + } } } return w.Flush() diff --git a/container_test.go b/container_test.go index b51943fe1..fdcea5f23 100644 --- a/container_test.go +++ b/container_test.go @@ -17,6 +17,7 @@ import ( "github.com/containerd/typeurl" "github.com/containerd/containerd/errdefs" + "github.com/containerd/containerd/windows/hcsshimopts" gogotypes "github.com/gogo/protobuf/types" ) @@ -377,13 +378,25 @@ func TestContainerPids(t *testing.T) { t.Error(err) return } - if l := len(processes); l != 1 { - t.Errorf("expected 1 process but received %d", l) - } - if len(processes) > 0 { - actual := processes[0] - if pid != actual { - t.Errorf("expected pid %d but received %d", pid, actual) + switch runtime.GOOS { + case "windows": + if processes[0].Info == nil { + t.Error("expected additional process information but received nil") + } else { + var details hcsshimopts.ProcessDetails + if err := details.Unmarshal(processes[0].Info.Value); err != nil { + t.Errorf("expected Windows info type hcsshimopts.ProcessDetails %v", err) + } + } + default: + if l := len(processes); l != 1 { + t.Errorf("expected 1 process but received %d", l) + } + if len(processes) > 0 { + actual := processes[0].Pid + if pid != actual { + t.Errorf("expected pid %d but received %d", pid, actual) + } } } if err := task.Kill(ctx, syscall.SIGKILL); err != nil { diff --git a/linux/shim/service.go b/linux/shim/service.go index 25cc6ece8..9c9f50602 100644 --- a/linux/shim/service.go +++ b/linux/shim/service.go @@ -345,8 +345,14 @@ func (s *Service) ListPids(ctx context.Context, r *shimapi.ListPidsRequest) (*sh if err != nil { return nil, errdefs.ToGRPC(err) } + var processes []*task.ProcessInfo + for _, pid := range pids { + processes = append(processes, &task.ProcessInfo{ + Pid: pid, + }) + } return &shimapi.ListPidsResponse{ - Pids: pids, + Processes: processes, }, nil } diff --git a/linux/shim/v1/shim.pb.go b/linux/shim/v1/shim.pb.go index 1e9e3617c..831d091bb 100644 --- a/linux/shim/v1/shim.pb.go +++ b/linux/shim/v1/shim.pb.go @@ -195,7 +195,7 @@ func (*ListPidsRequest) ProtoMessage() {} func (*ListPidsRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{11} } type ListPidsResponse struct { - Pids []uint32 `protobuf:"varint,1,rep,packed,name=pids" json:"pids,omitempty"` + Processes []*containerd_v1_types.ProcessInfo `protobuf:"bytes,1,rep,name=processes" json:"processes,omitempty"` } func (m *ListPidsResponse) Reset() { *m = ListPidsResponse{} } @@ -1367,22 +1367,17 @@ func (m *ListPidsResponse) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Pids) > 0 { - dAtA6 := make([]byte, len(m.Pids)*10) - var j5 int - for _, num := range m.Pids { - for num >= 1<<7 { - dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j5++ + if len(m.Processes) > 0 { + for _, msg := range m.Processes { + dAtA[i] = 0xa + i++ + i = encodeVarintShim(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - dAtA6[j5] = uint8(num) - j5++ + i += n } - dAtA[i] = 0xa - i++ - i = encodeVarintShim(dAtA, i, uint64(j5)) - i += copy(dAtA[i:], dAtA6[:j5]) } return i, nil } @@ -1412,11 +1407,11 @@ func (m *CheckpointTaskRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintShim(dAtA, i, uint64(m.Options.Size())) - n7, err := m.Options.MarshalTo(dAtA[i:]) + n5, err := m.Options.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n7 + i += n5 } return i, nil } @@ -1463,11 +1458,11 @@ func (m *UpdateTaskRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintShim(dAtA, i, uint64(m.Resources.Size())) - n8, err := m.Resources.MarshalTo(dAtA[i:]) + n6, err := m.Resources.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n8 + i += n6 } return i, nil } @@ -1572,11 +1567,11 @@ func (m *WaitResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x12 i++ i = encodeVarintShim(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt))) - n9, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) + n7, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n7 return i, nil } @@ -1834,12 +1829,11 @@ func (m *ListPidsRequest) Size() (n int) { func (m *ListPidsResponse) Size() (n int) { var l int _ = l - if len(m.Pids) > 0 { - l = 0 - for _, e := range m.Pids { - l += sovShim(uint64(e)) + if len(m.Processes) > 0 { + for _, e := range m.Processes { + l = e.Size() + n += 1 + l + sovShim(uint64(l)) } - n += 1 + sovShim(uint64(l)) + l } return n } @@ -2089,7 +2083,7 @@ func (this *ListPidsResponse) String() string { return "nil" } s := strings.Join([]string{`&ListPidsResponse{`, - `Pids:` + fmt.Sprintf("%v", this.Pids) + `,`, + `Processes:` + strings.Replace(fmt.Sprintf("%v", this.Processes), "ProcessInfo", "containerd_v1_types.ProcessInfo", 1) + `,`, `}`, }, "") return s @@ -3900,67 +3894,36 @@ func (m *ListPidsResponse) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Processes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim } - m.Pids = append(m.Pids, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthShim - } - postIndex := iNdEx + packedLen - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Pids = append(m.Pids, v) + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Pids", wireType) } + if msglen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Processes = append(m.Processes, &containerd_v1_types.ProcessInfo{}) + if err := m.Processes[len(m.Processes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipShim(dAtA[iNdEx:]) @@ -4711,76 +4674,76 @@ func init() { } var fileDescriptorShim = []byte{ - // 1123 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x36, 0xf5, 0xaf, 0x51, 0xe4, 0xda, 0x5b, 0xc7, 0x65, 0x14, 0x40, 0x16, 0x08, 0xd4, 0x50, - 0x51, 0x84, 0xaa, 0xe5, 0x22, 0x69, 0x5a, 0xa0, 0x80, 0xed, 0x04, 0x85, 0xd1, 0x1a, 0x31, 0x68, - 0xa7, 0x29, 0x5a, 0x14, 0x06, 0x2d, 0xae, 0xa5, 0x85, 0x29, 0x92, 0xe1, 0x2e, 0x5d, 0xbb, 0xa7, -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x0e, 0x26, - 0x2e, 0x7f, 0x00, 0x05, 0xde, 0x1c, 0xd0, 0xa3, 0xf4, 0x85, 0x63, 0x4d, 0x24, 0x71, 0xb9, 0x63, - 0x28, 0xf0, 0x37, 0x05, 0xca, 0x70, 0x15, 0xe6, 0x5f, 0x4d, 0x89, 0xab, 0xbe, 0x82, 0xea, 0xf8, - 0x49, 0x82, 0x32, 0xf0, 0x36, 0xfb, 0x7e, 0x49, 0x5c, 0xf8, 0x08, 0xca, 0xaa, 0x93, 0xa1, 0x0c, - 0xfa, 0x9b, 0x6e, 0x7a, 0x89, 0x8b, 0x7e, 0x0f, 0x95, 0x51, 0xbb, 0x48, 0x64, 0x3b, 0xc3, 0x21, - 0xe6, 0x5a, 0xce, 0x4b, 0x28, 0xc9, 0xbe, 0x92, 0xa5, 0x3a, 0xcd, 0x75, 0xa0, 0xc4, 0x70, 0x31, - 0x14, 0x78, 0x6d, 0xcf, 0xa2, 0x80, 0x58, 0xab, 0x68, 0x98, 0x59, 0xe1, 0x32, 0xfa, 0xdd, 0x83, - 0xeb, 0x77, 0xcd, 0xa5, 0xbf, 0xdf, 0x35, 0x97, 0x7e, 0xbb, 0x69, 0x6a, 0xd7, 0x37, 0x4d, 0xed, - 0xaf, 0x9b, 0xa6, 0xf6, 0xef, 0x4d, 0x53, 0xfb, 0x71, 0x7b, 0xb1, 0xff, 0x69, 0xbf, 0xe2, 0xbf, - 0xa7, 0x25, 0x71, 0x8a, 0xed, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x70, 0x88, 0x12, 0x32, 0x11, - 0x0f, 0x00, 0x00, + // 1131 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4f, 0x4f, 0x1b, 0x47, + 0x14, 0x67, 0x8d, 0xff, 0x3e, 0xc7, 0x14, 0xa6, 0x84, 0x6e, 0x1c, 0xc9, 0x58, 0x2b, 0x35, 0x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, 0xff, 0xff, 0xad, 0x60, 0x08, 0x28, 0x3d, 0x0f, 0x00, 0x00, } diff --git a/linux/shim/v1/shim.proto b/linux/shim/v1/shim.proto index 19d8e2391..8d8af9578 100644 --- a/linux/shim/v1/shim.proto +++ b/linux/shim/v1/shim.proto @@ -129,8 +129,8 @@ message ListPidsRequest { string id = 1; } -message ListPidsResponse{ - repeated uint32 pids = 1; +message ListPidsResponse { + repeated containerd.v1.types.ProcessInfo processes = 1; } message CheckpointTaskRequest { diff --git a/linux/task.go b/linux/task.go index 4b22d90ef..a851ee77e 100644 --- a/linux/task.go +++ b/linux/task.go @@ -172,14 +172,20 @@ func (t *Task) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (runt } // Pids returns all system level process ids running inside the task -func (t *Task) Pids(ctx context.Context) ([]uint32, error) { +func (t *Task) Pids(ctx context.Context) ([]runtime.ProcessInfo, error) { resp, err := t.shim.ListPids(ctx, &shim.ListPidsRequest{ ID: t.id, }) if err != nil { return nil, errdefs.FromGRPC(err) } - return resp.Pids, nil + var processList []runtime.ProcessInfo + for _, p := range resp.Processes { + processList = append(processList, runtime.ProcessInfo{ + Pid: p.Pid, + }) + } + return processList, nil } // ResizePty changes the side of the task's PTY to the provided width and height diff --git a/runtime/task.go b/runtime/task.go index d5e13f742..019d4c8cf 100644 --- a/runtime/task.go +++ b/runtime/task.go @@ -42,7 +42,7 @@ type Task interface { // Exec adds a process into the container Exec(context.Context, string, ExecOpts) (Process, error) // Pids returns all pids - Pids(context.Context) ([]uint32, error) + Pids(context.Context) ([]ProcessInfo, error) // Checkpoint checkpoints a container to an image with live system data Checkpoint(context.Context, string, *types.Any) error // DeleteProcess deletes a specific exec process via its id @@ -92,3 +92,11 @@ type State struct { Stderr string Terminal bool } + +type ProcessInfo struct { + // Pid is the process ID + Pid uint32 + // Info includes additional process information + // Info varies by platform + Info interface{} +} diff --git a/services/tasks/service.go b/services/tasks/service.go index ba7041d5d..36c3230e7 100644 --- a/services/tasks/service.go +++ b/services/tasks/service.go @@ -27,6 +27,7 @@ import ( "github.com/containerd/containerd/runtime" "github.com/containerd/typeurl" google_protobuf "github.com/golang/protobuf/ptypes/empty" + "github.com/pkg/errors" "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -331,12 +332,26 @@ func (s *Service) ListPids(ctx context.Context, r *api.ListPidsRequest) (*api.Li if err != nil { return nil, err } - pids, err := t.Pids(ctx) + processList, err := t.Pids(ctx) if err != nil { return nil, errdefs.ToGRPC(err) } + var processes []*task.ProcessInfo + for _, p := range processList { + processInfo := task.ProcessInfo{ + Pid: p.Pid, + } + if p.Info != nil { + a, err := typeurl.MarshalAny(p.Info) + if err != nil { + return nil, errors.Wrapf(err, "failed to marshal process %d info", p.Pid) + } + processInfo.Info = a + } + processes = append(processes, &processInfo) + } return &api.ListPidsResponse{ - Pids: pids, + Processes: processes, }, nil } diff --git a/task.go b/task.go index 95ed7d869..d3636c925 100644 --- a/task.go +++ b/task.go @@ -20,6 +20,7 @@ import ( "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/rootfs" "github.com/containerd/typeurl" + google_protobuf "github.com/gogo/protobuf/types" digest "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/specs-go/v1" specs "github.com/opencontainers/runtime-spec/specs-go" @@ -41,6 +42,14 @@ type Status struct { ExitTime time.Time } +type ProcessInfo struct { + // Pid is the process ID + Pid uint32 + // Info includes additional process information + // Info varies by platform + Info *google_protobuf.Any +} + // ProcessStatus returns a human readable status for the Process representing its current status type ProcessStatus string @@ -107,7 +116,7 @@ type Task interface { // Exec creates a new process inside the task Exec(context.Context, string, *specs.Process, IOCreation) (Process, error) // Pids returns a list of system specific process ids inside the task - Pids(context.Context) ([]uint32, error) + Pids(context.Context) ([]ProcessInfo, error) // Checkpoint serializes the runtime and memory information of a task into an // OCI Index that can be push and pulled from a remote resource. // @@ -294,14 +303,18 @@ func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreat }, nil } -func (t *task) Pids(ctx context.Context) ([]uint32, error) { +func (t *task) Pids(ctx context.Context) ([]ProcessInfo, error) { response, err := t.client.TaskService().ListPids(ctx, &tasks.ListPidsRequest{ ContainerID: t.id, }) if err != nil { return nil, errdefs.FromGRPC(err) } - return response.Pids, nil + var processList []ProcessInfo + for _, p := range response.Processes { + processList = append(processList, ProcessInfo(*p)) + } + return processList, nil } func (t *task) CloseIO(ctx context.Context, opts ...IOCloserOpts) error { diff --git a/windows/hcsshimopts/hcsshim.pb.go b/windows/hcsshimopts/hcsshim.pb.go index fb0cc16fe..d81def278 100644 --- a/windows/hcsshimopts/hcsshim.pb.go +++ b/windows/hcsshimopts/hcsshim.pb.go @@ -10,6 +10,7 @@ It has these top-level messages: CreateOptions + ProcessDetails */ package hcsshimopts @@ -18,6 +19,7 @@ import fmt "fmt" import math "math" import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/golang/protobuf/ptypes/duration" +import google_protobuf2 "github.com/gogo/protobuf/types" import time "time" @@ -48,8 +50,26 @@ func (m *CreateOptions) Reset() { *m = CreateOptions{} } func (*CreateOptions) ProtoMessage() {} func (*CreateOptions) Descriptor() ([]byte, []int) { return fileDescriptorHcsshim, []int{0} } +// ProcessDetails contains additional information about a process +// ProcessDetails is made of the same fields as found in hcsshim.ProcessListItem +type ProcessDetails struct { + ImageName string `protobuf:"bytes,1,opt,name=image_name,json=imageName,proto3" json:"image_name,omitempty"` + CreatedAt *google_protobuf2.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt" json:"created_at,omitempty"` + KernelTime_100Ns uint64 `protobuf:"varint,3,opt,name=kernel_time_100_ns,json=kernelTime100Ns,proto3" json:"kernel_time_100_ns,omitempty"` + MemoryCommitBytes uint64 `protobuf:"varint,4,opt,name=memory_commit_bytes,json=memoryCommitBytes,proto3" json:"memory_commit_bytes,omitempty"` + MemoryWorkingSetPrivateBytes uint64 `protobuf:"varint,5,opt,name=memory_working_set_private_bytes,json=memoryWorkingSetPrivateBytes,proto3" json:"memory_working_set_private_bytes,omitempty"` + MemoryWorkingSetSharedBytes uint64 `protobuf:"varint,6,opt,name=memory_working_set_shared_bytes,json=memoryWorkingSetSharedBytes,proto3" json:"memory_working_set_shared_bytes,omitempty"` + ProcessID uint32 `protobuf:"varint,7,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"` + UserTime_100Ns uint64 `protobuf:"varint,8,opt,name=user_time_100_ns,json=userTime100Ns,proto3" json:"user_time_100_ns,omitempty"` +} + +func (m *ProcessDetails) Reset() { *m = ProcessDetails{} } +func (*ProcessDetails) ProtoMessage() {} +func (*ProcessDetails) Descriptor() ([]byte, []int) { return fileDescriptorHcsshim, []int{1} } + func init() { proto.RegisterType((*CreateOptions)(nil), "containerd.windows.hcsshim.CreateOptions") + proto.RegisterType((*ProcessDetails)(nil), "containerd.windows.hcsshim.ProcessDetails") } func (m *CreateOptions) Marshal() (dAtA []byte, err error) { size := m.Size() @@ -77,6 +97,70 @@ func (m *CreateOptions) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ProcessDetails) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ImageName) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintHcsshim(dAtA, i, uint64(len(m.ImageName))) + i += copy(dAtA[i:], m.ImageName) + } + if m.CreatedAt != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintHcsshim(dAtA, i, uint64(m.CreatedAt.Size())) + n2, err := m.CreatedAt.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + if m.KernelTime_100Ns != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintHcsshim(dAtA, i, uint64(m.KernelTime_100Ns)) + } + if m.MemoryCommitBytes != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintHcsshim(dAtA, i, uint64(m.MemoryCommitBytes)) + } + if m.MemoryWorkingSetPrivateBytes != 0 { + dAtA[i] = 0x28 + i++ + i = encodeVarintHcsshim(dAtA, i, uint64(m.MemoryWorkingSetPrivateBytes)) + } + if m.MemoryWorkingSetSharedBytes != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintHcsshim(dAtA, i, uint64(m.MemoryWorkingSetSharedBytes)) + } + if m.ProcessID != 0 { + dAtA[i] = 0x38 + i++ + i = encodeVarintHcsshim(dAtA, i, uint64(m.ProcessID)) + } + if m.UserTime_100Ns != 0 { + dAtA[i] = 0x40 + i++ + i = encodeVarintHcsshim(dAtA, i, uint64(m.UserTime_100Ns)) + } + return i, nil +} + func encodeFixed64Hcsshim(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) @@ -112,6 +196,38 @@ func (m *CreateOptions) Size() (n int) { return n } +func (m *ProcessDetails) Size() (n int) { + var l int + _ = l + l = len(m.ImageName) + if l > 0 { + n += 1 + l + sovHcsshim(uint64(l)) + } + if m.CreatedAt != nil { + l = m.CreatedAt.Size() + n += 1 + l + sovHcsshim(uint64(l)) + } + if m.KernelTime_100Ns != 0 { + n += 1 + sovHcsshim(uint64(m.KernelTime_100Ns)) + } + if m.MemoryCommitBytes != 0 { + n += 1 + sovHcsshim(uint64(m.MemoryCommitBytes)) + } + if m.MemoryWorkingSetPrivateBytes != 0 { + n += 1 + sovHcsshim(uint64(m.MemoryWorkingSetPrivateBytes)) + } + if m.MemoryWorkingSetSharedBytes != 0 { + n += 1 + sovHcsshim(uint64(m.MemoryWorkingSetSharedBytes)) + } + if m.ProcessID != 0 { + n += 1 + sovHcsshim(uint64(m.ProcessID)) + } + if m.UserTime_100Ns != 0 { + n += 1 + sovHcsshim(uint64(m.UserTime_100Ns)) + } + return n +} + func sovHcsshim(x uint64) (n int) { for { n++ @@ -135,6 +251,23 @@ func (this *CreateOptions) String() string { }, "") return s } +func (this *ProcessDetails) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ProcessDetails{`, + `ImageName:` + fmt.Sprintf("%v", this.ImageName) + `,`, + `CreatedAt:` + strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "google_protobuf2.Timestamp", 1) + `,`, + `KernelTime_100Ns:` + fmt.Sprintf("%v", this.KernelTime_100Ns) + `,`, + `MemoryCommitBytes:` + fmt.Sprintf("%v", this.MemoryCommitBytes) + `,`, + `MemoryWorkingSetPrivateBytes:` + fmt.Sprintf("%v", this.MemoryWorkingSetPrivateBytes) + `,`, + `MemoryWorkingSetSharedBytes:` + fmt.Sprintf("%v", this.MemoryWorkingSetSharedBytes) + `,`, + `ProcessID:` + fmt.Sprintf("%v", this.ProcessID) + `,`, + `UserTime_100Ns:` + fmt.Sprintf("%v", this.UserTime_100Ns) + `,`, + `}`, + }, "") + return s +} func valueToStringHcsshim(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -223,6 +356,232 @@ func (m *CreateOptions) Unmarshal(dAtA []byte) error { } return nil } +func (m *ProcessDetails) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHcsshim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProcessDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProcessDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImageName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHcsshim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthHcsshim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImageName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHcsshim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthHcsshim + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CreatedAt == nil { + m.CreatedAt = &google_protobuf2.Timestamp{} + } + if err := m.CreatedAt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field KernelTime_100Ns", wireType) + } + m.KernelTime_100Ns = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHcsshim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.KernelTime_100Ns |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemoryCommitBytes", wireType) + } + m.MemoryCommitBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHcsshim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MemoryCommitBytes |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemoryWorkingSetPrivateBytes", wireType) + } + m.MemoryWorkingSetPrivateBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHcsshim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MemoryWorkingSetPrivateBytes |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MemoryWorkingSetSharedBytes", wireType) + } + m.MemoryWorkingSetSharedBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHcsshim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MemoryWorkingSetSharedBytes |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProcessID", wireType) + } + m.ProcessID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHcsshim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProcessID |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserTime_100Ns", wireType) + } + m.UserTime_100Ns = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHcsshim + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserTime_100Ns |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipHcsshim(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthHcsshim + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipHcsshim(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 @@ -333,20 +692,35 @@ func init() { } var fileDescriptorHcsshim = []byte{ - // 227 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4a, 0xcf, 0x2c, 0xc9, - 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d, - 0x4a, 0x41, 0x66, 0x96, 0x67, 0xe6, 0xa5, 0xe4, 0x97, 0x17, 0xeb, 0x67, 0x24, 0x17, 0x17, 0x67, - 0x64, 0xe6, 0xe6, 0x17, 0x94, 0xc0, 0xd9, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x52, 0x08, - 0xd5, 0x7a, 0x50, 0xd5, 0x7a, 0x50, 0x15, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x65, 0xfa, - 0x20, 0x16, 0x44, 0x87, 0x94, 0x5c, 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x3e, 0x98, 0x97, 0x54, - 0x9a, 0xa6, 0x9f, 0x52, 0x5a, 0x94, 0x58, 0x92, 0x99, 0x9f, 0x07, 0x91, 0x57, 0x4a, 0xe6, 0xe2, - 0x75, 0x2e, 0x4a, 0x4d, 0x2c, 0x49, 0xf5, 0x2f, 0x00, 0x89, 0x16, 0x0b, 0x05, 0x71, 0x09, 0x95, - 0xa4, 0x16, 0xe5, 0x66, 0xe6, 0x25, 0x96, 0xa4, 0xc6, 0xc3, 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6a, - 0x70, 0x1b, 0x49, 0xea, 0x41, 0x4c, 0xd3, 0x83, 0x99, 0xa6, 0xe7, 0x02, 0x55, 0xe0, 0xc4, 0x71, - 0xe2, 0x9e, 0x3c, 0xc3, 0x8c, 0xfb, 0xf2, 0x8c, 0x41, 0x82, 0x70, 0xed, 0x70, 0xc9, 0xa8, 0x13, - 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0x68, 0x78, 0x24, 0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3, - 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x46, 0x39, 0x90, 0x13, 0x28, 0xd6, 0x48, 0xec, - 0x24, 0x36, 0xb0, 0x5b, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x75, 0x31, 0x65, 0xd0, 0x5f, - 0x01, 0x00, 0x00, + // 473 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xc1, 0x6e, 0xd3, 0x30, + 0x1c, 0xc6, 0x1b, 0x36, 0xc6, 0x6a, 0x54, 0x60, 0x86, 0x43, 0x28, 0x90, 0x54, 0xbb, 0x50, 0x09, + 0x94, 0x74, 0x70, 0x42, 0x5c, 0x20, 0xab, 0x90, 0x76, 0x19, 0x53, 0x86, 0x84, 0xb4, 0x8b, 0xe5, + 0x26, 0x7f, 0x52, 0x6b, 0xb5, 0x1d, 0xd9, 0x2e, 0xd5, 0x6e, 0x3c, 0x06, 0x0f, 0xc1, 0x83, 0xf4, + 0xc8, 0x91, 0xd3, 0x60, 0x79, 0x12, 0x14, 0xdb, 0x2d, 0x63, 0x70, 0xda, 0xed, 0x1f, 0x7f, 0xbf, + 0xef, 0xfb, 0xc7, 0x5f, 0x82, 0xb2, 0x8a, 0x99, 0xe9, 0x7c, 0x92, 0x14, 0x92, 0xa7, 0x85, 0x14, + 0x86, 0x32, 0x01, 0xaa, 0xbc, 0x3c, 0x2e, 0x98, 0x28, 0xe5, 0x42, 0xa7, 0xd3, 0x42, 0xeb, 0x29, + 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opts/hcsshim.proto b/windows/hcsshimopts/hcsshim.proto index 780aa3416..6c85c0b30 100644 --- a/windows/hcsshimopts/hcsshim.proto +++ b/windows/hcsshimopts/hcsshim.proto @@ -4,9 +4,23 @@ package containerd.windows.hcsshim; import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "github.com/containerd/containerd/windows/hcsshimopts;hcsshimopts"; message CreateOptions { google.protobuf.Duration terminate_duration = 1 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; } + +// ProcessDetails contains additional information about a process +// ProcessDetails is made of the same fields as found in hcsshim.ProcessListItem +message ProcessDetails { + string image_name = 1; + google.protobuf.Timestamp created_at = 2; + uint64 kernel_time_100_ns = 3; + uint64 memory_commit_bytes = 4; + uint64 memory_working_set_private_bytes = 5; + uint64 memory_working_set_shared_bytes = 6; + uint32 process_id = 7; + uint64 user_time_100_ns = 8; +} diff --git a/windows/hcsshimopts/next.pb.txt b/windows/hcsshimopts/next.pb.txt index fe43e0dc3..b2f96c2b9 100755 --- a/windows/hcsshimopts/next.pb.txt +++ b/windows/hcsshimopts/next.pb.txt @@ -29,11 +29,43 @@ file { } syntax: "proto3" } +file { + name: "google/protobuf/timestamp.proto" + package: "google.protobuf" + message_type { + name: "Timestamp" + field { + name: "seconds" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_INT64 + json_name: "seconds" + } + field { + name: "nanos" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_INT32 + json_name: "nanos" + } + } + options { + java_package: "com.google.protobuf" + java_outer_classname: "TimestampProto" + java_multiple_files: true + go_package: "github.com/golang/protobuf/ptypes/timestamp" + cc_enable_arenas: true + objc_class_prefix: "GPB" + csharp_namespace: "Google.Protobuf.WellKnownTypes" + } + syntax: "proto3" +} file { name: "github.com/containerd/containerd/windows/hcsshimopts/hcsshim.proto" package: "containerd.windows.hcsshim" dependency: "gogoproto/gogo.proto" dependency: "google/protobuf/duration.proto" + dependency: "google/protobuf/timestamp.proto" message_type { name: "CreateOptions" field { @@ -49,6 +81,66 @@ file { json_name: "terminateDuration" } } + message_type { + name: "ProcessDetails" + field { + name: "image_name" + number: 1 + label: LABEL_OPTIONAL + type: TYPE_STRING + json_name: "imageName" + } + field { + name: "created_at" + number: 2 + label: LABEL_OPTIONAL + type: TYPE_MESSAGE + type_name: ".google.protobuf.Timestamp" + json_name: "createdAt" + } + field { + name: "kernel_time_100_ns" + number: 3 + label: LABEL_OPTIONAL + type: TYPE_UINT64 + json_name: "kernelTime100Ns" + } + field { + name: "memory_commit_bytes" + number: 4 + label: LABEL_OPTIONAL + type: TYPE_UINT64 + json_name: "memoryCommitBytes" + } + field { + name: "memory_working_set_private_bytes" + number: 5 + label: LABEL_OPTIONAL + type: TYPE_UINT64 + json_name: "memoryWorkingSetPrivateBytes" + } + field { + name: "memory_working_set_shared_bytes" + number: 6 + label: LABEL_OPTIONAL + type: TYPE_UINT64 + json_name: "memoryWorkingSetSharedBytes" + } + field { + name: "process_id" + number: 7 + label: LABEL_OPTIONAL + type: TYPE_UINT32 + json_name: "processId" + } + field { + name: "user_time_100_ns" + number: 8 + label: LABEL_OPTIONAL + type: TYPE_UINT64 + json_name: "userTime100Ns" + } + } options { go_package: "github.com/containerd/containerd/windows/hcsshimopts;hcsshimopts" } diff --git a/windows/task.go b/windows/task.go index 362611ff2..b3f8a1762 100644 --- a/windows/task.go +++ b/windows/task.go @@ -12,6 +12,7 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/events" "github.com/containerd/containerd/runtime" + "github.com/containerd/containerd/windows/hcsshimopts" "github.com/containerd/typeurl" "github.com/gogo/protobuf/types" specs "github.com/opencontainers/runtime-spec/specs-go" @@ -213,20 +214,28 @@ func (t *task) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (runt return p, nil } -func (t *task) Pids(ctx context.Context) ([]uint32, error) { +func (t *task) Pids(ctx context.Context) ([]runtime.ProcessInfo, error) { t.Lock() defer t.Unlock() - var ( - pids = make([]uint32, len(t.processes)) - idx = 0 - ) - for _, p := range t.processes { - pids[idx] = p.Pid() - idx++ + var infoList []runtime.ProcessInfo + hcsProcessList, err := t.hcsContainer.ProcessList() + if err != nil { + return nil, err } - return pids, nil + for _, process := range hcsProcessList { + info, err := t.convertToProcessDetails(process) + if err != nil { + return nil, err + } + infoList = append(infoList, runtime.ProcessInfo{ + Pid: process.ProcessId, + Info: info, + }) + } + + return infoList, nil } func (t *task) Checkpoint(_ context.Context, _ string, _ *types.Any) error { @@ -388,3 +397,21 @@ func (t *task) cleanup() { removeLayer(context.Background(), t.rwLayer) t.Unlock() } + +// convertToProcessDetails converts a given hcsshim ProcessListItem to proto ProcessDetails +func (t *task) convertToProcessDetails(p hcsshim.ProcessListItem) (*hcsshimopts.ProcessDetails, error) { + protobufTime, err := types.TimestampProto(p.CreateTimestamp) + if err != nil { + return nil, errors.Wrapf(errdefs.ErrInvalidArgument, "failed to convert timestamp for process pid: %d\n", p.ProcessId) + } + return &hcsshimopts.ProcessDetails{ + ImageName: p.ImageName, + CreatedAt: protobufTime, + KernelTime_100Ns: p.KernelTime100ns, + MemoryCommitBytes: p.MemoryCommitBytes, + MemoryWorkingSetPrivateBytes: p.MemoryWorkingSetPrivateBytes, + MemoryWorkingSetSharedBytes: p.MemoryWorkingSetSharedBytes, + ProcessID: p.ProcessId, + UserTime_100Ns: p.UserTime100ns, + }, nil +}