From 36e4b5d27354efff336cb48868d0971e60a8c69a Mon Sep 17 00:00:00 2001 From: XkunW Date: Tue, 30 Sep 2025 00:06:59 -0400 Subject: [PATCH 1/3] Move REQUIRED_ARGS from _client_vars to environment.yaml --- vec_inf/client/_client_vars.py | 7 ------- vec_inf/client/_slurm_vars.py | 4 ++++ vec_inf/client/_utils.py | 4 ++-- vec_inf/config/environment.yaml | 4 ++++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/vec_inf/client/_client_vars.py b/vec_inf/client/_client_vars.py index a0c4af96..f21bcc82 100644 --- a/vec_inf/client/_client_vars.py +++ b/vec_inf/client/_client_vars.py @@ -71,10 +71,3 @@ # Required matching arguments for batch mode BATCH_MODE_REQUIRED_MATCHING_ARGS = ["venv", "log_dir"] - -# Required arguments for launching jobs that don't have a default value and their -# corresponding environment variables -REQUIRED_ARGS = { - "account": "VEC_INF_ACCOUNT", - "work_dir": "VEC_INF_WORK_DIR", -} diff --git a/vec_inf/client/_slurm_vars.py b/vec_inf/client/_slurm_vars.py index ca70305d..10d9f6c4 100644 --- a/vec_inf/client/_slurm_vars.py +++ b/vec_inf/client/_slurm_vars.py @@ -78,5 +78,9 @@ def create_literal_type(values: list[str], fallback: str = "") -> Any: _config["allowed_values"]["resource_type"] ) +# Extract required arguments, for launching jobs that don't have a default value and their +# corresponding environment variables +REQUIRED_ARGS: dict[str, str] = _config["required_args"] + # Extract default arguments DEFAULT_ARGS: dict[str, str] = _config["default_args"] diff --git a/vec_inf/client/_utils.py b/vec_inf/client/_utils.py index 296cc4c2..fbbe06f3 100644 --- a/vec_inf/client/_utils.py +++ b/vec_inf/client/_utils.py @@ -14,9 +14,9 @@ import requests import yaml -from vec_inf.client._client_vars import MODEL_READY_SIGNATURE, REQUIRED_ARGS +from vec_inf.client._client_vars import MODEL_READY_SIGNATURE from vec_inf.client._exceptions import MissingRequiredFieldsError -from vec_inf.client._slurm_vars import CACHED_CONFIG_DIR +from vec_inf.client._slurm_vars import CACHED_CONFIG_DIR, REQUIRED_ARGS from vec_inf.client.config import ModelConfig from vec_inf.client.models import ModelStatus diff --git a/vec_inf/config/environment.yaml b/vec_inf/config/environment.yaml index f5d1f40e..4fda61f5 100644 --- a/vec_inf/config/environment.yaml +++ b/vec_inf/config/environment.yaml @@ -15,6 +15,10 @@ allowed_values: partition: [] resource_type: ["l40s", "h100"] +required_args: + account: "VEC_INF_ACCOUNT" + work_dir: "VEC_INF_WORK_DIR" + default_args: cpus_per_task: "16" mem_per_node: "64G" From c2a2f178f738d348e8d3399e465cdbf571f22020 Mon Sep 17 00:00:00 2001 From: XkunW Date: Tue, 30 Sep 2025 00:13:26 -0400 Subject: [PATCH 2/3] mypy fix --- vec_inf/client/_slurm_vars.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vec_inf/client/_slurm_vars.py b/vec_inf/client/_slurm_vars.py index 10d9f6c4..24b9e9b0 100644 --- a/vec_inf/client/_slurm_vars.py +++ b/vec_inf/client/_slurm_vars.py @@ -78,8 +78,8 @@ def create_literal_type(values: list[str], fallback: str = "") -> Any: _config["allowed_values"]["resource_type"] ) -# Extract required arguments, for launching jobs that don't have a default value and their -# corresponding environment variables +# Extract required arguments, for launching jobs that don't have a default value and +# their corresponding environment variables REQUIRED_ARGS: dict[str, str] = _config["required_args"] # Extract default arguments From 1a5deb5c0f6107dc15e4055cb8c54f19f5e74ec5 Mon Sep 17 00:00:00 2001 From: XkunW Date: Tue, 30 Sep 2025 00:19:27 -0400 Subject: [PATCH 3/3] Minor update in documentation to reflect this change --- README.md | 2 +- docs/user_guide.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fe7aa725..ae514537 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ You should see an output like the following: launch_image -**NOTE**: On Vector Killarney Cluster environment, the following fields are required: +**NOTE**: You can set the required fields in the environment configuration (`environment.yaml`), it's a mapping between required arguments and their corresponding environment variables. On the Vector **Killarney** Cluster environment, the required fields are: * `--account`, `-A`: The Slurm account, this argument can be set to default by setting environment variable `VEC_INF_ACCOUNT`. * `--work-dir`, `-D`: A working directory other than your home directory, this argument can be set to default by seeting environment variable `VEC_INF_WORK_DIR`. diff --git a/docs/user_guide.md b/docs/user_guide.md index 3be64e18..1b24b488 100644 --- a/docs/user_guide.md +++ b/docs/user_guide.md @@ -37,7 +37,7 @@ You should see an output like the following: └─────────────────────────┴───────────────────────────────────────────┘ ``` -**NOTE**: On Vector Killarney Cluster environment, the following fields are required: +**NOTE**: You can set the required fields in the environment configuration (`environment.yaml`), it's a mapping between required arguments and their corresponding environment variables. On the Vector **Killarney** Cluster environment, the required fields are: * `--account`, `-A`: The Slurm account, this argument can be set to default by setting environment variable `VEC_INF_ACCOUNT`. * `--work-dir`, `-D`: A working directory other than your home directory, this argument can be set to default by seeting environment variable `VEC_INF_WORK_DIR`.