github.com/kubewharf/katalyst-core@v0.5.3/pkg/agent/qrm-plugins/cpu/dynamicpolicy/cpuadvisor/cpu.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 cpuadvisor; 20 21 import "github.com/gogo/protobuf/gogoproto/gogo.proto"; 22 import "github.com/kubewharf/katalyst-core/pkg/agent/qrm-plugins/advisorsvc/advisor_svc.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/cpu/dynamicpolicy/cpuadvisor"; 33 34 message ListAndWatchResponse { 35 map<string,CalculationEntries> entries = 1; // keyed by pool name or podUID 36 bool allow_shared_cores_overlap_reclaimed_cores= 2; // if set to true, cpuset of shared_cores may overlap with reclaimed_cores 37 } 38 39 message CalculationEntries { 40 map<string,CalculationInfo> entries = 1; // keyed by "" (for pool) or container name (for container) 41 } 42 43 message CalculationInfo { 44 // valid values: 45 // 1. "dedicated" (dedicated_cores container with or without numa_biding) 46 // 2. real pool name (shared_cores container entries and pool entries),, including: 47 // - common pools (eg. share, reclaim, flink, batch, bmq) 48 // - pools generated by qos aware server containing isolated shared_cores containers (eg. isolation0, isolation1, ...) 49 string owner_pool_name = 1; 50 map<int64, NumaCalculationResult> calculation_results_by_numas = 2; // keyed by NUMA id 51 } 52 53 message NumaCalculationResult { 54 // every block doesn't overlap with other blocks in same NumaCalculationResult 55 repeated Block blocks = 2; 56 } 57 58 message Block { 59 uint64 result = 1; 60 repeated OverlapTarget overlap_targets = 2; 61 string block_id = 3; 62 } 63 64 message OverlapTarget { 65 string overlap_target_pool_name = 1; 66 string overlap_target_pod_uid = 2; 67 string overlap_target_container_name = 3; 68 OverlapType overlap_type = 4; 69 } 70 71 enum OverlapType { 72 OverlapWithPod = 0; 73 OverlapWithPool = 1; 74 } 75 76 message GetCheckpointRequest { 77 } 78 79 message GetCheckpointResponse { 80 map<string,AllocationEntries> entries = 1; // keyed by pool name or podUID 81 } 82 83 message AllocationEntries { 84 map<string,AllocationInfo> entries = 1; // keyed by "" (for pool) or container name (for container) 85 } 86 87 message AllocationInfo { 88 bool ramp_up = 1; 89 // owner_pool_name indicates the real pool this entry belongs to, it may equal to 90 // 1. real pool name shows up explicitly in GetCheckpointResponse, including: 91 // - common pools (eg. share, reclaim, flink, batch, bmq) 92 // - pools generated by qos aware server containing isolated shared_cores containers (eg. isolation0, isolation1, ...) 93 // 2. "dedicated" (dedicated_cores container with or without numa_biding) 94 // 3. "fallback" (dedicated_cores without numa_binding will be put to this fake pool when it can't allocate isolated cpuset for them), there is no AllocationInfo for this fake pool 95 // 4. empty (the entry is ramping up) 96 string owner_pool_name = 2; 97 map<uint64,string> topology_aware_assignments = 3; // keyed by NUMA id 98 map<uint64,string> original_topology_aware_assignments = 4; // keyed by NUMA id 99 } 100 101 service CPUAdvisor { 102 rpc AddContainer(advisorsvc.ContainerMetadata) returns (advisorsvc.AddContainerResponse) {} 103 rpc RemovePod(advisorsvc.RemovePodRequest) returns (advisorsvc.RemovePodResponse) {} 104 rpc ListAndWatch(advisorsvc.Empty) returns (stream ListAndWatchResponse) {} 105 } 106 107 service CPUPlugin { 108 rpc GetCheckpoint(GetCheckpointRequest) returns (GetCheckpointResponse) {} 109 }