File tree Expand file tree Collapse file tree 4 files changed +7
-0
lines changed Expand file tree Collapse file tree 4 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ cryptography = "40.0.2"
3030executing = " 1.2.0"
3131pydantic = " < 2"
3232ipywidgets = " 8.1.2"
33+ mergedeep = " 1.3.4"
3334
3435[tool .poetry .group .docs ]
3536optional = true
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 = ""
Original file line number Diff line number Diff line change 3030from os import urandom
3131from base64 import b64encode
3232from urllib3 .util import parse_url
33+ from mergedeep import merge
3334
3435
3536def read_template (template ):
@@ -300,8 +301,10 @@ def generate_appwrapper(
300301 labels ,
301302 volumes : list [client .V1Volume ],
302303 volume_mounts : list [client .V1VolumeMount ],
304+ template_update_dict = {},
303305):
304306 cluster_yaml = read_template (template )
307+ cluster_yaml = merge (cluster_yaml , template_update_dict )
305308 appwrapper_name , cluster_name = gen_names (name )
306309 update_names (cluster_yaml , cluster_name , namespace )
307310 update_nodes (
You can’t perform that action at this time.
0 commit comments