Skip to content

Commit

Permalink
Simplify yaml generation by starting from non-AppWrapper template
Browse files Browse the repository at this point in the history
The v1/beta2 AppWrapper can be wrapped around a RayCluster as
a simple prefix to the "real" yaml.  So we can simplify yaml
generation/manipulation by starting with a vanilla RayCluster
and just optionally put it inside an AppWrapper at the end.
  • Loading branch information
dgrove-oss authored and openshift-merge-bot[bot] committed Jun 18, 2024
1 parent 3864bcf commit 3d9ebc9
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 323 deletions.
2 changes: 1 addition & 1 deletion src/codeflare_sdk/cluster/awload.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class AWManager:
"""
An object for submitting and removing existing AppWrapper yamls
to be added to the MCAD queue.
to be added to the Kueue localqueue.
"""

def __init__(self, filename: str) -> None:
Expand Down
8 changes: 2 additions & 6 deletions src/codeflare_sdk/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,9 @@ def create_app_wrapper(self):
template = self.config.template
image = self.config.image
appwrapper = self.config.appwrapper
instance_types = self.config.machine_types
env = self.config.envs
image_pull_secrets = self.config.image_pull_secrets
write_to_file = self.config.write_to_file
verify_tls = self.config.verify_tls
local_queue = self.config.local_queue
labels = self.config.labels
return generate_appwrapper(
Expand All @@ -169,20 +167,18 @@ def create_app_wrapper(self):
template=template,
image=image,
appwrapper=appwrapper,
instance_types=instance_types,
env=env,
image_pull_secrets=image_pull_secrets,
write_to_file=write_to_file,
verify_tls=verify_tls,
local_queue=local_queue,
labels=labels,
)

# creates a new cluster with the provided or default spec
def up(self):
"""
Applies the AppWrapper yaml, pushing the resource request onto
the MCAD queue.
Applies the Cluster yaml, pushing the resource request onto
the Kueue localqueue.
"""

# check if RayCluster CustomResourceDefinition exists if not throw RuntimeError
Expand Down
Loading

0 comments on commit 3d9ebc9

Please sign in to comment.