From 2b6d790ff48fae599debd31ba9db6eee083752a6 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Tue, 11 Jul 2017 16:12:14 -0700 Subject: [PATCH] Refactor runtime events into Task* types This removes the RuntimeEvent super proto with enums into separate runtime event protos to be inline with the other events that are output by containerd. This also renames the runtime events into Task* events. Fixes #1071 Signed-off-by: Michael Crosby --- api/services/events/v1/container.pb.go | 13 +- api/services/events/v1/runtime.pb.go | 1649 ------------------------ api/services/events/v1/runtime.proto | 56 - api/services/events/v1/task.pb.go | 1647 ++++++++++++++++++++++- api/services/events/v1/task.proto | 49 + cmd/ctr/events.go | 59 +- cmd/ctr/shim.go | 23 - linux/runtime.go | 50 +- linux/shim/local.go | 42 - linux/shim/service.go | 108 +- linux/shim/v1/shim.pb.go | 296 +---- linux/shim/v1/shim.proto | 6 - metrics/cgroups/cgroups.go | 7 +- process.go | 8 +- task.go | 9 +- windows/container.go | 35 +- windows/runtime.go | 23 +- 17 files changed, 1831 insertions(+), 2249 deletions(-) delete mode 100644 api/services/events/v1/runtime.pb.go delete mode 100644 api/services/events/v1/runtime.proto diff --git a/api/services/events/v1/container.pb.go b/api/services/events/v1/container.pb.go index ce7bd2f15..362cafede 100644 --- a/api/services/events/v1/container.pb.go +++ b/api/services/events/v1/container.pb.go @@ -11,7 +11,6 @@ github.com/containerd/containerd/api/services/events/v1/events.proto github.com/containerd/containerd/api/services/events/v1/image.proto github.com/containerd/containerd/api/services/events/v1/namespace.proto - github.com/containerd/containerd/api/services/events/v1/runtime.proto github.com/containerd/containerd/api/services/events/v1/snapshot.proto github.com/containerd/containerd/api/services/events/v1/task.proto @@ -29,17 +28,19 @@ NamespaceCreate NamespaceUpdate NamespaceDelete - RuntimeIO - RuntimeMount - RuntimeCreate - RuntimeEvent - RuntimeDelete SnapshotPrepare SnapshotCommit SnapshotRemove TaskCreate TaskStart TaskDelete + TaskIO + TaskExit + TaskOOM + TaskExecAdded + TaskPaused + TaskResumed + TaskCheckpointed */ package events diff --git a/api/services/events/v1/runtime.pb.go b/api/services/events/v1/runtime.pb.go deleted file mode 100644 index 0104e332b..000000000 --- a/api/services/events/v1/runtime.pb.go +++ /dev/null @@ -1,1649 +0,0 @@ -// Code generated by protoc-gen-gogo. -// source: github.com/containerd/containerd/api/services/events/v1/runtime.proto -// DO NOT EDIT! - -package events - -import proto "github.com/gogo/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" -import _ "github.com/gogo/protobuf/types" - -import time "time" - -import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - -import strings "strings" -import reflect "reflect" - -import io "io" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -type RuntimeEvent_EventType int32 - -const ( - RuntimeEvent_EXIT RuntimeEvent_EventType = 0 - RuntimeEvent_OOM RuntimeEvent_EventType = 1 - RuntimeEvent_CREATE RuntimeEvent_EventType = 2 - RuntimeEvent_START RuntimeEvent_EventType = 3 - RuntimeEvent_EXEC_ADDED RuntimeEvent_EventType = 4 - RuntimeEvent_PAUSED RuntimeEvent_EventType = 5 - RuntimeEvent_RESUMED RuntimeEvent_EventType = 6 - RuntimeEvent_CHECKPOINTED RuntimeEvent_EventType = 7 -) - -var RuntimeEvent_EventType_name = map[int32]string{ - 0: "EXIT", - 1: "OOM", - 2: "CREATE", - 3: "START", - 4: "EXEC_ADDED", - 5: "PAUSED", - 6: "RESUMED", - 7: "CHECKPOINTED", -} -var RuntimeEvent_EventType_value = map[string]int32{ - "EXIT": 0, - "OOM": 1, - "CREATE": 2, - "START": 3, - "EXEC_ADDED": 4, - "PAUSED": 5, - "RESUMED": 6, - "CHECKPOINTED": 7, -} - -func (x RuntimeEvent_EventType) String() string { - return proto.EnumName(RuntimeEvent_EventType_name, int32(x)) -} -func (RuntimeEvent_EventType) EnumDescriptor() ([]byte, []int) { - return fileDescriptorRuntime, []int{3, 0} -} - -type RuntimeIO struct { - Stdin string `protobuf:"bytes,1,opt,name=stdin,proto3" json:"stdin,omitempty"` - Stdout string `protobuf:"bytes,2,opt,name=stdout,proto3" json:"stdout,omitempty"` - Stderr string `protobuf:"bytes,3,opt,name=stderr,proto3" json:"stderr,omitempty"` - Terminal bool `protobuf:"varint,4,opt,name=terminal,proto3" json:"terminal,omitempty"` -} - -func (m *RuntimeIO) Reset() { *m = RuntimeIO{} } -func (*RuntimeIO) ProtoMessage() {} -func (*RuntimeIO) Descriptor() ([]byte, []int) { return fileDescriptorRuntime, []int{0} } - -type RuntimeMount struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` - Options []string `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"` -} - -func (m *RuntimeMount) Reset() { *m = RuntimeMount{} } -func (*RuntimeMount) ProtoMessage() {} -func (*RuntimeMount) Descriptor() ([]byte, []int) { return fileDescriptorRuntime, []int{1} } - -type RuntimeCreate struct { - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - Bundle string `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"` - RootFS []*RuntimeMount `protobuf:"bytes,3,rep,name=rootfs" json:"rootfs,omitempty"` - IO *RuntimeIO `protobuf:"bytes,4,opt,name=io" json:"io,omitempty"` - Checkpoint string `protobuf:"bytes,5,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` -} - -func (m *RuntimeCreate) Reset() { *m = RuntimeCreate{} } -func (*RuntimeCreate) ProtoMessage() {} -func (*RuntimeCreate) Descriptor() ([]byte, []int) { return fileDescriptorRuntime, []int{2} } - -type RuntimeEvent struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - ContainerID string `protobuf:"bytes,2,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - Type RuntimeEvent_EventType `protobuf:"varint,3,opt,name=type,proto3,enum=containerd.services.events.v1.RuntimeEvent_EventType" json:"type,omitempty"` - Pid uint32 `protobuf:"varint,4,opt,name=pid,proto3" json:"pid,omitempty"` - ExitStatus uint32 `protobuf:"varint,5,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` - ExitedAt time.Time `protobuf:"bytes,6,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"` - Timestamp time.Time `protobuf:"bytes,7,opt,name=timestamp,stdtime" json:"timestamp"` -} - -func (m *RuntimeEvent) Reset() { *m = RuntimeEvent{} } -func (*RuntimeEvent) ProtoMessage() {} -func (*RuntimeEvent) Descriptor() ([]byte, []int) { return fileDescriptorRuntime, []int{3} } - -type RuntimeDelete struct { - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - Runtime string `protobuf:"bytes,2,opt,name=runtime,proto3" json:"runtime,omitempty"` - ExitStatus uint32 `protobuf:"varint,3,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` - ExitedAt time.Time `protobuf:"bytes,4,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"` -} - -func (m *RuntimeDelete) Reset() { *m = RuntimeDelete{} } -func (*RuntimeDelete) ProtoMessage() {} -func (*RuntimeDelete) Descriptor() ([]byte, []int) { return fileDescriptorRuntime, []int{4} } - -func init() { - proto.RegisterType((*RuntimeIO)(nil), "containerd.services.events.v1.RuntimeIO") - proto.RegisterType((*RuntimeMount)(nil), "containerd.services.events.v1.RuntimeMount") - proto.RegisterType((*RuntimeCreate)(nil), "containerd.services.events.v1.RuntimeCreate") - proto.RegisterType((*RuntimeEvent)(nil), "containerd.services.events.v1.RuntimeEvent") - proto.RegisterType((*RuntimeDelete)(nil), "containerd.services.events.v1.RuntimeDelete") - proto.RegisterEnum("containerd.services.events.v1.RuntimeEvent_EventType", RuntimeEvent_EventType_name, RuntimeEvent_EventType_value) -} -func (m *RuntimeIO) 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 *RuntimeIO) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Stdin) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.Stdin))) - i += copy(dAtA[i:], m.Stdin) - } - if len(m.Stdout) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.Stdout))) - i += copy(dAtA[i:], m.Stdout) - } - if len(m.Stderr) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.Stderr))) - i += copy(dAtA[i:], m.Stderr) - } - if m.Terminal { - dAtA[i] = 0x20 - i++ - if m.Terminal { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - return i, nil -} - -func (m *RuntimeMount) 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 *RuntimeMount) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.Type) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.Type))) - i += copy(dAtA[i:], m.Type) - } - if len(m.Source) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.Source))) - i += copy(dAtA[i:], m.Source) - } - if len(m.Options) > 0 { - for _, s := range m.Options { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - return i, nil -} - -func (m *RuntimeCreate) 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 *RuntimeCreate) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.Bundle) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.Bundle))) - i += copy(dAtA[i:], m.Bundle) - } - if len(m.RootFS) > 0 { - for _, msg := range m.RootFS { - dAtA[i] = 0x1a - i++ - i = encodeVarintRuntime(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } - } - if m.IO != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(m.IO.Size())) - n1, err := m.IO.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - } - if len(m.Checkpoint) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.Checkpoint))) - i += copy(dAtA[i:], m.Checkpoint) - } - return i, nil -} - -func (m *RuntimeEvent) 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 *RuntimeEvent) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if len(m.ContainerID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if m.Type != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(m.Type)) - } - if m.Pid != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(m.Pid)) - } - if m.ExitStatus != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(m.ExitStatus)) - } - dAtA[i] = 0x32 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt))) - n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 - dAtA[i] = 0x3a - i++ - i = encodeVarintRuntime(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) - n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 - return i, nil -} - -func (m *RuntimeDelete) 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 *RuntimeDelete) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.Runtime) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(len(m.Runtime))) - i += copy(dAtA[i:], m.Runtime) - } - if m.ExitStatus != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(m.ExitStatus)) - } - dAtA[i] = 0x22 - i++ - i = encodeVarintRuntime(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt))) - n4, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 - return i, nil -} - -func encodeFixed64Runtime(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Runtime(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} -func encodeVarintRuntime(dAtA []byte, offset int, v uint64) int { - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return offset + 1 -} -func (m *RuntimeIO) Size() (n int) { - var l int - _ = l - l = len(m.Stdin) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - l = len(m.Stdout) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - l = len(m.Stderr) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - if m.Terminal { - n += 2 - } - return n -} - -func (m *RuntimeMount) Size() (n int) { - var l int - _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - l = len(m.Source) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - if len(m.Options) > 0 { - for _, s := range m.Options { - l = len(s) - n += 1 + l + sovRuntime(uint64(l)) - } - } - return n -} - -func (m *RuntimeCreate) Size() (n int) { - var l int - _ = l - l = len(m.ContainerID) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - l = len(m.Bundle) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - if len(m.RootFS) > 0 { - for _, e := range m.RootFS { - l = e.Size() - n += 1 + l + sovRuntime(uint64(l)) - } - } - if m.IO != nil { - l = m.IO.Size() - n += 1 + l + sovRuntime(uint64(l)) - } - l = len(m.Checkpoint) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - return n -} - -func (m *RuntimeEvent) Size() (n int) { - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - l = len(m.ContainerID) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - if m.Type != 0 { - n += 1 + sovRuntime(uint64(m.Type)) - } - if m.Pid != 0 { - n += 1 + sovRuntime(uint64(m.Pid)) - } - if m.ExitStatus != 0 { - n += 1 + sovRuntime(uint64(m.ExitStatus)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt) - n += 1 + l + sovRuntime(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovRuntime(uint64(l)) - return n -} - -func (m *RuntimeDelete) Size() (n int) { - var l int - _ = l - l = len(m.ContainerID) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - l = len(m.Runtime) - if l > 0 { - n += 1 + l + sovRuntime(uint64(l)) - } - if m.ExitStatus != 0 { - n += 1 + sovRuntime(uint64(m.ExitStatus)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt) - n += 1 + l + sovRuntime(uint64(l)) - return n -} - -func sovRuntime(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n -} -func sozRuntime(x uint64) (n int) { - return sovRuntime(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *RuntimeIO) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RuntimeIO{`, - `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, - `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, - `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, - `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`, - `}`, - }, "") - return s -} -func (this *RuntimeMount) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RuntimeMount{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Source:` + fmt.Sprintf("%v", this.Source) + `,`, - `Options:` + fmt.Sprintf("%v", this.Options) + `,`, - `}`, - }, "") - return s -} -func (this *RuntimeCreate) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RuntimeCreate{`, - `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, - `Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`, - `RootFS:` + strings.Replace(fmt.Sprintf("%v", this.RootFS), "RuntimeMount", "RuntimeMount", 1) + `,`, - `IO:` + strings.Replace(fmt.Sprintf("%v", this.IO), "RuntimeIO", "RuntimeIO", 1) + `,`, - `Checkpoint:` + fmt.Sprintf("%v", this.Checkpoint) + `,`, - `}`, - }, "") - return s -} -func (this *RuntimeEvent) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RuntimeEvent{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, - `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_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`, - `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func (this *RuntimeDelete) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&RuntimeDelete{`, - `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, - `Runtime:` + fmt.Sprintf("%v", this.Runtime) + `,`, - `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, - `ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} -func valueToStringRuntime(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *RuntimeIO) 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 ErrIntOverflowRuntime - } - 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: RuntimeIO: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuntimeIO: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Stdin = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Stdout = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Stderr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Terminal = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipRuntime(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRuntime - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RuntimeMount) 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 ErrIntOverflowRuntime - } - 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: RuntimeMount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuntimeMount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRuntime(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRuntime - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RuntimeCreate) 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 ErrIntOverflowRuntime - } - 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: RuntimeCreate: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuntimeCreate: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContainerID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bundle", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bundle = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootFS", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuntime - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootFS = append(m.RootFS, &RuntimeMount{}) - if err := m.RootFS[len(m.RootFS)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IO", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuntime - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.IO == nil { - m.IO = &RuntimeIO{} - } - if err := m.IO.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Checkpoint = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRuntime(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRuntime - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RuntimeEvent) 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 ErrIntOverflowRuntime - } - 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: RuntimeEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuntimeEvent: 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 ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContainerID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= (RuntimeEvent_EventType(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - 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 ErrIntOverflowRuntime - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Pid |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType) - } - m.ExitStatus = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExitStatus |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuntime - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuntime - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRuntime(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRuntime - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RuntimeDelete) 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 ErrIntOverflowRuntime - } - 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: RuntimeDelete: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RuntimeDelete: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ContainerID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Runtime", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - 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 ErrInvalidLengthRuntime - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Runtime = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType) - } - m.ExitStatus = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExitStatus |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuntime - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRuntime - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRuntime(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthRuntime - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRuntime(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRuntime - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRuntime - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - return iNdEx, nil - case 1: - iNdEx += 8 - return iNdEx, nil - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRuntime - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - iNdEx += length - if length < 0 { - return 0, ErrInvalidLengthRuntime - } - return iNdEx, nil - case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRuntime - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipRuntime(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - } - return iNdEx, nil - case 4: - return iNdEx, nil - case 5: - iNdEx += 4 - return iNdEx, nil - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - } - panic("unreachable") -} - -var ( - ErrInvalidLengthRuntime = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRuntime = fmt.Errorf("proto: integer overflow") -) - -func init() { - proto.RegisterFile("github.com/containerd/containerd/api/services/events/v1/runtime.proto", fileDescriptorRuntime) -} - -var fileDescriptorRuntime = []byte{ - // 664 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x41, 0x6b, 0xdb, 0x4a, - 0x10, 0xb6, 0x24, 0x5b, 0xb6, 0xc7, 0x49, 0x9e, 0x58, 0x42, 0x10, 0x86, 0x67, 0x07, 0x9f, 0x0c, - 0x0f, 0x24, 0xe2, 0x47, 0x4f, 0x85, 0x52, 0xdb, 0x52, 0xa9, 0x28, 0xa9, 0xc3, 0x5a, 0x81, 0xd0, - 0x8b, 0x91, 0xad, 0x8d, 0xb3, 0xd4, 0xd6, 0x0a, 0x69, 0x65, 0x9a, 0x5b, 0x7f, 0x41, 0xe9, 0x5f, - 0xea, 0x2d, 0xc7, 0xf6, 0xd6, 0x93, 0xdb, 0xe8, 0x97, 0x14, 0xad, 0x64, 0x25, 0xb4, 0x10, 0xd2, - 0x5c, 0xcc, 0x7c, 0xc3, 0xcc, 0xf7, 0xed, 0x7c, 0x33, 0x16, 0xd8, 0x4b, 0xca, 0xaf, 0x92, 0xb9, - 0xb1, 0x60, 0x6b, 0x73, 0xc1, 0x02, 0xee, 0xd1, 0x80, 0x44, 0xfe, 0xfd, 0xd0, 0x0b, 0xa9, 0x19, - 0x93, 0x68, 0x43, 0x17, 0x24, 0x36, 0xc9, 0x86, 0x04, 0x3c, 0x36, 0x37, 0x27, 0x66, 0x94, 0x04, - 0x9c, 0xae, 0x89, 0x11, 0x46, 0x8c, 0x33, 0xf4, 0xef, 0x5d, 0x83, 0xb1, 0x2b, 0x36, 0xf2, 0x62, - 0x63, 0x73, 0xd2, 0x3e, 0x5c, 0xb2, 0x25, 0x13, 0x95, 0x66, 0x16, 0xe5, 0x4d, 0xed, 0xee, 0x92, - 0xb1, 0xe5, 0x8a, 0x98, 0x02, 0xcd, 0x93, 0x4b, 0x33, 0x23, 0x8c, 0xb9, 0xb7, 0x0e, 0xf3, 0x82, - 0xde, 0x1a, 0x9a, 0x38, 0x97, 0x71, 0x26, 0xe8, 0x10, 0x6a, 0x31, 0xf7, 0x69, 0xa0, 0x4b, 0xc7, - 0x52, 0xbf, 0x89, 0x73, 0x80, 0x8e, 0x40, 0x8d, 0xb9, 0xcf, 0x12, 0xae, 0xcb, 0x22, 0x5d, 0xa0, - 0x22, 0x4f, 0xa2, 0x48, 0x57, 0xca, 0x3c, 0x89, 0x22, 0xd4, 0x86, 0x06, 0x27, 0xd1, 0x9a, 0x06, - 0xde, 0x4a, 0xaf, 0x1e, 0x4b, 0xfd, 0x06, 0x2e, 0x71, 0xcf, 0x85, 0xbd, 0x42, 0xee, 0x94, 0x25, - 0x01, 0x47, 0x08, 0xaa, 0xfc, 0x3a, 0x24, 0x85, 0xa0, 0x88, 0x05, 0x2f, 0x4b, 0xa2, 0x05, 0x29, - 0xf5, 0x04, 0x42, 0x3a, 0xd4, 0x59, 0xc8, 0x29, 0x0b, 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0xa4, 0x1d, 0xe9, 0x6b, 0xda, 0x91, 0x7e, 0xa6, 0x1d, 0xe9, 0xdd, 0x8b, 0x27, - 0x7e, 0x24, 0x9f, 0xe7, 0xd1, 0x5c, 0x15, 0x2f, 0xf8, 0xff, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xf5, 0x10, 0x75, 0xb5, 0x6d, 0x05, 0x00, 0x00, -} diff --git a/api/services/events/v1/runtime.proto b/api/services/events/v1/runtime.proto deleted file mode 100644 index ee501947d..000000000 --- a/api/services/events/v1/runtime.proto +++ /dev/null @@ -1,56 +0,0 @@ -syntax = "proto3"; - -package containerd.services.events.v1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/containerd/containerd/api/services/events/v1;events"; - -message RuntimeIO { - string stdin = 1; - string stdout = 2; - string stderr = 3; - bool terminal = 4; -} - -message RuntimeMount { - string type = 1; - string source = 2; - repeated string options = 3; -} - -message RuntimeCreate { - string container_id = 1; - string bundle = 2; - repeated RuntimeMount rootfs = 3 [(gogoproto.customname) = "RootFS"]; - RuntimeIO io = 4 [(gogoproto.customname) = "IO"]; - string checkpoint = 5; -} - -message RuntimeEvent { - string id = 1; - string container_id = 2; - enum EventType { - EXIT = 0; - OOM = 1; - CREATE = 2; - START = 3; - EXEC_ADDED = 4; - PAUSED = 5; - RESUMED = 6; - CHECKPOINTED = 7; - } - EventType type = 3; - uint32 pid = 4; - uint32 exit_status = 5; - google.protobuf.Timestamp exited_at = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; -} - -message RuntimeDelete { - string container_id = 1; - string runtime = 2; - uint32 exit_status = 3; - google.protobuf.Timestamp exited_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; -} diff --git a/api/services/events/v1/task.pb.go b/api/services/events/v1/task.pb.go index d80459721..a657039c9 100644 --- a/api/services/events/v1/task.pb.go +++ b/api/services/events/v1/task.pb.go @@ -7,6 +7,13 @@ package events import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "github.com/gogo/protobuf/types" +import containerd_types "github.com/containerd/containerd/api/types" + +import time "time" + +import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" import strings "strings" import reflect "reflect" @@ -17,9 +24,15 @@ import io "io" var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen type TaskCreate struct { - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + Bundle string `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"` + Rootfs []*containerd_types.Mount `protobuf:"bytes,3,rep,name=rootfs" json:"rootfs,omitempty"` + IO *TaskIO `protobuf:"bytes,4,opt,name=io" json:"io,omitempty"` + Checkpoint string `protobuf:"bytes,5,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` + Pid uint32 `protobuf:"varint,6,opt,name=pid,proto3" json:"pid,omitempty"` } func (m *TaskCreate) Reset() { *m = TaskCreate{} } @@ -28,6 +41,7 @@ func (*TaskCreate) Descriptor() ([]byte, []int) { return fileDescriptorTask, []i type TaskStart struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` } func (m *TaskStart) Reset() { *m = TaskStart{} } @@ -35,19 +49,93 @@ func (*TaskStart) ProtoMessage() {} func (*TaskStart) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{1} } type TaskDelete struct { - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` - ExitStatus uint32 `protobuf:"varint,3,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + Pid uint32 `protobuf:"varint,2,opt,name=pid,proto3" json:"pid,omitempty"` + ExitStatus uint32 `protobuf:"varint,3,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` + ExitedAt time.Time `protobuf:"bytes,4,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"` } func (m *TaskDelete) Reset() { *m = TaskDelete{} } func (*TaskDelete) ProtoMessage() {} func (*TaskDelete) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{2} } +type TaskIO struct { + Stdin string `protobuf:"bytes,1,opt,name=stdin,proto3" json:"stdin,omitempty"` + Stdout string `protobuf:"bytes,2,opt,name=stdout,proto3" json:"stdout,omitempty"` + Stderr string `protobuf:"bytes,3,opt,name=stderr,proto3" json:"stderr,omitempty"` + Terminal bool `protobuf:"varint,4,opt,name=terminal,proto3" json:"terminal,omitempty"` +} + +func (m *TaskIO) Reset() { *m = TaskIO{} } +func (*TaskIO) ProtoMessage() {} +func (*TaskIO) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{3} } + +type TaskExit struct { + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` + Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"` + ExitStatus uint32 `protobuf:"varint,4,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` + ExitedAt time.Time `protobuf:"bytes,5,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"` +} + +func (m *TaskExit) Reset() { *m = TaskExit{} } +func (*TaskExit) ProtoMessage() {} +func (*TaskExit) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{4} } + +type TaskOOM struct { + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` +} + +func (m *TaskOOM) Reset() { *m = TaskOOM{} } +func (*TaskOOM) ProtoMessage() {} +func (*TaskOOM) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{5} } + +type TaskExecAdded struct { + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + ExecID string `protobuf:"bytes,2,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"` + Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"` +} + +func (m *TaskExecAdded) Reset() { *m = TaskExecAdded{} } +func (*TaskExecAdded) ProtoMessage() {} +func (*TaskExecAdded) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{6} } + +type TaskPaused struct { + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` +} + +func (m *TaskPaused) Reset() { *m = TaskPaused{} } +func (*TaskPaused) ProtoMessage() {} +func (*TaskPaused) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{7} } + +type TaskResumed struct { + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` +} + +func (m *TaskResumed) Reset() { *m = TaskResumed{} } +func (*TaskResumed) ProtoMessage() {} +func (*TaskResumed) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{8} } + +type TaskCheckpointed struct { + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + Checkpoint string `protobuf:"bytes,2,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` +} + +func (m *TaskCheckpointed) Reset() { *m = TaskCheckpointed{} } +func (*TaskCheckpointed) ProtoMessage() {} +func (*TaskCheckpointed) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{9} } + func init() { proto.RegisterType((*TaskCreate)(nil), "containerd.services.events.v1.TaskCreate") proto.RegisterType((*TaskStart)(nil), "containerd.services.events.v1.TaskStart") proto.RegisterType((*TaskDelete)(nil), "containerd.services.events.v1.TaskDelete") + proto.RegisterType((*TaskIO)(nil), "containerd.services.events.v1.TaskIO") + proto.RegisterType((*TaskExit)(nil), "containerd.services.events.v1.TaskExit") + proto.RegisterType((*TaskOOM)(nil), "containerd.services.events.v1.TaskOOM") + proto.RegisterType((*TaskExecAdded)(nil), "containerd.services.events.v1.TaskExecAdded") + proto.RegisterType((*TaskPaused)(nil), "containerd.services.events.v1.TaskPaused") + proto.RegisterType((*TaskResumed)(nil), "containerd.services.events.v1.TaskResumed") + proto.RegisterType((*TaskCheckpointed)(nil), "containerd.services.events.v1.TaskCheckpointed") } func (m *TaskCreate) Marshal() (dAtA []byte, err error) { size := m.Size() @@ -70,6 +158,45 @@ func (m *TaskCreate) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID))) i += copy(dAtA[i:], m.ContainerID) } + if len(m.Bundle) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.Bundle))) + i += copy(dAtA[i:], m.Bundle) + } + if len(m.Rootfs) > 0 { + for _, msg := range m.Rootfs { + dAtA[i] = 0x1a + i++ + i = encodeVarintTask(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if m.IO != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintTask(dAtA, i, uint64(m.IO.Size())) + n1, err := m.IO.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if len(m.Checkpoint) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.Checkpoint))) + i += copy(dAtA[i:], m.Checkpoint) + } + if m.Pid != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintTask(dAtA, i, uint64(m.Pid)) + } return i, nil } @@ -94,6 +221,11 @@ func (m *TaskStart) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID))) i += copy(dAtA[i:], m.ContainerID) } + if m.Pid != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintTask(dAtA, i, uint64(m.Pid)) + } return i, nil } @@ -128,6 +260,245 @@ func (m *TaskDelete) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus)) } + dAtA[i] = 0x22 + i++ + i = encodeVarintTask(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt))) + n2, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + return i, nil +} + +func (m *TaskIO) 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 *TaskIO) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Stdin) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.Stdin))) + i += copy(dAtA[i:], m.Stdin) + } + if len(m.Stdout) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.Stdout))) + i += copy(dAtA[i:], m.Stdout) + } + if len(m.Stderr) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.Stderr))) + i += copy(dAtA[i:], m.Stderr) + } + if m.Terminal { + dAtA[i] = 0x20 + i++ + if m.Terminal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + return i, nil +} + +func (m *TaskExit) 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 *TaskExit) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ContainerID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID))) + i += copy(dAtA[i:], m.ContainerID) + } + if len(m.ID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } + if m.Pid != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintTask(dAtA, i, uint64(m.Pid)) + } + if m.ExitStatus != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus)) + } + dAtA[i] = 0x2a + i++ + i = encodeVarintTask(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt))) + n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + return i, nil +} + +func (m *TaskOOM) 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 *TaskOOM) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ContainerID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID))) + i += copy(dAtA[i:], m.ContainerID) + } + return i, nil +} + +func (m *TaskExecAdded) 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 *TaskExecAdded) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ContainerID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID))) + i += copy(dAtA[i:], m.ContainerID) + } + if len(m.ExecID) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } + if m.Pid != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintTask(dAtA, i, uint64(m.Pid)) + } + return i, nil +} + +func (m *TaskPaused) 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 *TaskPaused) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ContainerID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID))) + i += copy(dAtA[i:], m.ContainerID) + } + return i, nil +} + +func (m *TaskResumed) 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 *TaskResumed) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ContainerID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID))) + i += copy(dAtA[i:], m.ContainerID) + } + return i, nil +} + +func (m *TaskCheckpointed) 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 *TaskCheckpointed) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ContainerID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.ContainerID))) + i += copy(dAtA[i:], m.ContainerID) + } + if len(m.Checkpoint) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintTask(dAtA, i, uint64(len(m.Checkpoint))) + i += copy(dAtA[i:], m.Checkpoint) + } return i, nil } @@ -165,6 +536,27 @@ func (m *TaskCreate) Size() (n int) { if l > 0 { n += 1 + l + sovTask(uint64(l)) } + l = len(m.Bundle) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + if len(m.Rootfs) > 0 { + for _, e := range m.Rootfs { + l = e.Size() + n += 1 + l + sovTask(uint64(l)) + } + } + if m.IO != nil { + l = m.IO.Size() + n += 1 + l + sovTask(uint64(l)) + } + l = len(m.Checkpoint) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + if m.Pid != 0 { + n += 1 + sovTask(uint64(m.Pid)) + } return n } @@ -175,6 +567,9 @@ func (m *TaskStart) Size() (n int) { if l > 0 { n += 1 + l + sovTask(uint64(l)) } + if m.Pid != 0 { + n += 1 + sovTask(uint64(m.Pid)) + } return n } @@ -191,6 +586,112 @@ func (m *TaskDelete) Size() (n int) { if m.ExitStatus != 0 { n += 1 + sovTask(uint64(m.ExitStatus)) } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt) + n += 1 + l + sovTask(uint64(l)) + return n +} + +func (m *TaskIO) Size() (n int) { + var l int + _ = l + l = len(m.Stdin) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + l = len(m.Stdout) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + l = len(m.Stderr) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + if m.Terminal { + n += 2 + } + return n +} + +func (m *TaskExit) Size() (n int) { + var l int + _ = l + l = len(m.ContainerID) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + l = len(m.ID) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + if m.Pid != 0 { + n += 1 + sovTask(uint64(m.Pid)) + } + if m.ExitStatus != 0 { + n += 1 + sovTask(uint64(m.ExitStatus)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt) + n += 1 + l + sovTask(uint64(l)) + return n +} + +func (m *TaskOOM) Size() (n int) { + var l int + _ = l + l = len(m.ContainerID) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + return n +} + +func (m *TaskExecAdded) Size() (n int) { + var l int + _ = l + l = len(m.ContainerID) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + l = len(m.ExecID) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + if m.Pid != 0 { + n += 1 + sovTask(uint64(m.Pid)) + } + return n +} + +func (m *TaskPaused) Size() (n int) { + var l int + _ = l + l = len(m.ContainerID) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + return n +} + +func (m *TaskResumed) Size() (n int) { + var l int + _ = l + l = len(m.ContainerID) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + return n +} + +func (m *TaskCheckpointed) Size() (n int) { + var l int + _ = l + l = len(m.ContainerID) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } + l = len(m.Checkpoint) + if l > 0 { + n += 1 + l + sovTask(uint64(l)) + } return n } @@ -213,6 +714,11 @@ func (this *TaskCreate) String() string { } s := strings.Join([]string{`&TaskCreate{`, `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`, + `Rootfs:` + strings.Replace(fmt.Sprintf("%v", this.Rootfs), "Mount", "containerd_types.Mount", 1) + `,`, + `IO:` + strings.Replace(fmt.Sprintf("%v", this.IO), "TaskIO", "TaskIO", 1) + `,`, + `Checkpoint:` + fmt.Sprintf("%v", this.Checkpoint) + `,`, + `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `}`, }, "") return s @@ -223,6 +729,7 @@ func (this *TaskStart) String() string { } s := strings.Join([]string{`&TaskStart{`, `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `}`, }, "") return s @@ -235,6 +742,87 @@ func (this *TaskDelete) String() string { `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, + `ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *TaskIO) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TaskIO{`, + `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, + `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, + `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, + `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`, + `}`, + }, "") + return s +} +func (this *TaskExit) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TaskExit{`, + `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, + `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, + `ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`, + `}`, + }, "") + return s +} +func (this *TaskOOM) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TaskOOM{`, + `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `}`, + }, "") + return s +} +func (this *TaskExecAdded) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TaskExecAdded{`, + `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `ExecID:` + fmt.Sprintf("%v", this.ExecID) + `,`, + `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, + `}`, + }, "") + return s +} +func (this *TaskPaused) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TaskPaused{`, + `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `}`, + }, "") + return s +} +func (this *TaskResumed) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TaskResumed{`, + `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `}`, + }, "") + return s +} +func (this *TaskCheckpointed) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&TaskCheckpointed{`, + `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, + `Checkpoint:` + fmt.Sprintf("%v", this.Checkpoint) + `,`, `}`, }, "") return s @@ -305,6 +893,147 @@ func (m *TaskCreate) Unmarshal(dAtA []byte) error { } m.ContainerID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bundle", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bundle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rootfs", 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 + } + m.Rootfs = append(m.Rootfs, &containerd_types.Mount{}) + if err := m.Rootfs[len(m.Rootfs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IO", 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.IO == nil { + m.IO = &TaskIO{} + } + if err := m.IO.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checkpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + 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 + } + } default: iNdEx = preIndex skippy, err := skipTask(dAtA[iNdEx:]) @@ -384,6 +1113,25 @@ func (m *TaskStart) Unmarshal(dAtA []byte) error { } m.ContainerID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + 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 + } + } default: iNdEx = preIndex skippy, err := skipTask(dAtA[iNdEx:]) @@ -501,6 +1249,841 @@ func (m *TaskDelete) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", 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 err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, 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 (m *TaskIO) 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: TaskIO: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TaskIO: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Stdin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Stdout = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Stderr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Terminal = bool(v != 0) + 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 (m *TaskExit) 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: TaskExit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TaskExit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType) + } + m.ExitStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExitStatus |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", 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 err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, 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 (m *TaskOOM) 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: TaskOOM: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TaskOOM: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerID = string(dAtA[iNdEx:postIndex]) + 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 (m *TaskExecAdded) 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: TaskExecAdded: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TaskExecAdded: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExecID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + 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 + } + } + 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 (m *TaskPaused) 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: TaskPaused: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TaskPaused: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerID = string(dAtA[iNdEx:postIndex]) + 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 (m *TaskResumed) 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: TaskResumed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TaskResumed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerID = string(dAtA[iNdEx:postIndex]) + 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 (m *TaskCheckpointed) 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: TaskCheckpointed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TaskCheckpointed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContainerID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ContainerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checkpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTask + } + 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 ErrInvalidLengthTask + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checkpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTask(dAtA[iNdEx:]) @@ -632,21 +2215,43 @@ func init() { } var fileDescriptorTask = []byte{ - // 245 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, 0x26, 0x16, 0x64, 0xea, 0x17, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x16, 0xeb, - 0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0xeb, 0x97, 0x19, 0xea, 0x97, 0x24, 0x16, 0x67, 0xeb, 0x15, - 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xc9, 0x22, 0x54, 0xeb, 0xc1, 0x54, 0xea, 0x41, 0x54, 0xea, 0x95, - 0x19, 0x2a, 0x39, 0x70, 0x71, 0x85, 0x24, 0x16, 0x67, 0x3b, 0x17, 0xa5, 0x26, 0x96, 0xa4, 0x0a, - 0x19, 0x71, 0xf1, 0xc0, 0x95, 0xc7, 0x67, 0xa6, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0xf1, - 0x3f, 0xba, 0x27, 0xcf, 0xed, 0x0c, 0x13, 0xf7, 0x74, 0x09, 0xe2, 0x86, 0x2b, 0xf2, 0x4c, 0x51, - 0xb2, 0xe7, 0xe2, 0x04, 0x99, 0x10, 0x5c, 0x92, 0x58, 0x54, 0x42, 0x96, 0x01, 0xc5, 0x10, 0x27, - 0xb8, 0xa4, 0xe6, 0xa4, 0x92, 0xe7, 0x04, 0x21, 0x01, 0x2e, 0xe6, 0x82, 0xcc, 0x14, 0x09, 0x26, - 0x05, 0x46, 0x0d, 0xde, 0x20, 0x10, 0x53, 0x48, 0x9e, 0x8b, 0x3b, 0xb5, 0x22, 0xb3, 0x24, 0xbe, - 0xb8, 0x24, 0xb1, 0xa4, 0xb4, 0x58, 0x82, 0x19, 0x2c, 0xc3, 0x05, 0x12, 0x0a, 0x06, 0x8b, 0x38, - 0x45, 0x9c, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0x43, 0xc3, 0x23, 0x39, 0xc6, 0x13, 0x8f, - 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x31, 0xca, 0x8e, 0xcc, 0x40, 0xb7, - 0x86, 0xb0, 0x92, 0xd8, 0xc0, 0xe1, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x52, 0xb1, - 0x6e, 0xbd, 0x01, 0x00, 0x00, + // 607 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0x6b, 0xa7, 0x75, 0x93, 0x09, 0x15, 0x95, 0x55, 0x41, 0x14, 0x09, 0x3b, 0x32, 0x42, + 0xca, 0xc9, 0x56, 0x8b, 0xc4, 0x05, 0x15, 0x91, 0x34, 0x1c, 0x72, 0xa8, 0x02, 0x6e, 0x0f, 0x88, + 0x4b, 0xe4, 0xd8, 0xd3, 0x74, 0x69, 0xe2, 0x8d, 0xbc, 0xe3, 0xa8, 0x70, 0xe2, 0x11, 0x78, 0x1a, + 0x9e, 0xa1, 0x07, 0x0e, 0x1c, 0x39, 0x05, 0xea, 0xc7, 0xe0, 0x84, 0xd6, 0xeb, 0xa4, 0xe1, 0x5f, + 0x85, 0x7c, 0xdb, 0x19, 0x7f, 0x3b, 0xfe, 0xe6, 0xe7, 0xf1, 0x40, 0x77, 0xcc, 0xe8, 0x3c, 0x1d, + 0xb9, 0x21, 0x9f, 0x7a, 0x21, 0x8f, 0x29, 0x60, 0x31, 0x26, 0xd1, 0xfa, 0x31, 0x98, 0x31, 0x4f, + 0x60, 0x32, 0x67, 0x21, 0x0a, 0x0f, 0xe7, 0x18, 0x93, 0xf0, 0xe6, 0xfb, 0x1e, 0x05, 0xe2, 0xc2, + 0x9d, 0x25, 0x9c, 0xb8, 0xf9, 0x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2f, 0x8f, 0xce, + 0x2b, 0xa8, 0xc9, 0x3a, 0x27, 0x14, 0x24, 0x54, 0xaa, 0xf5, 0xa2, 0xa4, 0x7e, 0x53, 0xf2, 0x53, + 0xc1, 0xb3, 0x87, 0x13, 0x2c, 0xc9, 0xf3, 0x8f, 0xa2, 0xa6, 0x0d, 0x75, 0xbc, 0x64, 0x34, 0x14, + 0x14, 0x50, 0x2a, 0x71, 0xca, 0x27, 0x20, 0x53, 0x27, 0x79, 0xc6, 0xec, 0x40, 0x4d, 0x46, 0x18, + 0x0d, 0x03, 0x2a, 0x00, 0x36, 0x5d, 0x35, 0x32, 0xee, 0x72, 0x64, 0xdc, 0xd3, 0xe5, 0xc8, 0x74, + 0xab, 0x57, 0x0b, 0x7b, 0xe3, 0xe3, 0x37, 0x5b, 0xf3, 0xab, 0xea, 0x5a, 0x87, 0x9c, 0xb7, 0x60, + 0x28, 0xa6, 0xe6, 0x1e, 0x6c, 0x09, 0x8a, 0x58, 0xac, 0xcc, 0xfa, 0x2a, 0x90, 0x5f, 0x59, 0x50, + 0xc4, 0x53, 0x5a, 0x7e, 0x65, 0x15, 0x15, 0x79, 0x4c, 0x92, 0xdc, 0x96, 0xca, 0x63, 0x92, 0x98, + 0x4d, 0xa8, 0x12, 0x26, 0x53, 0x16, 0x07, 0x93, 0xdc, 0x51, 0xd5, 0x5f, 0xc5, 0xce, 0x67, 0x0d, + 0xaa, 0xf2, 0x65, 0x2f, 0x2e, 0x19, 0x95, 0x1c, 0x39, 0xbd, 0x20, 0x54, 0x2b, 0x46, 0xa0, 0xe7, + 0xeb, 0x6c, 0x85, 0xae, 0xf2, 0x4f, 0x74, 0x9b, 0xb7, 0xa3, 0xdb, 0x2a, 0x85, 0xee, 0x10, 0xb6, + 0x65, 0x37, 0x83, 0xc1, 0x71, 0x99, 0x66, 0x9c, 0xf7, 0xb0, 0xa3, 0x60, 0x60, 0xd8, 0x89, 0x22, + 0x8c, 0x4a, 0x11, 0x79, 0x08, 0xdb, 0x78, 0x89, 0xe1, 0x70, 0x85, 0x05, 0xb2, 0x85, 0x6d, 0xc8, + 0x9a, 0xfd, 0x9e, 0x6f, 0xc8, 0x47, 0xfd, 0xbf, 0xe0, 0x71, 0x9e, 0xab, 0x69, 0x7d, 0x19, 0xa4, + 0xa2, 0xdc, 0x8b, 0x9d, 0x0e, 0xd4, 0x65, 0x05, 0x1f, 0x45, 0x3a, 0x2d, 0x59, 0xe2, 0x0c, 0x76, + 0xf3, 0x15, 0xb4, 0xfa, 0x55, 0x4b, 0x32, 0xf8, 0x75, 0x01, 0xe8, 0xbf, 0x2f, 0x80, 0xee, 0xeb, + 0xab, 0x6b, 0x6b, 0xe3, 0xeb, 0xb5, 0xb5, 0xf1, 0x21, 0xb3, 0xb4, 0xab, 0xcc, 0xd2, 0xbe, 0x64, + 0x96, 0xf6, 0x3d, 0xb3, 0xb4, 0x37, 0xcf, 0x4a, 0xee, 0xf5, 0xa7, 0xea, 0x34, 0x32, 0xf2, 0x49, + 0x79, 0xfc, 0x33, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xfa, 0x67, 0x90, 0x20, 0x06, 0x00, 0x00, } diff --git a/api/services/events/v1/task.proto b/api/services/events/v1/task.proto index 179c71cae..46917510f 100644 --- a/api/services/events/v1/task.proto +++ b/api/services/events/v1/task.proto @@ -2,18 +2,67 @@ syntax = "proto3"; package containerd.services.events.v1; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "github.com/containerd/containerd/api/types/mount.proto"; + option go_package = "github.com/containerd/containerd/api/services/events/v1;events"; message TaskCreate { string container_id = 1; + string bundle = 2; + repeated containerd.types.Mount rootfs = 3; + TaskIO io = 4 [(gogoproto.customname) = "IO"]; + string checkpoint = 5; + uint32 pid = 6; } message TaskStart { string container_id = 1; + uint32 pid = 2; } message TaskDelete { string container_id = 1; uint32 pid = 2; uint32 exit_status = 3; + google.protobuf.Timestamp exited_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +message TaskIO { + string stdin = 1; + string stdout = 2; + string stderr = 3; + bool terminal = 4; +} + +message TaskExit { + string container_id = 1; + string id = 2; + uint32 pid = 3; + uint32 exit_status = 4; + google.protobuf.Timestamp exited_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; +} + +message TaskOOM { + string container_id = 1; +} + +message TaskExecAdded { + string container_id = 1; + string exec_id = 2; + uint32 pid = 3; +} + +message TaskPaused { + string container_id = 1; +} + +message TaskResumed { + string container_id = 1; +} + +message TaskCheckpointed { + string container_id = 1; + string checkpoint = 2; } diff --git a/cmd/ctr/events.go b/cmd/ctr/events.go index a327a4795..9cd9d29b1 100644 --- a/cmd/ctr/events.go +++ b/cmd/ctr/events.go @@ -1,9 +1,9 @@ package main import ( + "encoding/json" "fmt" "os" - "strings" "text/tabwriter" eventsapi "github.com/containerd/containerd/api/services/events/v1" @@ -33,7 +33,11 @@ var eventsCommand = cli.Command{ return err } - out, err := getEventOutput(e) + v, err := typeurl.UnmarshalAny(e.Event) + if err != nil { + return err + } + out, err := json.Marshal(v) if err != nil { return err } @@ -54,54 +58,3 @@ var eventsCommand = cli.Command{ } }, } - -func getEventOutput(env *eventsapi.Envelope) (string, error) { - out := "" - v, err := typeurl.UnmarshalAny(env.Event) - if err != nil { - return "", err - } - switch e := v.(type) { - case *eventsapi.ContainerCreate: - out = fmt.Sprintf("id=%s image=%s runtime=%s", e.ID, e.Image, e.Runtime) - case *eventsapi.TaskCreate: - out = "id=" + e.ContainerID - case *eventsapi.TaskStart: - out = "id=" + e.ContainerID - case *eventsapi.TaskDelete: - out = fmt.Sprintf("id=%s pid=%d status=%d", e.ContainerID, e.Pid, e.ExitStatus) - case *eventsapi.ContainerUpdate: - out = "id=" + e.ID - case *eventsapi.ContainerDelete: - out = "id=" + e.ID - case *eventsapi.SnapshotPrepare: - out = fmt.Sprintf("key=%s parent=%s", e.Key, e.Parent) - case *eventsapi.SnapshotCommit: - out = fmt.Sprintf("key=%s name=%s", e.Key, e.Name) - case *eventsapi.SnapshotRemove: - out = "key=" + e.Key - case *eventsapi.ImageUpdate: - out = fmt.Sprintf("name=%s labels=%s", e.Name, e.Labels) - case *eventsapi.ImageDelete: - out = "name=" + e.Name - case *eventsapi.NamespaceCreate: - out = fmt.Sprintf("name=%s labels=%s", e.Name, e.Labels) - case *eventsapi.NamespaceUpdate: - out = fmt.Sprintf("name=%s labels=%s", e.Name, e.Labels) - case *eventsapi.NamespaceDelete: - out = "name=" + e.Name - case *eventsapi.RuntimeCreate: - mounts := []string{} - for _, m := range e.RootFS { - mounts = append(mounts, fmt.Sprintf("type=%s:src=%s", m.Type, m.Source)) - } - out = fmt.Sprintf("id=%s bundle=%s rootfs=%s checkpoint=%s", e.ContainerID, e.Bundle, strings.Join(mounts, ","), e.Checkpoint) - case *eventsapi.RuntimeEvent: - out = fmt.Sprintf("id=%s container_id=%s type=%s pid=%d status=%d exited=%s", e.ID, e.ContainerID, e.Type, e.Pid, e.ExitStatus, e.ExitedAt) - case *eventsapi.RuntimeDelete: - out = fmt.Sprintf("id=%s runtime=%s status=%d exited=%s", e.ContainerID, e.Runtime, e.ExitStatus, e.ExitedAt) - default: - out = env.Event.TypeUrl - } - return out, nil -} diff --git a/cmd/ctr/shim.go b/cmd/ctr/shim.go index 6b053904f..66a576275 100644 --- a/cmd/ctr/shim.go +++ b/cmd/ctr/shim.go @@ -62,7 +62,6 @@ var shimCommand = cli.Command{ shimCreateCommand, shimStartCommand, shimDeleteCommand, - shimEventsCommand, shimStateCommand, shimExecCommand, }, @@ -293,28 +292,6 @@ var shimExecCommand = cli.Command{ }, } -var shimEventsCommand = cli.Command{ - Name: "events", - Usage: "get events for a shim", - Action: func(context *cli.Context) error { - service, err := getShimService(context) - if err != nil { - return err - } - events, err := service.Stream(gocontext.Background(), &shim.StreamEventsRequest{}) - if err != nil { - return err - } - for { - e, err := events.Recv() - if err != nil { - return err - } - fmt.Printf("type=%s id=%s pid=%d status=%d\n", e.Type, e.ID, e.Pid, e.ExitStatus) - } - }, -} - func getShimService(context *cli.Context) (shim.ShimClient, error) { bindSocket := context.GlobalString("socket") if bindSocket == "" { diff --git a/linux/runtime.go b/linux/runtime.go index 3785f5c54..79d8fc4ee 100644 --- a/linux/runtime.go +++ b/linux/runtime.go @@ -12,9 +12,7 @@ import ( "google.golang.org/grpc" "github.com/boltdb/bolt" - eventsapi "github.com/containerd/containerd/api/services/events/v1" "github.com/containerd/containerd/api/types" - "github.com/containerd/containerd/events" client "github.com/containerd/containerd/linux/shim" shim "github.com/containerd/containerd/linux/shim/v1" "github.com/containerd/containerd/log" @@ -92,7 +90,6 @@ func New(ic *plugin.InitContext) (interface{}, error) { runtime: cfg.Runtime, monitor: monitor.(runtime.TaskMonitor), tasks: newTaskList(), - emitter: events.GetPoster(ic.Context), db: m.(*bolt.DB), address: ic.Address, } @@ -118,7 +115,6 @@ type Runtime struct { monitor runtime.TaskMonitor tasks *taskList - emitter events.Poster db *bolt.DB } @@ -180,29 +176,6 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts if err = r.monitor.Monitor(t); err != nil { return nil, err } - - var runtimeMounts []*eventsapi.RuntimeMount - for _, m := range opts.Rootfs { - runtimeMounts = append(runtimeMounts, &eventsapi.RuntimeMount{ - Type: m.Type, - Source: m.Source, - Options: m.Options, - }) - } - if err := r.emit(ctx, "/runtime/create", &eventsapi.RuntimeCreate{ - ContainerID: id, - Bundle: bundle.path, - RootFS: runtimeMounts, - IO: &eventsapi.RuntimeIO{ - Stdin: opts.IO.Stdin, - Stdout: opts.IO.Stdout, - Stderr: opts.IO.Stderr, - Terminal: opts.IO.Terminal, - }, - Checkpoint: opts.Checkpoint, - }); err != nil { - return nil, err - } return t, nil } @@ -227,23 +200,15 @@ func (r *Runtime) Delete(ctx context.Context, c runtime.Task) (*runtime.Exit, er } r.tasks.delete(ctx, lc) - var ( - bundle = loadBundle(filepath.Join(r.root, namespace, lc.id), namespace) - i = c.Info() - ) - if err := r.emit(ctx, "/runtime/delete", &eventsapi.RuntimeDelete{ - ContainerID: i.ID, - Runtime: i.Runtime, - ExitStatus: rsp.ExitStatus, - ExitedAt: rsp.ExitedAt, - }); err != nil { + bundle := loadBundle(filepath.Join(r.root, namespace, lc.id), namespace) + if err := bundle.Delete(); err != nil { return nil, err } return &runtime.Exit{ Status: rsp.ExitStatus, Timestamp: rsp.ExitedAt, Pid: rsp.Pid, - }, bundle.Delete() + }, nil } func (r *Runtime) Tasks(ctx context.Context) ([]runtime.Task, error) { @@ -356,12 +321,3 @@ func (r *Runtime) getRuntime(ctx context.Context, ns, id string) (*runc.Runc, er Root: filepath.Join(client.RuncRoot, ns), }, nil } - -func (r *Runtime) emit(ctx context.Context, topic string, evt interface{}) error { - emitterCtx := events.WithTopic(ctx, topic) - if err := r.emitter.Post(emitterCtx, evt); err != nil { - return err - } - - return nil -} diff --git a/linux/shim/local.go b/linux/shim/local.go index b74301221..10215ea41 100644 --- a/linux/shim/local.go +++ b/linux/shim/local.go @@ -12,7 +12,6 @@ import ( "golang.org/x/net/context" "golang.org/x/sys/unix" "google.golang.org/grpc" - "google.golang.org/grpc/metadata" ) // NewLocal returns a shim client implementation for issue commands to a shim @@ -54,13 +53,6 @@ func (c *local) ResizePty(ctx context.Context, in *shimapi.ResizePtyRequest, opt return c.s.ResizePty(ctx, in) } -func (c *local) Stream(ctx context.Context, in *shimapi.StreamEventsRequest, opts ...grpc.CallOption) (shimapi.Shim_StreamClient, error) { - return &streamEvents{ - c: c.s.events, - ctx: ctx, - }, nil -} - func (c *local) State(ctx context.Context, in *shimapi.StateRequest, opts ...grpc.CallOption) (*shimapi.StateResponse, error) { return c.s.State(ctx, in) } @@ -97,40 +89,6 @@ func (c *local) Update(ctx context.Context, in *shimapi.UpdateTaskRequest, opts return c.s.Update(ctx, in) } -type streamEvents struct { - c chan *events.RuntimeEvent - ctx context.Context -} - -func (e *streamEvents) Recv() (*events.RuntimeEvent, error) { - ev := <-e.c - return ev, nil -} - -func (e *streamEvents) Header() (metadata.MD, error) { - return nil, nil -} - -func (e *streamEvents) Trailer() metadata.MD { - return nil -} - -func (e *streamEvents) CloseSend() error { - return nil -} - -func (e *streamEvents) Context() context.Context { - return e.ctx -} - -func (e *streamEvents) SendMsg(m interface{}) error { - return nil -} - -func (e *streamEvents) RecvMsg(m interface{}) error { - return nil -} - type poster interface { Post(ctx context.Context, in *events.PostEventRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) } diff --git a/linux/shim/service.go b/linux/shim/service.go index dd89fc67f..45f364616 100644 --- a/linux/shim/service.go +++ b/linux/shim/service.go @@ -54,7 +54,7 @@ func NewService(path, namespace, address string) (*Service, error) { s := &Service{ path: path, processes: make(map[string]process), - events: make(chan *events.RuntimeEvent, 4096), + events: make(chan interface{}, 4096), namespace: namespace, context: context, } @@ -69,9 +69,9 @@ type Service struct { bundle string mu sync.Mutex processes map[string]process - events chan *events.RuntimeEvent + events chan interface{} eventsMu sync.Mutex - deferredEvent *events.RuntimeEvent + deferredEvent interface{} namespace string context context.Context } @@ -96,11 +96,18 @@ func (s *Service) Create(ctx context.Context, r *shimapi.CreateTaskRequest) (*sh ExitCh: make(chan int, 1), } reaper.Default.Register(pid, cmd) - s.events <- &events.RuntimeEvent{ - Type: events.RuntimeEvent_CREATE, - ID: r.ID, - ContainerID: s.id, - Pid: uint32(pid), + s.events <- &events.TaskCreate{ + ContainerID: r.ID, + Bundle: r.Bundle, + Rootfs: r.Rootfs, + IO: &events.TaskIO{ + Stdin: r.Stdin, + Stdout: r.Stdout, + Stderr: r.Stderr, + Terminal: r.Terminal, + }, + Checkpoint: r.Checkpoint, + Pid: uint32(pid), } go s.waitExit(process, pid, cmd) return &shimapi.CreateTaskResponse{ @@ -115,9 +122,7 @@ func (s *Service) Start(ctx context.Context, r *google_protobuf.Empty) (*google_ if err := s.initProcess.Start(ctx); err != nil { return nil, err } - s.events <- &events.RuntimeEvent{ - Type: events.RuntimeEvent_START, - ID: s.id, + s.events <- &events.TaskStart{ ContainerID: s.id, Pid: uint32(s.initProcess.Pid()), } @@ -134,6 +139,12 @@ func (s *Service) Delete(ctx context.Context, r *google_protobuf.Empty) (*shimap s.mu.Lock() delete(s.processes, p.ID()) s.mu.Unlock() + s.events <- &events.TaskDelete{ + ContainerID: s.id, + ExitStatus: uint32(p.Status()), + ExitedAt: p.ExitedAt(), + Pid: uint32(p.Pid()), + } return &shimapi.DeleteResponse{ ExitStatus: uint32(p.Status()), ExitedAt: p.ExitedAt(), @@ -184,10 +195,9 @@ func (s *Service) Exec(ctx context.Context, r *shimapi.ExecProcessRequest) (*shi reaper.Default.Register(pid, cmd) s.processes[r.ID] = process - s.events <- &events.RuntimeEvent{ - Type: events.RuntimeEvent_EXEC_ADDED, - ID: r.ID, + s.events <- &events.TaskExecAdded{ ContainerID: s.id, + ExecID: r.ID, Pid: uint32(pid), } go s.waitExit(process, pid, cmd) @@ -216,30 +226,6 @@ func (s *Service) ResizePty(ctx context.Context, r *shimapi.ResizePtyRequest) (* return empty, nil } -func (s *Service) Stream(r *shimapi.StreamEventsRequest, stream shimapi.Shim_StreamServer) error { - s.eventsMu.Lock() - defer s.eventsMu.Unlock() - - if s.deferredEvent != nil { - if err := stream.Send(s.deferredEvent); err != nil { - return err - } - s.deferredEvent = nil - } - - for { - select { - case e := <-s.events: - if err := stream.Send(e); err != nil { - s.deferredEvent = e - return err - } - case <-stream.Context().Done(): - return stream.Context().Err() - } - } -} - func (s *Service) State(ctx context.Context, r *shimapi.StateRequest) (*shimapi.StateResponse, error) { if s.initProcess == nil { return nil, errors.New(ErrContainerNotCreated) @@ -283,11 +269,8 @@ func (s *Service) Pause(ctx context.Context, r *google_protobuf.Empty) (*google_ if err := s.initProcess.Pause(ctx); err != nil { return nil, err } - s.events <- &events.RuntimeEvent{ - Type: events.RuntimeEvent_PAUSED, - ID: s.id, + s.events <- &events.TaskPaused{ ContainerID: s.id, - Timestamp: time.Now(), } return empty, nil } @@ -299,11 +282,8 @@ func (s *Service) Resume(ctx context.Context, r *google_protobuf.Empty) (*google if err := s.initProcess.Resume(ctx); err != nil { return nil, err } - s.events <- &events.RuntimeEvent{ - Type: events.RuntimeEvent_RESUMED, - ID: s.id, + s.events <- &events.TaskResumed{ ContainerID: s.id, - Timestamp: time.Now(), } return empty, nil } @@ -356,11 +336,8 @@ func (s *Service) Checkpoint(ctx context.Context, r *shimapi.CheckpointTaskReque if err := s.initProcess.Checkpoint(ctx, r); err != nil { return nil, err } - s.events <- &events.RuntimeEvent{ - Type: events.RuntimeEvent_CHECKPOINTED, - ID: s.id, + s.events <- &events.TaskCheckpointed{ ContainerID: s.id, - Timestamp: time.Now(), } return empty, nil } @@ -386,10 +363,9 @@ func (s *Service) waitExit(p process, pid int, cmd *reaper.Cmd) { p.Exited(status) reaper.Default.Delete(pid) - s.events <- &events.RuntimeEvent{ - Type: events.RuntimeEvent_EXIT, - ID: p.ID(), + s.events <- &events.TaskExit{ ContainerID: s.id, + ID: p.ID(), Pid: uint32(pid), ExitStatus: uint32(status), ExitedAt: p.ExitedAt(), @@ -418,7 +394,7 @@ func (s *Service) forward(client poster) { if _, err := client.Post(s.context, &events.PostEventRequest{ Envelope: &events.Envelope{ Timestamp: time.Now(), - Topic: "/runtime/" + getTopic(e), + Topic: "/task/" + getTopic(e), Event: a, }, }); err != nil { @@ -427,18 +403,26 @@ func (s *Service) forward(client poster) { } } -func getTopic(e *events.RuntimeEvent) string { - switch e.Type { - case events.RuntimeEvent_CREATE: +func getTopic(e interface{}) string { + switch e.(type) { + case *events.TaskCreate: return "task-create" - case events.RuntimeEvent_START: + case *events.TaskStart: return "task-start" - case events.RuntimeEvent_EXEC_ADDED: - return "task-execadded" - case events.RuntimeEvent_OOM: + case *events.TaskOOM: return "task-oom" - case events.RuntimeEvent_EXIT: + case *events.TaskExit: return "task-exit" + case *events.TaskDelete: + return "task-delete" + case *events.TaskExecAdded: + return "task-exec-added" + case *events.TaskPaused: + return "task-paused" + case *events.TaskResumed: + return "task-resumed" + case *events.TaskCheckpointed: + return "task-checkpointed" } return "?" } diff --git a/linux/shim/v1/shim.pb.go b/linux/shim/v1/shim.pb.go index cf35fef3a..5c14a0243 100644 --- a/linux/shim/v1/shim.pb.go +++ b/linux/shim/v1/shim.pb.go @@ -24,7 +24,6 @@ ListPidsResponse CheckpointTaskRequest ShimInfoResponse - StreamEventsRequest UpdateTaskRequest */ package shim @@ -38,7 +37,6 @@ import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/gogo/protobuf/types" import containerd_types "github.com/containerd/containerd/api/types" import containerd_v1_types "github.com/containerd/containerd/api/types/task" -import containerd_services_events_v1 "github.com/containerd/containerd/api/services/events/v1" import time "time" @@ -216,20 +214,13 @@ func (m *ShimInfoResponse) Reset() { *m = ShimInfoResponse{} func (*ShimInfoResponse) ProtoMessage() {} func (*ShimInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{14} } -type StreamEventsRequest struct { -} - -func (m *StreamEventsRequest) Reset() { *m = StreamEventsRequest{} } -func (*StreamEventsRequest) ProtoMessage() {} -func (*StreamEventsRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{15} } - type UpdateTaskRequest struct { Resources *google_protobuf.Any `protobuf:"bytes,1,opt,name=resources" json:"resources,omitempty"` } func (m *UpdateTaskRequest) Reset() { *m = UpdateTaskRequest{} } func (*UpdateTaskRequest) ProtoMessage() {} -func (*UpdateTaskRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{16} } +func (*UpdateTaskRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{15} } func init() { proto.RegisterType((*CreateTaskRequest)(nil), "containerd.runtime.linux.shim.v1.CreateTaskRequest") @@ -247,7 +238,6 @@ func init() { proto.RegisterType((*ListPidsResponse)(nil), "containerd.runtime.linux.shim.v1.ListPidsResponse") proto.RegisterType((*CheckpointTaskRequest)(nil), "containerd.runtime.linux.shim.v1.CheckpointTaskRequest") proto.RegisterType((*ShimInfoResponse)(nil), "containerd.runtime.linux.shim.v1.ShimInfoResponse") - proto.RegisterType((*StreamEventsRequest)(nil), "containerd.runtime.linux.shim.v1.StreamEventsRequest") proto.RegisterType((*UpdateTaskRequest)(nil), "containerd.runtime.linux.shim.v1.UpdateTaskRequest") } @@ -272,7 +262,6 @@ type ShimClient interface { Pause(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Resume(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Checkpoint(ctx context.Context, in *CheckpointTaskRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) - Stream(ctx context.Context, in *StreamEventsRequest, opts ...grpc.CallOption) (Shim_StreamClient, error) Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Exec(ctx context.Context, in *ExecProcessRequest, opts ...grpc.CallOption) (*ExecProcessResponse, error) ResizePty(ctx context.Context, in *ResizePtyRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) @@ -371,38 +360,6 @@ func (c *shimClient) Checkpoint(ctx context.Context, in *CheckpointTaskRequest, return out, nil } -func (c *shimClient) Stream(ctx context.Context, in *StreamEventsRequest, opts ...grpc.CallOption) (Shim_StreamClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Shim_serviceDesc.Streams[0], c.cc, "/containerd.runtime.linux.shim.v1.Shim/Stream", opts...) - if err != nil { - return nil, err - } - x := &shimStreamClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Shim_StreamClient interface { - Recv() (*containerd_services_events_v1.RuntimeEvent, error) - grpc.ClientStream -} - -type shimStreamClient struct { - grpc.ClientStream -} - -func (x *shimStreamClient) Recv() (*containerd_services_events_v1.RuntimeEvent, error) { - m := new(containerd_services_events_v1.RuntimeEvent) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - func (c *shimClient) Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) { out := new(google_protobuf1.Empty) err := grpc.Invoke(ctx, "/containerd.runtime.linux.shim.v1.Shim/Kill", in, out, c.cc, opts...) @@ -470,7 +427,6 @@ type ShimServer interface { Pause(context.Context, *google_protobuf1.Empty) (*google_protobuf1.Empty, error) Resume(context.Context, *google_protobuf1.Empty) (*google_protobuf1.Empty, error) Checkpoint(context.Context, *CheckpointTaskRequest) (*google_protobuf1.Empty, error) - Stream(*StreamEventsRequest, Shim_StreamServer) error Kill(context.Context, *KillRequest) (*google_protobuf1.Empty, error) Exec(context.Context, *ExecProcessRequest) (*ExecProcessResponse, error) ResizePty(context.Context, *ResizePtyRequest) (*google_protobuf1.Empty, error) @@ -646,27 +602,6 @@ func _Shim_Checkpoint_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -func _Shim_Stream_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(StreamEventsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ShimServer).Stream(m, &shimStreamServer{stream}) -} - -type Shim_StreamServer interface { - Send(*containerd_services_events_v1.RuntimeEvent) error - grpc.ServerStream -} - -type shimStreamServer struct { - grpc.ServerStream -} - -func (x *shimStreamServer) Send(m *containerd_services_events_v1.RuntimeEvent) error { - return x.ServerStream.SendMsg(m) -} - func _Shim_Kill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(KillRequest) if err := dec(in); err != nil { @@ -840,13 +775,7 @@ var _Shim_serviceDesc = grpc.ServiceDesc{ Handler: _Shim_Update_Handler, }, }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Stream", - Handler: _Shim_Stream_Handler, - ServerStreams: true, - }, - }, + Streams: []grpc.StreamDesc{}, Metadata: "github.com/containerd/containerd/linux/shim/v1/shim.proto", } @@ -1431,24 +1360,6 @@ func (m *ShimInfoResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *StreamEventsRequest) 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 *StreamEventsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - func (m *UpdateTaskRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1762,12 +1673,6 @@ func (m *ShimInfoResponse) Size() (n int) { return n } -func (m *StreamEventsRequest) Size() (n int) { - var l int - _ = l - return n -} - func (m *UpdateTaskRequest) Size() (n int) { var l int _ = l @@ -1971,15 +1876,6 @@ func (this *ShimInfoResponse) String() string { }, "") return s } -func (this *StreamEventsRequest) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&StreamEventsRequest{`, - `}`, - }, "") - return s -} func (this *UpdateTaskRequest) String() string { if this == nil { return "nil" @@ -3956,56 +3852,6 @@ func (m *ShimInfoResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *StreamEventsRequest) 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: StreamEventsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StreamEventsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - 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 *UpdateTaskRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4199,75 +4045,71 @@ func init() { } var fileDescriptorShim = []byte{ - // 1117 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4d, 0x6f, 0xdb, 0x46, - 0x13, 0x36, 0xf5, 0x41, 0xc9, 0xa3, 0x57, 0x7e, 0xed, 0x8d, 0xe3, 0x32, 0x0a, 0x20, 0x0b, 0x3c, - 0xb8, 0x2a, 0x82, 0x90, 0xb1, 0xdc, 0x24, 0xfd, 0x00, 0x0a, 0xd8, 0x8e, 0x51, 0x18, 0xad, 0x11, - 0x83, 0x4e, 0xda, 0xa2, 0x45, 0x61, 0xd0, 0xe2, 0x5a, 0x5a, 0x58, 0x22, 0x19, 0xee, 0xd2, 0xb5, - 0x7b, 0xea, 0xa9, 0xe7, 0xfe, 0x9c, 0xde, 0x7b, 0xf1, 0xb1, 0xc7, 0x9e, 0xd2, 0x46, 0xa7, 0x5e, - 0xfa, 0x1f, 0x8a, 0xfd, 0x90, 0x45, 0x49, 0x26, 0x48, 0xf5, 0x62, 0xed, 0xec, 0xce, 0x2c, 0x67, - 0xe6, 0x79, 0x66, 0x66, 0x0d, 0x1f, 0xf7, 0x08, 0xeb, 0xc7, 0x67, 0x56, 0x37, 0x18, 0xda, 0xdd, - 0xc0, 0x67, 0x2e, 0xf1, 0x71, 0xe4, 0x25, 0x97, 0x03, 0xe2, 0xc7, 0x57, 0x36, 0xed, 0x93, 0xa1, - 0x7d, 0xb9, 0x2d, 0x7e, 0xad, 0x30, 0x0a, 0x58, 0x80, 0x5a, 0x13, 0x25, 0x2b, 0x8a, 0x7d, 0x46, - 0x86, 0xd8, 0x12, 0xca, 0x96, 0x50, 0xba, 0xdc, 0x6e, 0x3c, 0xe8, 0x05, 0x41, 0x6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c, 0x6b, 0x2e, 0xfd, 0xf1, - 0xae, 0xb9, 0xf4, 0xd3, 0xa8, 0xa9, 0xdd, 0x8c, 0x9a, 0xda, 0xef, 0xa3, 0xa6, 0xf6, 0xd7, 0xa8, - 0xa9, 0x7d, 0xbb, 0xb3, 0xd8, 0x3f, 0x76, 0x9f, 0xf2, 0xdf, 0x33, 0x5d, 0x5c, 0xbf, 0xf3, 0x6f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0x23, 0x98, 0xb4, 0x16, 0x0e, 0x00, 0x00, + // 1049 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0x5f, 0xe7, 0xaf, 0xfb, 0x42, 0x4a, 0x3b, 0x94, 0xe2, 0xcd, 0x4a, 0x69, 0xe4, 0x43, 0x09, + 0x42, 0x6b, 0xd3, 0x14, 0x76, 0xf9, 0x23, 0x21, 0xb5, 0xdd, 0x15, 0xaa, 0xa0, 0xda, 0xca, 0xdd, + 0x05, 0x04, 0x42, 0x95, 0x1b, 0x4f, 0x93, 0x51, 0x1d, 0x8f, 0xd7, 0x33, 0x2e, 0x2d, 0x27, 0x4e, + 0x9c, 0xf9, 0x38, 0x7c, 0x84, 0x1e, 0x91, 0xb8, 0x70, 0x5a, 0xd8, 0x9c, 0xb8, 0xf0, 0x1d, 0xd0, + 0x8c, 0x27, 0x8d, 0x93, 0xd4, 0xb2, 0xc3, 0xa5, 0x9e, 0x37, 0xf3, 0x7b, 0x33, 0xef, 0xcd, 0xef, + 0xcd, 0xef, 0x35, 0xf0, 0xc9, 0x80, 0xf0, 0x61, 0x7c, 0x66, 0xf5, 0xe9, 0xc8, 0xee, 0xd3, 0x80, + 0xbb, 0x24, 0xc0, 0x91, 0x97, 0x1e, 0xfa, 0x24, 0x88, 0xaf, 0x6c, 0x36, 0x24, 0x23, 0xfb, 0x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xff, + 0xff, 0xa3, 0x6e, 0xef, 0x88, 0x48, 0x0d, 0x00, 0x00, } diff --git a/linux/shim/v1/shim.proto b/linux/shim/v1/shim.proto index bc8604631..814cb8889 100644 --- a/linux/shim/v1/shim.proto +++ b/linux/shim/v1/shim.proto @@ -8,7 +8,6 @@ import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "github.com/containerd/containerd/api/types/mount.proto"; import "github.com/containerd/containerd/api/types/task/task.proto"; -import "github.com/containerd/containerd/api/services/events/v1/runtime.proto"; option go_package = "github.com/containerd/containerd/linux/shim/v1;shim"; @@ -36,8 +35,6 @@ service Shim { rpc Checkpoint(CheckpointTaskRequest) returns (google.protobuf.Empty); - rpc Stream(StreamEventsRequest) returns (stream containerd.services.events.v1.RuntimeEvent); - rpc Kill(KillRequest) returns (google.protobuf.Empty); rpc Exec(ExecProcessRequest) returns (ExecProcessResponse); @@ -142,9 +139,6 @@ message ShimInfoResponse { uint32 shim_pid = 1; } -message StreamEventsRequest { -} - message UpdateTaskRequest { google.protobuf.Any resources = 1; } diff --git a/metrics/cgroups/cgroups.go b/metrics/cgroups/cgroups.go index ddb811317..e2adc7d15 100644 --- a/metrics/cgroups/cgroups.go +++ b/metrics/cgroups/cgroups.go @@ -3,8 +3,6 @@ package cgroups import ( - "time" - "github.com/containerd/cgroups" events "github.com/containerd/containerd/api/services/events/v1" evt "github.com/containerd/containerd/events" @@ -71,10 +69,7 @@ func (m *cgroupsMonitor) Stop(c runtime.Task) error { } func (m *cgroupsMonitor) trigger(id string, cg cgroups.Cgroup) { - if err := m.emitter.Post(m.context, &events.RuntimeEvent{ - Timestamp: time.Now(), - Type: events.RuntimeEvent_OOM, - ID: id, + if err := m.emitter.Post(m.context, &events.TaskOOM{ ContainerID: id, }); err != nil { log.G(m.context).WithError(err).Error("post OOM event") diff --git a/process.go b/process.go index 9255ff882..549641b13 100644 --- a/process.go +++ b/process.go @@ -65,21 +65,17 @@ func (p *process) Wait(ctx context.Context) (uint32, error) { if err != nil { return UnknownExitStatus, err } -evloop: for { evt, err := eventstream.Recv() if err != nil { return UnknownExitStatus, err } - if typeurl.Is(evt.Event, &eventsapi.RuntimeEvent{}) { + if typeurl.Is(evt.Event, &eventsapi.TaskExit{}) { v, err := typeurl.UnmarshalAny(evt.Event) if err != nil { return UnknownExitStatus, err } - e := v.(*eventsapi.RuntimeEvent) - if e.Type != eventsapi.RuntimeEvent_EXIT { - continue evloop - } + e := v.(*eventsapi.TaskExit) if e.ID == p.id && e.ContainerID == p.task.id { return e.ExitStatus, nil } diff --git a/task.go b/task.go index 60f894686..4fb3ed414 100644 --- a/task.go +++ b/task.go @@ -153,16 +153,13 @@ func (t *task) Wait(ctx context.Context) (uint32, error) { if err != nil { return UnknownExitStatus, err } - if typeurl.Is(evt.Event, &eventsapi.RuntimeEvent{}) { + if typeurl.Is(evt.Event, &eventsapi.TaskExit{}) { v, err := typeurl.UnmarshalAny(evt.Event) if err != nil { return UnknownExitStatus, err } - e := v.(*eventsapi.RuntimeEvent) - if e.Type != eventsapi.RuntimeEvent_EXIT { - continue - } - if e.ID == t.id && e.Pid == t.pid { + e := v.(*eventsapi.TaskExit) + if e.ContainerID == t.id && e.Pid == t.pid { return e.ExitStatus, nil } } diff --git a/windows/container.go b/windows/container.go index 4f1c1bc5f..6f95fca8c 100644 --- a/windows/container.go +++ b/windows/container.go @@ -7,9 +7,7 @@ import ( "encoding/json" "fmt" "sync" - "time" - events "github.com/containerd/containerd/api/services/events/v1" "github.com/containerd/containerd/log" "github.com/containerd/containerd/runtime" "github.com/containerd/containerd/windows/hcs" @@ -21,9 +19,7 @@ import ( var ErrLoadedContainer = errors.New("loaded container can only be terminated") -type eventCallback func(id string, evType events.RuntimeEvent_EventType, pid, exitStatus uint32, exitedAt time.Time) - -func loadContainers(ctx context.Context, h *hcs.HCS, sendEvent eventCallback) ([]*container, error) { +func loadContainers(ctx context.Context, h *hcs.HCS) ([]*container, error) { hCtr, err := h.LoadContainers(ctx) if err != nil { return nil, err @@ -32,16 +28,15 @@ func loadContainers(ctx context.Context, h *hcs.HCS, sendEvent eventCallback) ([ containers := make([]*container, 0) for _, c := range hCtr { containers = append(containers, &container{ - ctr: c, - status: runtime.RunningStatus, - sendEvent: sendEvent, + ctr: c, + status: runtime.RunningStatus, }) } return containers, nil } -func newContainer(ctx context.Context, h *hcs.HCS, id string, spec *RuntimeSpec, io runtime.IO, sendEvent eventCallback) (*container, error) { +func newContainer(ctx context.Context, h *hcs.HCS, id string, spec *RuntimeSpec, io runtime.IO) (*container, error) { cio, err := hcs.NewIO(io.Stdin, io.Stdout, io.Stderr, io.Terminal) if err != nil { return nil, err @@ -51,21 +46,19 @@ func newContainer(ctx context.Context, h *hcs.HCS, id string, spec *RuntimeSpec, if err != nil { return nil, err } - sendEvent(id, events.RuntimeEvent_CREATE, hcsCtr.Pid(), 0, time.Time{}) + //sendEvent(id, events.RuntimeEvent_CREATE, hcsCtr.Pid(), 0, time.Time{}) return &container{ - ctr: hcsCtr, - status: runtime.CreatedStatus, - sendEvent: sendEvent, + ctr: hcsCtr, + status: runtime.CreatedStatus, }, nil } type container struct { sync.Mutex - ctr *hcs.Container - status runtime.Status - sendEvent eventCallback + ctr *hcs.Container + status runtime.Status } func (c *container) ID() string { @@ -90,16 +83,16 @@ func (c *container) Start(ctx context.Context) error { } c.setStatus(runtime.RunningStatus) - c.sendEvent(c.ctr.ID(), events.RuntimeEvent_START, c.ctr.Pid(), 0, time.Time{}) + // c.sendEvent(c.ctr.ID(), events.RuntimeEvent_START, c.ctr.Pid(), 0, time.Time{}) // Wait for our process to terminate go func() { - ec, err := c.ctr.ExitCode() + _, err := c.ctr.ExitCode() if err != nil { log.G(ctx).Debug(err) } c.setStatus(runtime.StoppedStatus) - c.sendEvent(c.ctr.ID(), events.RuntimeEvent_EXIT, c.ctr.Pid(), ec, c.ctr.Processes()[0].ExitedAt()) + // c.sendEvent(c.ctr.ID(), events.RuntimeEvent_EXIT, c.ctr.Pid(), ec, c.ctr.Processes()[0].ExitedAt()) }() return nil @@ -163,11 +156,11 @@ func (c *container) Exec(ctx context.Context, id string, opts runtime.ExecOpts) } go func() { - ec, err := p.ExitCode() + _, err := p.ExitCode() if err != nil { log.G(ctx).Debug(err) } - c.sendEvent(c.ctr.ID(), events.RuntimeEvent_EXEC_ADDED, p.Pid(), ec, p.ExitedAt()) + //c.sendEvent(c.ctr.ID(), events.RuntimeEvent_EXEC_ADDED, p.Pid(), ec, p.ExitedAt()) }() return &process{p}, nil diff --git a/windows/runtime.go b/windows/runtime.go index 675513a55..42ffc883b 100644 --- a/windows/runtime.go +++ b/windows/runtime.go @@ -8,9 +8,7 @@ import ( "os" "path/filepath" "sync" - "time" - events "github.com/containerd/containerd/api/services/events/v1" "github.com/containerd/containerd/log" "github.com/containerd/containerd/plugin" "github.com/containerd/containerd/runtime" @@ -47,7 +45,7 @@ func New(ic *plugin.InitContext) (interface{}, error) { r := &Runtime{ pidPool: pid.NewPool(), containers: make(map[string]*container), - events: make(chan *events.RuntimeEvent, 2048), + events: make(chan interface{}, 2048), eventsContext: c, eventsCancel: cancel, rootDir: rootDir, @@ -56,14 +54,14 @@ func New(ic *plugin.InitContext) (interface{}, error) { // Terminate all previous container that we may have started. We don't // support restoring containers - ctrs, err := loadContainers(ic.Context, r.hcs, r.sendEvent) + ctrs, err := loadContainers(ic.Context, r.hcs) if err != nil { return nil, err } for _, c := range ctrs { c.ctr.Delete(ic.Context) - r.sendEvent(c.ctr.ID(), events.RuntimeEvent_EXIT, c.ctr.Pid(), 255, time.Time{}) + //r.sendEvent(c.ctr.ID(), events.RuntimeEvent_EXIT, c.ctr.Pid(), 255, time.Time{}) } // Try to delete the old state dir and recreate it @@ -90,7 +88,7 @@ type Runtime struct { containers map[string]*container - events chan *events.RuntimeEvent + events chan interface{} eventsContext context.Context eventsCancel func() } @@ -113,7 +111,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts return nil, err } rtSpec := v.(*RuntimeSpec) - ctr, err := newContainer(ctx, r.hcs, id, rtSpec, opts.IO, r.sendEvent) + ctr, err := newContainer(ctx, r.hcs, id, rtSpec, opts.IO) if err != nil { return nil, err } @@ -171,14 +169,3 @@ func (r *Runtime) Get(ctx context.Context, id string) (runtime.Task, error) { } return c, nil } - -func (r *Runtime) sendEvent(id string, evType events.RuntimeEvent_EventType, pid, exitStatus uint32, exitedAt time.Time) { - r.events <- &events.RuntimeEvent{ - Timestamp: time.Now(), - Type: evType, - Pid: pid, - ID: id, - ExitStatus: exitStatus, - ExitedAt: exitedAt, - } -}