-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PENG-2193 Added slurm job state to submission payload
Now, when Jobs are submitted by the jobbergate agent, the slurm job info (like job_state, job_info, and reason) are immediately fetched from sinfo. The payload to the Jobbergate API for the newly submitted job now includes the slurm job info. Consequently, the slurm job state info is available immediatley at job submission time instead of requiring a full cycle of the jobbergate agent to update the job.
- Loading branch information
1 parent
073ded9
commit 5d3ea9b
Showing
5 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1289,6 +1289,8 @@ async def test_job_submissions_agent_submitted__success( | |
payload = dict( | ||
id=inserted_job_submission_id, | ||
slurm_job_id=111, | ||
slurm_job_state=SlurmJobState.RUNNING, | ||
slurm_job_info="Fake slurm job info", | ||
) | ||
|
||
inject_security_header("[email protected]", Permissions.JOB_SUBMISSIONS_EDIT, client_id="dummy-client") | ||
|
@@ -1299,6 +1301,9 @@ async def test_job_submissions_agent_submitted__success( | |
assert instance.id == inserted_job_submission_id | ||
assert instance.status == JobSubmissionStatus.SUBMITTED | ||
assert instance.slurm_job_id == payload["slurm_job_id"] | ||
assert instance.slurm_job_state == payload["slurm_job_state"] | ||
assert instance.slurm_job_info == payload["slurm_job_info"] | ||
assert instance.report_message is None | ||
|
||
|
||
async def test_job_submissions_agent_submitted__fails_if_status_is_not_CREATED( | ||
|
@@ -1330,6 +1335,8 @@ async def test_job_submissions_agent_submitted__fails_if_status_is_not_CREATED( | |
payload = dict( | ||
id=inserted_job_submission_id, | ||
slurm_job_id=111, | ||
slurm_job_state=SlurmJobState.RUNNING, | ||
slurm_job_info="Fake slurm job info", | ||
) | ||
|
||
inject_security_header("[email protected]", Permissions.JOB_SUBMISSIONS_EDIT, client_id="dummy-client") | ||
|
@@ -1351,7 +1358,12 @@ async def test_job_submissions_agent_submitted__fails_if_token_does_not_carry_cl | |
inject_security_header("[email protected]", Permissions.JOB_SUBMISSIONS_EDIT) | ||
response = await client.put( | ||
"/jobbergate/job-submissions/agent/1", | ||
json=dict(status=JobSubmissionStatus.SUBMITTED, slurm_job_id=111), | ||
json=dict( | ||
status=JobSubmissionStatus.SUBMITTED, | ||
slurm_job_id=111, | ||
slurm_job_state=SlurmJobState.RUNNING, | ||
slurm_job_info="Fake slurm job info", | ||
), | ||
) | ||
assert response.status_code == status.HTTP_400_BAD_REQUEST | ||
assert "Checked expressions failed: Access token does not contain\\n 1: client_id" in response.text | ||
|
@@ -1383,6 +1395,8 @@ async def test_job_submissions_agent_submitted__fails_if_client_id_does_not_matc | |
payload = dict( | ||
id=inserted_job_submission_id, | ||
slurm_job_id=111, | ||
slurm_job_state=SlurmJobState.RUNNING, | ||
slurm_job_info="Fake slurm job info", | ||
) | ||
|
||
inject_security_header("[email protected]", Permissions.JOB_SUBMISSIONS_EDIT, client_id="stupid-client") | ||
|