sinfo drain/draining

35 views
Skip to first unread message

dd...@nau.edu

unread,
Nov 14, 2018, 10:49:24 AM11/14/18
to pyslurm
Hello, I'm new to pyslurm and was wondering if pyslurm allows me to get a list of hosts with drained / draining status?

If this is not currently supported, then I would be available to contribute. 

Thanks,
Duane Booher

Giovanni

unread,
Nov 14, 2018, 1:30:57 PM11/14/18
to pyslurm
The nodes class will return all nodes in all states.

Giovanni

Giovanni

unread,
Nov 15, 2018, 7:21:01 PM11/15/18
to pyslurm
Here's an example:

# scontrol update nodename=c10 state=drain reason='example'
# python -c 'import pyslurm; print(pyslurm.node().get_node("c10")).values()[0]["state"]'
IDLE+DRAIN

Giovanni

dd...@nau.edu

unread,
Nov 27, 2018, 9:51:44 AM11/27/18
to pyslurm
Hi Giovanni,

I have pyslurm installed with the get_node function working. We are currently at slurm 17.11.12. A couple of questions: for every new slurm release we install, would we need to update pyslurm? Also, does the pyslurm api allow for updates, such as the scontrol update command?

Duane

Giovanni

unread,
Nov 27, 2018, 7:15:14 PM11/27/18
to pyslurm


On Tuesday, November 27, 2018 at 9:51:44 AM UTC-5, ddb79wrote:
Hi Duane,

Currently, we check the MAJOR.MINOR.MICRO version of Slurm to ensure compatibility at build time.  This was necessary a couple years ago when there would be some backwards incompatible changes in the middle of a branch, for example, a new field in a struct.  This hasn't happened in a while, and I'd like to just check MAJOR.MINOR.  As long as your version of Slurm is covered in the min/max hex versions here: https://github.com/PySlurm/pyslurm/blob/master/setup.py#L17-L18, you wouldn't need to reinstall PySlurm.  I try to keep these min/max versions up-to-date as best I can.

The `scontrol update` subcommands are wrapped in separate classes.  For example, you would use pyslurm.node().update({}) to update a node using a dictionary of key/value pairs.  Valid keys are here: https://github.com/PySlurm/pyslurm/blob/master/pyslurm/pyslurm.pyx#L3578-L3600



Looks like updating a job or jobstep is not wrapped.

Giovanni


Reply all
Reply to author
Forward
0 new messages