github.com/kubewharf/katalyst-core@v0.5.3/pkg/agent/qrm-plugins/advisorsvc/advisor_svc.proto (about) 1 /* 2 Copyright 2022 The Katalyst Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 syntax = 'proto3'; 18 19 package advisorsvc; 20 21 import "github.com/gogo/protobuf/gogoproto/gogo.proto"; 22 import "github.com/kubewharf/kubelet/pkg/apis/resourceplugin/v1alpha1/api.proto"; 23 24 option (gogoproto.goproto_stringer_all) = false; 25 option (gogoproto.stringer_all) = true; 26 option (gogoproto.goproto_getters_all) = true; 27 option (gogoproto.marshaler_all) = true; 28 option (gogoproto.sizer_all) = true; 29 option (gogoproto.unmarshaler_all) = true; 30 option (gogoproto.goproto_unrecognized_all) = false; 31 32 option go_package = "github.com/kubewharf/katalyst-core/pkg/agent/qrm-plugins/advisorsvc"; 33 34 // containing metadata of the container which won't be changed during container's lifecycle 35 message ContainerMetadata { 36 string pod_uid = 1; 37 string pod_namespace = 2; 38 string pod_name = 3; 39 string container_name = 4; 40 resourceplugin.v1alpha1.ContainerType container_type = 5; 41 uint64 container_index = 6; 42 map<string,string> labels = 7; 43 map<string,string> annotations = 8; 44 string qos_level = 9; 45 uint64 requestQuantity = 10; 46 } 47 48 message AddContainerResponse { 49 } 50 51 message Empty { 52 } 53 54 message RemovePodRequest { 55 string pod_uid = 1; 56 } 57 58 message RemovePodResponse { 59 } 60 61 message ListAndWatchResponse { 62 map<string,CalculationEntries> pod_entries = 1; // keyed by podUID 63 repeated CalculationInfo extra_entries = 2; // for non-container level adjustment (eg. /kubepods/besteffort) 64 } 65 66 message CalculationEntries { 67 map<string,CalculationInfo> container_entries = 1; // keyed by container name 68 } 69 70 message CalculationInfo { 71 // eg. "/kubepods/besteffort"; 72 // empty for container; non-empty for high level cgroup path; since subsystem may be different for different control knob, so we use relative path here. 73 string cgroup_path = 1; 74 CalculationResult calculation_result = 2; 75 } 76 77 message CalculationResult { 78 map<string,string> values = 1; // eg. map[string]string{"memory_limit_in_bytes": "1073741824"} 79 } 80 81 service AdvisorService { 82 rpc AddContainer(ContainerMetadata) returns (AddContainerResponse) {} 83 rpc RemovePod(RemovePodRequest) returns (RemovePodResponse) {} 84 rpc ListAndWatch(Empty) returns (stream ListAndWatchResponse) {} 85 } 86 87 message ListContainersResponse { 88 repeated ContainerMetadata containers = 1; 89 } 90 91 service QRMService { 92 rpc ListContainers(Empty) returns (ListContainersResponse) {} 93 }