diff --git a/api/services/execution/execution.pb.go b/api/services/execution/execution.pb.go index d2015dec0..3a97e66ba 100644 --- a/api/services/execution/execution.pb.go +++ b/api/services/execution/execution.pb.go @@ -25,6 +25,8 @@ CloseStdinRequest PauseRequest ResumeRequest + ProcessesRequest + ProcessesResponse */ package execution @@ -140,13 +142,121 @@ func (*ListResponse) Descriptor() ([]byte, []int) { return fileDescriptorExecuti type KillRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Signal uint32 `protobuf:"varint,2,opt,name=signal,proto3" json:"signal,omitempty"` - All bool `protobuf:"varint,3,opt,name=all,proto3" json:"all,omitempty"` + // Types that are valid to be assigned to PidOrAll: + // *KillRequest_All + // *KillRequest_Pid + PidOrAll isKillRequest_PidOrAll `protobuf_oneof:"pid_or_all"` } func (m *KillRequest) Reset() { *m = KillRequest{} } func (*KillRequest) ProtoMessage() {} func (*KillRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{8} } +type isKillRequest_PidOrAll interface { + isKillRequest_PidOrAll() + MarshalTo([]byte) (int, error) + Size() int +} + +type KillRequest_All struct { + All bool `protobuf:"varint,3,opt,name=all,proto3,oneof"` +} +type KillRequest_Pid struct { + Pid uint32 `protobuf:"varint,4,opt,name=pid,proto3,oneof"` +} + +func (*KillRequest_All) isKillRequest_PidOrAll() {} +func (*KillRequest_Pid) isKillRequest_PidOrAll() {} + +func (m *KillRequest) GetPidOrAll() isKillRequest_PidOrAll { + if m != nil { + return m.PidOrAll + } + return nil +} + +func (m *KillRequest) GetAll() bool { + if x, ok := m.GetPidOrAll().(*KillRequest_All); ok { + return x.All + } + return false +} + +func (m *KillRequest) GetPid() uint32 { + if x, ok := m.GetPidOrAll().(*KillRequest_Pid); ok { + return x.Pid + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*KillRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _KillRequest_OneofMarshaler, _KillRequest_OneofUnmarshaler, _KillRequest_OneofSizer, []interface{}{ + (*KillRequest_All)(nil), + (*KillRequest_Pid)(nil), + } +} + +func _KillRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*KillRequest) + // pid_or_all + switch x := m.PidOrAll.(type) { + case *KillRequest_All: + t := uint64(0) + if x.All { + t = 1 + } + _ = b.EncodeVarint(3<<3 | proto.WireVarint) + _ = b.EncodeVarint(t) + case *KillRequest_Pid: + _ = b.EncodeVarint(4<<3 | proto.WireVarint) + _ = b.EncodeVarint(uint64(x.Pid)) + case nil: + default: + return fmt.Errorf("KillRequest.PidOrAll has unexpected type %T", x) + } + return nil +} + +func _KillRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*KillRequest) + switch tag { + case 3: // pid_or_all.all + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.PidOrAll = &KillRequest_All{x != 0} + return true, err + case 4: // pid_or_all.pid + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.PidOrAll = &KillRequest_Pid{uint32(x)} + return true, err + default: + return false, nil + } +} + +func _KillRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*KillRequest) + // pid_or_all + switch x := m.PidOrAll.(type) { + case *KillRequest_All: + n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += 1 + case *KillRequest_Pid: + n += proto.SizeVarint(4<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.Pid)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + type EventsRequest struct { } @@ -211,6 +321,22 @@ func (m *ResumeRequest) Reset() { *m = ResumeRequest{} } func (*ResumeRequest) ProtoMessage() {} func (*ResumeRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{15} } +type ProcessesRequest struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *ProcessesRequest) Reset() { *m = ProcessesRequest{} } +func (*ProcessesRequest) ProtoMessage() {} +func (*ProcessesRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{16} } + +type ProcessesResponse struct { + Processes []*containerd_v1_types1.Process `protobuf:"bytes,1,rep,name=processes" json:"processes,omitempty"` +} + +func (m *ProcessesResponse) Reset() { *m = ProcessesResponse{} } +func (*ProcessesResponse) ProtoMessage() {} +func (*ProcessesResponse) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{17} } + func init() { proto.RegisterType((*CreateRequest)(nil), "containerd.v1.services.CreateRequest") proto.RegisterType((*CreateResponse)(nil), "containerd.v1.services.CreateResponse") @@ -228,6 +354,8 @@ func init() { proto.RegisterType((*CloseStdinRequest)(nil), "containerd.v1.services.CloseStdinRequest") proto.RegisterType((*PauseRequest)(nil), "containerd.v1.services.PauseRequest") proto.RegisterType((*ResumeRequest)(nil), "containerd.v1.services.ResumeRequest") + proto.RegisterType((*ProcessesRequest)(nil), "containerd.v1.services.ProcessesRequest") + proto.RegisterType((*ProcessesResponse)(nil), "containerd.v1.services.ProcessesResponse") } // Reference imports to suppress errors if they are not otherwise used. @@ -253,6 +381,7 @@ type ContainerServiceClient interface { CloseStdin(ctx context.Context, in *CloseStdinRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) Pause(ctx context.Context, in *PauseRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) Resume(ctx context.Context, in *ResumeRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) + Processes(ctx context.Context, in *ProcessesRequest, opts ...grpc.CallOption) (*ProcessesResponse, error) } type containerServiceClient struct { @@ -394,6 +523,15 @@ func (c *containerServiceClient) Resume(ctx context.Context, in *ResumeRequest, return out, nil } +func (c *containerServiceClient) Processes(ctx context.Context, in *ProcessesRequest, opts ...grpc.CallOption) (*ProcessesResponse, error) { + out := new(ProcessesResponse) + err := grpc.Invoke(ctx, "/containerd.v1.services.ContainerService/Processes", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for ContainerService service type ContainerServiceServer interface { @@ -409,6 +547,7 @@ type ContainerServiceServer interface { CloseStdin(context.Context, *CloseStdinRequest) (*google_protobuf.Empty, error) Pause(context.Context, *PauseRequest) (*google_protobuf.Empty, error) Resume(context.Context, *ResumeRequest) (*google_protobuf.Empty, error) + Processes(context.Context, *ProcessesRequest) (*ProcessesResponse, error) } func RegisterContainerServiceServer(s *grpc.Server, srv ContainerServiceServer) { @@ -634,6 +773,24 @@ func _ContainerService_Resume_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _ContainerService_Processes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProcessesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainerServiceServer).Processes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/containerd.v1.services.ContainerService/Processes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainerServiceServer).Processes(ctx, req.(*ProcessesRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _ContainerService_serviceDesc = grpc.ServiceDesc{ ServiceName: "containerd.v1.services.ContainerService", HandlerType: (*ContainerServiceServer)(nil), @@ -682,6 +839,10 @@ var _ContainerService_serviceDesc = grpc.ServiceDesc{ MethodName: "Resume", Handler: _ContainerService_Resume_Handler, }, + { + MethodName: "Processes", + Handler: _ContainerService_Processes_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -985,19 +1146,35 @@ func (m *KillRequest) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintExecution(dAtA, i, uint64(m.Signal)) } - if m.All { - dAtA[i] = 0x18 - i++ - if m.All { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.PidOrAll != nil { + nn3, err := m.PidOrAll.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err } - i++ + i += nn3 } return i, nil } +func (m *KillRequest_All) MarshalTo(dAtA []byte) (int, error) { + i := 0 + dAtA[i] = 0x18 + i++ + if m.All { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + return i, nil +} +func (m *KillRequest_Pid) MarshalTo(dAtA []byte) (int, error) { + i := 0 + dAtA[i] = 0x20 + i++ + i = encodeVarintExecution(dAtA, i, uint64(m.Pid)) + return i, nil +} func (m *EventsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1069,11 +1246,11 @@ func (m *ExecRequest) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x32 i++ i = encodeVarintExecution(dAtA, i, uint64(m.Spec.Size())) - n3, err := m.Spec.MarshalTo(dAtA[i:]) + n4, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n3 + i += n4 } return i, nil } @@ -1217,6 +1394,60 @@ func (m *ResumeRequest) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ProcessesRequest) 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 *ProcessesRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintExecution(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } + return i, nil +} + +func (m *ProcessesResponse) 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 *ProcessesResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Processes) > 0 { + for _, msg := range m.Processes { + dAtA[i] = 0xa + i++ + i = encodeVarintExecution(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + func encodeFixed64Execution(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) @@ -1369,12 +1600,24 @@ func (m *KillRequest) Size() (n int) { if m.Signal != 0 { n += 1 + sovExecution(uint64(m.Signal)) } - if m.All { - n += 2 + if m.PidOrAll != nil { + n += m.PidOrAll.Size() } return n } +func (m *KillRequest_All) Size() (n int) { + var l int + _ = l + n += 2 + return n +} +func (m *KillRequest_Pid) Size() (n int) { + var l int + _ = l + n += 1 + sovExecution(uint64(m.Pid)) + return n +} func (m *EventsRequest) Size() (n int) { var l int _ = l @@ -1471,6 +1714,28 @@ func (m *ResumeRequest) Size() (n int) { return n } +func (m *ProcessesRequest) Size() (n int) { + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovExecution(uint64(l)) + } + return n +} + +func (m *ProcessesResponse) Size() (n int) { + var l int + _ = l + if len(m.Processes) > 0 { + for _, e := range m.Processes { + l = e.Size() + n += 1 + l + sovExecution(uint64(l)) + } + } + return n +} + func sovExecution(x uint64) (n int) { for { n++ @@ -1580,11 +1845,31 @@ func (this *KillRequest) String() string { s := strings.Join([]string{`&KillRequest{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Signal:` + fmt.Sprintf("%v", this.Signal) + `,`, + `PidOrAll:` + fmt.Sprintf("%v", this.PidOrAll) + `,`, + `}`, + }, "") + return s +} +func (this *KillRequest_All) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&KillRequest_All{`, `All:` + fmt.Sprintf("%v", this.All) + `,`, `}`, }, "") return s } +func (this *KillRequest_Pid) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&KillRequest_Pid{`, + `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, + `}`, + }, "") + return s +} func (this *EventsRequest) String() string { if this == nil { return "nil" @@ -1663,6 +1948,26 @@ func (this *ResumeRequest) String() string { }, "") return s } +func (this *ProcessesRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ProcessesRequest{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `}`, + }, "") + return s +} +func (this *ProcessesResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ProcessesResponse{`, + `Processes:` + strings.Replace(fmt.Sprintf("%v", this.Processes), "Process", "containerd_v1_types1.Process", 1) + `,`, + `}`, + }, "") + return s +} func valueToStringExecution(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -2640,7 +2945,28 @@ func (m *KillRequest) Unmarshal(dAtA []byte) error { break } } - m.All = bool(v != 0) + b := bool(v != 0) + m.PidOrAll = &KillRequest_All{b} + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) + } + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExecution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.PidOrAll = &KillRequest_Pid{v} default: iNdEx = preIndex skippy, err := skipExecution(dAtA[iNdEx:]) @@ -3392,6 +3718,166 @@ func (m *ResumeRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *ProcessesRequest) 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 ErrIntOverflowExecution + } + 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: ProcessesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProcessesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowExecution + } + 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 ErrInvalidLengthExecution + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipExecution(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthExecution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProcessesResponse) 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 ErrIntOverflowExecution + } + 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: ProcessesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProcessesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowExecution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthExecution + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Processes = append(m.Processes, &containerd_v1_types1.Process{}) + if err := m.Processes[len(m.Processes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipExecution(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthExecution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipExecution(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 @@ -3502,59 +3988,64 @@ func init() { } var fileDescriptorExecution = []byte{ - // 854 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4f, 0x8f, 0xdb, 0x44, - 0x14, 0x5f, 0xe7, 0x8f, 0x37, 0x7d, 0xd9, 0x94, 0x32, 0x5a, 0xad, 0x8c, 0x91, 0x92, 0xc8, 0xb4, - 0x25, 0x5c, 0x1c, 0x58, 0x6e, 0x08, 0x90, 0xb2, 0xd9, 0xa8, 0xaa, 0x4a, 0xe9, 0xe2, 0x20, 0x71, - 0xac, 0xbc, 0xf1, 0x6c, 0x32, 0x92, 0xe3, 0x31, 0x9e, 0xf1, 0xb2, 0xb9, 0xc1, 0x9d, 0x03, 0x5f, - 0x85, 0x0b, 0x9f, 0x61, 0x8f, 0x1c, 0x39, 0x15, 0x9a, 0x4f, 0x82, 0x66, 0xc6, 0x4e, 0xec, 0x6c, - 0xa6, 0xee, 0x5e, 0xa2, 0x79, 0x2f, 0xef, 0xbd, 0xf9, 0xbd, 0x37, 0xbf, 0xdf, 0x33, 0x3c, 0x9b,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a, 0xb7, 0xeb, 0xae, 0xf1, 0xf7, 0xba, 0x6b, 0xfc, - 0xb7, 0xee, 0x1a, 0x97, 0xa6, 0x8c, 0xfc, 0xf2, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x67, 0xba, - 0xdb, 0xdc, 0x03, 0x0a, 0x00, 0x00, + // 930 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xae, 0xf3, 0xc3, 0x9b, 0xbe, 0x34, 0x4b, 0x77, 0x54, 0x55, 0xc6, 0xa0, 0x24, 0x32, 0xbb, + 0x4b, 0x96, 0x83, 0x03, 0xe5, 0xb6, 0x02, 0xa4, 0xfe, 0x88, 0x96, 0xd5, 0xb2, 0x6c, 0x71, 0x91, + 0x38, 0x16, 0x37, 0x9e, 0x26, 0x23, 0x39, 0x1e, 0xe3, 0x19, 0x97, 0xe6, 0x06, 0x77, 0x0e, 0x1c, + 0xf9, 0x37, 0xf8, 0x2f, 0x7a, 0xe4, 0xc8, 0x69, 0x61, 0xf3, 0x97, 0xa0, 0xf1, 0x8c, 0x13, 0x3b, + 0xcd, 0xe0, 0xf6, 0x12, 0xcd, 0x7b, 0xf9, 0xde, 0xf8, 0x7b, 0x6f, 0xbe, 0xf9, 0x06, 0x5e, 0x4c, + 0x08, 0x9f, 0xa6, 0x17, 0xee, 0x98, 0xce, 0x86, 0x63, 0x1a, 0x71, 0x9f, 0x44, 0x38, 0x09, 0x8a, + 0x4b, 0x3f, 0x26, 0x43, 0x86, 0x93, 0x2b, 0x32, 0xc6, 0x6c, 0x88, 0xaf, 0xf1, 0x38, 0xe5, 0x84, + 0x46, 0xab, 0x95, 0x1b, 0x27, 0x94, 0x53, 0xb4, 0xbf, 0x2a, 0x71, 0xaf, 0x3e, 0x73, 0xf3, 0x0a, + 0xfb, 0x83, 0x09, 0xa5, 0x93, 0x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, 0x9c, 0xd6, 0x8c, 0xc5, + 0x7e, 0x76, 0x07, 0xa4, 0x3c, 0x85, 0x23, 0xeb, 0xe6, 0x5d, 0x77, 0xeb, 0xef, 0x77, 0xdd, 0xad, + 0x5f, 0x16, 0x5d, 0xe3, 0x66, 0xd1, 0x35, 0xfe, 0x5a, 0x74, 0x8d, 0x7f, 0x17, 0x5d, 0xe3, 0xc2, + 0xcc, 0xb8, 0x7c, 0xfe, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, 0x89, 0x1c, 0x40, 0x06, 0x0b, + 0x00, 0x00, } diff --git a/api/services/execution/execution.proto b/api/services/execution/execution.proto index b964a876b..36a153447 100644 --- a/api/services/execution/execution.proto +++ b/api/services/execution/execution.proto @@ -22,11 +22,12 @@ service ContainerService { rpc CloseStdin(CloseStdinRequest) returns (google.protobuf.Empty); rpc Pause(PauseRequest) returns (google.protobuf.Empty); rpc Resume(ResumeRequest) returns (google.protobuf.Empty); + rpc Processes(ProcessesRequest) returns (ProcessesResponse); } message CreateRequest { string id = 1 [(gogoproto.customname) = "ID"]; - google.protobuf.Any spec = 2; + google.protobuf.Any spec = 2; repeated containerd.v1.types.Mount rootfs = 3; string runtime = 4; string stdin = 5; @@ -68,7 +69,10 @@ message ListResponse { message KillRequest { string id = 1 [(gogoproto.customname) = "ID"]; uint32 signal = 2; - bool all = 3; + oneof pid_or_all { + bool all = 3; + uint32 pid = 4; + } } message EventsRequest { @@ -106,3 +110,11 @@ message PauseRequest { message ResumeRequest { string id = 1 [(gogoproto.customname) = "ID"]; } + +message ProcessesRequest { + string id = 1 [(gogoproto.customname) = "ID"]; +} + +message ProcessesResponse{ + repeated containerd.v1.types.Process processes = 1; +} diff --git a/api/services/shim/shim.pb.go b/api/services/shim/shim.pb.go index b19c1cc93..fa0f44e90 100644 --- a/api/services/shim/shim.pb.go +++ b/api/services/shim/shim.pb.go @@ -26,6 +26,8 @@ ExitRequest KillRequest CloseStdinRequest + ProcessesRequest + ProcessesResponse */ package shim @@ -218,6 +220,22 @@ func (m *CloseStdinRequest) Reset() { *m = CloseStdinRequest{ func (*CloseStdinRequest) ProtoMessage() {} func (*CloseStdinRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{16} } +type ProcessesRequest struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *ProcessesRequest) Reset() { *m = ProcessesRequest{} } +func (*ProcessesRequest) ProtoMessage() {} +func (*ProcessesRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{17} } + +type ProcessesResponse struct { + Processes []*containerd_v1_types1.Process `protobuf:"bytes,1,rep,name=processes" json:"processes,omitempty"` +} + +func (m *ProcessesResponse) Reset() { *m = ProcessesResponse{} } +func (*ProcessesResponse) ProtoMessage() {} +func (*ProcessesResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{18} } + func init() { proto.RegisterType((*CreateRequest)(nil), "containerd.v1.services.shim.CreateRequest") proto.RegisterType((*CreateResponse)(nil), "containerd.v1.services.shim.CreateResponse") @@ -236,6 +254,8 @@ func init() { proto.RegisterType((*ExitRequest)(nil), "containerd.v1.services.shim.ExitRequest") proto.RegisterType((*KillRequest)(nil), "containerd.v1.services.shim.KillRequest") proto.RegisterType((*CloseStdinRequest)(nil), "containerd.v1.services.shim.CloseStdinRequest") + proto.RegisterType((*ProcessesRequest)(nil), "containerd.v1.services.shim.ProcessesRequest") + proto.RegisterType((*ProcessesResponse)(nil), "containerd.v1.services.shim.ProcessesResponse") } // Reference imports to suppress errors if they are not otherwise used. @@ -253,6 +273,7 @@ type ShimClient interface { Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) State(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) + Processes(ctx context.Context, in *ProcessesRequest, opts ...grpc.CallOption) (*ProcessesResponse, error) Pause(ctx context.Context, in *PauseRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Resume(ctx context.Context, in *ResumeRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Exit(ctx context.Context, in *ExitRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) @@ -307,6 +328,15 @@ func (c *shimClient) State(ctx context.Context, in *StateRequest, opts ...grpc.C return out, nil } +func (c *shimClient) Processes(ctx context.Context, in *ProcessesRequest, opts ...grpc.CallOption) (*ProcessesResponse, error) { + out := new(ProcessesResponse) + err := grpc.Invoke(ctx, "/containerd.v1.services.shim.Shim/Processes", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *shimClient) Pause(ctx context.Context, in *PauseRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { out := new(google_protobuf1.Empty) err := grpc.Invoke(ctx, "/containerd.v1.services.shim.Shim/Pause", in, out, c.cc, opts...) @@ -409,6 +439,7 @@ type ShimServer interface { Start(context.Context, *StartRequest) (*google_protobuf1.Empty, error) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) State(context.Context, *StateRequest) (*StateResponse, error) + Processes(context.Context, *ProcessesRequest) (*ProcessesResponse, error) Pause(context.Context, *PauseRequest) (*google_protobuf1.Empty, error) Resume(context.Context, *ResumeRequest) (*google_protobuf1.Empty, error) Exit(context.Context, *ExitRequest) (*google_protobuf1.Empty, error) @@ -495,6 +526,24 @@ func _Shim_State_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _Shim_Processes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProcessesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ShimServer).Processes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/containerd.v1.services.shim.Shim/Processes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ShimServer).Processes(ctx, req.(*ProcessesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Shim_Pause_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PauseRequest) if err := dec(in); err != nil { @@ -662,6 +711,10 @@ var _Shim_serviceDesc = grpc.ServiceDesc{ MethodName: "State", Handler: _Shim_State_Handler, }, + { + MethodName: "Processes", + Handler: _Shim_Processes_Handler, + }, { MethodName: "Pause", Handler: _Shim_Pause_Handler, @@ -1231,6 +1284,60 @@ func (m *CloseStdinRequest) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *ProcessesRequest) 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 *ProcessesRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintShim(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } + return i, nil +} + +func (m *ProcessesResponse) 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 *ProcessesResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + 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 + } + i += n + } + } + return i, nil +} + func encodeFixed64Shim(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) @@ -1480,6 +1587,28 @@ func (m *CloseStdinRequest) Size() (n int) { return n } +func (m *ProcessesRequest) Size() (n int) { + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovShim(uint64(l)) + } + return n +} + +func (m *ProcessesResponse) Size() (n int) { + var l int + _ = l + if len(m.Processes) > 0 { + for _, e := range m.Processes { + l = e.Size() + n += 1 + l + sovShim(uint64(l)) + } + } + return n +} + func sovShim(x uint64) (n int) { for { n++ @@ -1680,6 +1809,26 @@ func (this *CloseStdinRequest) String() string { }, "") return s } +func (this *ProcessesRequest) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ProcessesRequest{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `}`, + }, "") + return s +} +func (this *ProcessesResponse) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&ProcessesResponse{`, + `Processes:` + strings.Replace(fmt.Sprintf("%v", this.Processes), "Process", "containerd_v1_types1.Process", 1) + `,`, + `}`, + }, "") + return s +} func valueToStringShim(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -3357,6 +3506,166 @@ func (m *CloseStdinRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *ProcessesRequest) 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 ErrIntOverflowShim + } + 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: ProcessesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProcessesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowShim + } + 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 ErrInvalidLengthShim + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipShim(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthShim + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProcessesResponse) 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 ErrIntOverflowShim + } + 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: ProcessesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProcessesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthShim + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Processes = append(m.Processes, &containerd_v1_types1.Process{}) + 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:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthShim + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipShim(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 @@ -3467,63 +3776,65 @@ func init() { } var fileDescriptorShim = []byte{ - // 913 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0xaf, 0x93, 0xd4, 0x4d, 0x5f, 0xd6, 0x5d, 0x18, 0x55, 0x95, 0x37, 0x45, 0x49, 0xb1, 0x84, - 0xc8, 0x2e, 0x92, 0x03, 0xd9, 0x1b, 0x82, 0x43, 0xbb, 0x2d, 0x62, 0x61, 0x91, 0xa2, 0xe9, 0xde, - 0x90, 0xa8, 0xdc, 0x78, 0x9a, 0x8c, 0x64, 0x7b, 0x8c, 0x67, 0x5c, 0x36, 0x37, 0xce, 0x9c, 0xb8, - 0xf2, 0x75, 0x38, 0xf5, 0xc8, 0x91, 0xd3, 0xc2, 0xe6, 0x3b, 0x70, 0x47, 0xf3, 0xc7, 0x76, 0xd2, - 0xd6, 0x49, 0xf7, 0x62, 0xbd, 0xf7, 0xe6, 0xcd, 0x9b, 0xdf, 0xfb, 0xbd, 0x3f, 0x86, 0xaf, 0xa7, - 0x54, 0xcc, 0xf2, 0x4b, 0x7f, 0xc2, 0xe2, 0xe1, 0x84, 0x25, 0x22, 0xa0, 0x09, 0xc9, 0xc2, 0x65, - 0x31, 0x48, 0xe9, 0x90, 0x93, 0xec, 0x9a, 0x4e, 0x08, 0x1f, 0xf2, 0x19, 0x8d, 0xd5, 0xc7, 0x4f, - 0x33, 0x26, 0x18, 0x3a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, 0xbf, 0x7e, - 0xe0, 0x6e, 0x4f, 0x7c, 0x5d, 0xd4, 0x13, 0xf7, 0xe6, 0x5d, 0x6f, 0xeb, 0xef, 0x77, 0xbd, 0xad, - 0x5f, 0x17, 0x3d, 0xeb, 0x66, 0xd1, 0xb3, 0xfe, 0x5a, 0xf4, 0xac, 0x7f, 0x17, 0x3d, 0xeb, 0xd2, - 0x56, 0x9e, 0xcf, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x79, 0x60, 0xe3, 0x1d, 0x0a, 0x00, - 0x00, + // 951 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x5e, 0x27, 0xa9, 0x9b, 0xbe, 0xac, 0xbb, 0xbb, 0xa3, 0xaa, 0xf2, 0xa6, 0x28, 0x29, 0x96, + 0x10, 0xd9, 0x22, 0x1c, 0xc8, 0xde, 0x10, 0x1c, 0xda, 0x6d, 0x11, 0x0b, 0x8b, 0x88, 0xa6, 0x7b, + 0x43, 0xa2, 0x72, 0x93, 0x69, 0x32, 0xc8, 0xf6, 0x18, 0xcf, 0xb8, 0x6c, 0x6e, 0x9c, 0x39, 0x71, + 0xe5, 0xdf, 0xe1, 0xd4, 0x23, 0x47, 0x4e, 0x0b, 0xcd, 0x5f, 0x82, 0xe6, 0x87, 0x9d, 0xa4, 0xa9, + 0x93, 0xf4, 0x62, 0xcd, 0x7b, 0xfe, 0x66, 0xe6, 0x7b, 0xdf, 0xfb, 0x31, 0xf0, 0xd5, 0x88, 0x8a, + 0x71, 0x76, 0xe9, 0x0f, 0x58, 0xd4, 0x1d, 0xb0, 0x58, 0x04, 0x34, 0x26, 0xe9, 0x70, 0x7e, 0x19, + 0x24, 0xb4, 0xcb, 0x49, 0x7a, 0x4d, 0x07, 0x84, 0x77, 0xf9, 0x98, 0x46, 0xea, 0xe3, 0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x2a, 0xcc, 0x67, 0x96, 0x64, 0x27, 0xa7, 0xc1, 0x1a, 0x76, 0x73, 0x03, 0xa3, + 0x94, 0xdd, 0x8f, 0x32, 0x4e, 0x32, 0x58, 0x1b, 0x67, 0xf1, 0xc2, 0x35, 0x5f, 0x6c, 0x80, 0x34, + 0xe9, 0xfd, 0x1a, 0xaa, 0x7d, 0x31, 0x41, 0x1f, 0xaf, 0x4e, 0x6e, 0xf1, 0x74, 0x94, 0x92, 0x7c, + 0x0b, 0x30, 0x9b, 0x58, 0x68, 0x75, 0x91, 0x2d, 0x8d, 0xb6, 0xb2, 0x53, 0x4f, 0xdc, 0x9b, 0xdb, + 0xd6, 0xa3, 0x7f, 0x6e, 0x5b, 0x8f, 0x7e, 0x9b, 0xb6, 0xac, 0x9b, 0x69, 0xcb, 0xfa, 0x7b, 0xda, + 0xb2, 0xfe, 0x9b, 0xb6, 0xac, 0x4b, 0x5b, 0x21, 0x5f, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x26, + 0xfb, 0xd6, 0x0f, 0x06, 0x0b, 0x00, 0x00, } diff --git a/api/services/shim/shim.proto b/api/services/shim/shim.proto index ce96cb806..2aa12c682 100644 --- a/api/services/shim/shim.proto +++ b/api/services/shim/shim.proto @@ -18,6 +18,7 @@ service Shim { rpc Start(StartRequest) returns (google.protobuf.Empty); rpc Delete(DeleteRequest) returns (DeleteResponse); rpc State(StateRequest) returns (StateResponse); + rpc Processes(ProcessesRequest) returns (ProcessesResponse); rpc Pause(PauseRequest) returns (google.protobuf.Empty); rpc Resume(ResumeRequest) returns (google.protobuf.Empty); @@ -113,3 +114,11 @@ message KillRequest { message CloseStdinRequest { uint32 pid = 1; } + +message ProcessesRequest { + string id = 1 [(gogoproto.customname) = "ID"]; +} + +message ProcessesResponse{ + repeated containerd.v1.types.Process processes = 1; +} diff --git a/api/types/container/container.pb.go b/api/types/container/container.pb.go index b1e66024b..573265286 100644 --- a/api/types/container/container.pb.go +++ b/api/types/container/container.pb.go @@ -19,6 +19,7 @@ package container import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" +import google_protobuf "github.com/gogo/protobuf/types" import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/gogo/protobuf/types" @@ -117,14 +118,15 @@ func (*Container) ProtoMessage() {} func (*Container) Descriptor() ([]byte, []int) { return fileDescriptorContainer, []int{0} } type Process struct { - Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` - Args []string `protobuf:"bytes,2,rep,name=args" json:"args,omitempty"` - Env []string `protobuf:"bytes,3,rep,name=env" json:"env,omitempty"` - User *User `protobuf:"bytes,4,opt,name=user" json:"user,omitempty"` - Cwd string `protobuf:"bytes,5,opt,name=cwd,proto3" json:"cwd,omitempty"` - Terminal bool `protobuf:"varint,6,opt,name=terminal,proto3" json:"terminal,omitempty"` - ExitStatus uint32 `protobuf:"varint,7,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` - Status Status `protobuf:"varint,8,opt,name=status,proto3,enum=containerd.v1.types.Status" json:"status,omitempty"` + Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` + Args []string `protobuf:"bytes,2,rep,name=args" json:"args,omitempty"` + Env []string `protobuf:"bytes,3,rep,name=env" json:"env,omitempty"` + User *User `protobuf:"bytes,4,opt,name=user" json:"user,omitempty"` + Cwd string `protobuf:"bytes,5,opt,name=cwd,proto3" json:"cwd,omitempty"` + Terminal bool `protobuf:"varint,6,opt,name=terminal,proto3" json:"terminal,omitempty"` + ExitStatus uint32 `protobuf:"varint,7,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` + Status Status `protobuf:"varint,8,opt,name=status,proto3,enum=containerd.v1.types.Status" json:"status,omitempty"` + RuntimeData *google_protobuf.Any `protobuf:"bytes,9,opt,name=runtime_data,json=runtimeData" json:"runtime_data,omitempty"` } func (m *Process) Reset() { *m = Process{} } @@ -281,6 +283,16 @@ func (m *Process) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintContainer(dAtA, i, uint64(m.Status)) } + if m.RuntimeData != nil { + dAtA[i] = 0x4a + i++ + i = encodeVarintContainer(dAtA, i, uint64(m.RuntimeData.Size())) + n2, err := m.RuntimeData.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } return i, nil } @@ -310,21 +322,21 @@ func (m *User) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintContainer(dAtA, i, uint64(m.Gid)) } if len(m.AdditionalGids) > 0 { - dAtA3 := make([]byte, len(m.AdditionalGids)*10) - var j2 int + dAtA4 := make([]byte, len(m.AdditionalGids)*10) + var j3 int for _, num := range m.AdditionalGids { for num >= 1<<7 { - dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) + dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j2++ + j3++ } - dAtA3[j2] = uint8(num) - j2++ + dAtA4[j3] = uint8(num) + j3++ } dAtA[i] = 0x1a i++ - i = encodeVarintContainer(dAtA, i, uint64(j2)) - i += copy(dAtA[i:], dAtA3[:j2]) + i = encodeVarintContainer(dAtA, i, uint64(j3)) + i += copy(dAtA[i:], dAtA4[:j3]) } return i, nil } @@ -368,11 +380,11 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintContainer(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt))) - n4, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) + n5, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) if err != nil { return 0, err } - i += n4 + i += n5 return i, nil } @@ -454,6 +466,10 @@ func (m *Process) Size() (n int) { if m.Status != 0 { n += 1 + sovContainer(uint64(m.Status)) } + if m.RuntimeData != nil { + l = m.RuntimeData.Size() + n += 1 + l + sovContainer(uint64(l)) + } return n } @@ -535,6 +551,7 @@ func (this *Process) String() string { `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, `Status:` + fmt.Sprintf("%v", this.Status) + `,`, + `RuntimeData:` + strings.Replace(fmt.Sprintf("%v", this.RuntimeData), "Any", "google_protobuf.Any", 1) + `,`, `}`, }, "") return s @@ -560,7 +577,7 @@ func (this *Event) String() string { `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, - `ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`, + `ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf2.Timestamp", 1), `&`, ``, 1) + `,`, `}`, }, "") return s @@ -916,6 +933,39 @@ func (m *Process) Unmarshal(dAtA []byte) error { break } } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuntimeData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContainer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthContainer + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RuntimeData == nil { + m.RuntimeData = &google_protobuf.Any{} + } + if err := m.RuntimeData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipContainer(dAtA[iNdEx:]) @@ -1363,41 +1413,44 @@ func init() { } var fileDescriptorContainer = []byte{ - // 576 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcf, 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0x86, - 0xac, 0xb7, 0xff, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xa6, 0xfb, 0xbb, 0xac, 0xdb, 0x03, 0x00, 0x00, + // 612 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xcd, 0xd8, 0xce, 0x8f, 0x6f, 0xbe, 0xe6, 0xb3, 0x86, 0x0a, 0xb9, 0x41, 0x4a, 0xa2, 0x08, + 0x89, 0x08, 0x09, 0x47, 0xa4, 0x0b, 0xd8, 0xba, 0xb5, 0x55, 0x2a, 0x44, 0x12, 0x26, 0x8e, 0xe8, + 0x2e, 0x9a, 0xc6, 0xc6, 0x0c, 0x6a, 0xec, 0xc8, 0x1e, 0x17, 0xb2, 0xe3, 0x11, 0x78, 0x06, 0xf6, + 0xbc, 0x47, 0x97, 0x2c, 0x59, 0x15, 0x9a, 0x27, 0x41, 0x33, 0x4e, 0xea, 0xaa, 0x2d, 0x12, 0x1b, + 0xeb, 0xdc, 0xab, 0x73, 0xcf, 0xdc, 0x73, 0x8f, 0xc1, 0x09, 0x19, 0xff, 0x90, 0x9d, 0x5a, 0xf3, + 0x78, 0xd1, 0x9f, 0xc7, 0x11, 0xa7, 0x2c, 0x0a, 0x12, 0xff, 0x26, 0xa4, 0x4b, 0xd6, 0xe7, 0xab, + 0x65, 0x90, 0x16, 0xcd, 0x02, 0x59, 0xcb, 0x24, 0xe6, 0x31, 0x7e, 0x50, 0xf0, 0xad, 0xf3, 0xe7, + 0x96, 0xa4, 0x37, 0xf7, 0xc2, 0x38, 0x0e, 0xcf, 0x82, 0xbe, 0xa4, 0x9c, 0x66, 0xef, 0xfb, 0x34, + 0x5a, 0xe5, 0xfc, 0xe6, 0x6e, 0x18, 0x87, 0xb1, 0x84, 0x7d, 0x81, 0x36, 0xdd, 0xf6, 0xed, 0x01, + 0xce, 0x16, 0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 0x94, + 0x9f, 0xbe, 0x82, 0xca, 0x66, 0xbf, 0x3a, 0x54, 0xa7, 0xc3, 0xd7, 0xc3, 0xd1, 0xbb, 0xa1, 0x51, + 0x12, 0x45, 0xae, 0xe4, 0x18, 0x48, 0x14, 0x64, 0x3a, 0x1c, 0x1e, 0x0f, 0x8f, 0x0c, 0x45, 0x14, + 0x13, 0x6f, 0x34, 0x1e, 0xbb, 0x8e, 0xa1, 0xde, 0x50, 0xd2, 0x0e, 0xcc, 0x8b, 0xab, 0x56, 0xe9, + 0xe7, 0x55, 0xab, 0xf4, 0x65, 0xdd, 0x42, 0x17, 0xeb, 0x16, 0xfa, 0xb1, 0x6e, 0xa1, 0xdf, 0xeb, + 0x16, 0x3a, 0xad, 0x48, 0x7b, 0xfb, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x9b, 0x55, 0x0d, + 0x2f, 0x04, 0x00, 0x00, } diff --git a/api/types/container/container.proto b/api/types/container/container.proto index 7e8985809..3ae378615 100644 --- a/api/types/container/container.proto +++ b/api/types/container/container.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package containerd.v1.types; +import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; @@ -28,6 +29,7 @@ message Process { bool terminal = 6; uint32 exit_status = 7; Status status = 8; + google.protobuf.Any runtime_data = 9; } message User { diff --git a/cmd/ctr/kill.go b/cmd/ctr/kill.go index f5deb607e..38c69d7f8 100644 --- a/cmd/ctr/kill.go +++ b/cmd/ctr/kill.go @@ -16,6 +16,11 @@ var killCommand = cli.Command{ Name: "id", Usage: "id of the container", }, + cli.IntFlag{ + Name: "pid", + Usage: "pid to kill", + Value: 0, + }, cli.BoolFlag{ Name: "all, a", Usage: "send signal to all processes inside the container", @@ -37,14 +42,29 @@ var killCommand = cli.Command{ return err } - containers, err := getExecutionService(context) - if err != nil { - return err + pid := context.Int("pid") + all := context.Bool("all") + if pid > 0 && all { + return errors.New("enter a pid or all; not both") } + killRequest := &execution.KillRequest{ ID: id, Signal: uint32(signal), - All: context.Bool("all"), + PidOrAll: &execution.KillRequest_Pid{ + Pid: uint32(pid), + }, + } + + if all { + killRequest.PidOrAll = &execution.KillRequest_All{ + All: true, + } + } + + containers, err := getExecutionService(context) + if err != nil { + return err } _, err = containers.Kill(gocontext.Background(), killRequest) if err != nil { diff --git a/cmd/ctr/main.go b/cmd/ctr/main.go index bbe673883..5e08b39f8 100644 --- a/cmd/ctr/main.go +++ b/cmd/ctr/main.go @@ -63,6 +63,7 @@ containerd client resumeCommand, snapshotCommand, versionCommand, + psCommand, } app.Commands = append(app.Commands, extraCmds...) app.Before = func(context *cli.Context) error { diff --git a/cmd/ctr/ps.go b/cmd/ctr/ps.go new file mode 100644 index 000000000..d8589da9d --- /dev/null +++ b/cmd/ctr/ps.go @@ -0,0 +1,58 @@ +package main + +import ( + gocontext "context" + "fmt" + "os" + "text/tabwriter" + + "github.com/containerd/containerd/api/services/execution" + "github.com/pkg/errors" + "github.com/urfave/cli" +) + +var psCommand = cli.Command{ + Name: "ps", + Usage: "list processes for container", + Flags: []cli.Flag{ + cli.StringFlag{ + Name: "id", + Usage: "id of the container", + }, + }, + Action: func(context *cli.Context) error { + id := context.String("id") + if id == "" { + return errors.New("container id must be provided") + } + + pr := &execution.ProcessesRequest{ + ID: id, + } + + containers, err := getExecutionService(context) + if err != nil { + return err + } + + resp, err := containers.Processes(gocontext.Background(), pr) + if err != nil { + return err + } + + w := tabwriter.NewWriter(os.Stdout, 10, 1, 3, ' ', 0) + fmt.Fprintln(w, "PID") + for _, ps := range resp.Processes { + if _, err := fmt.Fprintf(w, "%d\n", + ps.Pid, + ); err != nil { + return err + } + } + if err := w.Flush(); err != nil { + return err + } + + return nil + }, +} diff --git a/cmd/ctr/utils.go b/cmd/ctr/utils.go index c99aa2849..2f88940bf 100644 --- a/cmd/ctr/utils.go +++ b/cmd/ctr/utils.go @@ -117,7 +117,9 @@ func forwardAllSignals(containers execution.ContainerServiceClient, id string) c killRequest := &execution.KillRequest{ ID: id, Signal: uint32(s.(syscall.Signal)), - All: false, + PidOrAll: &execution.KillRequest_All{ + All: false, + }, } _, err := containers.Kill(gocontext.Background(), killRequest) if err != nil { diff --git a/linux/container.go b/linux/container.go index 716064ca3..e09a9e045 100644 --- a/linux/container.go +++ b/linux/container.go @@ -83,9 +83,10 @@ func (c *Container) Resume(ctx context.Context) error { return err } -func (c *Container) Kill(ctx context.Context, signal uint32, all bool) error { +func (c *Container) Kill(ctx context.Context, signal uint32, pid uint32, all bool) error { _, err := c.shim.Kill(ctx, &shim.KillRequest{ Signal: signal, + Pid: pid, All: all, }) return err @@ -105,12 +106,32 @@ func (c *Container) Exec(ctx context.Context, opts plugin.ExecOpts) (plugin.Proc resp, err := c.shim.Exec(ctx, request) if err != nil { return nil, err + } return &Process{ pid: int(resp.Pid), c: c, }, nil } + +func (c *Container) Processes(ctx context.Context) ([]uint32, error) { + resp, err := c.shim.Processes(ctx, &shim.ProcessesRequest{ + ID: c.id, + }) + + if err != nil { + return nil, err + } + + pids := make([]uint32, 0, len(resp.Processes)) + + for _, ps := range resp.Processes { + pids = append(pids, ps.Pid) + } + + return pids, nil +} + func (c *Container) Pty(ctx context.Context, pid uint32, size plugin.ConsoleSize) error { _, err := c.shim.Pty(ctx, &shim.PtyRequest{ Pid: pid, diff --git a/linux/shim/client.go b/linux/shim/client.go index c614cf5e4..1ab1f64e2 100644 --- a/linux/shim/client.go +++ b/linux/shim/client.go @@ -82,6 +82,10 @@ func (c *client) Kill(ctx context.Context, in *shimapi.KillRequest, opts ...grpc return c.s.Kill(ctx, in) } +func (c *client) Processes(ctx context.Context, in *shimapi.ProcessesRequest, opts ...grpc.CallOption) (*shimapi.ProcessesResponse, error) { + return c.s.Processes(ctx, in) +} + func (c *client) Exit(ctx context.Context, in *shimapi.ExitRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { // don't exit the calling process for the client // but make sure we unmount the containers rootfs for this client diff --git a/linux/shim/service.go b/linux/shim/service.go index 8ccc456e8..a8a857f33 100644 --- a/linux/shim/service.go +++ b/linux/shim/service.go @@ -225,16 +225,51 @@ func (s *Service) Kill(ctx context.Context, r *shimapi.KillRequest) (*google_pro } return empty, nil } - proc, ok := s.processes[int(r.Pid)] - if !ok { - return nil, fmt.Errorf("process does not exist %d", r.Pid) - } - if err := proc.Signal(int(r.Signal)); err != nil { + + pids, err := s.getContainerPids(ctx, s.initProcess.id) + if err != nil { return nil, err } + + valid := false + for _, p := range pids { + if r.Pid == p { + valid = true + break + } + } + + if !valid { + return nil, errors.Errorf("process %d does not exist in container", r.Pid) + } + + if err := unix.Kill(int(r.Pid), syscall.Signal(r.Signal)); err != nil { + return nil, err + } + return empty, nil } +func (s *Service) Processes(ctx context.Context, r *shimapi.ProcessesRequest) (*shimapi.ProcessesResponse, error) { + pids, err := s.getContainerPids(ctx, r.ID) + if err != nil { + return nil, err + } + + ps := []*container.Process{} + for _, pid := range pids { + ps = append(ps, &container.Process{ + Pid: pid, + }) + } + resp := &shimapi.ProcessesResponse{ + Processes: ps, + } + + return resp, nil + +} + func (s *Service) CloseStdin(ctx context.Context, r *shimapi.CloseStdinRequest) (*google_protobuf.Empty, error) { p, ok := s.processes[int(r.Pid)] if !ok { @@ -257,3 +292,17 @@ func (s *Service) waitExit(p process, pid int, cmd *reaper.Cmd) { ExitedAt: p.ExitedAt(), } } + +func (s *Service) getContainerPids(ctx context.Context, id string) ([]uint32, error) { + p, err := s.initProcess.runc.Ps(ctx, id) + if err != nil { + return nil, err + } + + pids := make([]uint32, 0, len(p)) + for _, pid := range p { + pids = append(pids, uint32(pid)) + } + + return pids, nil +} diff --git a/plugin/container.go b/plugin/container.go index b0297a3c9..75ebc13f7 100644 --- a/plugin/container.go +++ b/plugin/container.go @@ -19,9 +19,11 @@ type Container interface { // Resume unpauses the container process Resume(context.Context) error // Kill signals a container - Kill(context.Context, uint32, bool) error + Kill(context.Context, uint32, uint32, bool) error // Exec adds a process into the container Exec(context.Context, ExecOpts) (Process, error) + // Processes returns all pids for the container + Processes(context.Context) ([]uint32, error) // Pty resizes the processes pty/console Pty(context.Context, uint32, ConsoleSize) error // CloseStdin closes the processes stdin diff --git a/services/execution/service.go b/services/execution/service.go index 884925247..149793021 100644 --- a/services/execution/service.go +++ b/services/execution/service.go @@ -1,6 +1,7 @@ package execution import ( + "fmt" "sync" "github.com/containerd/containerd" @@ -217,12 +218,47 @@ func (s *Service) Kill(ctx context.Context, r *api.KillRequest) (*google_protobu if err != nil { return nil, err } - if err := c.Kill(ctx, r.Signal, r.All); err != nil { - return nil, err + + switch v := r.PidOrAll.(type) { + case *api.KillRequest_All: + if err := c.Kill(ctx, r.Signal, 0, true); err != nil { + return nil, err + } + case *api.KillRequest_Pid: + if err := c.Kill(ctx, r.Signal, v.Pid, false); err != nil { + return nil, err + } + default: + return nil, fmt.Errorf("invalid option specified; expected pid or all") } return empty, nil } +func (s *Service) Processes(ctx context.Context, r *api.ProcessesRequest) (*api.ProcessesResponse, error) { + c, err := s.getContainer(r.ID) + if err != nil { + return nil, err + } + + pids, err := c.Processes(ctx) + if err != nil { + return nil, err + } + + ps := []*container.Process{} + for _, pid := range pids { + ps = append(ps, &container.Process{ + Pid: pid, + }) + } + + resp := &api.ProcessesResponse{ + Processes: ps, + } + + return resp, nil +} + func (s *Service) Events(r *api.EventsRequest, server api.ContainerService_EventsServer) error { w := &grpcEventWriter{ server: server, diff --git a/windows/container.go b/windows/container.go index 1a7d7b73c..a54bbcb35 100644 --- a/windows/container.go +++ b/windows/container.go @@ -120,7 +120,7 @@ func (c *container) State(ctx context.Context) (plugin.State, error) { return c, nil } -func (c *container) Kill(ctx context.Context, signal uint32, all bool) error { +func (c *container) Kill(ctx context.Context, signal uint32, pid uint32, all bool) error { if winsys.Signal(signal) == winsys.SIGKILL { return c.ctr.Kill(ctx) } @@ -174,6 +174,20 @@ func (c *container) Pid() uint32 { return c.ctr.Pid() } +func (c *container) Processes(ctx context.Context) ([]uint32, error) { + pl, err := c.ctr.ProcessList() + if err != nil { + return nil, err + } + + pids := make([]uint32, 0, len(pl)) + for _, p := range pl { + pids = append(pids, p.ProcessId) + } + + return pids, nil +} + func (c *container) setStatus(status plugin.Status) { c.Lock() c.status = status