Skip to content

Commit

Permalink
Add detailed_job_info
Browse files Browse the repository at this point in the history
Here, I add the command to retrieve the `detailed_job_info`, which wasn't
implemented before. This caused jobs run with HQ have no
information about the job in their attributes.
The `hq job info <id>` command is used and transformed into a one-line
JSON string using jq. This string is stored in the attributes and can be
transformed into a proper dictionary using `json.loads`.
  • Loading branch information
t-reents committed Jul 10, 2024
1 parent 2a0afb6 commit 4507080
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions aiida_hyperqueue/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ def _parse_joblist_output(self, retval: int, stdout: str,
job_info_list.append(job_info)

return job_info_list

def _get_detailed_job_info_command(self, job_id):
"""Return the command to run to get the detailed information on a job,
even after the job has finished.
The output text is just retrieved, and returned for logging purposes.
`jq` is used to transform the json into a one-line string.
"""
return f"hq job info {job_id} --output-mode json | jq -c ."


def _get_kill_command(self, jobid):
"""
Expand Down

0 comments on commit 4507080

Please sign in to comment.