Skip to content

Commit 83082e2

Browse files
authored
Merge pull request #67 from eth-cscs/RESTAPI-1507-add-account-param
Add account parameter
2 parents 375f199 + 0fc8bd9 commit 83082e2

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- Path parameter for submitting jobs from a remote file
12+
- `account` optional parameter to job submission request
13+
- `script_path` optional parameter for submitting jobs from a remote file
1314
- JupyterHub example
1415
- Documentation for logging architecture
1516
- Workflow orchestrator example

src/firecrest/compute/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class PostJobSubmitRequest(JobSubmitRequestModel):
2424
{
2525
"job": {
2626
"name": "Example with inline script",
27+
"account": "myproject",
2728
"working_directory": "{{home_path}}",
2829
"standard_input": "/dev/null",
2930
"standard_output": "count_to_100.out",
@@ -38,6 +39,7 @@ class PostJobSubmitRequest(JobSubmitRequestModel):
3839
{
3940
"job": {
4041
"name": "Example with script path",
42+
"account": "myproject",
4143
"working_directory": "{{home_path}}",
4244
"standard_input": "/dev/null",
4345
"standard_output": "count_to_100.out",

src/lib/scheduler_clients/slurm/cli_commands/sbatch_command.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def get_command(self) -> str:
2323
in self.job_description.environment.items())
2424
cmd += [f"--export='ALL,{env}'"]
2525
cmd += [f"--chdir='{self.job_description.current_working_directory}'"]
26+
if self.job_description.account:
27+
cmd.append(f"--account='{self.job_description.account}'")
2628
if self.job_description.name:
2729
cmd.append(f"--job-name='{self.job_description.name}'")
2830
if self.job_description.standard_error:

src/lib/scheduler_clients/slurm/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def __init__(self, **kwargs):
3636

3737
class SlurmJobDescription(JobDescriptionModel):
3838
name: Optional[str] = Field(default=None, description="Name for the job")
39+
account: Optional[str] = Field(default=None, description="Charge job resources to specified account")
3940
current_working_directory: str = Field(alias="working_directory", description="Job working directory")
4041
standard_input: Optional[str] = Field(default=None, description="Standard input file name")
4142
standard_output: Optional[str] = Field(default=None, description="Standard output file name")

0 commit comments

Comments
 (0)