Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make parsing of output more robust #160

Open
yarikoptic opened this issue Dec 8, 2023 · 0 comments
Open

Make parsing of output more robust #160

yarikoptic opened this issue Dec 8, 2023 · 0 comments

Comments

@yarikoptic
Copy link
Collaborator

ATM whenever something doesn't go right in SLURM commands, babs would crash with smth like

    df_all_job_status = request_all_job_status(self.type_system)
  File "/home/asmacdo/devel/babs/babs/utils.py", line 1896, in request_all_job_status
    return _request_all_job_status_slurm()
  File "/home/asmacdo/devel/babs/babs/utils.py", line 1937, in _request_all_job_status_slurm
    squeue_out_df = _parsing_squeue_out(std)
  File "/home/asmacdo/devel/babs/babs/utils.py", line 1977, in _parsing_squeue_out
    raise Exception("error in the `squeue` output,"
Exception: error in the `squeue` output, expected jobid and got squeue:

which leaves you guessing what is happening. In this case it was due to us lacking the original user inside the slurm podman container

[root@slurmctl /]# squeue -u blah
squeue: error: Invalid user: blah

             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
[root@slurmctl /]# squeue -u blah 2>/dev/null
             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
[root@slurmctl /]# echo $?
0

so it is coming to stderr not stdout which is what we want to parse. I think it would make more sense to

  • parse only stdout
  • if there is stderr for squeue -- take it as indication of error and output entire stderr for the user to digest, and use not just Exception but some more descriptive one, e.g. RuntimeError

@asmacdo might want to prep a quick PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant