Utilities and APIs for interfacing with the Slurm workload manager.
slurmutils is a collection of various utilities that make it easier for you and your friends to interface with the Slurm workload manager, especially if you are orchestrating deployments of new and current Slurm clusters. Gone are the days of seething over incomplete Jinja2 templates. Current utilities shipped in the slurmutils package include:
slurmconfig
: An editor for slurm.conf configuration files.slurmdbdconfig
: An editor for slurmdbd.conf configuration files.
For more information on how to use or contribute to slurmutils, check out the Getting Started and Development sections below ๐
$ python3 -m pip install slurmutils
We use the Poetry packaging and dependency manager to manage this project. It must be installed on your system if installing slurmutils from source.
$ git clone https://github.com/canonical/slurmutils.git
$ cd slurmutils
$ poetry install
This module provides an API for editing both slurm.conf and Include files, and can create new configuration files if they do not exist. Here's some common Slurm lifecycle management operators you can perform using this editor:
from slurmutils.editors import slurmconfig
# Open, edit, and save the slurm.conf file located at _/etc/slurm/slurm.conf_.
with slurmconfig.edit("/etc/slurm/slurm.conf") as config:
del config.inactive_limit
config.max_job_count = 20000
config.proctrack_type = "proctrack/linuxproc"
from slurmutils.editors import slurmconfig
from slurmutils.models import Node
with slurmconfig.edit("/etc/slurm/slurm.conf") as config:
node = Node(
NodeName="batch-[0-25]",
NodeAddr="12.34.56.78",
CPUs=1,
RealMemory=1000,
TmpDisk=10000,
)
config.nodes.update(node.dict())
This module provides and API for editing slurmdbd.conf files, and can create new slurmdbd.conf files if they do not exist. Here's some operations you can perform on the slurmdbd.conf file using this editor:
from slurmutils.editors import slurmdbdconfig
with slurmdbdconfig.edit("/etc/slurm/slurmdbd.conf") as config:
config.archive_usage = "yes"
config.log_file = "/var/spool/slurmdbd.log"
config.debug_flags = ["DB_EVENT", "DB_JOB", "DB_USAGE"]
del config.auth_alt_types
del config.auth_alt_parameters
If you want to learn more about all the things you can do with slurmutils, here are some further resources for you to explore:
This project uses tox as its command runner, which provides some useful commands that will help you while hacking on slurmutils:
tox run -e fmt # Apply formatting standards to code.
tox run -e lint # Check code against coding style standards.
tox run -e unit # Run unit tests.
If you're interested in contributing your work to slurmutils, take a look at our contributing guidelines for further details.
slurmutils is a project of the Ubuntu High-Performance Computing community. Interested in contributing bug fixes, new editors, documentation, or feedback? Want to join the Ubuntu HPC community? Youโve come to the right place ๐คฉ
Hereโs some links to help you get started with joining the community:
- Ubuntu Code of Conduct
- Contributing guidelines
- Join the conversation on Matrix
- Get the latest news on Discourse
- Ask and answer questions on GitHub
slurmutils is free software, distributed under the GNU Lesser General Public License, v3.0. See the LGPL-3.0 LICENSE file for further details.