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 17, 2024
1 parent d53617a commit 35c73f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions aiida_hyperqueue/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ def _parse_kill_output(self, retval, stdout, stderr):
return True

def _get_detailed_job_info_command(self, job_id: str) -> dict[str, t.Any]:
"""hq command to get the detailed job info."""
"""Return the command to run to get the detailed information on a job,
even after the job has finished.
# TODO: implement me to get walltime issue etc
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 ."

0 comments on commit 35c73f2

Please sign in to comment.