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

fix: Use sacct syntax that is compatible with slurm < 20.11.0 #26

Merged
merged 6 commits into from
Feb 14, 2024

Conversation

dnerini
Copy link
Contributor

@dnerini dnerini commented Jan 29, 2024

Closes #25

Tested with slurm 20.02.07

Not a great contribution in terms of code readability, but it'd ensure that the plugin works with older slurm versions.

@fgvieira
Copy link
Contributor

fgvieira commented Feb 2, 2024

slurm 2.11.0 is more than 3 years old. Wouldn't it be better to update it?

@dnerini
Copy link
Contributor Author

dnerini commented Feb 2, 2024

I agree, it would be great, but unfortunately that is not an option in my case.
I'm happy to keep using my fork. I just thought I would submit the PR in case someone else is facing the same issue.

@cmeesters
Copy link
Collaborator

Yep, and I would support this PR rather than lose the idea. I would also hate to require from you @dnerini to update your fork, whenever a relevant feature or fix is merged upstream ... and I understand that some admins are very reluctant to update their slurm. Although they really should due to security fixes.

Please run black on your code and add the comment.

@dnerini
Copy link
Contributor Author

dnerini commented Feb 5, 2024

thanks @cmeesters for the feedback. I reformatted the code, added a comment, and changed to local time using datetime.now() (although it shouldn't make a difference for the purpose introduced in #9).

dnerini and others added 3 commits February 5, 2024 20:23
wanted to keep original code version (outcommented) present
fixed trailing white space
Copy link
Collaborator

@cmeesters cmeesters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finally, after retriggering the workflow ...

@@ -205,7 +206,8 @@ async def check_active_jobs(
(status_of_jobs, sacct_query_duration) = await self.job_stati(
# -X: only show main job, no substeps
f"sacct -X --parsable2 --noheader --format=JobIdRaw,State "
f"--starttime now-2days --endtime now --name {self.run_uuid}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just out comment this line and add an appropriate comment: While ensuring backwards compatibility is worth the change, eventually, such clusters will be out phased for good, and we will hardly know why the following line has been introduced at all.

@cmeesters cmeesters merged commit c1591ff into snakemake:main Feb 14, 2024
4 checks passed
cmeesters pushed a commit that referenced this pull request Feb 14, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.3.1](v0.3.0...v0.3.1)
(2024-02-14)


### Bug Fixes

* Use sacct syntax that is compatible with slurm &lt; 20.11.0
([#26](#26))
([c1591ff](c1591ff))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Plugin is not compatible with older SLURM versions
3 participants