Skip to content

Commit 5a8a079

Browse files
authored
Merge pull request #148 from VectorInstitute/bugfix/required_args_bon_echo
Move REQUIRED_ARGS from _client_vars to environment.yaml
2 parents d16ffdc + 644c6e1 commit 5a8a079

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You should see an output like the following:
4444

4545
<img width="720" alt="launch_image" src="https://github.com/user-attachments/assets/c1e0c60c-cf7a-49ed-a426-fdb38ebf88ee" />
4646

47-
**NOTE**: On Vector Killarney Cluster environment, the following fields are required:
47+
**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:
4848
* `--account`, `-A`: The Slurm account, this argument can be set to default by setting environment variable `VEC_INF_ACCOUNT`.
4949
* `--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`.
5050

docs/user_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ You should see an output like the following:
3737
└─────────────────────────┴───────────────────────────────────────────┘
3838
```
3939

40-
**NOTE**: On Vector Killarney Cluster environment, the following fields are required:
40+
**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:
4141
* `--account`, `-A`: The Slurm account, this argument can be set to default by setting environment variable `VEC_INF_ACCOUNT`.
4242
* `--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`.
4343

vec_inf/client/_client_vars.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,3 @@
7171

7272
# Required matching arguments for batch mode
7373
BATCH_MODE_REQUIRED_MATCHING_ARGS = ["venv", "log_dir"]
74-
75-
# Required arguments for launching jobs that don't have a default value and their
76-
# corresponding environment variables
77-
REQUIRED_ARGS = {
78-
"account": "VEC_INF_ACCOUNT",
79-
"work_dir": "VEC_INF_WORK_DIR",
80-
}

vec_inf/client/_slurm_vars.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,9 @@ def create_literal_type(values: list[str], fallback: str = "") -> Any:
7878
_config["allowed_values"]["resource_type"]
7979
)
8080

81+
# Extract required arguments, for launching jobs that don't have a default value and
82+
# their corresponding environment variables
83+
REQUIRED_ARGS: dict[str, str] = _config["required_args"]
84+
8185
# Extract default arguments
8286
DEFAULT_ARGS: dict[str, str] = _config["default_args"]

vec_inf/client/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
import requests
1515
import yaml
1616

17-
from vec_inf.client._client_vars import MODEL_READY_SIGNATURE, REQUIRED_ARGS
17+
from vec_inf.client._client_vars import MODEL_READY_SIGNATURE
1818
from vec_inf.client._exceptions import MissingRequiredFieldsError
19-
from vec_inf.client._slurm_vars import CACHED_CONFIG_DIR
19+
from vec_inf.client._slurm_vars import CACHED_CONFIG_DIR, REQUIRED_ARGS
2020
from vec_inf.client.config import ModelConfig
2121
from vec_inf.client.models import ModelStatus
2222

vec_inf/config/environment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ allowed_values:
1515
partition: []
1616
resource_type: ["l40s", "h100"]
1717

18+
required_args:
19+
account: "VEC_INF_ACCOUNT"
20+
work_dir: "VEC_INF_WORK_DIR"
21+
1822
default_args:
1923
cpus_per_task: "16"
2024
mem_per_node: "64G"

0 commit comments

Comments
 (0)