Utilities and APIs for interfacing with the Slurm workload manager.
Project description
Features
slurmutils
is a collection of various utilities and APIs to 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 and APIs shipped in the
slurmutils
package include:
from slurmutils.editors import ...
slurmconfig
: An editor slurm.conf and Include files.slurmdbdconfig
: An editor for slurmdbd.conf files.
Installation
Option 1: Install from PyPI
$ python3 -m pip install slurmutils
Option 2: Install from source
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
Usage
Editors
slurmconfig
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:
Edit a pre-existing slurm.conf configuration file
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"
Add a new node to the slurm.conf file
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[node.node_name] = node
slurmdbdconfig
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:
Edit a pre-existing slurmdbd.conf configuration file
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
Project & Community
The slurmutils
package is a project of the
Ubuntu HPC community.
It is an open-source project that is welcome to community involvement, contributions, suggestions, fixes,
and constructive feedback. Interested in being involved with the development of slurmutils
?
Check out these links below:
License
The slurmutils
package is free software, distributed under the GNU Lesser General Public License, v3.0.
See the LICENSE file for more information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for slurmutils-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77a92f7158b11ae9dbcd3f411b262758cdad2ee15972998d8e1f6531795680cc |
|
MD5 | 5970458566f7a2ed59d2283f2c1eced3 |
|
BLAKE2b-256 | e95b3acce6be1c1e719c2e9949a6f36bed19ffa8bbe162d605e50bd9332201aa |