File tree 3 files changed +24
-1
lines changed
3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,10 @@ def create_app_wrapper(self):
99
99
100
100
# Before attempting to create the cluster AW, let's evaluate the ClusterConfig
101
101
if self .config .dispatch_priority :
102
+ if not self .config .mcad :
103
+ raise ValueError (
104
+ "Invalid Cluster Configuration, cannot have dispatch priority without MCAD"
105
+ )
102
106
priority_val = self .evaluate_dispatch_priority ()
103
107
if priority_val == None :
104
108
raise ValueError (
@@ -121,6 +125,7 @@ def create_app_wrapper(self):
121
125
template = self .config .template
122
126
image = self .config .image
123
127
instascale = self .config .instascale
128
+ mcad = self .config .mcad
124
129
instance_types = self .config .machine_types
125
130
env = self .config .envs
126
131
local_interactive = self .config .local_interactive
@@ -141,6 +146,7 @@ def create_app_wrapper(self):
141
146
template = template ,
142
147
image = image ,
143
148
instascale = instascale ,
149
+ mcad = mcad ,
144
150
instance_types = instance_types ,
145
151
env = env ,
146
152
local_interactive = local_interactive ,
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ class ClusterConfiguration:
46
46
num_gpus : int = 0
47
47
template : str = f"{ dir } /templates/base-template.yaml"
48
48
instascale : bool = False
49
+ mcad : bool = True
49
50
envs : dict = field (default_factory = dict )
50
51
image : str = "quay.io/project-codeflare/ray:2.5.0-py38-cu116"
51
52
local_interactive : bool = False
Original file line number Diff line number Diff line change @@ -369,6 +369,18 @@ def write_user_appwrapper(user_yaml, output_file_name):
369
369
print (f"Written to: { output_file_name } " )
370
370
371
371
372
+ def write_components (user_yaml , output_file_name ):
373
+ components = user_yaml .get ("spec" , "resources" )["resources" ].get ("GenericItems" )
374
+ open (output_file_name , "w" ).close ()
375
+ with open (output_file_name , "a" ) as outfile :
376
+ for component in components :
377
+ if "generictemplate" in component :
378
+ yaml .dump (
379
+ component ["generictemplate" ], outfile , default_flow_style = False
380
+ )
381
+ print (f"Written to: { output_file_name } " )
382
+
383
+
372
384
def generate_appwrapper (
373
385
name : str ,
374
386
namespace : str ,
@@ -384,6 +396,7 @@ def generate_appwrapper(
384
396
template : str ,
385
397
image : str ,
386
398
instascale : bool ,
399
+ mcad : bool ,
387
400
instance_types : list ,
388
401
env ,
389
402
local_interactive : bool ,
@@ -434,5 +447,8 @@ def generate_appwrapper(
434
447
else :
435
448
disable_raycluster_tls (resources ["resources" ])
436
449
outfile = appwrapper_name + ".yaml"
437
- write_user_appwrapper (user_yaml , outfile )
450
+ if not mcad :
451
+ write_components (user_yaml , outfile )
452
+ else :
453
+ write_user_appwrapper (user_yaml , outfile )
438
454
return outfile
You can’t perform that action at this time.
0 commit comments