Skip to content

Commit 223be62

Browse files
authored
Merge pull request #22 from scaleapi/jason/deploy
Adding deploy handler
2 parents 44e7e8a + 34fd849 commit 223be62

File tree

2 files changed

+924
-903
lines changed

2 files changed

+924
-903
lines changed

src/agentex/lib/cli/handlers/deploy_handlers.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ def load_override_config(override_file_path: str | None = None) -> ClusterConfig
9494
) from e
9595

9696

97+
98+
def convert_env_vars_dict_to_list(env_vars: dict[str, str]) -> list[dict[str, str]]:
99+
"""Convert a dictionary of environment variables to a list of dictionaries"""
100+
return [{"name": key, "value": value} for key, value in env_vars.items()]
101+
102+
97103
def merge_deployment_configs(
98104
manifest: AgentManifest,
99105
cluster_config: ClusterConfig | None,
@@ -219,6 +225,21 @@ def merge_deployment_configs(
219225
if cluster_config.additional_overrides:
220226
_deep_merge(helm_values, cluster_config.additional_overrides)
221227

228+
# Convert the env vars to a list of dictionaries
229+
if "env" in helm_values:
230+
helm_values["env"] = convert_env_vars_dict_to_list(helm_values["env"])
231+
if TEMPORAL_WORKER_KEY in helm_values and "env" in helm_values[TEMPORAL_WORKER_KEY]:
232+
helm_values[TEMPORAL_WORKER_KEY]["env"] = convert_env_vars_dict_to_list(
233+
helm_values[TEMPORAL_WORKER_KEY]["env"]
234+
)
235+
236+
print("Deploying with the following helm values: ", helm_values)alues["env"] = convert_env_vars_dict_to_list(helm_values["env"])
237+
if TEMPORAL_WORKER_KEY in helm_values:
238+
helm_values[TEMPORAL_WORKER_KEY]["env"] = convert_env_vars_dict_to_list(
239+
helm_values[TEMPORAL_WORKER_KEY]["env"]
240+
)
241+
242+
print("Deploying with the following helm values: ", helm_values)
222243
return helm_values
223244

224245

0 commit comments

Comments
 (0)