Beispiel #1
0
 def mark_affinity_met_because_all_affinity_pods_are_matched(
         self, pod: Pod, globalVar: GlobalVar):
     assert pod.calc_affinity_pods_list_length == pod.podsMatchedByAffinity_length
     assert pod.affinity_set == True
     # assert globalVar.block_policy_calculated == True
     pod.affinity_met = True
     globalVar.block_policy_calculated = True
Beispiel #2
0
 def mark_antiaffinity_met_because_all_antiaffinity_pods_are_matched_and_those_that_cant_dont_suite(
         self, pod: Pod, globalVar: GlobalVar):
     assert pod.calc_antiaffinity_pods_list_length == pod.target_number_of_antiaffinity_pods
     assert pod.antiaffinity_set == True
     # assert globalVar.block_policy_calculated == True
     pod.antiaffinity_met = True
     globalVar.block_policy_calculated = True
Beispiel #3
0
 def mark_that_node_cant_allocate_pod_by_mem(self, pod: Pod, node: Node,
                                             globalVar: GlobalVar):
     assert node.isNull == False
     if not node in pod.nodesThatCantAllocateThisPod:
         assert pod.memRequest > node.memCapacity - node.currentFormalMemConsumption
         pod.nodesThatCantAllocateThisPod.add(node)
         pod.nodesThatCantAllocateThisPod_length += 1
     # assert globalVar.block_policy_calculated == True
     globalVar.block_policy_calculated = True
Beispiel #4
0
 def mark_checked_pod_as_affinity_checked_for_target_pod(
         self, target_pod: Pod, checked_pod: Pod, globalVar: GlobalVar,
         scheduler: Scheduler):
     if checked_pod.atNode == target_pod.atNode and \
                 target_pod.affinity_set == True and \
             checked_pod not in target_pod.calc_affinity_pods_list:
         target_pod.calc_affinity_pods_list.add(checked_pod)
         target_pod.calc_affinity_pods_list_length += 1
     assert checked_pod in target_pod.podsMatchedByAffinity
     # assert globalVar.block_policy_calculated == True
     globalVar.block_policy_calculated = True
Beispiel #5
0
 def mark_checked_pod_as_antiaffinity_checked_for_target_pod(
         self, target_pod: Pod, antiaffinity_pod: Pod, globalVar: GlobalVar,
         scheduler: Scheduler, antiaffinity_pod_node: Node):
     if antiaffinity_pod.atNode != target_pod.atNode and \
                 target_pod.antiaffinity_set == True and \
             antiaffinity_pod not in target_pod.calc_antiaffinity_pods_list:
         target_pod.calc_antiaffinity_pods_list.add(antiaffinity_pod)
         target_pod.calc_antiaffinity_pods_list_length += 1
     assert antiaffinity_pod in target_pod.podsMatchedByAntiaffinity
     assert antiaffinity_pod.atNode == antiaffinity_pod_node
     assert antiaffinity_pod_node.isNull == False
     # assert globalVar.block_policy_calculated == True
     globalVar.block_policy_calculated = True