11import os
2- import subprocess
32import tempfile
4- from pathlib import Path
3+ import subprocess
54from typing import Any
5+ from pathlib import Path
66
77import yaml
8- from pydantic import BaseModel , Field
8+ from pydantic import Field , BaseModel
99from rich .console import Console
1010
11- from agentex .lib .cli .utils .exceptions import DeploymentError , HelmError
12- from agentex .lib .sdk .config .environment_config import AgentEnvironmentConfig
13- from agentex .lib .cli .utils .kubectl_utils import check_and_switch_cluster_context
14- from agentex .lib .cli .utils .path_utils import calculate_docker_acp_module , PathResolutionError
11+ from agentex .lib .utils .logging import make_logger
12+ from agentex .lib .cli .utils .exceptions import HelmError , DeploymentError
13+ from agentex .lib .cli .utils .path_utils import PathResolutionError , calculate_docker_acp_module
1514from agentex .lib .environment_variables import EnvVarKeys
15+ from agentex .lib .cli .utils .kubectl_utils import check_and_switch_cluster_context
1616from agentex .lib .sdk .config .agent_config import AgentConfig
1717from agentex .lib .sdk .config .agent_manifest import AgentManifest
18-
19- from agentex .lib .utils .logging import make_logger
18+ from agentex .lib .sdk .config .environment_config import AgentEnvironmentConfig
2019
2120logger = make_logger (__name__ )
2221console = Console ()
@@ -46,23 +45,23 @@ def check_helm_installed() -> bool:
4645 return False
4746
4847
49- def add_helm_repo () -> None :
48+ def add_helm_repo (helm_repository_name : str , helm_repository_url : str ) -> None :
5049 """Add the agentex helm repository if not already added"""
5150 try :
5251 # Check if repo already exists
5352 result = subprocess .run (
5453 ["helm" , "repo" , "list" ], capture_output = True , text = True , check = True
5554 )
5655
57- if "scale-egp" not in result .stdout :
56+ if helm_repository_name not in result .stdout :
5857 console .print ("Adding agentex helm repository..." )
5958 subprocess .run (
6059 [
6160 "helm" ,
6261 "repo" ,
6362 "add" ,
64- "scale-egp" ,
65- "https://scale-egp-helm-charts-us-west-2.s3.amazonaws.com/charts" ,
63+ helm_repository_name ,
64+ helm_repository_url ,
6665 ],
6766 check = True ,
6867 )
@@ -265,7 +264,7 @@ def merge_deployment_configs(
265264 if not helm_overrides_command :
266265 add_acp_command_to_helm_values (helm_values , manifest , manifest_path )
267266
268- print ("Deploying with the following helm values: " , helm_values )
267+ console . print ("Deploying with the following helm values: " , helm_values )
269268 return helm_values
270269
271270
@@ -318,8 +317,14 @@ def deploy_agent(
318317 else :
319318 console .print (f"[yellow]⚠[/yellow] No environments.yaml found, skipping environment-specific config" )
320319
320+ if agent_env_config :
321+ helm_repository_name = agent_env_config .helm_repository_name
322+ helm_repository_url = agent_env_config .helm_repository_url
323+ else :
324+ helm_repository_name = "scale-egp"
325+ helm_repository_url = "https://scale-egp-helm-charts-us-west-2.s3.amazonaws.com/charts"
321326 # Add helm repository/update
322- add_helm_repo ()
327+ add_helm_repo (helm_repository_name , helm_repository_url )
323328
324329 # Merge configurations
325330 helm_values = merge_deployment_configs (manifest , agent_env_config , deploy_overrides , manifest_path )
@@ -349,7 +354,7 @@ def deploy_agent(
349354 "helm" ,
350355 "upgrade" ,
351356 release_name ,
352- "scale-egp /agentex-agent" ,
357+ f" { helm_repository_name } /agentex-agent" ,
353358 "--version" ,
354359 AGENTEX_AGENTS_HELM_CHART_VERSION ,
355360 "-f" ,
@@ -371,7 +376,7 @@ def deploy_agent(
371376 "helm" ,
372377 "install" ,
373378 release_name ,
374- "scale-egp /agentex-agent" ,
379+ f" { helm_repository_name } /agentex-agent" ,
375380 "--version" ,
376381 AGENTEX_AGENTS_HELM_CHART_VERSION ,
377382 "-f" ,
0 commit comments