@@ -89,12 +89,19 @@ def update_labels(yaml, instascale, instance_types):
8989 metadata .pop ("labels" )
9090
9191
92- def update_priority (item , dispatch_priority ):
92+ def update_priority (yaml , item , workers , dispatch_priority ):
9393 if dispatch_priority is not None :
9494 head = item .get ("generictemplate" ).get ("spec" ).get ("headGroupSpec" )
9595 worker = item .get ("generictemplate" ).get ("spec" ).get ("workerGroupSpecs" )[0 ]
9696 head ["template" ]["spec" ]["priorityClassName" ] = dispatch_priority
9797 worker ["template" ]["spec" ]["priorityClassName" ] = dispatch_priority
98+ update_scheduling_spec (yaml , workers )
99+
100+
101+ def update_scheduling_spec (yaml , workers ):
102+ spec = yaml .get ("spec" )
103+ spec ["schedulingSpec" ] = {"minAvailable" : "" }
104+ spec ["schedulingSpec" ]["minAvailable" ] = workers + 1
98105
99106
100107def update_custompodresources (
@@ -183,11 +190,6 @@ def update_resources(spec, min_cpu, max_cpu, min_memory, max_memory, gpu):
183190 limits ["nvidia.com/gpu" ] = gpu
184191
185192
186- def update_scheduling_spec (yaml , workers ):
187- spec = yaml .get ("spec" )
188- spec ["schedulingSpec" ]["minAvailable" ] = workers + 1
189-
190-
191193def update_nodes (
192194 item ,
193195 appwrapper_name ,
@@ -368,8 +370,7 @@ def generate_appwrapper(
368370 route_item = resources ["resources" ].get ("GenericItems" )[1 ]
369371 update_names (user_yaml , item , appwrapper_name , cluster_name , namespace )
370372 update_labels (user_yaml , instascale , instance_types )
371- update_priority (item , dispatch_priority )
372- update_scheduling_spec (user_yaml , workers )
373+ update_priority (user_yaml , item , workers , dispatch_priority )
373374 update_custompodresources (
374375 item , min_cpu , max_cpu , min_memory , max_memory , gpu , workers
375376 )
0 commit comments