Skip to content

Commit 930b9c5

Browse files
committed
RHOAIENG-8098 - ClusterConfiguration can be patched
1 parent c51ab98 commit 930b9c5

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/codeflare_sdk/cluster/cluster.py

+2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def create_app_wrapper(self):
145145
gpu = self.config.num_gpus
146146
workers = self.config.num_workers
147147
template = self.config.template
148+
template_update_dict = self.config.template_update_dict
148149
image = self.config.image
149150
appwrapper = self.config.appwrapper
150151
env = self.config.envs
@@ -176,6 +177,7 @@ def create_app_wrapper(self):
176177
labels=labels,
177178
volumes=volumes,
178179
volume_mounts=volume_mounts,
180+
template_update_dict = template_update_dict
179181
)
180182

181183
# creates a new cluster with the provided or default spec

src/codeflare_sdk/cluster/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class ClusterConfiguration:
4646
max_memory: typing.Union[int, str] = 2
4747
num_gpus: int = 0
4848
template: str = f"{dir}/templates/base-template.yaml"
49+
template_update_dict = {}
4950
appwrapper: bool = False
5051
envs: dict = field(default_factory=dict)
5152
image: str = ""

src/codeflare_sdk/utils/generate_yaml.py

+2
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,10 @@ def generate_appwrapper(
300300
labels,
301301
volumes: list[client.V1Volume],
302302
volume_mounts: list[client.V1VolumeMount],
303+
template_update_dict = {}
303304
):
304305
cluster_yaml = read_template(template)
306+
cluster_yaml.update(template_update_dict)
305307
appwrapper_name, cluster_name = gen_names(name)
306308
update_names(cluster_yaml, cluster_name, namespace)
307309
update_nodes(

0 commit comments

Comments
 (0)