diff --git a/internal/machine/api/pb/docker.pb.go b/internal/machine/api/pb/docker.pb.go index da212270..8cf74da9 100644 --- a/internal/machine/api/pb/docker.pb.go +++ b/internal/machine/api/pb/docker.pb.go @@ -21,6 +21,55 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// ContainerType specifies the purpose of the container being created. +type CreateServiceContainerRequest_ContainerType int32 + +const ( + // SERVICE is the default type for long-running service containers. + CreateServiceContainerRequest_SERVICE CreateServiceContainerRequest_ContainerType = 0 + // PRE_DEPLOY is a one-shot container for a pre-deploy hook to run before service deployment. + CreateServiceContainerRequest_PRE_DEPLOY CreateServiceContainerRequest_ContainerType = 1 +) + +// Enum value maps for CreateServiceContainerRequest_ContainerType. +var ( + CreateServiceContainerRequest_ContainerType_name = map[int32]string{ + 0: "SERVICE", + 1: "PRE_DEPLOY", + } + CreateServiceContainerRequest_ContainerType_value = map[string]int32{ + "SERVICE": 0, + "PRE_DEPLOY": 1, + } +) + +func (x CreateServiceContainerRequest_ContainerType) Enum() *CreateServiceContainerRequest_ContainerType { + p := new(CreateServiceContainerRequest_ContainerType) + *p = x + return p +} + +func (x CreateServiceContainerRequest_ContainerType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CreateServiceContainerRequest_ContainerType) Descriptor() protoreflect.EnumDescriptor { + return file_internal_machine_api_pb_docker_proto_enumTypes[0].Descriptor() +} + +func (CreateServiceContainerRequest_ContainerType) Type() protoreflect.EnumType { + return &file_internal_machine_api_pb_docker_proto_enumTypes[0] +} + +func (x CreateServiceContainerRequest_ContainerType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CreateServiceContainerRequest_ContainerType.Descriptor instead. +func (CreateServiceContainerRequest_ContainerType) EnumDescriptor() ([]byte, []int) { + return file_internal_machine_api_pb_docker_proto_rawDescGZIP(), []int{31, 0} +} + type CreateContainerRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1776,8 +1825,9 @@ type CreateServiceContainerRequest struct { ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` // JSON serialised api.ServiceSpec. - ServiceSpec []byte `protobuf:"bytes,2,opt,name=service_spec,json=serviceSpec,proto3" json:"service_spec,omitempty"` - ContainerName string `protobuf:"bytes,3,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"` + ServiceSpec []byte `protobuf:"bytes,2,opt,name=service_spec,json=serviceSpec,proto3" json:"service_spec,omitempty"` + ContainerName string `protobuf:"bytes,3,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"` + ContainerType CreateServiceContainerRequest_ContainerType `protobuf:"varint,4,opt,name=container_type,json=containerType,proto3,enum=api.CreateServiceContainerRequest_ContainerType" json:"container_type,omitempty"` } func (x *CreateServiceContainerRequest) Reset() { @@ -1833,6 +1883,13 @@ func (x *CreateServiceContainerRequest) GetContainerName() string { return "" } +func (x *CreateServiceContainerRequest) GetContainerType() CreateServiceContainerRequest_ContainerType { + if x != nil { + return x.ContainerType + } + return CreateServiceContainerRequest_SERVICE +} + type ServiceContainer struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2002,6 +2059,8 @@ type MachineServiceContainers struct { Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Containers []*ServiceContainer `protobuf:"bytes,2,rep,name=containers,proto3" json:"containers,omitempty"` + // One-shot containers for deployment hooks (e.g. pre-deploy). + HookContainers []*ServiceContainer `protobuf:"bytes,3,rep,name=hook_containers,json=hookContainers,proto3" json:"hook_containers,omitempty"` } func (x *MachineServiceContainers) Reset() { @@ -2050,6 +2109,13 @@ func (x *MachineServiceContainers) GetContainers() []*ServiceContainer { return nil } +func (x *MachineServiceContainers) GetHookContainers() []*ServiceContainer { + if x != nil { + return x.HookContainers + } + return nil +} + var File_internal_machine_api_pb_docker_proto protoreflect.FileDescriptor var file_internal_machine_api_pb_docker_proto_rawDesc = []byte{ @@ -2204,7 +2270,7 @@ var file_internal_machine_api_pb_docker_proto_rawDesc = []byte{ 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x1d, 0x43, 0x72, + 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x8f, 0x02, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, @@ -2213,123 +2279,136 @@ var file_internal_machine_api_pb_docker_proto_rawDesc = []byte{ 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x10, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, 0x22, 0x57, 0x0a, 0x1c, 0x4c, 0x69, 0x73, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x57, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x22, 0x2c, 0x0a, + 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, + 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x50, + 0x52, 0x45, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x10, 0x01, 0x22, 0x53, 0x0a, 0x10, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, + 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x21, 0x0a, + 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x70, 0x65, 0x63, + 0x22, 0x57, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5a, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x5a, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x61, 0x63, 0x68, - 0x69, 0x6e, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x73, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x7c, - 0x0a, 0x18, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x35, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x32, 0xfb, 0x0a, 0x0a, - 0x06, 0x44, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x10, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, - 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x42, 0x0a, 0x0d, - 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x19, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x49, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1b, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x12, 0x4a, 0x0a, 0x0d, 0x45, 0x78, 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x43, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x08, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0xbc, 0x01, 0x0a, 0x18, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x73, 0x12, 0x29, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x35, 0x0a, + 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x73, 0x12, 0x3e, 0x0a, 0x0f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0e, 0x68, 0x6f, 0x6f, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x73, 0x32, 0xfb, 0x0a, 0x0a, 0x06, 0x44, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x12, + 0x4c, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, - 0x32, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x73, - 0x12, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x30, 0x01, 0x12, 0x36, 0x0a, 0x09, 0x50, 0x75, 0x6c, 0x6c, 0x49, 0x6d, 0x61, 0x67, 0x65, - 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x49, 0x6d, 0x61, 0x67, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x53, - 0x4f, 0x4e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x0c, 0x49, - 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, - 0x65, 0x63, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x55, 0x0a, 0x12, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, - 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, - 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, + 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, + 0x10, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, + 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x12, 0x42, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x6f, 0x70, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x49, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4a, 0x0a, 0x0d, 0x45, + 0x78, 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x19, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x78, + 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x32, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, + 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x30, 0x01, 0x12, 0x36, 0x0a, 0x09, 0x50, + 0x75, 0x6c, 0x6c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, + 0x75, 0x6c, 0x6c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x0c, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, + 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x12, 0x49, 0x6e, 0x73, 0x70, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1e, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x52, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3d, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, - 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x4c, - 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, - 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, - 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x18, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, - 0x5a, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x17, 0x49, - 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, - 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x5e, 0x0a, 0x15, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x16, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x73, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x73, 0x6b, 0x69, 0x2f, 0x75, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, + 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x18, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x73, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x56, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x5a, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x17, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1c, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x12, 0x5e, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x42, 0x37, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x70, 0x73, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x6b, 0x69, 0x2f, 0x75, 0x6e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x6d, 0x61, 0x63, + 0x68, 0x69, 0x6e, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -2344,108 +2423,112 @@ func file_internal_machine_api_pb_docker_proto_rawDescGZIP() []byte { return file_internal_machine_api_pb_docker_proto_rawDescData } +var file_internal_machine_api_pb_docker_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_internal_machine_api_pb_docker_proto_msgTypes = make([]protoimpl.MessageInfo, 36) var file_internal_machine_api_pb_docker_proto_goTypes = []any{ - (*CreateContainerRequest)(nil), // 0: api.CreateContainerRequest - (*CreateContainerResponse)(nil), // 1: api.CreateContainerResponse - (*InspectContainerRequest)(nil), // 2: api.InspectContainerRequest - (*InspectContainerResponse)(nil), // 3: api.InspectContainerResponse - (*StartContainerRequest)(nil), // 4: api.StartContainerRequest - (*StopContainerRequest)(nil), // 5: api.StopContainerRequest - (*ListContainersRequest)(nil), // 6: api.ListContainersRequest - (*ListContainersResponse)(nil), // 7: api.ListContainersResponse - (*MachineContainers)(nil), // 8: api.MachineContainers - (*RemoveContainerRequest)(nil), // 9: api.RemoveContainerRequest - (*ExecContainerRequest)(nil), // 10: api.ExecContainerRequest - (*ExecConfig)(nil), // 11: api.ExecConfig - (*ResizeEvent)(nil), // 12: api.ResizeEvent - (*ExecContainerResponse)(nil), // 13: api.ExecContainerResponse - (*PullImageRequest)(nil), // 14: api.PullImageRequest - (*JSONMessage)(nil), // 15: api.JSONMessage - (*InspectImageRequest)(nil), // 16: api.InspectImageRequest - (*InspectImageResponse)(nil), // 17: api.InspectImageResponse - (*Image)(nil), // 18: api.Image - (*InspectRemoteImageRequest)(nil), // 19: api.InspectRemoteImageRequest - (*InspectRemoteImageResponse)(nil), // 20: api.InspectRemoteImageResponse - (*RemoteImage)(nil), // 21: api.RemoteImage - (*ListImagesRequest)(nil), // 22: api.ListImagesRequest - (*ListImagesResponse)(nil), // 23: api.ListImagesResponse - (*MachineImages)(nil), // 24: api.MachineImages - (*CreateVolumeRequest)(nil), // 25: api.CreateVolumeRequest - (*CreateVolumeResponse)(nil), // 26: api.CreateVolumeResponse - (*ListVolumesRequest)(nil), // 27: api.ListVolumesRequest - (*ListVolumesResponse)(nil), // 28: api.ListVolumesResponse - (*MachineVolumes)(nil), // 29: api.MachineVolumes - (*RemoveVolumeRequest)(nil), // 30: api.RemoveVolumeRequest - (*CreateServiceContainerRequest)(nil), // 31: api.CreateServiceContainerRequest - (*ServiceContainer)(nil), // 32: api.ServiceContainer - (*ListServiceContainersRequest)(nil), // 33: api.ListServiceContainersRequest - (*ListServiceContainersResponse)(nil), // 34: api.ListServiceContainersResponse - (*MachineServiceContainers)(nil), // 35: api.MachineServiceContainers - (*Metadata)(nil), // 36: api.Metadata - (*LogsRequest)(nil), // 37: api.LogsRequest - (*emptypb.Empty)(nil), // 38: google.protobuf.Empty - (*LogEntry)(nil), // 39: api.LogEntry + (CreateServiceContainerRequest_ContainerType)(0), // 0: api.CreateServiceContainerRequest.ContainerType + (*CreateContainerRequest)(nil), // 1: api.CreateContainerRequest + (*CreateContainerResponse)(nil), // 2: api.CreateContainerResponse + (*InspectContainerRequest)(nil), // 3: api.InspectContainerRequest + (*InspectContainerResponse)(nil), // 4: api.InspectContainerResponse + (*StartContainerRequest)(nil), // 5: api.StartContainerRequest + (*StopContainerRequest)(nil), // 6: api.StopContainerRequest + (*ListContainersRequest)(nil), // 7: api.ListContainersRequest + (*ListContainersResponse)(nil), // 8: api.ListContainersResponse + (*MachineContainers)(nil), // 9: api.MachineContainers + (*RemoveContainerRequest)(nil), // 10: api.RemoveContainerRequest + (*ExecContainerRequest)(nil), // 11: api.ExecContainerRequest + (*ExecConfig)(nil), // 12: api.ExecConfig + (*ResizeEvent)(nil), // 13: api.ResizeEvent + (*ExecContainerResponse)(nil), // 14: api.ExecContainerResponse + (*PullImageRequest)(nil), // 15: api.PullImageRequest + (*JSONMessage)(nil), // 16: api.JSONMessage + (*InspectImageRequest)(nil), // 17: api.InspectImageRequest + (*InspectImageResponse)(nil), // 18: api.InspectImageResponse + (*Image)(nil), // 19: api.Image + (*InspectRemoteImageRequest)(nil), // 20: api.InspectRemoteImageRequest + (*InspectRemoteImageResponse)(nil), // 21: api.InspectRemoteImageResponse + (*RemoteImage)(nil), // 22: api.RemoteImage + (*ListImagesRequest)(nil), // 23: api.ListImagesRequest + (*ListImagesResponse)(nil), // 24: api.ListImagesResponse + (*MachineImages)(nil), // 25: api.MachineImages + (*CreateVolumeRequest)(nil), // 26: api.CreateVolumeRequest + (*CreateVolumeResponse)(nil), // 27: api.CreateVolumeResponse + (*ListVolumesRequest)(nil), // 28: api.ListVolumesRequest + (*ListVolumesResponse)(nil), // 29: api.ListVolumesResponse + (*MachineVolumes)(nil), // 30: api.MachineVolumes + (*RemoveVolumeRequest)(nil), // 31: api.RemoveVolumeRequest + (*CreateServiceContainerRequest)(nil), // 32: api.CreateServiceContainerRequest + (*ServiceContainer)(nil), // 33: api.ServiceContainer + (*ListServiceContainersRequest)(nil), // 34: api.ListServiceContainersRequest + (*ListServiceContainersResponse)(nil), // 35: api.ListServiceContainersResponse + (*MachineServiceContainers)(nil), // 36: api.MachineServiceContainers + (*Metadata)(nil), // 37: api.Metadata + (*LogsRequest)(nil), // 38: api.LogsRequest + (*emptypb.Empty)(nil), // 39: google.protobuf.Empty + (*LogEntry)(nil), // 40: api.LogEntry } var file_internal_machine_api_pb_docker_proto_depIdxs = []int32{ - 8, // 0: api.ListContainersResponse.messages:type_name -> api.MachineContainers - 36, // 1: api.MachineContainers.metadata:type_name -> api.Metadata - 11, // 2: api.ExecContainerRequest.config:type_name -> api.ExecConfig - 12, // 3: api.ExecContainerRequest.resize:type_name -> api.ResizeEvent - 18, // 4: api.InspectImageResponse.messages:type_name -> api.Image - 36, // 5: api.Image.metadata:type_name -> api.Metadata - 21, // 6: api.InspectRemoteImageResponse.messages:type_name -> api.RemoteImage - 36, // 7: api.RemoteImage.metadata:type_name -> api.Metadata - 24, // 8: api.ListImagesResponse.messages:type_name -> api.MachineImages - 36, // 9: api.MachineImages.metadata:type_name -> api.Metadata - 29, // 10: api.ListVolumesResponse.messages:type_name -> api.MachineVolumes - 36, // 11: api.MachineVolumes.metadata:type_name -> api.Metadata - 35, // 12: api.ListServiceContainersResponse.messages:type_name -> api.MachineServiceContainers - 36, // 13: api.MachineServiceContainers.metadata:type_name -> api.Metadata - 32, // 14: api.MachineServiceContainers.containers:type_name -> api.ServiceContainer - 0, // 15: api.Docker.CreateContainer:input_type -> api.CreateContainerRequest - 2, // 16: api.Docker.InspectContainer:input_type -> api.InspectContainerRequest - 4, // 17: api.Docker.StartContainer:input_type -> api.StartContainerRequest - 5, // 18: api.Docker.StopContainer:input_type -> api.StopContainerRequest - 6, // 19: api.Docker.ListContainers:input_type -> api.ListContainersRequest - 9, // 20: api.Docker.RemoveContainer:input_type -> api.RemoveContainerRequest - 10, // 21: api.Docker.ExecContainer:input_type -> api.ExecContainerRequest - 37, // 22: api.Docker.ContainerLogs:input_type -> api.LogsRequest - 14, // 23: api.Docker.PullImage:input_type -> api.PullImageRequest - 16, // 24: api.Docker.InspectImage:input_type -> api.InspectImageRequest - 19, // 25: api.Docker.InspectRemoteImage:input_type -> api.InspectRemoteImageRequest - 22, // 26: api.Docker.ListImages:input_type -> api.ListImagesRequest - 25, // 27: api.Docker.CreateVolume:input_type -> api.CreateVolumeRequest - 27, // 28: api.Docker.ListVolumes:input_type -> api.ListVolumesRequest - 30, // 29: api.Docker.RemoveVolume:input_type -> api.RemoveVolumeRequest - 31, // 30: api.Docker.CreateServiceContainer:input_type -> api.CreateServiceContainerRequest - 2, // 31: api.Docker.InspectServiceContainer:input_type -> api.InspectContainerRequest - 33, // 32: api.Docker.ListServiceContainers:input_type -> api.ListServiceContainersRequest - 9, // 33: api.Docker.RemoveServiceContainer:input_type -> api.RemoveContainerRequest - 1, // 34: api.Docker.CreateContainer:output_type -> api.CreateContainerResponse - 3, // 35: api.Docker.InspectContainer:output_type -> api.InspectContainerResponse - 38, // 36: api.Docker.StartContainer:output_type -> google.protobuf.Empty - 38, // 37: api.Docker.StopContainer:output_type -> google.protobuf.Empty - 7, // 38: api.Docker.ListContainers:output_type -> api.ListContainersResponse - 38, // 39: api.Docker.RemoveContainer:output_type -> google.protobuf.Empty - 13, // 40: api.Docker.ExecContainer:output_type -> api.ExecContainerResponse - 39, // 41: api.Docker.ContainerLogs:output_type -> api.LogEntry - 15, // 42: api.Docker.PullImage:output_type -> api.JSONMessage - 17, // 43: api.Docker.InspectImage:output_type -> api.InspectImageResponse - 20, // 44: api.Docker.InspectRemoteImage:output_type -> api.InspectRemoteImageResponse - 23, // 45: api.Docker.ListImages:output_type -> api.ListImagesResponse - 26, // 46: api.Docker.CreateVolume:output_type -> api.CreateVolumeResponse - 28, // 47: api.Docker.ListVolumes:output_type -> api.ListVolumesResponse - 38, // 48: api.Docker.RemoveVolume:output_type -> google.protobuf.Empty - 1, // 49: api.Docker.CreateServiceContainer:output_type -> api.CreateContainerResponse - 32, // 50: api.Docker.InspectServiceContainer:output_type -> api.ServiceContainer - 34, // 51: api.Docker.ListServiceContainers:output_type -> api.ListServiceContainersResponse - 38, // 52: api.Docker.RemoveServiceContainer:output_type -> google.protobuf.Empty - 34, // [34:53] is the sub-list for method output_type - 15, // [15:34] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name + 9, // 0: api.ListContainersResponse.messages:type_name -> api.MachineContainers + 37, // 1: api.MachineContainers.metadata:type_name -> api.Metadata + 12, // 2: api.ExecContainerRequest.config:type_name -> api.ExecConfig + 13, // 3: api.ExecContainerRequest.resize:type_name -> api.ResizeEvent + 19, // 4: api.InspectImageResponse.messages:type_name -> api.Image + 37, // 5: api.Image.metadata:type_name -> api.Metadata + 22, // 6: api.InspectRemoteImageResponse.messages:type_name -> api.RemoteImage + 37, // 7: api.RemoteImage.metadata:type_name -> api.Metadata + 25, // 8: api.ListImagesResponse.messages:type_name -> api.MachineImages + 37, // 9: api.MachineImages.metadata:type_name -> api.Metadata + 30, // 10: api.ListVolumesResponse.messages:type_name -> api.MachineVolumes + 37, // 11: api.MachineVolumes.metadata:type_name -> api.Metadata + 0, // 12: api.CreateServiceContainerRequest.container_type:type_name -> api.CreateServiceContainerRequest.ContainerType + 36, // 13: api.ListServiceContainersResponse.messages:type_name -> api.MachineServiceContainers + 37, // 14: api.MachineServiceContainers.metadata:type_name -> api.Metadata + 33, // 15: api.MachineServiceContainers.containers:type_name -> api.ServiceContainer + 33, // 16: api.MachineServiceContainers.hook_containers:type_name -> api.ServiceContainer + 1, // 17: api.Docker.CreateContainer:input_type -> api.CreateContainerRequest + 3, // 18: api.Docker.InspectContainer:input_type -> api.InspectContainerRequest + 5, // 19: api.Docker.StartContainer:input_type -> api.StartContainerRequest + 6, // 20: api.Docker.StopContainer:input_type -> api.StopContainerRequest + 7, // 21: api.Docker.ListContainers:input_type -> api.ListContainersRequest + 10, // 22: api.Docker.RemoveContainer:input_type -> api.RemoveContainerRequest + 11, // 23: api.Docker.ExecContainer:input_type -> api.ExecContainerRequest + 38, // 24: api.Docker.ContainerLogs:input_type -> api.LogsRequest + 15, // 25: api.Docker.PullImage:input_type -> api.PullImageRequest + 17, // 26: api.Docker.InspectImage:input_type -> api.InspectImageRequest + 20, // 27: api.Docker.InspectRemoteImage:input_type -> api.InspectRemoteImageRequest + 23, // 28: api.Docker.ListImages:input_type -> api.ListImagesRequest + 26, // 29: api.Docker.CreateVolume:input_type -> api.CreateVolumeRequest + 28, // 30: api.Docker.ListVolumes:input_type -> api.ListVolumesRequest + 31, // 31: api.Docker.RemoveVolume:input_type -> api.RemoveVolumeRequest + 32, // 32: api.Docker.CreateServiceContainer:input_type -> api.CreateServiceContainerRequest + 3, // 33: api.Docker.InspectServiceContainer:input_type -> api.InspectContainerRequest + 34, // 34: api.Docker.ListServiceContainers:input_type -> api.ListServiceContainersRequest + 10, // 35: api.Docker.RemoveServiceContainer:input_type -> api.RemoveContainerRequest + 2, // 36: api.Docker.CreateContainer:output_type -> api.CreateContainerResponse + 4, // 37: api.Docker.InspectContainer:output_type -> api.InspectContainerResponse + 39, // 38: api.Docker.StartContainer:output_type -> google.protobuf.Empty + 39, // 39: api.Docker.StopContainer:output_type -> google.protobuf.Empty + 8, // 40: api.Docker.ListContainers:output_type -> api.ListContainersResponse + 39, // 41: api.Docker.RemoveContainer:output_type -> google.protobuf.Empty + 14, // 42: api.Docker.ExecContainer:output_type -> api.ExecContainerResponse + 40, // 43: api.Docker.ContainerLogs:output_type -> api.LogEntry + 16, // 44: api.Docker.PullImage:output_type -> api.JSONMessage + 18, // 45: api.Docker.InspectImage:output_type -> api.InspectImageResponse + 21, // 46: api.Docker.InspectRemoteImage:output_type -> api.InspectRemoteImageResponse + 24, // 47: api.Docker.ListImages:output_type -> api.ListImagesResponse + 27, // 48: api.Docker.CreateVolume:output_type -> api.CreateVolumeResponse + 29, // 49: api.Docker.ListVolumes:output_type -> api.ListVolumesResponse + 39, // 50: api.Docker.RemoveVolume:output_type -> google.protobuf.Empty + 2, // 51: api.Docker.CreateServiceContainer:output_type -> api.CreateContainerResponse + 33, // 52: api.Docker.InspectServiceContainer:output_type -> api.ServiceContainer + 35, // 53: api.Docker.ListServiceContainers:output_type -> api.ListServiceContainersResponse + 39, // 54: api.Docker.RemoveServiceContainer:output_type -> google.protobuf.Empty + 36, // [36:55] is the sub-list for method output_type + 17, // [17:36] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_internal_machine_api_pb_docker_proto_init() } @@ -2904,13 +2987,14 @@ func file_internal_machine_api_pb_docker_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_internal_machine_api_pb_docker_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 36, NumExtensions: 0, NumServices: 1, }, GoTypes: file_internal_machine_api_pb_docker_proto_goTypes, DependencyIndexes: file_internal_machine_api_pb_docker_proto_depIdxs, + EnumInfos: file_internal_machine_api_pb_docker_proto_enumTypes, MessageInfos: file_internal_machine_api_pb_docker_proto_msgTypes, }.Build() File_internal_machine_api_pb_docker_proto = out.File diff --git a/internal/machine/api/pb/docker.proto b/internal/machine/api/pb/docker.proto index 7984fa39..09d93100 100644 --- a/internal/machine/api/pb/docker.proto +++ b/internal/machine/api/pb/docker.proto @@ -228,6 +228,15 @@ message CreateServiceContainerRequest { // JSON serialised api.ServiceSpec. bytes service_spec = 2; string container_name = 3; + + // ContainerType specifies the purpose of the container being created. + enum ContainerType { + // SERVICE is the default type for long-running service containers. + SERVICE = 0; + // PRE_DEPLOY is a one-shot container for a pre-deploy hook to run before service deployment. + PRE_DEPLOY = 1; + } + ContainerType container_type = 4; } message ServiceContainer { @@ -252,4 +261,6 @@ message ListServiceContainersResponse { message MachineServiceContainers { Metadata metadata = 1; repeated ServiceContainer containers = 2; + // One-shot containers for deployment hooks (e.g. pre-deploy). + repeated ServiceContainer hook_containers = 3; } diff --git a/internal/machine/docker/client.go b/internal/machine/docker/client.go index 25dfe66f..fd7e89fa 100644 --- a/internal/machine/docker/client.go +++ b/internal/machine/docker/client.go @@ -420,34 +420,6 @@ func (c *Client) RemoveVolume(ctx context.Context, id string, force bool) error return err } -// CreateServiceContainer creates a new container for the service with the given specifications. -func (c *Client) CreateServiceContainer( - ctx context.Context, serviceID string, spec api.ServiceSpec, containerName string, -) (container.CreateResponse, error) { - var resp container.CreateResponse - - specBytes, err := json.Marshal(spec) - if err != nil { - return resp, fmt.Errorf("marshal service spec: %w", err) - } - grpcResp, err := c.GRPCClient.CreateServiceContainer(ctx, &pb.CreateServiceContainerRequest{ - ServiceId: serviceID, - ServiceSpec: specBytes, - ContainerName: containerName, - }) - if err != nil { - if status.Convert(err).Code() == codes.NotFound { - return resp, errdefs.NotFound(err) - } - return resp, err - } - - if err = json.Unmarshal(grpcResp.Response, &resp); err != nil { - return resp, fmt.Errorf("unmarshal gRPC response: %w", err) - } - return resp, nil -} - // InspectServiceContainer returns the container information and service specification that was used to create the // container with the given ID. func (c *Client) InspectServiceContainer(ctx context.Context, id string) (api.ServiceContainer, error) { @@ -474,10 +446,13 @@ func (c *Client) InspectServiceContainer(ctx context.Context, id string) (api.Se type MachineServiceContainers struct { Metadata *pb.Metadata Containers []api.ServiceContainer + // HookContainers are one-shot containers for deployment hooks (e.g. pre-deploy). + HookContainers []api.ServiceContainer } // ListServiceContainers returns all containers on requested machines that belong to the service with the given // name or ID. If serviceNameOrID is empty, all service containers are returned. +// Set opts.All to true to include hook containers. func (c *Client) ListServiceContainers( ctx context.Context, serviceNameOrID string, opts container.ListOptions, ) ([]MachineServiceContainers, error) { @@ -501,22 +476,33 @@ func (c *Client) ListServiceContainers( continue } - containers := make([]api.ServiceContainer, len(msg.Containers)) - for j, sc := range msg.Containers { - if err = json.Unmarshal(sc.Container, &containers[j].Container); err != nil { - return nil, fmt.Errorf("unmarshal container: %w", err) - } - if err = json.Unmarshal(sc.ServiceSpec, &containers[j].ServiceSpec); err != nil { - return nil, fmt.Errorf("unmarshal service spec: %w", err) - } + machineContainers[i].Containers, err = serviceContainersFromProto(msg.Containers) + if err != nil { + return nil, err + } + machineContainers[i].HookContainers, err = serviceContainersFromProto(msg.HookContainers) + if err != nil { + return nil, err } - - machineContainers[i].Containers = containers } return machineContainers, nil } +// serviceContainersFromProto converts a slice of protobuf service containers to api.ServiceContainer. +func serviceContainersFromProto(pbContainers []*pb.ServiceContainer) ([]api.ServiceContainer, error) { + containers := make([]api.ServiceContainer, len(pbContainers)) + for i, sc := range pbContainers { + if err := json.Unmarshal(sc.Container, &containers[i].Container); err != nil { + return nil, fmt.Errorf("unmarshal container: %w", err) + } + if err := json.Unmarshal(sc.ServiceSpec, &containers[i].ServiceSpec); err != nil { + return nil, fmt.Errorf("unmarshal service spec: %w", err) + } + } + return containers, nil +} + // RemoveServiceContainer stops (kills after grace period) and removes a service container with the given ID. // A service container is a container that has been created with CreateServiceContainer. func (c *Client) RemoveServiceContainer(ctx context.Context, id string, opts container.RemoveOptions) error { diff --git a/internal/machine/docker/controller.go b/internal/machine/docker/controller.go index 1b5317d1..ada3f06a 100644 --- a/internal/machine/docker/controller.go +++ b/internal/machine/docker/controller.go @@ -152,12 +152,16 @@ func (c *Controller) syncContainersToStore(ctx context.Context) error { return fmt.Errorf("list containers from store: %w", err) } - containers, err := c.service.ListServiceContainers(ctx, "", container.ListOptions{}) + // List containers for all services, including stopped ones and deployment hooks. + result, err := c.service.ListServiceContainers(ctx, "", container.ListOptions{All: true}) if err != nil { // TODO: mark all containers as outdated in the store. return fmt.Errorf("list service containers: %w", err) } + // Sync both regular and one-off hook containers to the store. + containers := append(result.Containers, result.HookContainers...) + // Delete containers from the store that are no longer present in the Docker daemon. var deleteIDs []string for _, sc := range storeContainers { diff --git a/internal/machine/docker/server.go b/internal/machine/docker/server.go index ece38179..2a4ff65e 100644 --- a/internal/machine/docker/server.go +++ b/internal/machine/docker/server.go @@ -664,6 +664,39 @@ func (s *Server) CreateServiceContainer( } } + // Strip the container configuration that doesn't make sense for the pre-deploy hook and apply its overrides. + if spec.PreDeploy != nil && req.ContainerType == pb.CreateServiceContainerRequest_PRE_DEPLOY { + config.Labels = map[string]string{ + api.LabelServiceID: req.ServiceId, + api.LabelServiceName: spec.Name, + api.LabelHook: api.LabelHookPreDeploy, + api.LabelManaged: "", + } + config.Healthcheck = &container.HealthConfig{ + Test: []string{"NONE"}, + } + hostConfig.PortBindings = nil + hostConfig.RestartPolicy = container.RestartPolicy{ + Name: container.RestartPolicyDisabled, + } + + // Apply the pre-deploy hook overrides. + config.Cmd = spec.PreDeploy.Command + + for k, v := range spec.PreDeploy.Env { + envVars[k] = v + } + envVars["UNCLOUD_HOOK_PRE_DEPLOY"] = "true" + config.Env = envVars.ToSlice() + + if spec.PreDeploy.Privileged != nil { + hostConfig.Privileged = *spec.PreDeploy.Privileged + } + if spec.PreDeploy.User != "" { + config.User = spec.PreDeploy.User + } + } + networkConfig := &network.NetworkingConfig{ EndpointsConfig: map[string]*network.EndpointSettings{ NetworkName: {}, @@ -1009,37 +1042,49 @@ func (s *Server) ListServiceContainers( } } - containers, err := s.service.ListServiceContainers(ctx, req.ServiceId, opts) + result, err := s.service.ListServiceContainers(ctx, req.ServiceId, opts) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } - // Convert to protobuf format. + pbContainers, err := serviceContainersToProto(result.Containers) + if err != nil { + return nil, err + } + pbHookContainers, err := serviceContainersToProto(result.HookContainers) + if err != nil { + return nil, err + } + + return &pb.ListServiceContainersResponse{ + Messages: []*pb.MachineServiceContainers{ + { + Containers: pbContainers, + HookContainers: pbHookContainers, + }, + }, + }, nil +} + +// serviceContainersToProto converts a slice of service containers to protobuf format. +func serviceContainersToProto(containers []api.ServiceContainer) ([]*pb.ServiceContainer, error) { pbContainers := make([]*pb.ServiceContainer, 0, len(containers)) for _, ctr := range containers { ctrBytes, err := json.Marshal(ctr.Container) if err != nil { return nil, status.Errorf(codes.Internal, "marshal container: %v", err) } - specBytes, err := json.Marshal(ctr.ServiceSpec) if err != nil { return nil, status.Errorf(codes.Internal, "marshal service spec: %v", err) } - pbContainers = append(pbContainers, &pb.ServiceContainer{ Container: ctrBytes, ServiceSpec: specBytes, }) } - return &pb.ListServiceContainersResponse{ - Messages: []*pb.MachineServiceContainers{ - { - Containers: pbContainers, - }, - }, - }, nil + return pbContainers, nil } // RemoveServiceContainer stops (kills after grace period) and removes a service container with the given ID. diff --git a/internal/machine/docker/service.go b/internal/machine/docker/service.go index 4b736e1e..ffcf442b 100644 --- a/internal/machine/docker/service.go +++ b/internal/machine/docker/service.go @@ -74,11 +74,20 @@ func (s *Service) InspectServiceContainer(ctx context.Context, nameOrID string) return serviceCtr, nil } +// ListServiceContainersResult holds the result of listing service containers, split into regular +// service containers and one-off hook containers. +type ListServiceContainersResult struct { + Containers []api.ServiceContainer + HookContainers []api.ServiceContainer +} + // ListServiceContainers lists Docker containers that belong to the service with the given name or ID. // If serviceIDOrName is empty, all service containers are returned. The opts parameter allows additional filtering. func (s *Service) ListServiceContainers( ctx context.Context, serviceNameOrID string, opts container.ListOptions, -) ([]api.ServiceContainer, error) { +) (ListServiceContainersResult, error) { + var result ListServiceContainersResult + if opts.Filters.Len() == 0 { opts.Filters = filters.NewArgs() } @@ -88,10 +97,9 @@ func (s *Service) ListServiceContainers( containerSummaries, err := s.Client.ContainerList(ctx, opts) if err != nil { - return nil, err + return result, err } - var containers []api.ServiceContainer for _, cs := range containerSummaries { // Filter by service name or ID if provided. if serviceNameOrID != "" && @@ -106,10 +114,15 @@ func (s *Service) ListServiceContainers( slog.Error("Failed to inspect service container.", "service", serviceNameOrID, "id", cs.ID, "err", err) continue } - containers = append(containers, ctr) + + if ctr.IsHook() { + result.HookContainers = append(result.HookContainers, ctr) + } else { + result.Containers = append(result.Containers, ctr) + } } - return containers, nil + return result, nil } // IsContainerdImageStoreEnabled checks if Docker is configured to use the containerd image store: diff --git a/pkg/api/client.go b/pkg/api/client.go index c17d3e49..70d7d1a5 100644 --- a/pkg/api/client.go +++ b/pkg/api/client.go @@ -21,6 +21,9 @@ type ContainerClient interface { CreateContainer( ctx context.Context, serviceID string, spec ServiceSpec, machineID string, ) (container.CreateResponse, error) + CreatePreDeployHookContainer( + ctx context.Context, serviceID string, spec ServiceSpec, machineID string, + ) (container.CreateResponse, error) ExecContainer(ctx context.Context, serviceNameOrID, containerNameOrID string, config ExecOptions) (int, error) InspectContainer(ctx context.Context, serviceNameOrID, containerNameOrID string) (MachineServiceContainer, error) StartContainer(ctx context.Context, serviceNameOrID, containerNameOrID string) error diff --git a/pkg/api/container.go b/pkg/api/container.go index c5742e3d..2e15804e 100644 --- a/pkg/api/container.go +++ b/pkg/api/container.go @@ -18,11 +18,16 @@ const ( // DockerNetworkName is the name of the Docker network used by uncloud. Keep the value in sync with NetworkName // in internal/machine/docker/manager.go. DockerNetworkName = "uncloud" + LabelManaged = "uncloud.managed" LabelServiceID = "uncloud.service.id" LabelServiceName = "uncloud.service.name" LabelServiceMode = "uncloud.service.mode" LabelServicePorts = "uncloud.service.ports" + // LabelHook marks a container as a deployment hook. The value indicates the hook type (e.g. LabelHookPreDeploy). + LabelHook = "uncloud.service.hook" + // LabelHookPreDeploy indicates that the container is a pre-deploy hook that runs before deploying the service. + LabelHookPreDeploy = "pre-deploy" ) type Container struct { @@ -181,10 +186,17 @@ func (c *ServiceContainer) ServiceName() string { // ServiceMode returns the replication mode of the service this container belongs to. func (c *ServiceContainer) ServiceMode() string { - return c.Config.Labels[LabelServiceMode] + return c.ServiceSpec.Mode +} + +// IsHook returns true if the container is a deployment hook (e.g. pre-deploy). +func (c *ServiceContainer) IsHook() bool { + _, ok := c.Config.Labels[LabelHook] + return ok } // ServicePorts returns the ports this container publishes as part of its service. +// TODO: return ports from ServiceSpec to allow updating ingress ports without recreating containers. func (c *ServiceContainer) ServicePorts() ([]PortSpec, error) { encoded, ok := c.Config.Labels[LabelServicePorts] if !ok { diff --git a/pkg/api/service.go b/pkg/api/service.go index 38f0a25c..4536b477 100644 --- a/pkg/api/service.go +++ b/pkg/api/service.go @@ -454,8 +454,8 @@ type PreDeployHook struct { Command []string // Env defines additional environment variables for the container, merged with the service's environment variables. Env EnvVars `json:",omitempty"` - // Privileged gives extended privileges to the container. - Privileged bool `json:",omitempty"` + // Privileged overrides the container's privileged mode. nil means inherit from the service. + Privileged *bool `json:",omitempty"` // Timeout is the maximum duration to wait for the command to complete. On timeout, the container is stopped // and the deployment fails. If nil, a default timeout is used. Timeout *time.Duration `json:",omitempty"` @@ -505,10 +505,13 @@ type RunServiceResponse struct { } type Service struct { - ID string - Name string - Mode string + ID string + Name string + Mode string + // Containers is the regular long-running service containers. Containers []MachineServiceContainer + // HookContainers are one-shot containers for deployment hooks (e.g. pre-deploy). + HookContainers []MachineServiceContainer } type MachineServiceContainer struct { diff --git a/pkg/client/container.go b/pkg/client/container.go index 8ea074d2..375cfd61 100644 --- a/pkg/client/container.go +++ b/pkg/client/container.go @@ -7,14 +7,17 @@ import ( "strings" "time" - "github.com/containerd/errdefs" + "encoding/json" + "github.com/docker/compose/v2/pkg/progress" "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/jsonmessage" "github.com/psviderski/uncloud/internal/docker" + "github.com/psviderski/uncloud/internal/machine/api/pb" machinedocker "github.com/psviderski/uncloud/internal/machine/docker" "github.com/psviderski/uncloud/internal/secret" "github.com/psviderski/uncloud/pkg/api" + "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -24,6 +27,27 @@ import ( // CreateContainer creates a new container for the given service on the specified machine. func (cli *Client) CreateContainer( ctx context.Context, serviceID string, spec api.ServiceSpec, machineID string, +) (container.CreateResponse, error) { + return cli.createServiceContainerWithPull(ctx, serviceID, spec, machineID, pb.CreateServiceContainerRequest_SERVICE) +} + +// CreatePreDeployHookContainer creates a one-shot container for a pre-deploy hook for the given service +// on the specified machine. +func (cli *Client) CreatePreDeployHookContainer( + ctx context.Context, serviceID string, spec api.ServiceSpec, machineID string, +) (container.CreateResponse, error) { + return cli.createServiceContainerWithPull( + ctx, serviceID, spec, machineID, pb.CreateServiceContainerRequest_PRE_DEPLOY) +} + +// createServiceContainerWithPull creates a regular or deployment hook container for the service +// on the specified machine, pulling the image if needed. +func (cli *Client) createServiceContainerWithPull( + ctx context.Context, + serviceID string, + spec api.ServiceSpec, + machineID string, + containerType pb.CreateServiceContainerRequest_ContainerType, ) (container.CreateResponse, error) { var resp container.CreateResponse @@ -43,6 +67,9 @@ func (cli *Client) CreateContainer( return resp, fmt.Errorf("generate random suffix: %w", err) } containerName := fmt.Sprintf("%s-%s", spec.Name, suffix) + if containerType == pb.CreateServiceContainerRequest_PRE_DEPLOY { + containerName = fmt.Sprintf("%s-%s-%s", spec.Name, api.LabelHookPreDeploy, suffix) + } // Proxy Docker gRPC requests to the selected machine. ctx = proxyToMachine(ctx, machine.Machine) @@ -57,7 +84,18 @@ func (cli *Client) CreateContainer( } } - resp, err = cli.Docker.CreateServiceContainer(ctx, serviceID, spec, containerName) + specBytes, err := json.Marshal(spec) + if err != nil { + return resp, fmt.Errorf("marshal service spec: %w", err) + } + req := &pb.CreateServiceContainerRequest{ + ServiceId: serviceID, + ServiceSpec: specBytes, + ContainerName: containerName, + ContainerType: containerType, + } + + grpcResp, err := cli.Docker.GRPCClient.CreateServiceContainer(ctx, req) if err != nil { switch spec.Container.PullPolicy { case api.PullPolicyAlways, api.PullPolicyNever: @@ -68,7 +106,7 @@ func (cli *Client) CreateContainer( } // NotFound (No such image) error is expected if the image is missing. - if !errdefs.IsNotFound(err) || !strings.Contains(err.Error(), "No such image") { + if status.Code(err) != codes.NotFound || !strings.Contains(err.Error(), "No such image") { return resp, err } @@ -76,10 +114,14 @@ func (cli *Client) CreateContainer( if err = cli.pullImageWithProgress(ctx, spec.Container.Image, machine.Machine.Name, eventID); err != nil { return resp, err } - if resp, err = cli.Docker.CreateServiceContainer(ctx, serviceID, spec, containerName); err != nil { + if grpcResp, err = cli.Docker.GRPCClient.CreateServiceContainer(ctx, req); err != nil { return resp, err } } + + if err = json.Unmarshal(grpcResp.Response, &resp); err != nil { + return resp, fmt.Errorf("unmarshal gRPC response: %w", err) + } pw.Event(progress.CreatedEvent(eventID)) return resp, nil diff --git a/pkg/client/service.go b/pkg/client/service.go index 369d34ca..cba0610a 100644 --- a/pkg/client/service.go +++ b/pkg/client/service.go @@ -109,7 +109,7 @@ func (cli *Client) InspectService(ctx context.Context, nameOrID string) (api.Ser } listCtx := metadata.NewOutgoingContext(ctx, md) - // List all service containers including stopped ones. + // List all service containers including stopped ones and deployment hooks. opts := container.ListOptions{All: true} machineContainers, err := cli.Docker.ListServiceContainers(listCtx, nameOrID, opts) if err != nil { @@ -146,16 +146,15 @@ func (cli *Client) InspectService(ctx context.Context, nameOrID string) (api.Ser } } - for _, ctr := range mc.Containers { - if ctr.ServiceID() == nameOrID || ctr.ServiceName() == nameOrID { - containers = append(containers, api.MachineServiceContainer{ - MachineID: machineID, - Container: ctr, - }) + // Collect both regular and hook containers for the service. + for _, ctr := range append(mc.Containers, mc.HookContainers...) { + containers = append(containers, api.MachineServiceContainer{ + MachineID: machineID, + Container: ctr, + }) - if ctr.ServiceID() == nameOrID { - foundByID = true - } + if ctr.ServiceID() == nameOrID { + foundByID = true } } } @@ -181,14 +180,22 @@ func (cli *Client) InspectService(ctx context.Context, nameOrID string) (api.Ser } } - svc = api.Service{ - ID: containers[0].Container.ServiceID(), - Name: containers[0].Container.ServiceName(), - Mode: containers[0].Container.ServiceMode(), - Containers: containers, + // Partition containers into regular service containers and hook containers. + var serviceContainers, hookContainers []api.MachineServiceContainer + for _, mc := range containers { + if mc.Container.IsHook() { + hookContainers = append(hookContainers, mc) + } else { + serviceContainers = append(serviceContainers, mc) + } } - if svc.Mode == "" { - svc.Mode = api.ServiceModeReplicated + + svc = api.Service{ + ID: containers[0].Container.ServiceID(), + Name: containers[0].Container.ServiceName(), + Mode: containers[0].Container.ServiceMode(), + Containers: serviceContainers, + HookContainers: hookContainers, } return svc, nil