Skip to content

Commit

Permalink
RHOAIENG-8098 - ClusterConfiguration can be patched
Browse files Browse the repository at this point in the history
  • Loading branch information
jiripetrlik committed Jun 19, 2024
1 parent c51ab98 commit 930b9c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/codeflare_sdk/cluster/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def create_app_wrapper(self):
gpu = self.config.num_gpus
workers = self.config.num_workers
template = self.config.template
template_update_dict = self.config.template_update_dict
image = self.config.image
appwrapper = self.config.appwrapper
env = self.config.envs
Expand Down Expand Up @@ -176,6 +177,7 @@ def create_app_wrapper(self):
labels=labels,
volumes=volumes,
volume_mounts=volume_mounts,
template_update_dict = template_update_dict
)

# creates a new cluster with the provided or default spec
Expand Down
1 change: 1 addition & 0 deletions src/codeflare_sdk/cluster/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class ClusterConfiguration:
max_memory: typing.Union[int, str] = 2
num_gpus: int = 0
template: str = f"{dir}/templates/base-template.yaml"
template_update_dict = {}
appwrapper: bool = False
envs: dict = field(default_factory=dict)
image: str = ""
Expand Down
2 changes: 2 additions & 0 deletions src/codeflare_sdk/utils/generate_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,10 @@ def generate_appwrapper(
labels,
volumes: list[client.V1Volume],
volume_mounts: list[client.V1VolumeMount],
template_update_dict = {}
):
cluster_yaml = read_template(template)
cluster_yaml.update(template_update_dict)
appwrapper_name, cluster_name = gen_names(name)
update_names(cluster_yaml, cluster_name, namespace)
update_nodes(
Expand Down

0 comments on commit 930b9c5

Please sign in to comment.