@@ -107,7 +107,17 @@ def update_priority(yaml, item, dispatch_priority, priority_val):
107
107
108
108
109
109
def update_custompodresources (
110
- item , min_cpu , max_cpu , min_memory , max_memory , gpu , workers , head_cpus , head_memory , head_gpus ):
110
+ item ,
111
+ min_cpu ,
112
+ max_cpu ,
113
+ min_memory ,
114
+ max_memory ,
115
+ gpu ,
116
+ workers ,
117
+ head_cpus ,
118
+ head_memory ,
119
+ head_gpus ,
120
+ ):
111
121
if "custompodresources" in item .keys ():
112
122
custompodresources = item .get ("custompodresources" )
113
123
for i in range (len (custompodresources )):
@@ -120,8 +130,8 @@ def update_custompodresources(
120
130
resource ["limits" ]["memory" ] = str (head_memory ) + "G"
121
131
resource ["requests" ]["nvidia.com/gpu" ] = head_gpus
122
132
resource ["limits" ]["nvidia.com/gpu" ] = head_gpus
123
-
124
- else :
133
+
134
+ else :
125
135
for k , v in resource .items ():
126
136
if k == "replicas" and i == 1 :
127
137
resource [k ] = workers
@@ -217,8 +227,8 @@ def update_nodes(
217
227
):
218
228
if "generictemplate" in item .keys ():
219
229
head = item .get ("generictemplate" ).get ("spec" ).get ("headGroupSpec" )
220
- head ["rayStartParams" ]["num_gpus " ] = str (int (head_gpus ))
221
-
230
+ head ["rayStartParams" ]["num-gpus " ] = str (int (head_gpus ))
231
+
222
232
worker = item .get ("generictemplate" ).get ("spec" ).get ("workerGroupSpecs" )[0 ]
223
233
# Head counts as first worker
224
234
worker ["replicas" ] = workers
@@ -235,7 +245,9 @@ def update_nodes(
235
245
update_env (spec , env )
236
246
if comp == head :
237
247
# TODO: Eventually add head node configuration outside of template
238
- update_resources (spec , head_cpus , head_cpus , head_memory , head_memory , head_gpus )
248
+ update_resources (
249
+ spec , head_cpus , head_cpus , head_memory , head_memory , head_gpus
250
+ )
239
251
else :
240
252
update_resources (spec , min_cpu , max_cpu , min_memory , max_memory , gpu )
241
253
@@ -388,7 +400,17 @@ def generate_appwrapper(
388
400
update_labels (user_yaml , instascale , instance_types )
389
401
update_priority (user_yaml , item , dispatch_priority , priority_val )
390
402
update_custompodresources (
391
- item , min_cpu , max_cpu , min_memory , max_memory , gpu , workers , head_cpus , head_memory , head_gpus )
403
+ item ,
404
+ min_cpu ,
405
+ max_cpu ,
406
+ min_memory ,
407
+ max_memory ,
408
+ gpu ,
409
+ workers ,
410
+ head_cpus ,
411
+ head_memory ,
412
+ head_gpus ,
413
+ )
392
414
update_nodes (
393
415
item ,
394
416
appwrapper_name ,
0 commit comments