Skip to content

Commit

Permalink
Allow to specify conda store service namespace via env variable (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski authored Mar 22, 2024
1 parent 38bc89f commit 1d9f1d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion argo_jupyter_scheduler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

CONDA_STORE_TOKEN = "CONDA_STORE_TOKEN"
CONDA_STORE_SERVICE = "CONDA_STORE_SERVICE"
CONDA_STORE_SERVICE_NAMESPACE = "CONDA_STORE_SERVICE_NAMESPACE"

CONDA_ENV_LOCATION = "/opt/conda/envs/{conda_env_name}"
CONDA_STORE_ENV_LOCATION = "/home/conda/{env_namespace}/envs/{conda_env_name}"
Expand Down Expand Up @@ -114,9 +115,10 @@ def gen_log_path(input_path: str):
def send_request(api_v1_endpoint):
token = os.environ[CONDA_STORE_TOKEN]
conda_store_svc_name = os.environ[CONDA_STORE_SERVICE]
conda_store_svc_namespace = os.environ[CONDA_STORE_SERVICE_NAMESPACE]

conda_store_svc_name, conda_store_service_port = conda_store_svc_name.split(":")
conda_store_endpoint = f"http://{conda_store_svc_name}.dev.svc:{conda_store_service_port}/conda-store/api/v1/"
conda_store_endpoint = f"http://{conda_store_svc_name}.{conda_store_svc_namespace}.svc:{conda_store_service_port}/conda-store/api/v1/"
url = urljoin(conda_store_endpoint, api_v1_endpoint)

http = urllib3.PoolManager()
Expand Down

0 comments on commit 1d9f1d1

Please sign in to comment.