Version information
This version is compatible with:
- ,
Start using this module
Add this module to your Puppetfile:
mod 'ULHPC-slurm', '1.0.1'
Learn more about managing modules with a PuppetfileDocumentation
-- mode: markdown; mode: visual-line; --
Slurm Puppet Module
Configure and manage Slurm: A Highly Scalable Resource Manager
Copyright (c) 2017 UL HPC Team <hpc-sysadmins@uni.lu>
. see also http://hpc.uni.lu
Overview
Slurm (aka "Simple Linux Utility for Resource Management") is a free and open-source job scheduler for Linux and Unix-like kernels, used by many of the world's supercomputers and computer clusters (~60% of Top500 rely on it).
Slurm is an open source, fault-tolerant, and highly scalable cluster management and job scheduling system for large and small Linux clusters
It provides three key functions.
- it allocates exclusive and/or non-exclusive access to resources (computer nodes) to users for some duration of time so they can perform work.
- it provides a framework for starting, executing, and monitoring work (typically a parallel job such as MPI) on a set of allocated nodes.
- Finally, it arbitrates contention for resources by managing a queue of pending jobs.
This Puppet module is designed to configure and manage the different daemons and components of a typical Slurm architecture, depicted below:
In particular, this module implements the following elements:
Puppet Class | Description |
---|---|
slurm |
The main slurm class, piloting all aspects of the configuration |
slurm::slurmdbd |
Specialized class for Slurmdbd, the Slurm Database Daemon. |
slurm::slurmctld |
Specialized class for Slurmctld, the central management daemon of Slurm. |
slurm::slurmd |
Specialized class for Slurmd, the compute node daemon for Slurm. |
slurm::munge |
Manages MUNGE, an authentication service for creating and validating credentials. |
slurm::pam |
Handle PAM aspects for SLURM (Memlock for MPI etc.) |
Puppet Defines | Description |
---|---|
slurm::download |
takes care of downloading the SLURM sources for a given version passed as resource name |
slurm::build |
building Slurm sources into packages (_i.e. RPMs for the moment) for a given version passed as resource name |
slurm::install::packages |
installs the Slurm packages, typically built from slurm::build , for a given version passed as resource name. |
slurm::acct::cluster |
adding (or removing) a cluster to the slurm database |
In addition, this puppet module implements several private classes:
slurm::common[::redhat]
: handles common tasks to all daemonslurm::install
: install the Slurm packages, eventually built from downloaded sourcesslurm::config[::{cgroup,gres,topology}]
: handles the various aspects of the configuration of SLURM daemons -- see https://slurm.schedmd.com/slurm.conf.html#lbANslurm::plugins::lua
: takes care of the Job Submit plugin 'lua' i.e. of the filejob_submit.lua
.
All these components are configured through a set of variables you will find in manifests/params.pp
.
Note: the various operations that can be conducted from this repository are piloted from a Rakefile
and assumes you have a running Ruby installation.
See docs/contributing.md
for more details on the steps you shall follow to have this Rakefile
working properly.
IMPORTANT Until the release of version 1.0 (denoting a usage in production on the UL HPC Platform), this module is still to be considered in alpha state and a work in progress. Use it at your own risks!
Setup Requirements
This module currently only works completely on Redhat / CentOS 7 over Puppet 4.x. Over operating systems and support for Puppet 5.x will eventually be added. Yet feel free to contribute to this module to help us extending the usage of this module.
By default, some key configuration decisions are configured, namely:
- MUNGE is used for shared key authentication.
- the shared key is generated by default, but you probably want to provide it to puppet via a URI.
- None of the daemons are configured by default.
- You have to set the boolean parameter(s)
with_{slurmdbd,slurmctl,slurmd}
totrue
and/or include explicitly theslurm::{slurmdbd,slurmctld,slurmd}
classes
- You have to set the boolean parameter(s)
Forge Module Dependencies
See metadata.json
. In particular, this module depends on
- puppetlabs/stdlib
- puppetlabs/mysql
- puppetlabs/inifile
- puppet/archive
- puppet/yum
- stahnma/epel
- bodgit/rngd
- ghoneycutt/pam
Overview and Usage
Class slurm
This is the main class defined in this module.
It accepts so many parameters that they are not listed here -- see the [puppet strings @param
] comments of manifests/init.pp
Use it as follows:
include ::slurm
See also tests/init.pp
or a more advanced usage (defining the network topology, the computing nodes and the SLURM partitions) in tests/advanced.pp
Class slurm::slurmdbd
This class is responsible for setting up a Slurm Database Daemon, which provides a secure enterprise-wide interface to a database for Slurm. In particular, it can run relatively independently of the other slurm daemon instances and thus is proposed as a separate independent class.
You can simply configure it as follows:
include ::slurm
include ::slurm::slurmdbd
Alternatively, you can use the with_slurdbd
parameter of the ::slurm
class:
class { '::slurm':
with_slurmdbd => true,
}
See also tests/slurmdbd.pp
The slurm::slurmdbd
accepts also so many parameters that they are not listed here -- see the [puppet strings @param
] comments of manifests/slurmdbd.pp
for more details
Class slurm::slurmctld
The main helper class specializing the main slurm class for setting up a Slurmctld daemon aka the slurm controller.
include ::slurm
include ::slurm::slurmctld
Alternatively, you can use the with_slurctld
parameter of the ::slurm
class:
class { '::slurm':
with_slurmctld => true,
}
Class slurm::slurmd
The main helper class specializing the main slurm class for setting up a Slurmctld daemon aka the slurm controller.
include ::slurm
include ::slurm::slurmctld
Alternatively, you can use the with_slurd
parameter of the ::slurm
class:
class { '::slurm':
with_slurmd => true,
}
There are of course many configuration parameters that you can set to change the content of the slurm.conf
configuration file (generated from the ERB template).
Read the documentation of the slurm
class to make them suit your tastes and wishes.
Class slurm::munge
MUNGE (MUNGE Uid 'N' Gid Emporium) is an authentication service for creating and validating credentials. It is designed to be highly scalable for use in an HPC cluster environment. It allows a process to authenticate the UID and GID of another local or remote process within a group of hosts having common users and groups. These hosts form a security realm that is defined by a shared cryptographic key. Clients within this security realm can create and validate credentials without the use of root privileges, reserved ports, or platform-specific methods.
For more information, see https://github.com/dun/munge
The puppet class slurm::munge
is thus responsible for setting up a working Munge environment to
be used by the SLURM daemons -- see also https://slurm.schedmd.com/authplugins.html
Use it as follows:
include ::slurm::munge
Or, if you wish to provide the munge key using puppet URI:
class {'::slurm::munge':
ensure => true,
key_source => "puppet:///modules/${myprofile}/munge.key"
}
If, as in the above example, the key is stored centrally in your control repository, you probably want to store it encrypted using git-crypt for instance.
The slurm::munge
class accepts the following parameters:
ensure
[String] Default: 'present'- Ensure the presence (or absence) of the Munge service
create_key
[Boolean] Default: true- Whether or not to generate a new key if it does not exists
daemon_args
[Array] Default: []- Set the content of the DAEMON_ARGS variable, which permits to set additional command-line options to the daemon. For example, this can be used to override the location of the secret key (
--key-file
) or set the number of worker threads (--num-threads
) See https://github.com/dun/munge/wiki/Installation-Guide#starting-the-daemon.
- Set the content of the DAEMON_ARGS variable, which permits to set additional command-line options to the daemon. For example, this can be used to override the location of the secret key (
gid
[Integer] Default: 992- GID of the munge group
key_content
[String] Default: undef- The desired contents of a file, as a string. This attribute is mutually exclusive with source and target.
key_filename
[String] Default: '/etc/munge/munge.key'- The secret key filename
key_source
[String] Default: undef- A source file, which will be copied into place on the local system. This attribute is mutually exclusive with content. The normal form of a puppet: URI is
puppet:///modules/<MODULE NAME>/<FILE PATH>
- A source file, which will be copied into place on the local system. This attribute is mutually exclusive with content. The normal form of a puppet: URI is
uid
[Integer] Default: 992- UID of the munge user
Note that the slurm
class makes use of this class by default as the parameter manage_munge
is set to true by default.
Definition slurm::download
This definition takes care of downloading the SLURM sources for a given version (passed as name to this resource) and placing them into $target
directory. You can also invoke this definition with the full archive filename i.e. slurm-<version>.tar.bz2
.
ensure
[String] Default:present
- Ensure the presence (or absence) of building
target
[String] Default:/usr/local/src
- Target directory for the downloaded sources
archived
[Boolean] Default:false
- Whether the sources tar.bz2 has been archived or not.Thus by default, it is assumed that the provided version is the latest version (from https://www.schedmd.com/downloads/latest/).
- If set to
true
, the sources will be download from https://www.schedmd.com/downloads/archive/
checksum_type
[String] Default:md5
- archive file checksum type (none|md5|sha1|sha2|sh256|sha384| sha512).
checksum_verify
[Boolean] Default: false- whether checksum will be verified (true|false).
checksum
[String] Default: ''- archive file checksum (match checksum_type)
Example 1: Downloading version 17.06.7 (latest at the time of writing) of SLURM
slurm::download { '17.02.7':
ensure => 'present',
checksum => '64009c1ed120b9ce5d79424dca743a06',
target => '/usr/local/src/',
}
Example 2: Downloading archived version 16.05.10 version of SLURM
slurm::download { 'slurm-16.05.10.tar.bz2':
ensure => 'present',
archived => true,
target => '/usr/local/src/',
}
Definition slurm::build
This definition takes care of building Slurm sources into RPMs using 'rpmbuild'. It expect to get as resource name the SLURM version to build This assumes the sources have been downloaded using slurm::download
ensure
[String] Default:present
- Ensure the presence (or absence) of building
srcdir
[String] Default:/usr/local/src
- Where the [downloaded] Slurm sources are located
dir
[String] Default:/root/rpmbuild
on redhat systems- Top directory of the sources builds (i.e. RPMs, debs...). For instance, built RPMs will be placed under
${dir}/RPMS/${::architecture}
- Top directory of the sources builds (i.e. RPMs, debs...). For instance, built RPMs will be placed under
with
[Array] Default:[ 'lua', ... ]
- List of --with build options to pass to rpmbuild -- see https://github.com/SchedMD/slurm/blob/master/slurm.spec
without
[Array] Default:[]
- List of --without build options to pass to rpmbuild -- see https://github.com/SchedMD/slurm/blob/master/slurm.spec
Example: Building version 17.06.7 (latest at the time of writing) of SLURM
slurm::build { '17.02.7':
ensure => 'present',
srcdir => '/usr/local/src',
dir => '/root/rpmbuild',
with => [ 'lua', 'mysql', 'openssl' ]
}
Definition slurm::install::packages
This definition takes care of installing the Slurm packages, typically built from slurm::build
, for a given version passed as resource name.
Example: installing slurmd packages in version 17.02.7:
slurm::install::packages { '17.02.7':
ensure => 'present',
pkgdir => "/root/rpmbuild/RPMs/${::architecture}",
slurmd => true
}
Librarian-Puppet / R10K Setup
You can of course configure the slurm module in your Puppetfile
to make it available with Librarian puppet or r10k by adding the following entry:
# Modules from the Puppet Forge
mod "ULHPC/slurm"
or, if you prefer to work on the git version:
mod "ULHPC/slurm",
:git => 'https://github.com/ULHPC/puppet-slurm',
:ref => 'production'
Issues / Feature request
You can submit bug / issues / feature request using the slurm Puppet Module Tracker.
Developments / Contributing to the code
If you want to contribute to the code, you shall be aware of the way this module is organized.
These elements are detailed on docs/contributing.md
.
You are more than welcome to contribute to its development by sending a pull request.
Puppet modules tests within a Vagrant box
The best way to test this module in a non-intrusive way is to rely on Vagrant.
The Vagrantfile
at the root of the repository pilot the provisioning various vagrant boxes available on Vagrant cloud you can use to test this module.
See docs/vagrant.md
for more details.
Online Documentation
Read the Docs aka RTFD hosts documentation for the open source community and the slurm puppet module has its documentation (see the docs/
directly) hosted on readthedocs.
See docs/rtfd.md
for more details.
Licence
This project and the sources proposed within this repository are released under the terms of the Apache-2.0 licence.
Dependencies
- puppetlabs-stdlib (>=4.2.2 <5.0.0)
- puppetlabs-mysql (>=3.11.0 <4.0.0)
- puppetlabs-inifile (>=2.0.0 <3.0.0)
- puppetlabs-vcsrepo (>=2.0.0 <3.0.0)
- puppetlabs-firewall (>=1.9.0 <2.0.0)
- puppet-archive (>=1.3.0 <2.0.0)
- puppet-yum (>=2.0.0 <3.0.0)
- puppet-selinux (>=1.3.0 <2.0.0)
- stahnma-epel (>=1.2.2 <2.0.0)
- svarrette-ulimit (>=1.0.6 <2.0.0)
- crayfishx-firewalld (>=3.4.0 <4.0.0)
- bodgit-rngd (>=2.0.0 <3.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2017 UL, HPC, Team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.