@@ -87,56 +87,6 @@ def update_names(yaml, item, appwrapper_name, cluster_name, namespace):
87
87
lower_meta ["namespace" ] = namespace
88
88
89
89
90
- def update_custompodresources (
91
- item ,
92
- min_cpu ,
93
- max_cpu ,
94
- min_memory ,
95
- max_memory ,
96
- gpu ,
97
- workers ,
98
- head_cpus ,
99
- head_memory ,
100
- head_gpus ,
101
- ):
102
- if "custompodresources" in item .keys ():
103
- custompodresources = item .get ("custompodresources" )
104
- for i in range (len (custompodresources )):
105
- resource = custompodresources [i ]
106
- if i == 0 :
107
- # Leave head node resources as template default
108
- resource ["requests" ]["cpu" ] = head_cpus
109
- resource ["limits" ]["cpu" ] = head_cpus
110
- resource ["requests" ]["memory" ] = head_memory
111
- resource ["limits" ]["memory" ] = head_memory
112
- resource ["requests" ]["nvidia.com/gpu" ] = head_gpus
113
- resource ["limits" ]["nvidia.com/gpu" ] = head_gpus
114
-
115
- else :
116
- for k , v in resource .items ():
117
- if k == "replicas" and i == 1 :
118
- resource [k ] = workers
119
- if k == "requests" or k == "limits" :
120
- for spec , _ in v .items ():
121
- if spec == "cpu" :
122
- if k == "limits" :
123
- resource [k ][spec ] = max_cpu
124
- else :
125
- resource [k ][spec ] = min_cpu
126
- if spec == "memory" :
127
- if k == "limits" :
128
- resource [k ][spec ] = max_memory
129
- else :
130
- resource [k ][spec ] = min_memory
131
- if spec == "nvidia.com/gpu" :
132
- if i == 0 :
133
- resource [k ][spec ] = 0
134
- else :
135
- resource [k ][spec ] = gpu
136
- else :
137
- sys .exit ("Error: malformed template" )
138
-
139
-
140
90
def update_image (spec , image ):
141
91
containers = spec .get ("containers" )
142
92
for container in containers :
@@ -355,18 +305,6 @@ def generate_appwrapper(
355
305
cluster_name ,
356
306
namespace ,
357
307
)
358
- update_custompodresources (
359
- item ,
360
- min_cpu ,
361
- max_cpu ,
362
- min_memory ,
363
- max_memory ,
364
- gpu ,
365
- workers ,
366
- head_cpus ,
367
- head_memory ,
368
- head_gpus ,
369
- )
370
308
update_nodes (
371
309
item ,
372
310
appwrapper_name ,
0 commit comments