From 1521b26410268b2efe2f5102e2cb6ee326f1ed7a Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Fri, 7 Feb 2025 17:01:11 +1100 Subject: [PATCH] cheating --- .../ftl/provisioner/v1beta1/plugin.pb.go | 389 +++++------------- .../ftl/provisioner/v1beta1/plugin.proto | 14 - .../provisionerpbconnect/plugin.connect.go | 33 +- backend/provisioner/inmem_provisioner.go | 100 +---- backend/provisioner/noop_provisioner.go | 7 - backend/provisioner/service.go | 16 +- .../ftl/provisioner/v1beta1/plugin_connect.ts | 11 +- .../ftl/provisioner/v1beta1/plugin_pb.ts | 104 ----- .../ftl/provisioner/v1beta1/plugin_pb2.py | 34 +- .../ftl/provisioner/v1beta1/plugin_pb2.pyi | 22 - 10 files changed, 152 insertions(+), 578 deletions(-) diff --git a/backend/protos/xyz/block/ftl/provisioner/v1beta1/plugin.pb.go b/backend/protos/xyz/block/ftl/provisioner/v1beta1/plugin.pb.go index fba1078983..fec60d8405 100644 --- a/backend/protos/xyz/block/ftl/provisioner/v1beta1/plugin.pb.go +++ b/backend/protos/xyz/block/ftl/provisioner/v1beta1/plugin.pb.go @@ -197,134 +197,6 @@ func (x *ProvisionResponse) GetStatus() ProvisionResponseStatus { return ProvisionResponseStatus_PROVISION_RESPONSE_STATUS_UNSPECIFIED } -type DeProvisionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - FtlClusterId string `protobuf:"bytes,1,opt,name=ftl_cluster_id,json=ftlClusterId,proto3" json:"ftl_cluster_id,omitempty"` - Module *v1.Module `protobuf:"bytes,2,opt,name=module,proto3" json:"module,omitempty"` - ReplacementModule *v1.Module `protobuf:"bytes,3,opt,name=replacement_module,json=replacementModule,proto3,oneof" json:"replacement_module,omitempty"` - Changeset string `protobuf:"bytes,4,opt,name=changeset,proto3" json:"changeset,omitempty"` - Kinds []string `protobuf:"bytes,5,rep,name=kinds,proto3" json:"kinds,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeProvisionRequest) Reset() { - *x = DeProvisionRequest{} - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeProvisionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeProvisionRequest) ProtoMessage() {} - -func (x *DeProvisionRequest) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeProvisionRequest.ProtoReflect.Descriptor instead. -func (*DeProvisionRequest) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{2} -} - -func (x *DeProvisionRequest) GetFtlClusterId() string { - if x != nil { - return x.FtlClusterId - } - return "" -} - -func (x *DeProvisionRequest) GetModule() *v1.Module { - if x != nil { - return x.Module - } - return nil -} - -func (x *DeProvisionRequest) GetReplacementModule() *v1.Module { - if x != nil { - return x.ReplacementModule - } - return nil -} - -func (x *DeProvisionRequest) GetChangeset() string { - if x != nil { - return x.Changeset - } - return "" -} - -func (x *DeProvisionRequest) GetKinds() []string { - if x != nil { - return x.Kinds - } - return nil -} - -type DeProvisionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProvisioningToken string `protobuf:"bytes,1,opt,name=provisioning_token,json=provisioningToken,proto3" json:"provisioning_token,omitempty"` - Status ProvisionResponseStatus `protobuf:"varint,2,opt,name=status,proto3,enum=xyz.block.ftl.provisioner.v1beta1.ProvisionResponseStatus" json:"status,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeProvisionResponse) Reset() { - *x = DeProvisionResponse{} - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeProvisionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeProvisionResponse) ProtoMessage() {} - -func (x *DeProvisionResponse) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeProvisionResponse.ProtoReflect.Descriptor instead. -func (*DeProvisionResponse) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{3} -} - -func (x *DeProvisionResponse) GetProvisioningToken() string { - if x != nil { - return x.ProvisioningToken - } - return "" -} - -func (x *DeProvisionResponse) GetStatus() ProvisionResponseStatus { - if x != nil { - return x.Status - } - return ProvisionResponseStatus_PROVISION_RESPONSE_STATUS_UNSPECIFIED -} - type StatusRequest struct { state protoimpl.MessageState `protogen:"open.v1"` ProvisioningToken string `protobuf:"bytes,1,opt,name=provisioning_token,json=provisioningToken,proto3" json:"provisioning_token,omitempty"` @@ -336,7 +208,7 @@ type StatusRequest struct { func (x *StatusRequest) Reset() { *x = StatusRequest{} - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[4] + mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -348,7 +220,7 @@ func (x *StatusRequest) String() string { func (*StatusRequest) ProtoMessage() {} func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[4] + mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -361,7 +233,7 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{4} + return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{2} } func (x *StatusRequest) GetProvisioningToken() string { @@ -391,7 +263,7 @@ type StatusResponse struct { func (x *StatusResponse) Reset() { *x = StatusResponse{} - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[5] + mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -403,7 +275,7 @@ func (x *StatusResponse) String() string { func (*StatusResponse) ProtoMessage() {} func (x *StatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[5] + mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -416,7 +288,7 @@ func (x *StatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. func (*StatusResponse) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{5} + return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{3} } func (x *StatusResponse) GetStatus() isStatusResponse_Status { @@ -468,7 +340,7 @@ type StatusResponse_ProvisioningRunning struct { func (x *StatusResponse_ProvisioningRunning) Reset() { *x = StatusResponse_ProvisioningRunning{} - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[6] + mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -480,7 +352,7 @@ func (x *StatusResponse_ProvisioningRunning) String() string { func (*StatusResponse_ProvisioningRunning) ProtoMessage() {} func (x *StatusResponse_ProvisioningRunning) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[6] + mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -493,7 +365,7 @@ func (x *StatusResponse_ProvisioningRunning) ProtoReflect() protoreflect.Message // Deprecated: Use StatusResponse_ProvisioningRunning.ProtoReflect.Descriptor instead. func (*StatusResponse_ProvisioningRunning) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{5, 0} + return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{3, 0} } type StatusResponse_ProvisioningFailed struct { @@ -505,7 +377,7 @@ type StatusResponse_ProvisioningFailed struct { func (x *StatusResponse_ProvisioningFailed) Reset() { *x = StatusResponse_ProvisioningFailed{} - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[7] + mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -517,7 +389,7 @@ func (x *StatusResponse_ProvisioningFailed) String() string { func (*StatusResponse_ProvisioningFailed) ProtoMessage() {} func (x *StatusResponse_ProvisioningFailed) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[7] + mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -530,7 +402,7 @@ func (x *StatusResponse_ProvisioningFailed) ProtoReflect() protoreflect.Message // Deprecated: Use StatusResponse_ProvisioningFailed.ProtoReflect.Descriptor instead. func (*StatusResponse_ProvisioningFailed) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{5, 1} + return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{3, 1} } func (x *StatusResponse_ProvisioningFailed) GetErrorMessage() string { @@ -549,7 +421,7 @@ type StatusResponse_ProvisioningSuccess struct { func (x *StatusResponse_ProvisioningSuccess) Reset() { *x = StatusResponse_ProvisioningSuccess{} - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[8] + mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -561,7 +433,7 @@ func (x *StatusResponse_ProvisioningSuccess) String() string { func (*StatusResponse_ProvisioningSuccess) ProtoMessage() {} func (x *StatusResponse_ProvisioningSuccess) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[8] + mi := &file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -574,7 +446,7 @@ func (x *StatusResponse_ProvisioningSuccess) ProtoReflect() protoreflect.Message // Deprecated: Use StatusResponse_ProvisioningSuccess.ProtoReflect.Descriptor instead. func (*StatusResponse_ProvisioningSuccess) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{5, 2} + return file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP(), []int{3, 2} } func (x *StatusResponse_ProvisioningSuccess) GetOutputs() []*v1.RuntimeElement { @@ -622,109 +494,74 @@ var file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDesc = string([]byte{ 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, - 0x93, 0x02, 0x0a, 0x12, 0x44, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x66, 0x74, 0x6c, 0x5f, 0x63, 0x6c, - 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x66, 0x74, 0x6c, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x06, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, - 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x06, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x53, 0x0a, 0x12, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, - 0x6c, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x48, 0x00, 0x52, 0x11, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6b, 0x69, 0x6e, 0x64, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x69, 0x6e, 0x64, 0x73, 0x42, 0x15, - 0x0a, 0x13, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, - 0x12, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x52, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3a, 0x2e, 0x78, + 0x86, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, + 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x12, 0x46, 0x0a, 0x0e, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x0d, 0x64, 0x65, 0x73, 0x69, 0x72, + 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x8c, 0x03, 0x0a, 0x0e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x07, 0x72, + 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0x86, 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, - 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, - 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x46, 0x0a, 0x0e, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x79, 0x7a, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x0d, 0x64, 0x65, 0x73, 0x69, - 0x72, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x8c, 0x03, 0x0a, 0x0e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x07, - 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, - 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6e, - 0x6e, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x12, - 0x61, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x45, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, - 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, - 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x1a, 0x15, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, - 0x6e, 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x1a, 0x39, 0x0a, 0x12, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, - 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x1a, 0x58, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x07, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, - 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x6c, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x42, 0x08, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x6d, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x29, 0x0a, 0x25, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, - 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x27, - 0x0a, 0x23, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, - 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x55, 0x42, 0x4d, - 0x49, 0x54, 0x54, 0x45, 0x44, 0x10, 0x01, 0x32, 0xc6, 0x03, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x2e, 0x78, - 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x78, 0x79, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6e, 0x6e, + 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x07, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x61, + 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x45, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x53, + 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x1a, 0x15, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, + 0x67, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x1a, 0x39, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x23, + 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x1a, 0x58, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x69, 0x6e, 0x67, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x07, 0x6f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x79, + 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x73, 0x63, 0x68, 0x65, + 0x6d, 0x61, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x6c, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x42, 0x08, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x6d, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x29, 0x0a, 0x25, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, + 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x27, 0x0a, + 0x23, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, + 0x4e, 0x53, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x53, 0x55, 0x42, 0x4d, 0x49, + 0x54, 0x54, 0x45, 0x44, 0x10, 0x01, 0x32, 0xc8, 0x02, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x76, 0x0a, 0x09, 0x50, - 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, - 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x7c, 0x0a, 0x0b, 0x44, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x35, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, - 0x74, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x78, 0x79, 0x7a, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x44, 0x65, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x6d, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x30, 0x2e, 0x78, 0x79, - 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, - 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x57, 0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, - 0x6e, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x78, 0x79, 0x7a, 0x2f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x78, 0x79, 0x7a, + 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x76, 0x0a, 0x09, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x78, + 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x6d, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x30, 0x2e, 0x78, + 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, + 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x57, 0x50, 0x01, 0x5a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x62, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x78, 0x79, 0x7a, 0x2f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, }) var ( @@ -740,47 +577,40 @@ func file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDescGZIP() []byte { } var file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_goTypes = []any{ (ProvisionResponseStatus)(0), // 0: xyz.block.ftl.provisioner.v1beta1.ProvisionResponseStatus (*ProvisionRequest)(nil), // 1: xyz.block.ftl.provisioner.v1beta1.ProvisionRequest (*ProvisionResponse)(nil), // 2: xyz.block.ftl.provisioner.v1beta1.ProvisionResponse - (*DeProvisionRequest)(nil), // 3: xyz.block.ftl.provisioner.v1beta1.DeProvisionRequest - (*DeProvisionResponse)(nil), // 4: xyz.block.ftl.provisioner.v1beta1.DeProvisionResponse - (*StatusRequest)(nil), // 5: xyz.block.ftl.provisioner.v1beta1.StatusRequest - (*StatusResponse)(nil), // 6: xyz.block.ftl.provisioner.v1beta1.StatusResponse - (*StatusResponse_ProvisioningRunning)(nil), // 7: xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningRunning - (*StatusResponse_ProvisioningFailed)(nil), // 8: xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningFailed - (*StatusResponse_ProvisioningSuccess)(nil), // 9: xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningSuccess - (*v1.Module)(nil), // 10: xyz.block.ftl.schema.v1.Module - (*v1.RuntimeElement)(nil), // 11: xyz.block.ftl.schema.v1.RuntimeElement - (*v11.PingRequest)(nil), // 12: xyz.block.ftl.v1.PingRequest - (*v11.PingResponse)(nil), // 13: xyz.block.ftl.v1.PingResponse + (*StatusRequest)(nil), // 3: xyz.block.ftl.provisioner.v1beta1.StatusRequest + (*StatusResponse)(nil), // 4: xyz.block.ftl.provisioner.v1beta1.StatusResponse + (*StatusResponse_ProvisioningRunning)(nil), // 5: xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningRunning + (*StatusResponse_ProvisioningFailed)(nil), // 6: xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningFailed + (*StatusResponse_ProvisioningSuccess)(nil), // 7: xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningSuccess + (*v1.Module)(nil), // 8: xyz.block.ftl.schema.v1.Module + (*v1.RuntimeElement)(nil), // 9: xyz.block.ftl.schema.v1.RuntimeElement + (*v11.PingRequest)(nil), // 10: xyz.block.ftl.v1.PingRequest + (*v11.PingResponse)(nil), // 11: xyz.block.ftl.v1.PingResponse } var file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_depIdxs = []int32{ - 10, // 0: xyz.block.ftl.provisioner.v1beta1.ProvisionRequest.desired_module:type_name -> xyz.block.ftl.schema.v1.Module - 10, // 1: xyz.block.ftl.provisioner.v1beta1.ProvisionRequest.previous_module:type_name -> xyz.block.ftl.schema.v1.Module + 8, // 0: xyz.block.ftl.provisioner.v1beta1.ProvisionRequest.desired_module:type_name -> xyz.block.ftl.schema.v1.Module + 8, // 1: xyz.block.ftl.provisioner.v1beta1.ProvisionRequest.previous_module:type_name -> xyz.block.ftl.schema.v1.Module 0, // 2: xyz.block.ftl.provisioner.v1beta1.ProvisionResponse.status:type_name -> xyz.block.ftl.provisioner.v1beta1.ProvisionResponseStatus - 10, // 3: xyz.block.ftl.provisioner.v1beta1.DeProvisionRequest.module:type_name -> xyz.block.ftl.schema.v1.Module - 10, // 4: xyz.block.ftl.provisioner.v1beta1.DeProvisionRequest.replacement_module:type_name -> xyz.block.ftl.schema.v1.Module - 0, // 5: xyz.block.ftl.provisioner.v1beta1.DeProvisionResponse.status:type_name -> xyz.block.ftl.provisioner.v1beta1.ProvisionResponseStatus - 10, // 6: xyz.block.ftl.provisioner.v1beta1.StatusRequest.desired_module:type_name -> xyz.block.ftl.schema.v1.Module - 7, // 7: xyz.block.ftl.provisioner.v1beta1.StatusResponse.running:type_name -> xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningRunning - 9, // 8: xyz.block.ftl.provisioner.v1beta1.StatusResponse.success:type_name -> xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningSuccess - 11, // 9: xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningSuccess.outputs:type_name -> xyz.block.ftl.schema.v1.RuntimeElement - 12, // 10: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Ping:input_type -> xyz.block.ftl.v1.PingRequest - 1, // 11: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Provision:input_type -> xyz.block.ftl.provisioner.v1beta1.ProvisionRequest - 3, // 12: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.DeProvision:input_type -> xyz.block.ftl.provisioner.v1beta1.DeProvisionRequest - 5, // 13: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Status:input_type -> xyz.block.ftl.provisioner.v1beta1.StatusRequest - 13, // 14: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Ping:output_type -> xyz.block.ftl.v1.PingResponse - 2, // 15: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Provision:output_type -> xyz.block.ftl.provisioner.v1beta1.ProvisionResponse - 4, // 16: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.DeProvision:output_type -> xyz.block.ftl.provisioner.v1beta1.DeProvisionResponse - 6, // 17: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Status:output_type -> xyz.block.ftl.provisioner.v1beta1.StatusResponse - 14, // [14:18] is the sub-list for method output_type - 10, // [10:14] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 8, // 3: xyz.block.ftl.provisioner.v1beta1.StatusRequest.desired_module:type_name -> xyz.block.ftl.schema.v1.Module + 5, // 4: xyz.block.ftl.provisioner.v1beta1.StatusResponse.running:type_name -> xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningRunning + 7, // 5: xyz.block.ftl.provisioner.v1beta1.StatusResponse.success:type_name -> xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningSuccess + 9, // 6: xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningSuccess.outputs:type_name -> xyz.block.ftl.schema.v1.RuntimeElement + 10, // 7: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Ping:input_type -> xyz.block.ftl.v1.PingRequest + 1, // 8: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Provision:input_type -> xyz.block.ftl.provisioner.v1beta1.ProvisionRequest + 3, // 9: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Status:input_type -> xyz.block.ftl.provisioner.v1beta1.StatusRequest + 11, // 10: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Ping:output_type -> xyz.block.ftl.v1.PingResponse + 2, // 11: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Provision:output_type -> xyz.block.ftl.provisioner.v1beta1.ProvisionResponse + 4, // 12: xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Status:output_type -> xyz.block.ftl.provisioner.v1beta1.StatusResponse + 10, // [10:13] is the sub-list for method output_type + 7, // [7:10] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_init() } @@ -788,8 +618,7 @@ func file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_init() { if File_xyz_block_ftl_provisioner_v1beta1_plugin_proto != nil { return } - file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[2].OneofWrappers = []any{} - file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[5].OneofWrappers = []any{ + file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_msgTypes[3].OneofWrappers = []any{ (*StatusResponse_Running)(nil), (*StatusResponse_Success)(nil), } @@ -799,7 +628,7 @@ func file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDesc), len(file_xyz_block_ftl_provisioner_v1beta1_plugin_proto_rawDesc)), NumEnums: 1, - NumMessages: 9, + NumMessages: 7, NumExtensions: 0, NumServices: 1, }, diff --git a/backend/protos/xyz/block/ftl/provisioner/v1beta1/plugin.proto b/backend/protos/xyz/block/ftl/provisioner/v1beta1/plugin.proto index 52689f3fb5..243cefe269 100644 --- a/backend/protos/xyz/block/ftl/provisioner/v1beta1/plugin.proto +++ b/backend/protos/xyz/block/ftl/provisioner/v1beta1/plugin.proto @@ -27,19 +27,6 @@ message ProvisionResponse { ProvisionResponseStatus status = 2; } -message DeProvisionRequest { - string ftl_cluster_id = 1; - xyz.block.ftl.schema.v1.Module module = 2; - optional xyz.block.ftl.schema.v1.Module replacement_module = 3; - string changeset = 4; - repeated string kinds = 5; -} - -message DeProvisionResponse { - string provisioning_token = 1; - ProvisionResponseStatus status = 2; -} - message StatusRequest { string provisioning_token = 1; // The outputs of this module are updated if the the status is a success @@ -67,6 +54,5 @@ service ProvisionerPluginService { rpc Ping(xyz.block.ftl.v1.PingRequest) returns (xyz.block.ftl.v1.PingResponse); rpc Provision(ProvisionRequest) returns (ProvisionResponse); - rpc DeProvision(DeProvisionRequest) returns (DeProvisionResponse); rpc Status(StatusRequest) returns (StatusResponse); } diff --git a/backend/protos/xyz/block/ftl/provisioner/v1beta1/provisionerpbconnect/plugin.connect.go b/backend/protos/xyz/block/ftl/provisioner/v1beta1/provisionerpbconnect/plugin.connect.go index 7fbd47b509..fcf4061efb 100644 --- a/backend/protos/xyz/block/ftl/provisioner/v1beta1/provisionerpbconnect/plugin.connect.go +++ b/backend/protos/xyz/block/ftl/provisioner/v1beta1/provisionerpbconnect/plugin.connect.go @@ -40,9 +40,6 @@ const ( // ProvisionerPluginServiceProvisionProcedure is the fully-qualified name of the // ProvisionerPluginService's Provision RPC. ProvisionerPluginServiceProvisionProcedure = "/xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService/Provision" - // ProvisionerPluginServiceDeProvisionProcedure is the fully-qualified name of the - // ProvisionerPluginService's DeProvision RPC. - ProvisionerPluginServiceDeProvisionProcedure = "/xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService/DeProvision" // ProvisionerPluginServiceStatusProcedure is the fully-qualified name of the // ProvisionerPluginService's Status RPC. ProvisionerPluginServiceStatusProcedure = "/xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService/Status" @@ -53,7 +50,6 @@ const ( type ProvisionerPluginServiceClient interface { Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error) Provision(context.Context, *connect.Request[v1beta1.ProvisionRequest]) (*connect.Response[v1beta1.ProvisionResponse], error) - DeProvision(context.Context, *connect.Request[v1beta1.DeProvisionRequest]) (*connect.Response[v1beta1.DeProvisionResponse], error) Status(context.Context, *connect.Request[v1beta1.StatusRequest]) (*connect.Response[v1beta1.StatusResponse], error) } @@ -78,11 +74,6 @@ func NewProvisionerPluginServiceClient(httpClient connect.HTTPClient, baseURL st baseURL+ProvisionerPluginServiceProvisionProcedure, opts..., ), - deProvision: connect.NewClient[v1beta1.DeProvisionRequest, v1beta1.DeProvisionResponse]( - httpClient, - baseURL+ProvisionerPluginServiceDeProvisionProcedure, - opts..., - ), status: connect.NewClient[v1beta1.StatusRequest, v1beta1.StatusResponse]( httpClient, baseURL+ProvisionerPluginServiceStatusProcedure, @@ -93,10 +84,9 @@ func NewProvisionerPluginServiceClient(httpClient connect.HTTPClient, baseURL st // provisionerPluginServiceClient implements ProvisionerPluginServiceClient. type provisionerPluginServiceClient struct { - ping *connect.Client[v1.PingRequest, v1.PingResponse] - provision *connect.Client[v1beta1.ProvisionRequest, v1beta1.ProvisionResponse] - deProvision *connect.Client[v1beta1.DeProvisionRequest, v1beta1.DeProvisionResponse] - status *connect.Client[v1beta1.StatusRequest, v1beta1.StatusResponse] + ping *connect.Client[v1.PingRequest, v1.PingResponse] + provision *connect.Client[v1beta1.ProvisionRequest, v1beta1.ProvisionResponse] + status *connect.Client[v1beta1.StatusRequest, v1beta1.StatusResponse] } // Ping calls xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Ping. @@ -109,11 +99,6 @@ func (c *provisionerPluginServiceClient) Provision(ctx context.Context, req *con return c.provision.CallUnary(ctx, req) } -// DeProvision calls xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.DeProvision. -func (c *provisionerPluginServiceClient) DeProvision(ctx context.Context, req *connect.Request[v1beta1.DeProvisionRequest]) (*connect.Response[v1beta1.DeProvisionResponse], error) { - return c.deProvision.CallUnary(ctx, req) -} - // Status calls xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Status. func (c *provisionerPluginServiceClient) Status(ctx context.Context, req *connect.Request[v1beta1.StatusRequest]) (*connect.Response[v1beta1.StatusResponse], error) { return c.status.CallUnary(ctx, req) @@ -124,7 +109,6 @@ func (c *provisionerPluginServiceClient) Status(ctx context.Context, req *connec type ProvisionerPluginServiceHandler interface { Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error) Provision(context.Context, *connect.Request[v1beta1.ProvisionRequest]) (*connect.Response[v1beta1.ProvisionResponse], error) - DeProvision(context.Context, *connect.Request[v1beta1.DeProvisionRequest]) (*connect.Response[v1beta1.DeProvisionResponse], error) Status(context.Context, *connect.Request[v1beta1.StatusRequest]) (*connect.Response[v1beta1.StatusResponse], error) } @@ -144,11 +128,6 @@ func NewProvisionerPluginServiceHandler(svc ProvisionerPluginServiceHandler, opt svc.Provision, opts..., ) - provisionerPluginServiceDeProvisionHandler := connect.NewUnaryHandler( - ProvisionerPluginServiceDeProvisionProcedure, - svc.DeProvision, - opts..., - ) provisionerPluginServiceStatusHandler := connect.NewUnaryHandler( ProvisionerPluginServiceStatusProcedure, svc.Status, @@ -160,8 +139,6 @@ func NewProvisionerPluginServiceHandler(svc ProvisionerPluginServiceHandler, opt provisionerPluginServicePingHandler.ServeHTTP(w, r) case ProvisionerPluginServiceProvisionProcedure: provisionerPluginServiceProvisionHandler.ServeHTTP(w, r) - case ProvisionerPluginServiceDeProvisionProcedure: - provisionerPluginServiceDeProvisionHandler.ServeHTTP(w, r) case ProvisionerPluginServiceStatusProcedure: provisionerPluginServiceStatusHandler.ServeHTTP(w, r) default: @@ -181,10 +158,6 @@ func (UnimplementedProvisionerPluginServiceHandler) Provision(context.Context, * return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Provision is not implemented")) } -func (UnimplementedProvisionerPluginServiceHandler) DeProvision(context.Context, *connect.Request[v1beta1.DeProvisionRequest]) (*connect.Response[v1beta1.DeProvisionResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.DeProvision is not implemented")) -} - func (UnimplementedProvisionerPluginServiceHandler) Status(context.Context, *connect.Request[v1beta1.StatusRequest]) (*connect.Response[v1beta1.StatusResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Status is not implemented")) } diff --git a/backend/provisioner/inmem_provisioner.go b/backend/provisioner/inmem_provisioner.go index df428dc2aa..eb89dd6f71 100644 --- a/backend/provisioner/inmem_provisioner.go +++ b/backend/provisioner/inmem_provisioner.go @@ -57,89 +57,6 @@ type InMemProvisioner struct { removeHandlers map[schema.ResourceType]InMemResourceProvisionerFn } -func (d *InMemProvisioner) DeProvision(ctx context.Context, req *connect.Request[provisioner.DeProvisionRequest]) (*connect.Response[provisioner.DeProvisionResponse], error) { - logger := log.FromContext(ctx) - parsed, err := key.ParseChangesetKey(req.Msg.Changeset) - if err != nil { - err = fmt.Errorf("invalid changeset: %w", err) - return nil, connect.NewError(connect.CodeInvalidArgument, err) - } - - var replacementModule *schema.Module - if req.Msg.ReplacementModule != nil { - pm, err := schema.ValidatedModuleFromProto(req.Msg.ReplacementModule) - if err != nil { - err = fmt.Errorf("invalid replacment module: %w", err) - return nil, connect.NewError(connect.CodeInvalidArgument, err) - } - replacementModule = pm - } - removingModule, err := schema.ValidatedModuleFromProto(req.Msg.Module) - if err != nil { - err = fmt.Errorf("invalid removing module: %w", err) - return nil, connect.NewError(connect.CodeInvalidArgument, err) - } - kinds := slices.Map(req.Msg.Kinds, func(k string) schema.ResourceType { return schema.ResourceType(k) }) - currentNodes := schema.GetProvisioned(replacementModule) - removingNodes := schema.GetProvisioned(removingModule) - - task := &inMemProvisioningTask{} - // use chans to safely collect all events before completing each task - completions := make(chan stepCompletedEvent, 16) - - for id, toRemove := range removingNodes { - inUse, ok := currentNodes[id] - for _, resource := range toRemove.GetProvisioned() { - if !ok || !resource.IsEqual(inUse.GetProvisioned().Get(resource.Kind)) { - if slices.Contains(kinds, resource.Kind) { - handler, ok := d.removeHandlers[resource.Kind] - if !ok { - err := fmt.Errorf("unsupported resource type: %s", resource.Kind) - return nil, connect.NewError(connect.CodeInvalidArgument, err) - } - step := &inMemProvisioningStep{Done: atomic.New(false)} - task.steps = append(task.steps, step) - go func() { - event, err := handler(ctx, parsed, removingModule.Runtime.Deployment.DeploymentKey, toRemove) - if err != nil { - step.Err = err - logger.Errorf(err, "failed to de-provision resource %s:%s", resource.Kind, toRemove.ResourceID()) - completions <- stepCompletedEvent{step: step} - return - } - completions <- stepCompletedEvent{ - step: step, - event: optional.Ptr(event), - } - }() - } - } - } - } - - go func() { - for c := range channels.IterContext(ctx, completions) { - if e, ok := c.event.Get(); ok { - task.events = append(task.events, &e) - } - c.step.Done.Store(true) - done, err := task.Done() - if done || err != nil { - return - } - } - }() - - token := uuid.New().String() - logger.Debugf("started a task with token %s", token) - d.running.Store(token, task) - - return connect.NewResponse(&provisioner.DeProvisionResponse{ - ProvisioningToken: token, - Status: provisioner.ProvisionResponseStatus_PROVISION_RESPONSE_STATUS_SUBMITTED, - }), nil -} - func NewEmbeddedProvisioner(handlers map[schema.ResourceType]InMemResourceProvisionerFn, deProvisionHandlers map[schema.ResourceType]InMemResourceProvisionerFn) *InMemProvisioner { return &InMemProvisioner{ running: xsync.NewMapOf[string, *inMemProvisioningTask](), @@ -195,10 +112,19 @@ func (d *InMemProvisioner) Provision(ctx context.Context, req *connect.Request[p for _, resource := range desired.GetProvisioned() { if !ok || !resource.IsEqual(previous.GetProvisioned().Get(resource.Kind)) { if slices.Contains(kinds, resource.Kind) { - handler, ok := d.handlers[resource.Kind] - if !ok { - // TODO: should a missing de-provisioner handler be an error? - continue + var handler InMemResourceProvisionerFn + if desiredModule.Runtime.Deployment.State == schema.DeploymentStateDeProvisioning { + handler, ok = d.removeHandlers[resource.Kind] + if !ok { + // TODO: should a missing de-provisioner handler be an error? + continue + } + } else { + handler, ok = d.handlers[resource.Kind] + if !ok { + err := fmt.Errorf("unsupported resource type: %s", resource.Kind) + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } } step := &inMemProvisioningStep{Done: atomic.New(false)} task.steps = append(task.steps, step) diff --git a/backend/provisioner/noop_provisioner.go b/backend/provisioner/noop_provisioner.go index 3ecb6f0d81..42a7179f3a 100644 --- a/backend/provisioner/noop_provisioner.go +++ b/backend/provisioner/noop_provisioner.go @@ -13,13 +13,6 @@ import ( // NoopProvisioner is a provisioner that does nothing type NoopProvisioner struct{} -func (d *NoopProvisioner) DeProvision(ctx context.Context, c *connect.Request[provisioner.DeProvisionRequest]) (*connect.Response[provisioner.DeProvisionResponse], error) { - return connect.NewResponse(&provisioner.DeProvisionResponse{ - Status: provisioner.ProvisionResponseStatus_PROVISION_RESPONSE_STATUS_SUBMITTED, - ProvisioningToken: "token", - }), nil -} - var _ provisionerconnect.ProvisionerPluginServiceClient = (*NoopProvisioner)(nil) func (d *NoopProvisioner) Ping(context.Context, *connect.Request[ftlv1.PingRequest]) (*connect.Response[ftlv1.PingResponse], error) { diff --git a/backend/provisioner/service.go b/backend/provisioner/service.go index 87e5dcb6ef..8f998d4f49 100644 --- a/backend/provisioner/service.go +++ b/backend/provisioner/service.go @@ -181,16 +181,22 @@ func (s *Service) HandleChangesetCommitted(ctx context.Context, req *schema.Chan }() return nil } -func (s *Service) HandleChangesetDrained(ctx context.Context, req key.Changeset) error { +func (s *Service) HandleChangesetDrained(ctx context.Context, cs key.Changeset) error { logger := log.FromContext(ctx) group := errgroup.Group{} // TODO: Block deployments to make sure only one module is modified at a time - for _, module := range s.eventSource.ActiveChangeset()[req].RemovingModules { + changeset := s.eventSource.ActiveChangeset()[cs] + for _, module := range changeset.RemovingModules { moduleName := module.Name group.Go(func() error { - deployment := s.registry.CreateDeployment(ctx, req.Key, module, existingModule, func(element *schema.RuntimeElement) error { - cs := req.Key.String() + var current *schema.Module + existing := s.eventSource.CanonicalView().Module(moduleName) + if f, ok := existing.Get(); ok { + current = f + } + deployment := s.registry.CreateDeployment(ctx, cs, module, current, func(element *schema.RuntimeElement) error { + cs := cs.String() _, err := s.schemaClient.UpdateDeploymentRuntime(ctx, connect.NewRequest(&ftlv1.UpdateDeploymentRuntimeRequest{ Changeset: &cs, Update: element.ToProto(), @@ -220,7 +226,7 @@ func (s *Service) HandleChangesetDrained(ctx context.Context, req key.Changeset) if err != nil { return fmt.Errorf("error running deployments: %w", err) } - _, err := s.schemaClient.FinalizeChangeset(ctx, connect.NewRequest(&ftlv1.FinalizeChangesetRequest{Changeset: req.String()})) + _, err = s.schemaClient.FinalizeChangeset(ctx, connect.NewRequest(&ftlv1.FinalizeChangesetRequest{Changeset: cs.String()})) if err != nil { return fmt.Errorf("error finalizing changeset: %w", err) } diff --git a/frontend/console/src/protos/xyz/block/ftl/provisioner/v1beta1/plugin_connect.ts b/frontend/console/src/protos/xyz/block/ftl/provisioner/v1beta1/plugin_connect.ts index dbd5803158..823c2467a8 100644 --- a/frontend/console/src/protos/xyz/block/ftl/provisioner/v1beta1/plugin_connect.ts +++ b/frontend/console/src/protos/xyz/block/ftl/provisioner/v1beta1/plugin_connect.ts @@ -5,7 +5,7 @@ import { PingRequest, PingResponse } from "../../v1/ftl_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; -import { DeProvisionRequest, DeProvisionResponse, ProvisionRequest, ProvisionResponse, StatusRequest, StatusResponse } from "./plugin_pb.js"; +import { ProvisionRequest, ProvisionResponse, StatusRequest, StatusResponse } from "./plugin_pb.js"; /** * @generated from service xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService @@ -31,15 +31,6 @@ export const ProvisionerPluginService = { O: ProvisionResponse, kind: MethodKind.Unary, }, - /** - * @generated from rpc xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.DeProvision - */ - deProvision: { - name: "DeProvision", - I: DeProvisionRequest, - O: DeProvisionResponse, - kind: MethodKind.Unary, - }, /** * @generated from rpc xyz.block.ftl.provisioner.v1beta1.ProvisionerPluginService.Status */ diff --git a/frontend/console/src/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb.ts b/frontend/console/src/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb.ts index f0e307b3ab..477a10e6a1 100644 --- a/frontend/console/src/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb.ts +++ b/frontend/console/src/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb.ts @@ -131,110 +131,6 @@ export class ProvisionResponse extends Message { } } -/** - * @generated from message xyz.block.ftl.provisioner.v1beta1.DeProvisionRequest - */ -export class DeProvisionRequest extends Message { - /** - * @generated from field: string ftl_cluster_id = 1; - */ - ftlClusterId = ""; - - /** - * @generated from field: xyz.block.ftl.schema.v1.Module module = 2; - */ - module?: Module; - - /** - * @generated from field: optional xyz.block.ftl.schema.v1.Module replacement_module = 3; - */ - replacementModule?: Module; - - /** - * @generated from field: string changeset = 4; - */ - changeset = ""; - - /** - * @generated from field: repeated string kinds = 5; - */ - kinds: string[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "xyz.block.ftl.provisioner.v1beta1.DeProvisionRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "ftl_cluster_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "module", kind: "message", T: Module }, - { no: 3, name: "replacement_module", kind: "message", T: Module, opt: true }, - { no: 4, name: "changeset", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "kinds", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DeProvisionRequest { - return new DeProvisionRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DeProvisionRequest { - return new DeProvisionRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DeProvisionRequest { - return new DeProvisionRequest().fromJsonString(jsonString, options); - } - - static equals(a: DeProvisionRequest | PlainMessage | undefined, b: DeProvisionRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(DeProvisionRequest, a, b); - } -} - -/** - * @generated from message xyz.block.ftl.provisioner.v1beta1.DeProvisionResponse - */ -export class DeProvisionResponse extends Message { - /** - * @generated from field: string provisioning_token = 1; - */ - provisioningToken = ""; - - /** - * @generated from field: xyz.block.ftl.provisioner.v1beta1.ProvisionResponseStatus status = 2; - */ - status = ProvisionResponseStatus.UNSPECIFIED; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "xyz.block.ftl.provisioner.v1beta1.DeProvisionResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "provisioning_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "status", kind: "enum", T: proto3.getEnumType(ProvisionResponseStatus) }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DeProvisionResponse { - return new DeProvisionResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DeProvisionResponse { - return new DeProvisionResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DeProvisionResponse { - return new DeProvisionResponse().fromJsonString(jsonString, options); - } - - static equals(a: DeProvisionResponse | PlainMessage | undefined, b: DeProvisionResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(DeProvisionResponse, a, b); - } -} - /** * @generated from message xyz.block.ftl.provisioner.v1beta1.StatusRequest */ diff --git a/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb2.py b/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb2.py index 94e9c7a128..57374df41c 100644 --- a/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb2.py +++ b/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb2.py @@ -26,7 +26,7 @@ from xyz.block.ftl.v1 import ftl_pb2 as xyz_dot_block_dot_ftl_dot_v1_dot_ftl__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.xyz/block/ftl/provisioner/v1beta1/plugin.proto\x12!xyz.block.ftl.provisioner.v1beta1\x1a$xyz/block/ftl/schema/v1/schema.proto\x1a\x1axyz/block/ftl/v1/ftl.proto\"\xfe\x01\n\x10ProvisionRequest\x12$\n\x0e\x66tl_cluster_id\x18\x01 \x01(\tR\x0c\x66tlClusterId\x12\x46\n\x0e\x64\x65sired_module\x18\x02 \x01(\x0b\x32\x1f.xyz.block.ftl.schema.v1.ModuleR\rdesiredModule\x12H\n\x0fprevious_module\x18\x03 \x01(\x0b\x32\x1f.xyz.block.ftl.schema.v1.ModuleR\x0epreviousModule\x12\x1c\n\tchangeset\x18\x04 \x01(\tR\tchangeset\x12\x14\n\x05kinds\x18\x05 \x03(\tR\x05kinds\"\x96\x01\n\x11ProvisionResponse\x12-\n\x12provisioning_token\x18\x01 \x01(\tR\x11provisioningToken\x12R\n\x06status\x18\x02 \x01(\x0e\x32:.xyz.block.ftl.provisioner.v1beta1.ProvisionResponseStatusR\x06status\"\x93\x02\n\x12\x44\x65ProvisionRequest\x12$\n\x0e\x66tl_cluster_id\x18\x01 \x01(\tR\x0c\x66tlClusterId\x12\x37\n\x06module\x18\x02 \x01(\x0b\x32\x1f.xyz.block.ftl.schema.v1.ModuleR\x06module\x12S\n\x12replacement_module\x18\x03 \x01(\x0b\x32\x1f.xyz.block.ftl.schema.v1.ModuleH\x00R\x11replacementModule\x88\x01\x01\x12\x1c\n\tchangeset\x18\x04 \x01(\tR\tchangeset\x12\x14\n\x05kinds\x18\x05 \x03(\tR\x05kindsB\x15\n\x13_replacement_module\"\x98\x01\n\x13\x44\x65ProvisionResponse\x12-\n\x12provisioning_token\x18\x01 \x01(\tR\x11provisioningToken\x12R\n\x06status\x18\x02 \x01(\x0e\x32:.xyz.block.ftl.provisioner.v1beta1.ProvisionResponseStatusR\x06status\"\x86\x01\n\rStatusRequest\x12-\n\x12provisioning_token\x18\x01 \x01(\tR\x11provisioningToken\x12\x46\n\x0e\x64\x65sired_module\x18\x02 \x01(\x0b\x32\x1f.xyz.block.ftl.schema.v1.ModuleR\rdesiredModule\"\x8c\x03\n\x0eStatusResponse\x12\x61\n\x07running\x18\x01 \x01(\x0b\x32\x45.xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningRunningH\x00R\x07running\x12\x61\n\x07success\x18\x02 \x01(\x0b\x32\x45.xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningSuccessH\x00R\x07success\x1a\x15\n\x13ProvisioningRunning\x1a\x39\n\x12ProvisioningFailed\x12#\n\rerror_message\x18\x01 \x01(\tR\x0c\x65rrorMessage\x1aX\n\x13ProvisioningSuccess\x12\x41\n\x07outputs\x18\x01 \x03(\x0b\x32\'.xyz.block.ftl.schema.v1.RuntimeElementR\x07outputsB\x08\n\x06status*m\n\x17ProvisionResponseStatus\x12)\n%PROVISION_RESPONSE_STATUS_UNSPECIFIED\x10\x00\x12\'\n#PROVISION_RESPONSE_STATUS_SUBMITTED\x10\x01\x32\xc6\x03\n\x18ProvisionerPluginService\x12\x45\n\x04Ping\x12\x1d.xyz.block.ftl.v1.PingRequest\x1a\x1e.xyz.block.ftl.v1.PingResponse\x12v\n\tProvision\x12\x33.xyz.block.ftl.provisioner.v1beta1.ProvisionRequest\x1a\x34.xyz.block.ftl.provisioner.v1beta1.ProvisionResponse\x12|\n\x0b\x44\x65Provision\x12\x35.xyz.block.ftl.provisioner.v1beta1.DeProvisionRequest\x1a\x36.xyz.block.ftl.provisioner.v1beta1.DeProvisionResponse\x12m\n\x06Status\x12\x30.xyz.block.ftl.provisioner.v1beta1.StatusRequest\x1a\x31.xyz.block.ftl.provisioner.v1beta1.StatusResponseBWP\x01ZSgithub.com/block/ftl/backend/protos/xyz/block/ftl/provisioner/v1beta1;provisionerpbb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.xyz/block/ftl/provisioner/v1beta1/plugin.proto\x12!xyz.block.ftl.provisioner.v1beta1\x1a$xyz/block/ftl/schema/v1/schema.proto\x1a\x1axyz/block/ftl/v1/ftl.proto\"\xfe\x01\n\x10ProvisionRequest\x12$\n\x0e\x66tl_cluster_id\x18\x01 \x01(\tR\x0c\x66tlClusterId\x12\x46\n\x0e\x64\x65sired_module\x18\x02 \x01(\x0b\x32\x1f.xyz.block.ftl.schema.v1.ModuleR\rdesiredModule\x12H\n\x0fprevious_module\x18\x03 \x01(\x0b\x32\x1f.xyz.block.ftl.schema.v1.ModuleR\x0epreviousModule\x12\x1c\n\tchangeset\x18\x04 \x01(\tR\tchangeset\x12\x14\n\x05kinds\x18\x05 \x03(\tR\x05kinds\"\x96\x01\n\x11ProvisionResponse\x12-\n\x12provisioning_token\x18\x01 \x01(\tR\x11provisioningToken\x12R\n\x06status\x18\x02 \x01(\x0e\x32:.xyz.block.ftl.provisioner.v1beta1.ProvisionResponseStatusR\x06status\"\x86\x01\n\rStatusRequest\x12-\n\x12provisioning_token\x18\x01 \x01(\tR\x11provisioningToken\x12\x46\n\x0e\x64\x65sired_module\x18\x02 \x01(\x0b\x32\x1f.xyz.block.ftl.schema.v1.ModuleR\rdesiredModule\"\x8c\x03\n\x0eStatusResponse\x12\x61\n\x07running\x18\x01 \x01(\x0b\x32\x45.xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningRunningH\x00R\x07running\x12\x61\n\x07success\x18\x02 \x01(\x0b\x32\x45.xyz.block.ftl.provisioner.v1beta1.StatusResponse.ProvisioningSuccessH\x00R\x07success\x1a\x15\n\x13ProvisioningRunning\x1a\x39\n\x12ProvisioningFailed\x12#\n\rerror_message\x18\x01 \x01(\tR\x0c\x65rrorMessage\x1aX\n\x13ProvisioningSuccess\x12\x41\n\x07outputs\x18\x01 \x03(\x0b\x32\'.xyz.block.ftl.schema.v1.RuntimeElementR\x07outputsB\x08\n\x06status*m\n\x17ProvisionResponseStatus\x12)\n%PROVISION_RESPONSE_STATUS_UNSPECIFIED\x10\x00\x12\'\n#PROVISION_RESPONSE_STATUS_SUBMITTED\x10\x01\x32\xc8\x02\n\x18ProvisionerPluginService\x12\x45\n\x04Ping\x12\x1d.xyz.block.ftl.v1.PingRequest\x1a\x1e.xyz.block.ftl.v1.PingResponse\x12v\n\tProvision\x12\x33.xyz.block.ftl.provisioner.v1beta1.ProvisionRequest\x1a\x34.xyz.block.ftl.provisioner.v1beta1.ProvisionResponse\x12m\n\x06Status\x12\x30.xyz.block.ftl.provisioner.v1beta1.StatusRequest\x1a\x31.xyz.block.ftl.provisioner.v1beta1.StatusResponseBWP\x01ZSgithub.com/block/ftl/backend/protos/xyz/block/ftl/provisioner/v1beta1;provisionerpbb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -34,26 +34,22 @@ if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'P\001ZSgithub.com/block/ftl/backend/protos/xyz/block/ftl/provisioner/v1beta1;provisionerpb' - _globals['_PROVISIONRESPONSESTATUS']._serialized_start=1530 - _globals['_PROVISIONRESPONSESTATUS']._serialized_end=1639 + _globals['_PROVISIONRESPONSESTATUS']._serialized_start=1097 + _globals['_PROVISIONRESPONSESTATUS']._serialized_end=1206 _globals['_PROVISIONREQUEST']._serialized_start=152 _globals['_PROVISIONREQUEST']._serialized_end=406 _globals['_PROVISIONRESPONSE']._serialized_start=409 _globals['_PROVISIONRESPONSE']._serialized_end=559 - _globals['_DEPROVISIONREQUEST']._serialized_start=562 - _globals['_DEPROVISIONREQUEST']._serialized_end=837 - _globals['_DEPROVISIONRESPONSE']._serialized_start=840 - _globals['_DEPROVISIONRESPONSE']._serialized_end=992 - _globals['_STATUSREQUEST']._serialized_start=995 - _globals['_STATUSREQUEST']._serialized_end=1129 - _globals['_STATUSRESPONSE']._serialized_start=1132 - _globals['_STATUSRESPONSE']._serialized_end=1528 - _globals['_STATUSRESPONSE_PROVISIONINGRUNNING']._serialized_start=1348 - _globals['_STATUSRESPONSE_PROVISIONINGRUNNING']._serialized_end=1369 - _globals['_STATUSRESPONSE_PROVISIONINGFAILED']._serialized_start=1371 - _globals['_STATUSRESPONSE_PROVISIONINGFAILED']._serialized_end=1428 - _globals['_STATUSRESPONSE_PROVISIONINGSUCCESS']._serialized_start=1430 - _globals['_STATUSRESPONSE_PROVISIONINGSUCCESS']._serialized_end=1518 - _globals['_PROVISIONERPLUGINSERVICE']._serialized_start=1642 - _globals['_PROVISIONERPLUGINSERVICE']._serialized_end=2096 + _globals['_STATUSREQUEST']._serialized_start=562 + _globals['_STATUSREQUEST']._serialized_end=696 + _globals['_STATUSRESPONSE']._serialized_start=699 + _globals['_STATUSRESPONSE']._serialized_end=1095 + _globals['_STATUSRESPONSE_PROVISIONINGRUNNING']._serialized_start=915 + _globals['_STATUSRESPONSE_PROVISIONINGRUNNING']._serialized_end=936 + _globals['_STATUSRESPONSE_PROVISIONINGFAILED']._serialized_start=938 + _globals['_STATUSRESPONSE_PROVISIONINGFAILED']._serialized_end=995 + _globals['_STATUSRESPONSE_PROVISIONINGSUCCESS']._serialized_start=997 + _globals['_STATUSRESPONSE_PROVISIONINGSUCCESS']._serialized_end=1085 + _globals['_PROVISIONERPLUGINSERVICE']._serialized_start=1209 + _globals['_PROVISIONERPLUGINSERVICE']._serialized_end=1537 # @@protoc_insertion_point(module_scope) diff --git a/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb2.pyi b/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb2.pyi index 5e25a224d0..89982b69be 100644 --- a/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb2.pyi +++ b/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/provisioner/v1beta1/plugin_pb2.pyi @@ -37,28 +37,6 @@ class ProvisionResponse(_message.Message): status: ProvisionResponseStatus def __init__(self, provisioning_token: _Optional[str] = ..., status: _Optional[_Union[ProvisionResponseStatus, str]] = ...) -> None: ... -class DeProvisionRequest(_message.Message): - __slots__ = ("ftl_cluster_id", "module", "replacement_module", "changeset", "kinds") - FTL_CLUSTER_ID_FIELD_NUMBER: _ClassVar[int] - MODULE_FIELD_NUMBER: _ClassVar[int] - REPLACEMENT_MODULE_FIELD_NUMBER: _ClassVar[int] - CHANGESET_FIELD_NUMBER: _ClassVar[int] - KINDS_FIELD_NUMBER: _ClassVar[int] - ftl_cluster_id: str - module: _schema_pb2.Module - replacement_module: _schema_pb2.Module - changeset: str - kinds: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, ftl_cluster_id: _Optional[str] = ..., module: _Optional[_Union[_schema_pb2.Module, _Mapping]] = ..., replacement_module: _Optional[_Union[_schema_pb2.Module, _Mapping]] = ..., changeset: _Optional[str] = ..., kinds: _Optional[_Iterable[str]] = ...) -> None: ... - -class DeProvisionResponse(_message.Message): - __slots__ = ("provisioning_token", "status") - PROVISIONING_TOKEN_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - provisioning_token: str - status: ProvisionResponseStatus - def __init__(self, provisioning_token: _Optional[str] = ..., status: _Optional[_Union[ProvisionResponseStatus, str]] = ...) -> None: ... - class StatusRequest(_message.Message): __slots__ = ("provisioning_token", "desired_module") PROVISIONING_TOKEN_FIELD_NUMBER: _ClassVar[int]