File tree 2 files changed +24
-10
lines changed
2 files changed +24
-10
lines changed Original file line number Diff line number Diff line change 35
35
RayCluster ,
36
36
RayClusterStatus ,
37
37
)
38
- from kubernetes import client , config
38
+ from kubernetes import client , config , utils
39
39
import yaml
40
40
import os
41
41
import requests
@@ -165,15 +165,28 @@ def up(self):
165
165
try :
166
166
config_check ()
167
167
api_instance = client .CustomObjectsApi (api_config_handler ())
168
- with open (self .app_wrapper_yaml ) as f :
169
- aw = yaml .load (f , Loader = yaml .FullLoader )
170
- api_instance .create_namespaced_custom_object (
171
- group = "workload.codeflare.dev" ,
172
- version = "v1beta1" ,
173
- namespace = namespace ,
174
- plural = "appwrappers" ,
175
- body = aw ,
176
- )
168
+ if self .config .mcad :
169
+ with open (self .app_wrapper_yaml ) as f :
170
+ aw = yaml .load (f , Loader = yaml .FullLoader )
171
+ api_instance .create_namespaced_custom_object (
172
+ group = "workload.codeflare.dev" ,
173
+ version = "v1beta1" ,
174
+ namespace = namespace ,
175
+ plural = "appwrappers" ,
176
+ body = aw ,
177
+ )
178
+ else :
179
+ with open (self .app_wrapper_yaml ) as f :
180
+ yamls = yaml .load_all (f , Loader = yaml .FullLoader )
181
+ for resource in yamls :
182
+ print (resource ["kind" ])
183
+ # api_instance.create_namespaced_custom_object(
184
+ # group="ray.io",
185
+ # version="v1alpha1",
186
+ # namespace=namespace,
187
+ # plural="rayclusters",
188
+ # body=aw,
189
+ # )
177
190
except Exception as e : # pragma: no cover
178
191
return _kube_api_error_handling (e )
179
192
Original file line number Diff line number Diff line change @@ -375,6 +375,7 @@ def write_components(user_yaml, output_file_name):
375
375
with open (output_file_name , "a" ) as outfile :
376
376
for component in components :
377
377
if "generictemplate" in component :
378
+ outfile .write ("---\n " )
378
379
yaml .dump (
379
380
component ["generictemplate" ], outfile , default_flow_style = False
380
381
)
You can’t perform that action at this time.
0 commit comments