File tree 4 files changed +7
-0
lines changed
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"
30
30
executing = " 1.2.0"
31
31
pydantic = " < 2"
32
32
ipywidgets = " 8.1.2"
33
+ mergedeep = " 1.3.4"
33
34
34
35
[tool .poetry .group .docs ]
35
36
optional = true
Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ def create_app_wrapper(self):
145
145
gpu = self .config .num_gpus
146
146
workers = self .config .num_workers
147
147
template = self .config .template
148
+ template_update_dict = self .config .template_update_dict
148
149
image = self .config .image
149
150
appwrapper = self .config .appwrapper
150
151
env = self .config .envs
@@ -176,6 +177,7 @@ def create_app_wrapper(self):
176
177
labels = labels ,
177
178
volumes = volumes ,
178
179
volume_mounts = volume_mounts ,
180
+ template_update_dict = template_update_dict ,
179
181
)
180
182
181
183
# 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:
46
46
max_memory : typing .Union [int , str ] = 2
47
47
num_gpus : int = 0
48
48
template : str = f"{ dir } /templates/base-template.yaml"
49
+ template_update_dict = {}
49
50
appwrapper : bool = False
50
51
envs : dict = field (default_factory = dict )
51
52
image : str = ""
Original file line number Diff line number Diff line change 30
30
from os import urandom
31
31
from base64 import b64encode
32
32
from urllib3 .util import parse_url
33
+ from mergedeep import merge
33
34
34
35
35
36
def read_template (template ):
@@ -300,8 +301,10 @@ def generate_appwrapper(
300
301
labels ,
301
302
volumes : list [client .V1Volume ],
302
303
volume_mounts : list [client .V1VolumeMount ],
304
+ template_update_dict = {},
303
305
):
304
306
cluster_yaml = read_template (template )
307
+ cluster_yaml = merge (cluster_yaml , template_update_dict )
305
308
appwrapper_name , cluster_name = gen_names (name )
306
309
update_names (cluster_yaml , cluster_name , namespace )
307
310
update_nodes (
You can’t perform that action at this time.
0 commit comments