From bd85c098660b7d368f1591055f937181e7cf4f70 Mon Sep 17 00:00:00 2001 From: wei liu Date: Mon, 11 Nov 2024 15:22:19 +0800 Subject: [PATCH] enhance: Enable prefer node lables in resource group (#328) (#347) * enhance: Enable prefer node lables in resource group add prefer node labels in resource groups, so resource group will prefer to accept some node with given label. * support node label format with key value pair * refine node label filter name --------- Signed-off-by: Wei Liu --- go-api/rgpb/rg.pb.go | 185 +++++++++++++++++++++++++++++++------------ proto/rg.proto | 7 ++ 2 files changed, 141 insertions(+), 51 deletions(-) diff --git a/go-api/rgpb/rg.pb.go b/go-api/rgpb/rg.pb.go index f823e18..f56d5e4 100644 --- a/go-api/rgpb/rg.pb.go +++ b/go-api/rgpb/rg.pb.go @@ -7,6 +7,7 @@ package rgpb import ( + commonpb "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -114,6 +115,53 @@ func (x *ResourceGroupTransfer) GetResourceGroup() string { return "" } +type ResourceGroupNodeFilter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeLabels []*commonpb.KeyValuePair `protobuf:"bytes,1,rep,name=node_labels,json=nodeLabels,proto3" json:"node_labels,omitempty"` // node in resource group must match node labels requirements +} + +func (x *ResourceGroupNodeFilter) Reset() { + *x = ResourceGroupNodeFilter{} + if protoimpl.UnsafeEnabled { + mi := &file_rg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResourceGroupNodeFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResourceGroupNodeFilter) ProtoMessage() {} + +func (x *ResourceGroupNodeFilter) ProtoReflect() protoreflect.Message { + mi := &file_rg_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResourceGroupNodeFilter.ProtoReflect.Descriptor instead. +func (*ResourceGroupNodeFilter) Descriptor() ([]byte, []int) { + return file_rg_proto_rawDescGZIP(), []int{2} +} + +func (x *ResourceGroupNodeFilter) GetNodeLabels() []*commonpb.KeyValuePair { + if x != nil { + return x.NodeLabels + } + return nil +} + type ResourceGroupConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -123,12 +171,13 @@ type ResourceGroupConfig struct { Limits *ResourceGroupLimit `protobuf:"bytes,2,opt,name=limits,proto3" json:"limits,omitempty"` // limited node num in resource group, if node num is more than limits.nodeNum, it will be transfer to other resource group. TransferFrom []*ResourceGroupTransfer `protobuf:"bytes,3,rep,name=transfer_from,json=transferFrom,proto3" json:"transfer_from,omitempty"` // missing node should be transfer from given resource group at high priority in repeated list. TransferTo []*ResourceGroupTransfer `protobuf:"bytes,4,rep,name=transfer_to,json=transferTo,proto3" json:"transfer_to,omitempty"` // redundant node should be transfer to given resource group at high priority in repeated list. + NodeFilter *ResourceGroupNodeFilter `protobuf:"bytes,5,opt,name=node_filter,json=nodeFilter,proto3" json:"node_filter,omitempty"` // node in resource group must match node filters } func (x *ResourceGroupConfig) Reset() { *x = ResourceGroupConfig{} if protoimpl.UnsafeEnabled { - mi := &file_rg_proto_msgTypes[2] + mi := &file_rg_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -141,7 +190,7 @@ func (x *ResourceGroupConfig) String() string { func (*ResourceGroupConfig) ProtoMessage() {} func (x *ResourceGroupConfig) ProtoReflect() protoreflect.Message { - mi := &file_rg_proto_msgTypes[2] + mi := &file_rg_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -154,7 +203,7 @@ func (x *ResourceGroupConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceGroupConfig.ProtoReflect.Descriptor instead. func (*ResourceGroupConfig) Descriptor() ([]byte, []int) { - return file_rg_proto_rawDescGZIP(), []int{2} + return file_rg_proto_rawDescGZIP(), []int{3} } func (x *ResourceGroupConfig) GetRequests() *ResourceGroupLimit { @@ -185,45 +234,63 @@ func (x *ResourceGroupConfig) GetTransferTo() []*ResourceGroupTransfer { return nil } +func (x *ResourceGroupConfig) GetNodeFilter() *ResourceGroupNodeFilter { + if x != nil { + return x.NodeFilter + } + return nil +} + var File_rg_proto protoreflect.FileDescriptor var file_rg_proto_rawDesc = []byte{ 0x0a, 0x08, 0x72, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x6d, 0x69, 0x6c, 0x76, - 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x67, 0x22, 0x2f, 0x0a, 0x12, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x75, 0x6d, 0x22, 0x3e, 0x0a, 0x15, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xa9, 0x02, 0x0a, - 0x13, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, + 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x67, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2f, 0x0a, 0x12, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, + 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x75, 0x6d, 0x22, 0x3e, 0x0a, 0x15, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x5d, 0x0a, 0x17, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x6f, 0x64, 0x65, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6d, 0x69, 0x6c, + 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x0a, 0x6e, + 0x6f, 0x64, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0xf4, 0x02, 0x0a, 0x13, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x72, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x73, 0x12, 0x3b, 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x72, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x12, + 0x4b, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x66, 0x72, 0x6f, 0x6d, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x3b, 0x0a, 0x06, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x6c, 0x69, 0x6d, 0x69, - 0x74, 0x73, 0x12, 0x4b, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x66, - 0x72, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x69, 0x6c, 0x76, - 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x12, - 0x47, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x0a, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x6f, 0x42, 0x70, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x6d, - 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x42, 0x12, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x6c, - 0x76, 0x75, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x67, - 0x70, 0x62, 0xa0, 0x01, 0x01, 0xaa, 0x02, 0x12, 0x4d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x0c, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x47, 0x0a, 0x0b, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x72, 0x67, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x0a, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x54, 0x6f, 0x12, 0x49, 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x69, 0x6c, + 0x76, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x72, 0x67, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x6f, 0x64, 0x65, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x42, 0x70, 0x0a, 0x0e, 0x69, 0x6f, 0x2e, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x67, 0x72, + 0x70, 0x63, 0x42, 0x12, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x6d, + 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x67, 0x70, 0x62, 0xa0, 0x01, 0x01, 0xaa, 0x02, 0x12, + 0x4d, 0x69, 0x6c, 0x76, 0x75, 0x73, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x72, + 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -238,22 +305,26 @@ func file_rg_proto_rawDescGZIP() []byte { return file_rg_proto_rawDescData } -var file_rg_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_rg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_rg_proto_goTypes = []interface{}{ - (*ResourceGroupLimit)(nil), // 0: milvus.proto.rg.ResourceGroupLimit - (*ResourceGroupTransfer)(nil), // 1: milvus.proto.rg.ResourceGroupTransfer - (*ResourceGroupConfig)(nil), // 2: milvus.proto.rg.ResourceGroupConfig + (*ResourceGroupLimit)(nil), // 0: milvus.proto.rg.ResourceGroupLimit + (*ResourceGroupTransfer)(nil), // 1: milvus.proto.rg.ResourceGroupTransfer + (*ResourceGroupNodeFilter)(nil), // 2: milvus.proto.rg.ResourceGroupNodeFilter + (*ResourceGroupConfig)(nil), // 3: milvus.proto.rg.ResourceGroupConfig + (*commonpb.KeyValuePair)(nil), // 4: milvus.proto.common.KeyValuePair } var file_rg_proto_depIdxs = []int32{ - 0, // 0: milvus.proto.rg.ResourceGroupConfig.requests:type_name -> milvus.proto.rg.ResourceGroupLimit - 0, // 1: milvus.proto.rg.ResourceGroupConfig.limits:type_name -> milvus.proto.rg.ResourceGroupLimit - 1, // 2: milvus.proto.rg.ResourceGroupConfig.transfer_from:type_name -> milvus.proto.rg.ResourceGroupTransfer - 1, // 3: milvus.proto.rg.ResourceGroupConfig.transfer_to:type_name -> milvus.proto.rg.ResourceGroupTransfer - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 4, // 0: milvus.proto.rg.ResourceGroupNodeFilter.node_labels:type_name -> milvus.proto.common.KeyValuePair + 0, // 1: milvus.proto.rg.ResourceGroupConfig.requests:type_name -> milvus.proto.rg.ResourceGroupLimit + 0, // 2: milvus.proto.rg.ResourceGroupConfig.limits:type_name -> milvus.proto.rg.ResourceGroupLimit + 1, // 3: milvus.proto.rg.ResourceGroupConfig.transfer_from:type_name -> milvus.proto.rg.ResourceGroupTransfer + 1, // 4: milvus.proto.rg.ResourceGroupConfig.transfer_to:type_name -> milvus.proto.rg.ResourceGroupTransfer + 2, // 5: milvus.proto.rg.ResourceGroupConfig.node_filter:type_name -> milvus.proto.rg.ResourceGroupNodeFilter + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_rg_proto_init() } @@ -287,6 +358,18 @@ func file_rg_proto_init() { } } file_rg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceGroupNodeFilter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResourceGroupConfig); i { case 0: return &v.state @@ -305,7 +388,7 @@ func file_rg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_rg_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/rg.proto b/proto/rg.proto index 5aee428..91a14f9 100644 --- a/proto/rg.proto +++ b/proto/rg.proto @@ -10,6 +10,8 @@ option java_generate_equals_and_hash = true; option csharp_namespace = "Milvus.Client.Grpc"; +import "common.proto"; + message ResourceGroupLimit { int32 node_num = 1; // preserve for other limit. @@ -19,10 +21,15 @@ message ResourceGroupTransfer { string resource_group = 1; // resource groups can be transfered with current resource group. // preserve for other option, such as weight, priority or affinity setup. } + +message ResourceGroupNodeFilter { + repeated common.KeyValuePair node_labels = 1; // node in resource group must match node labels requirements +} message ResourceGroupConfig { ResourceGroupLimit requests = 1; // requests node num in resource group, if node num is less than requests.nodeNum, it will be transfer from other resource group. ResourceGroupLimit limits = 2; // limited node num in resource group, if node num is more than limits.nodeNum, it will be transfer to other resource group. repeated ResourceGroupTransfer transfer_from = 3; // missing node should be transfer from given resource group at high priority in repeated list. repeated ResourceGroupTransfer transfer_to = 4; // redundant node should be transfer to given resource group at high priority in repeated list. + ResourceGroupNodeFilter node_filter = 5; // node in resource group must match node filters }