Merge pull request #739 from crosbymichael/exitedat

Add exited at to events and delete requests
This commit is contained in:
Stephen Day 2017-04-14 13:10:53 -07:00 committed by GitHub
commit bbeaab5ee3
18 changed files with 383 additions and 215 deletions

View File

@ -34,12 +34,17 @@ import google_protobuf1 "github.com/gogo/protobuf/types"
import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/gogo/protobuf/gogoproto"
import containerd_v1_types "github.com/containerd/containerd/api/types/mount" import containerd_v1_types "github.com/containerd/containerd/api/types/mount"
import containerd_v1_types1 "github.com/containerd/containerd/api/types/container" import containerd_v1_types1 "github.com/containerd/containerd/api/types/container"
import _ "github.com/gogo/protobuf/types"
import time "time"
import ( import (
context "golang.org/x/net/context" context "golang.org/x/net/context"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
) )
import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
import strings "strings" import strings "strings"
import reflect "reflect" import reflect "reflect"
@ -49,6 +54,7 @@ import io "io"
var _ = proto.Marshal var _ = proto.Marshal
var _ = fmt.Errorf var _ = fmt.Errorf
var _ = math.Inf var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
@ -97,8 +103,9 @@ func (*DeleteRequest) ProtoMessage() {}
func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{3} } func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{3} }
type DeleteResponse struct { type DeleteResponse struct {
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
ExitStatus uint32 `protobuf:"varint,2,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` ExitStatus uint32 `protobuf:"varint,2,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
ExitedAt time.Time `protobuf:"bytes,3,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"`
} }
func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } func (m *DeleteResponse) Reset() { *m = DeleteResponse{} }
@ -783,6 +790,14 @@ func (m *DeleteResponse) MarshalTo(dAtA []byte) (int, error) {
i++ i++
i = encodeVarintExecution(dAtA, i, uint64(m.ExitStatus)) i = encodeVarintExecution(dAtA, i, uint64(m.ExitStatus))
} }
dAtA[i] = 0x1a
i++
i = encodeVarintExecution(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 return i, nil
} }
@ -968,11 +983,11 @@ func (m *ExecRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x32 dAtA[i] = 0x32
i++ i++
i = encodeVarintExecution(dAtA, i, uint64(m.Spec.Size())) i = encodeVarintExecution(dAtA, i, uint64(m.Spec.Size()))
n2, err := m.Spec.MarshalTo(dAtA[i:]) n3, err := m.Spec.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n2 i += n3
} }
return i, nil return i, nil
} }
@ -1177,6 +1192,8 @@ func (m *DeleteResponse) Size() (n int) {
if m.ExitStatus != 0 { if m.ExitStatus != 0 {
n += 1 + sovExecution(uint64(m.ExitStatus)) n += 1 + sovExecution(uint64(m.ExitStatus))
} }
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
n += 1 + l + sovExecution(uint64(l))
return n return n
} }
@ -1368,6 +1385,7 @@ func (this *DeleteResponse) String() string {
s := strings.Join([]string{`&DeleteResponse{`, s := strings.Join([]string{`&DeleteResponse{`,
`ID:` + fmt.Sprintf("%v", this.ID) + `,`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`,
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`,
`}`, `}`,
}, "") }, "")
return s return s
@ -2091,6 +2109,36 @@ func (m *DeleteResponse) Unmarshal(dAtA []byte) error {
break break
} }
} }
case 3:
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 ErrIntOverflowExecution
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthExecution
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipExecution(dAtA[iNdEx:]) skippy, err := skipExecution(dAtA[iNdEx:])
@ -3122,53 +3170,56 @@ func init() {
} }
var fileDescriptorExecution = []byte{ var fileDescriptorExecution = []byte{
// 763 bytes of a gzipped FileDescriptorProto // 814 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4f, 0x6f, 0xd3, 0x4a, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcf, 0x6f, 0xe2, 0x46,
0x10, 0xaf, 0xf3, 0xc7, 0xed, 0x9b, 0x34, 0x7d, 0x7d, 0xab, 0x2a, 0xf2, 0x33, 0x52, 0x1a, 0x99, 0x14, 0x8e, 0xf9, 0xe1, 0x90, 0x47, 0x48, 0xd3, 0x51, 0x84, 0x5c, 0x57, 0x02, 0xe4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, 0x68, 0x0f, 0x4f, 0x8d, 0xad, 0xb7, 0x4f, 0x8d, 0xad, 0x7f, 0xe6, 0x0d,
0xe5, 0x61, 0xde, 0x50, 0xde, 0xcc, 0x1b, 0xca, 0xfb, 0x79, 0x43, 0xb9, 0x51, 0xa3, 0xce, 0xef,
0x3f, 0x04, 0x00, 0x00, 0xff, 0xff, 0x74, 0xa6, 0x26, 0x26, 0x22, 0x09, 0x00, 0x00,
} }

View File

@ -7,6 +7,7 @@ import "google/protobuf/any.proto";
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";
import "github.com/containerd/containerd/api/types/mount/mount.proto"; import "github.com/containerd/containerd/api/types/mount/mount.proto";
import "github.com/containerd/containerd/api/types/container/container.proto"; import "github.com/containerd/containerd/api/types/container/container.proto";
import "google/protobuf/timestamp.proto";
service ContainerService { service ContainerService {
rpc Create(CreateRequest) returns (CreateResponse); rpc Create(CreateRequest) returns (CreateResponse);
@ -48,6 +49,7 @@ message DeleteRequest {
message DeleteResponse { message DeleteResponse {
string id = 1 [(gogoproto.customname) = "ID"]; string id = 1 [(gogoproto.customname) = "ID"];
uint32 exit_status = 2; uint32 exit_status = 2;
google.protobuf.Timestamp exited_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
} }
message InfoRequest { message InfoRequest {

View File

@ -37,12 +37,17 @@ import google_protobuf1 "github.com/golang/protobuf/ptypes/empty"
import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/gogo/protobuf/gogoproto"
import containerd_v1_types "github.com/containerd/containerd/api/types/mount" import containerd_v1_types "github.com/containerd/containerd/api/types/mount"
import containerd_v1_types1 "github.com/containerd/containerd/api/types/container" import containerd_v1_types1 "github.com/containerd/containerd/api/types/container"
import _ "github.com/gogo/protobuf/types"
import time "time"
import ( import (
context "golang.org/x/net/context" context "golang.org/x/net/context"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
) )
import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
import strings "strings" import strings "strings"
import reflect "reflect" import reflect "reflect"
@ -52,6 +57,7 @@ import io "io"
var _ = proto.Marshal var _ = proto.Marshal
var _ = fmt.Errorf var _ = fmt.Errorf
var _ = math.Inf var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
@ -99,7 +105,8 @@ func (*DeleteRequest) ProtoMessage() {}
func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{3} } func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{3} }
type DeleteResponse struct { type DeleteResponse struct {
ExitStatus uint32 `protobuf:"varint,1,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` ExitStatus uint32 `protobuf:"varint,1,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
ExitedAt time.Time `protobuf:"bytes,2,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"`
} }
func (m *DeleteResponse) Reset() { *m = DeleteResponse{} } func (m *DeleteResponse) Reset() { *m = DeleteResponse{} }
@ -242,34 +249,17 @@ const _ = grpc.SupportPackageIsVersion4
// Client API for Shim service // Client API for Shim service
type ShimClient interface { type ShimClient interface {
// container rpcs
// Create will create the container within the runtime. At this point in time the container
// should be created along with its resources without its user defined process being started
Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
// Start executes the user defined process of the container
Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
// Delete removes the container and its resources from the runtime after it has been stopped
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
// State returns the state of the container that the shim owns and its additional processes
State(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) State(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error)
// Pause pauses the container
Pause(ctx context.Context, in *PauseRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Pause(ctx context.Context, in *PauseRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
// Resume resumes a paused container back into a running state
Resume(ctx context.Context, in *ResumeRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Resume(ctx context.Context, in *ResumeRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
// shim rpcs
// Exit causes the shim to reap all remaining processes and exit
Exit(ctx context.Context, in *ExitRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Exit(ctx context.Context, in *ExitRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
// Events returns all events for the container owned by the shim including
// additional processes being added and removed and state changes
Events(ctx context.Context, in *EventsRequest, opts ...grpc.CallOption) (Shim_EventsClient, error) Events(ctx context.Context, in *EventsRequest, opts ...grpc.CallOption) (Shim_EventsClient, error)
// process rpcs
// Kill kills a container process owned by the shim
Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
// Exec adds and additional process to the container
Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error) Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error)
// Pty handles resizing the pty/console for a container
Pty(ctx context.Context, in *PtyRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) Pty(ctx context.Context, in *PtyRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
// CloseStdin closes the STDIN for a process that is owned by the shim
CloseStdin(ctx context.Context, in *CloseStdinRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) CloseStdin(ctx context.Context, in *CloseStdinRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
} }
@ -415,34 +405,17 @@ func (c *shimClient) CloseStdin(ctx context.Context, in *CloseStdinRequest, opts
// Server API for Shim service // Server API for Shim service
type ShimServer interface { type ShimServer interface {
// container rpcs
// Create will create the container within the runtime. At this point in time the container
// should be created along with its resources without its user defined process being started
Create(context.Context, *CreateRequest) (*CreateResponse, error) Create(context.Context, *CreateRequest) (*CreateResponse, error)
// Start executes the user defined process of the container
Start(context.Context, *StartRequest) (*google_protobuf1.Empty, error) Start(context.Context, *StartRequest) (*google_protobuf1.Empty, error)
// Delete removes the container and its resources from the runtime after it has been stopped
Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
// State returns the state of the container that the shim owns and its additional processes
State(context.Context, *StateRequest) (*StateResponse, error) State(context.Context, *StateRequest) (*StateResponse, error)
// Pause pauses the container
Pause(context.Context, *PauseRequest) (*google_protobuf1.Empty, error) Pause(context.Context, *PauseRequest) (*google_protobuf1.Empty, error)
// Resume resumes a paused container back into a running state
Resume(context.Context, *ResumeRequest) (*google_protobuf1.Empty, error) Resume(context.Context, *ResumeRequest) (*google_protobuf1.Empty, error)
// shim rpcs
// Exit causes the shim to reap all remaining processes and exit
Exit(context.Context, *ExitRequest) (*google_protobuf1.Empty, error) Exit(context.Context, *ExitRequest) (*google_protobuf1.Empty, error)
// Events returns all events for the container owned by the shim including
// additional processes being added and removed and state changes
Events(*EventsRequest, Shim_EventsServer) error Events(*EventsRequest, Shim_EventsServer) error
// process rpcs
// Kill kills a container process owned by the shim
Kill(context.Context, *KillRequest) (*google_protobuf1.Empty, error) Kill(context.Context, *KillRequest) (*google_protobuf1.Empty, error)
// Exec adds and additional process to the container
Exec(context.Context, *ExecRequest) (*ExecResponse, error) Exec(context.Context, *ExecRequest) (*ExecResponse, error)
// Pty handles resizing the pty/console for a container
Pty(context.Context, *PtyRequest) (*google_protobuf1.Empty, error) Pty(context.Context, *PtyRequest) (*google_protobuf1.Empty, error)
// CloseStdin closes the STDIN for a process that is owned by the shim
CloseStdin(context.Context, *CloseStdinRequest) (*google_protobuf1.Empty, error) CloseStdin(context.Context, *CloseStdinRequest) (*google_protobuf1.Empty, error)
} }
@ -898,6 +871,14 @@ func (m *DeleteResponse) MarshalTo(dAtA []byte) (int, error) {
i++ i++
i = encodeVarintShim(dAtA, i, uint64(m.ExitStatus)) i = encodeVarintShim(dAtA, i, uint64(m.ExitStatus))
} }
dAtA[i] = 0x12
i++
i = encodeVarintShim(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)))
n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n1
return i, nil return i, nil
} }
@ -948,11 +929,11 @@ func (m *ExecRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x2a dAtA[i] = 0x2a
i++ i++
i = encodeVarintShim(dAtA, i, uint64(m.Spec.Size())) i = encodeVarintShim(dAtA, i, uint64(m.Spec.Size()))
n1, err := m.Spec.MarshalTo(dAtA[i:]) n2, err := m.Spec.MarshalTo(dAtA[i:])
if err != nil { if err != nil {
return 0, err return 0, err
} }
i += n1 i += n2
} }
return i, nil return i, nil
} }
@ -1349,6 +1330,8 @@ func (m *DeleteResponse) Size() (n int) {
if m.ExitStatus != 0 { if m.ExitStatus != 0 {
n += 1 + sovShim(uint64(m.ExitStatus)) n += 1 + sovShim(uint64(m.ExitStatus))
} }
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
n += 1 + l + sovShim(uint64(l))
return n return n
} }
@ -1563,6 +1546,7 @@ func (this *DeleteResponse) String() string {
} }
s := strings.Join([]string{`&DeleteResponse{`, s := strings.Join([]string{`&DeleteResponse{`,
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf3.Timestamp", 1), `&`, ``, 1) + `,`,
`}`, `}`,
}, "") }, "")
return s return s
@ -2235,6 +2219,36 @@ func (m *DeleteResponse) Unmarshal(dAtA []byte) error {
break break
} }
} }
case 2:
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 ErrIntOverflowShim
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthShim
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipShim(dAtA[iNdEx:]) skippy, err := skipShim(dAtA[iNdEx:])
@ -3453,60 +3467,63 @@ func init() {
} }
var fileDescriptorShim = []byte{ var fileDescriptorShim = []byte{
// 871 bytes of a gzipped FileDescriptorProto // 913 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcd, 0x6e, 0xdb, 0x46, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4f, 0x6f, 0xe3, 0x44,
0x10, 0x0e, 0x25, 0x99, 0x96, 0x47, 0xa1, 0xd3, 0x2e, 0x0c, 0x83, 0xa1, 0x0b, 0xc5, 0x25, 0x50, 0x14, 0xaf, 0x93, 0xd4, 0x4d, 0x5f, 0xd6, 0x5d, 0x18, 0x55, 0x95, 0x37, 0x45, 0x49, 0xb1, 0x84,
0x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90, 0x91, 0xbf, 0x7e,
0x1a, 0x40, 0xbc, 0xb9, 0x09, 0x00, 0x00, 0xe0, 0x6e, 0x4f, 0x7c, 0x5d, 0xd4, 0x13, 0xf7, 0xe6, 0x5d, 0x6f, 0xeb, 0xef, 0x77, 0xbd, 0xad,
0x5f, 0x17, 0x3d, 0xeb, 0x66, 0xd1, 0xb3, 0xfe, 0x5a, 0xf4, 0xac, 0x7f, 0x17, 0x3d, 0xeb, 0xd2,
0x56, 0x9e, 0xcf, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x4c, 0x79, 0x60, 0xe3, 0x1d, 0x0a, 0x00,
0x00,
} }

View File

@ -7,6 +7,7 @@ import "google/protobuf/empty.proto";
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";
import "github.com/containerd/containerd/api/types/mount/mount.proto"; import "github.com/containerd/containerd/api/types/mount/mount.proto";
import "github.com/containerd/containerd/api/types/container/container.proto"; import "github.com/containerd/containerd/api/types/container/container.proto";
import "google/protobuf/timestamp.proto";
// Shim service is launched for each container and is responsible for owning the IO // Shim service is launched for each container and is responsible for owning the IO
// for the container and its additional processes. The shim is also the parent of // for the container and its additional processes. The shim is also the parent of
@ -53,6 +54,7 @@ message DeleteRequest {
message DeleteResponse { message DeleteResponse {
uint32 exit_status = 1; uint32 exit_status = 1;
google.protobuf.Timestamp exited_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
} }
message ExecRequest { message ExecRequest {

View File

@ -20,6 +20,11 @@ import proto "github.com/gogo/protobuf/proto"
import fmt "fmt" import fmt "fmt"
import math "math" import math "math"
import _ "github.com/gogo/protobuf/gogoproto" 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 strings "strings"
import reflect "reflect" import reflect "reflect"
@ -30,6 +35,7 @@ import io "io"
var _ = proto.Marshal var _ = proto.Marshal
var _ = fmt.Errorf var _ = fmt.Errorf
var _ = math.Inf var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
@ -140,6 +146,7 @@ type Event struct {
Type Event_EventType `protobuf:"varint,2,opt,name=type,proto3,enum=containerd.v1.types.Event_EventType" json:"type,omitempty"` Type Event_EventType `protobuf:"varint,2,opt,name=type,proto3,enum=containerd.v1.types.Event_EventType" json:"type,omitempty"`
Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,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"` 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 *Event) Reset() { *m = Event{} } func (m *Event) Reset() { *m = Event{} }
@ -358,6 +365,14 @@ func (m *Event) MarshalTo(dAtA []byte) (int, error) {
i++ i++
i = encodeVarintContainer(dAtA, i, uint64(m.ExitStatus)) i = encodeVarintContainer(dAtA, i, uint64(m.ExitStatus))
} }
dAtA[i] = 0x2a
i++
i = encodeVarintContainer(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)))
n4, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n4
return i, nil return i, nil
} }
@ -477,6 +492,8 @@ func (m *Event) Size() (n int) {
if m.ExitStatus != 0 { if m.ExitStatus != 0 {
n += 1 + sovContainer(uint64(m.ExitStatus)) n += 1 + sovContainer(uint64(m.ExitStatus))
} }
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
n += 1 + l + sovContainer(uint64(l))
return n return n
} }
@ -543,6 +560,7 @@ func (this *Event) String() string {
`Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`,
`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`,
`}`, `}`,
}, "") }, "")
return s return s
@ -1184,6 +1202,36 @@ func (m *Event) Unmarshal(dAtA []byte) error {
break 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 ErrIntOverflowContainer
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthContainer
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipContainer(dAtA[iNdEx:]) skippy, err := skipContainer(dAtA[iNdEx:])
@ -1315,38 +1363,41 @@ func init() {
} }
var fileDescriptorContainer = []byte{ var fileDescriptorContainer = []byte{
// 516 bytes of a gzipped FileDescriptorProto // 576 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x41, 0x8b, 0xd3, 0x5c, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x6d, 0xe2, 0xeb, 0x2a, 0xee, 0x02, 0xb8, 0x27, 0xee, 0xe1,
0x7e, 0x67, 0xd6, 0xbe, 0x6e, 0x4c, 0x74, 0xbb, 0x31, 0xd1, 0xb7, 0x8d, 0x89, 0x7e, 0x6d, 0x4c, 0xd2, 0x76, 0x1c, 0xd7, 0xd1, 0x35, 0x21, 0x9b, 0xd9, 0x8b, 0xb9, 0xeb, 0xe8, 0xf5, 0x27, 0x2f,
0x74, 0xa9, 0xcb, 0x9f, 0xe0, 0xf4, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x79, 0x66, 0x96, 0xba, 0xa0, 0xb1, 0xcd, 0xd7, 0x81, 0xe6, 0xc2, 0x7b, 0xe9, 0x4d, 0xdf, 0x78, 0x7a, 0x4d, 0x90, 0xd2,
0x77, 0x03, 0x00, 0x00, 0xc9, 0xd1, 0x91, 0x20, 0x64, 0xe1, 0x79, 0xc7, 0xde, 0x91, 0xae, 0x08, 0x32, 0xf7, 0xa7, 0xb3,
0x99, 0xeb, 0xe8, 0xea, 0x2d, 0x27, 0xed, 0xc0, 0xb8, 0xbc, 0xee, 0xd7, 0xbe, 0x5d, 0xf7, 0x6b,
0x9f, 0x36, 0x7d, 0x74, 0xb9, 0xe9, 0xa3, 0xaf, 0x9b, 0x3e, 0xfa, 0xb1, 0xe9, 0xa3, 0xd3, 0x86,
0xac, 0xb7, 0xff, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xa6, 0xfb, 0xbb, 0xac, 0xdb, 0x03, 0x00, 0x00,
} }

View File

@ -3,6 +3,7 @@ syntax = "proto3";
package containerd.v1.types; package containerd.v1.types;
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
enum Status { enum Status {
UNKNOWN = 0; UNKNOWN = 0;
@ -50,4 +51,5 @@ message Event {
EventType type = 2; EventType type = 2;
uint32 pid = 3; uint32 pid = 3;
uint32 exit_status = 4; uint32 exit_status = 4;
google.protobuf.Timestamp exited_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
} }

View File

@ -38,4 +38,5 @@ type Event struct {
ID string ID string
Pid uint32 Pid uint32
ExitStatus uint32 ExitStatus uint32
ExitedAt time.Time
} }

View File

@ -120,22 +120,25 @@ func (r *Runtime) Create(ctx context.Context, id string, opts containerd.CreateO
return c, nil return c, nil
} }
func (r *Runtime) Delete(ctx context.Context, c containerd.Container) (uint32, error) { func (r *Runtime) Delete(ctx context.Context, c containerd.Container) (*containerd.Exit, error) {
lc, ok := c.(*Container) lc, ok := c.(*Container)
if !ok { if !ok {
return 0, fmt.Errorf("container cannot be cast as *linux.Container") return nil, fmt.Errorf("container cannot be cast as *linux.Container")
} }
// remove the container from the monitor // remove the container from the monitor
if err := r.monitor.Stop(lc); err != nil { if err := r.monitor.Stop(lc); err != nil {
// TODO: log error here // TODO: log error here
return 0, err return nil, err
} }
rsp, err := lc.shim.Delete(ctx, &shim.DeleteRequest{}) rsp, err := lc.shim.Delete(ctx, &shim.DeleteRequest{})
if err != nil { if err != nil {
return 0, err return nil, err
} }
lc.shim.Exit(ctx, &shim.ExitRequest{}) lc.shim.Exit(ctx, &shim.ExitRequest{})
return rsp.ExitStatus, r.deleteBundle(lc.id) return &containerd.Exit{
Status: rsp.ExitStatus,
Timestamp: rsp.ExitedAt,
}, r.deleteBundle(lc.id)
} }
func (r *Runtime) Containers(ctx context.Context) ([]containerd.Container, error) { func (r *Runtime) Containers(ctx context.Context) ([]containerd.Container, error) {
@ -204,6 +207,7 @@ func (r *Runtime) forward(events shim.Shim_EventsClient) {
Pid: e.Pid, Pid: e.Pid,
ID: e.ID, ID: e.ID,
ExitStatus: e.ExitStatus, ExitStatus: e.ExitStatus,
ExitedAt: e.ExitedAt,
} }
} }
} }

View File

@ -11,6 +11,7 @@ import (
"path/filepath" "path/filepath"
"sync" "sync"
"syscall" "syscall"
"time"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
@ -28,6 +29,7 @@ type execProcess struct {
console console.Console console console.Console
io runc.IO io runc.IO
status int status int
exited time.Time
pid int pid int
closers []io.Closer closers []io.Closer
stdin io.Closer stdin io.Closer
@ -125,8 +127,13 @@ func (e *execProcess) Status() int {
return e.status return e.status
} }
func (e *execProcess) ExitedAt() time.Time {
return e.exited
}
func (e *execProcess) Exited(status int) { func (e *execProcess) Exited(status int) {
e.status = status e.status = status
e.exited = time.Now()
e.Wait() e.Wait()
if e.io != nil { if e.io != nil {
for _, c := range e.closers { for _, c := range e.closers {

View File

@ -9,6 +9,7 @@ import (
"path/filepath" "path/filepath"
"sync" "sync"
"syscall" "syscall"
"time"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
@ -28,6 +29,7 @@ type initProcess struct {
io runc.IO io runc.IO
runc *runc.Runc runc *runc.Runc
status int status int
exited time.Time
pid int pid int
closers []io.Closer closers []io.Closer
stdin io.Closer stdin io.Closer
@ -121,6 +123,10 @@ func (p *initProcess) Status() int {
return p.status return p.status
} }
func (p *initProcess) ExitedAt() time.Time {
return p.exited
}
// ContainerStatus return the state of the container (created, running, paused, stopped) // ContainerStatus return the state of the container (created, running, paused, stopped)
func (p *initProcess) ContainerStatus(ctx context.Context) (string, error) { func (p *initProcess) ContainerStatus(ctx context.Context) (string, error) {
c, err := p.runc.State(ctx, p.id) c, err := p.runc.State(ctx, p.id)
@ -136,6 +142,7 @@ func (p *initProcess) Start(context context.Context) error {
func (p *initProcess) Exited(status int) { func (p *initProcess) Exited(status int) {
p.status = status p.status = status
p.exited = time.Now()
} }
func (p *initProcess) Delete(context context.Context) error { func (p *initProcess) Delete(context context.Context) error {

View File

@ -5,6 +5,7 @@ package shim
import ( import (
"context" "context"
"io" "io"
"time"
"github.com/crosbymichael/console" "github.com/crosbymichael/console"
) )
@ -18,6 +19,8 @@ type process interface {
Exited(status int) Exited(status int)
// Status returns the exit status // Status returns the exit status
Status() int Status() int
// ExitedAt is the time the process exited
ExitedAt() time.Time
// Delete deletes the process and its resourcess // Delete deletes the process and its resourcess
Delete(context.Context) error Delete(context.Context) error
// Signal directly signals the process // Signal directly signals the process

View File

@ -94,6 +94,7 @@ func (s *Service) Delete(ctx context.Context, r *shimapi.DeleteRequest) (*shimap
s.mu.Unlock() s.mu.Unlock()
return &shimapi.DeleteResponse{ return &shimapi.DeleteResponse{
ExitStatus: uint32(p.Status()), ExitStatus: uint32(p.Status()),
ExitedAt: p.ExitedAt(),
}, nil }, nil
} }
@ -253,5 +254,6 @@ func (s *Service) waitExit(p process, pid int, cmd *reaper.Cmd) {
ID: s.id, ID: s.id,
Pid: uint32(pid), Pid: uint32(pid),
ExitStatus: uint32(status), ExitStatus: uint32(status),
ExitedAt: p.ExitedAt(),
} }
} }

View File

@ -1,6 +1,10 @@
package containerd package containerd
import "golang.org/x/net/context" import (
"time"
"golang.org/x/net/context"
)
type IO struct { type IO struct {
Stdin string Stdin string
@ -18,6 +22,11 @@ type CreateOpts struct {
IO IO IO IO
} }
type Exit struct {
Status uint32
Timestamp time.Time
}
// Runtime is responsible for the creation of containers for a certain platform, // Runtime is responsible for the creation of containers for a certain platform,
// arch, or custom usage. // arch, or custom usage.
type Runtime interface { type Runtime interface {
@ -26,7 +35,7 @@ type Runtime interface {
// Containers returns all the current containers for the runtime // Containers returns all the current containers for the runtime
Containers(context.Context) ([]Container, error) Containers(context.Context) ([]Container, error)
// Delete removes the container in the runtime // Delete removes the container in the runtime
Delete(context.Context, Container) (uint32, error) Delete(context.Context, Container) (*Exit, error)
// Events returns events for the runtime and all containers created by the runtime // Events returns events for the runtime and all containers created by the runtime
Events(context.Context) <-chan *Event Events(context.Context) <-chan *Event
} }

View File

@ -127,14 +127,17 @@ func (s *Service) Delete(ctx context.Context, r *api.DeleteRequest) (*api.Delete
if err != nil { if err != nil {
return nil, err return nil, err
} }
status, err := runtime.Delete(ctx, c) exit, err := runtime.Delete(ctx, c)
if err != nil { if err != nil {
return nil, err return nil, err
} }
delete(s.containers, r.ID) delete(s.containers, r.ID)
return &api.DeleteResponse{ExitStatus: status}, nil return &api.DeleteResponse{
ExitStatus: exit.Status,
ExitedAt: exit.Timestamp,
}, nil
} }
func containerFromContainerd(ctx context.Context, c containerd.Container) (*container.Container, error) { func containerFromContainerd(ctx context.Context, c containerd.Container) (*container.Container, error) {

View File

@ -5,6 +5,7 @@ package windows
import ( import (
"encoding/json" "encoding/json"
"sync" "sync"
"time"
"github.com/containerd/containerd" "github.com/containerd/containerd"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
@ -19,7 +20,7 @@ var (
ErrLoadedContainer = errors.New("loaded container can only be terminated") ErrLoadedContainer = errors.New("loaded container can only be terminated")
) )
type eventCallback func(id string, evType containerd.EventType, pid, exitStatus uint32) type eventCallback func(id string, evType containerd.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, sendEvent eventCallback) ([]*container, error) {
hCtr, err := h.LoadContainers(ctx) hCtr, err := h.LoadContainers(ctx)
@ -49,7 +50,7 @@ func newContainer(ctx context.Context, h *hcs.HCS, id string, spec RuntimeSpec,
if err != nil { if err != nil {
return nil, err return nil, err
} }
sendEvent(id, containerd.CreateEvent, hcsCtr.Pid(), 0) sendEvent(id, containerd.CreateEvent, hcsCtr.Pid(), 0, time.Time{})
return &container{ return &container{
ctr: hcsCtr, ctr: hcsCtr,
@ -85,7 +86,7 @@ func (c *container) Start(ctx context.Context) error {
} }
c.setStatus(containerd.RunningStatus) c.setStatus(containerd.RunningStatus)
c.sendEvent(c.ctr.ID(), containerd.StartEvent, c.ctr.Pid(), 0) c.sendEvent(c.ctr.ID(), containerd.StartEvent, c.ctr.Pid(), 0, time.Time{})
// Wait for our process to terminate // Wait for our process to terminate
go func() { go func() {
@ -94,7 +95,7 @@ func (c *container) Start(ctx context.Context) error {
log.G(ctx).Debug(err) log.G(ctx).Debug(err)
} }
c.setStatus(containerd.StoppedStatus) c.setStatus(containerd.StoppedStatus)
c.sendEvent(c.ctr.ID(), containerd.ExitEvent, c.ctr.Pid(), ec) c.sendEvent(c.ctr.ID(), containerd.ExitEvent, c.ctr.Pid(), ec, c.ctr.Processes()[0].ExitedAt())
}() }()
return nil return nil
@ -136,7 +137,7 @@ func (c *container) Exec(ctx context.Context, opts containerd.ExecOpts) (contain
if err != nil { if err != nil {
log.G(ctx).Debug(err) log.G(ctx).Debug(err)
} }
c.sendEvent(c.ctr.ID(), containerd.ExitEvent, p.Pid(), ec) c.sendEvent(c.ctr.ID(), containerd.ExitEvent, p.Pid(), ec, p.ExitedAt())
}() }()
return &process{p}, nil return &process{p}, nil

View File

@ -167,6 +167,10 @@ func (c *Container) Pid() uint32 {
return c.pid return c.pid
} }
func (c *Container) Processes() []*Process {
return c.processes
}
func (c *Container) Start(ctx context.Context) error { func (c *Container) Start(ctx context.Context) error {
_, err := c.addProcess(ctx, c.spec.Process, c.io) _, err := c.addProcess(ctx, c.spec.Process, c.io)
return err return err

View File

@ -4,6 +4,7 @@ package hcs
import ( import (
"syscall" "syscall"
"time"
"github.com/Microsoft/hcsshim" "github.com/Microsoft/hcsshim"
"github.com/containerd/containerd" "github.com/containerd/containerd"
@ -13,11 +14,12 @@ import (
type Process struct { type Process struct {
hcsshim.Process hcsshim.Process
pid uint32 pid uint32
io *IO io *IO
ec uint32 ec uint32
ecErr error exitedAt time.Time
ecSync chan struct{} ecErr error
ecSync chan struct{}
} }
func (p *Process) Pid() uint32 { func (p *Process) Pid() uint32 {
@ -29,6 +31,10 @@ func (p *Process) ExitCode() (uint32, error) {
return p.ec, p.ecErr return p.ec, p.ecErr
} }
func (p *Process) ExitedAt() time.Time {
return p.exitedAt
}
func (p *Process) Status() containerd.Status { func (p *Process) Status() containerd.Status {
select { select {
case <-p.ecSync: case <-p.ecSync:
@ -60,6 +66,6 @@ func processExitCode(containerID string, p *Process) (uint32, error) {
// Well, unknown exit code it is // Well, unknown exit code it is
ec = 255 ec = 255
} }
p.exitedAt = time.Now()
return uint32(ec), err return uint32(ec), err
} }

View File

@ -53,20 +53,16 @@ func New(ic *plugin.InitContext) (interface{}, error) {
hcs: hcs.New(owner, rootDir), hcs: hcs.New(owner, rootDir),
} }
sendEvent := func(id string, evType containerd.EventType, pid, exitStatus uint32) {
r.sendEvent(id, evType, pid, exitStatus)
}
// Terminate all previous container that we may have started. We don't // Terminate all previous container that we may have started. We don't
// support restoring containers // support restoring containers
ctrs, err := loadContainers(ic.Context, r.hcs, sendEvent) ctrs, err := loadContainers(ic.Context, r.hcs, r.sendEvent)
if err != nil { if err != nil {
return nil, err return nil, err
} }
for _, c := range ctrs { for _, c := range ctrs {
c.ctr.Delete(ic.Context) c.ctr.Delete(ic.Context)
r.sendEvent(c.ctr.ID(), containerd.ExitEvent, c.ctr.Pid(), 255) r.sendEvent(c.ctr.ID(), containerd.ExitEvent, c.ctr.Pid(), 255, time.Time{})
} }
// Try to delete the old state dir and recreate it // Try to delete the old state dir and recreate it
@ -112,11 +108,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts containerd.CreateO
return nil, errors.Wrap(err, "failed to unmarshal oci spec") return nil, errors.Wrap(err, "failed to unmarshal oci spec")
} }
sendEvent := func(id string, evType containerd.EventType, pid, exitStatus uint32) { ctr, err := newContainer(ctx, r.hcs, id, rtSpec, opts.IO, r.sendEvent)
r.sendEvent(id, evType, pid, exitStatus)
}
ctr, err := newContainer(ctx, r.hcs, id, rtSpec, opts.IO, sendEvent)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -128,10 +120,10 @@ func (r *Runtime) Create(ctx context.Context, id string, opts containerd.CreateO
return ctr, nil return ctr, nil
} }
func (r *Runtime) Delete(ctx context.Context, c containerd.Container) (uint32, error) { func (r *Runtime) Delete(ctx context.Context, c containerd.Container) (*containerd.Exit, error) {
wc, ok := c.(*container) wc, ok := c.(*container)
if !ok { if !ok {
return 0, fmt.Errorf("container cannot be cast as *windows.container") return nil, fmt.Errorf("container cannot be cast as *windows.container")
} }
ec, err := wc.ctr.ExitCode() ec, err := wc.ctr.ExitCode()
if err != nil { if err != nil {
@ -144,7 +136,10 @@ func (r *Runtime) Delete(ctx context.Context, c containerd.Container) (uint32, e
delete(r.containers, wc.ctr.ID()) delete(r.containers, wc.ctr.ID())
r.Unlock() r.Unlock()
return ec, err return &containerd.Exit{
Status: ec,
Timestamp: wc.ctr.Processes()[0].ExitedAt(),
}, nil
} }
func (r *Runtime) Containers(ctx context.Context) ([]containerd.Container, error) { func (r *Runtime) Containers(ctx context.Context) ([]containerd.Container, error) {
@ -167,7 +162,7 @@ func (r *Runtime) Events(ctx context.Context) <-chan *containerd.Event {
return r.events return r.events
} }
func (r *Runtime) sendEvent(id string, evType containerd.EventType, pid, exitStatus uint32) { func (r *Runtime) sendEvent(id string, evType containerd.EventType, pid, exitStatus uint32, exitedAt time.Time) {
r.events <- &containerd.Event{ r.events <- &containerd.Event{
Timestamp: time.Now(), Timestamp: time.Now(),
Runtime: runtimeName, Runtime: runtimeName,
@ -175,5 +170,6 @@ func (r *Runtime) sendEvent(id string, evType containerd.EventType, pid, exitSta
Pid: pid, Pid: pid,
ID: id, ID: id,
ExitStatus: exitStatus, ExitStatus: exitStatus,
ExitedAt: exitedAt,
} }
} }