Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to specify conda store service namespace via environment variable #7

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading