Skip to content

Commit

Permalink
Merge pull request #337 from mboisson/slurm_disable_spank_tmpfs
Browse files Browse the repository at this point in the history
Allow to disable Slurm's spank plugin to manage tmpfs mounts
  • Loading branch information
cmd-ntrf authored Jun 10, 2024
2 parents a6089e1 + 1475bfd commit 4f0e661
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 24 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ The `profile::` sections list the available classes, their role and their parame
- [`profile::slurm::base`](#profileslurmbase)
- [`profile::slurm::accounting`](#profileslurmaccounting)
- [`profile::slurm::controller`](#profileslurmcontroller)
- [`profile::slurm::node`](#profileslurmnode)
- [`profile::software_stack`](#profilesoftware_stack)
- [`profile::squid::server`](#profilesquidserver)
- [`profile::sssd::client`](#profilesssdclient)
Expand Down Expand Up @@ -1092,6 +1093,38 @@ When `profile::slurm::accounting` is included, these classes are included too:
- [`profile::slurm::base`](#profileslurmbase)
- [`profile::mail::server`](#profilemailserver)


## `profile::slurm::node`

This class installs and configure the Slurm node daemon - **slurmd**.

### parameters

| Variable | Description | Type |
| :---------------------- | :-------------------------------------------------------------------------------------------- | :------ |
| `enable_tmpfs_mounts` | Enable [spank-cc-tmpfs_mounts](https://github.com/ComputeCanada/spank-cc-tmpfs_mounts) plugin | Boolean |

<details>
<summary>default values</summary>

```yaml
profile::slurm::node::enable_tmpfs_mounts: true
```
</details>

<details>
<summary>example</summary>

```yaml
profile::slurm::node::enable_tmpfs_mounts: false
```
</details>

### dependency

When `profile::slurm::node` is included, this class is included too:
- [`profile::slurm::base`](#profileslurmbase)

## `profile::software_stack`

This class configures the initial shell profile that user will load on login and
Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ profile::software_stack::min_uid: "%{alias('profile::freeipa::server::id_start')
profile::slurm::base::slurm_version: '23.11'
profile::slurm::base::os_reserved_memory: 512
profile::slurm::controller::autoscale_version: '0.5.1'
profile::slurm::node::enable_tmpfs_mounts: true

profile::accounts::project_regex: '(ctb|def|rpp|rrg)-[a-z0-9_-]*'
profile::users::ldap::access_tags: ['login:sshd', 'node:sshd', 'proxy:jupyterhub-login']
Expand Down
51 changes: 27 additions & 24 deletions site/profile/manifests/slurm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -555,43 +555,46 @@
}

# Slurm node class. This is where slurmd is ran.
class profile::slurm::node {
class profile::slurm::node (
Boolean $enable_tmpfs_mounts = true,
) {
contain profile::slurm::base

$slurm_version = lookup('profile::slurm::base::slurm_version')
$cc_tmpfs_mounts_url = "https://download.copr.fedorainfracloud.org/results/cmdntrf/spank-cc-tmpfs_mounts-${slurm_version}/"

yumrepo { 'spank-cc-tmpfs_mounts-copr-repo':
enabled => true,
descr => 'Copr repo for spank-cc-tmpfs_mounts owned by cmdntrf',
baseurl => "${cc_tmpfs_mounts_url}/epel-\$releasever-\$basearch/",
skip_if_unavailable => true,
gpgcheck => 1,
gpgkey => "${cc_tmpfs_mounts_url}/pubkey.gpg",
repo_gpgcheck => 0,
}

package { ['slurm-slurmd', 'slurm-pam_slurm']:
ensure => 'installed',
require => Package['slurm']
}

package { 'spank-cc-tmpfs_mounts':
ensure => 'installed',
require => [
Package['slurm-slurmd'],
Yumrepo['spank-cc-tmpfs_mounts-copr-repo'],
]
if $enable_tmpfs_mounts {
$slurm_version = lookup('profile::slurm::base::slurm_version')
$cc_tmpfs_mounts_url = "https://download.copr.fedorainfracloud.org/results/cmdntrf/spank-cc-tmpfs_mounts-${slurm_version}/"

yumrepo { 'spank-cc-tmpfs_mounts-copr-repo':
enabled => true,
descr => 'Copr repo for spank-cc-tmpfs_mounts owned by cmdntrf',
baseurl => "${cc_tmpfs_mounts_url}/epel-\$releasever-\$basearch/",
skip_if_unavailable => true,
gpgcheck => 1,
gpgkey => "${cc_tmpfs_mounts_url}/pubkey.gpg",
repo_gpgcheck => 0,
}
package { 'spank-cc-tmpfs_mounts':
ensure => 'installed',
require => [
Package['slurm-slurmd'],
Yumrepo['spank-cc-tmpfs_mounts-copr-repo'],
]
}
$plugstack = 'required /opt/software/slurm/lib64/slurm/cc-tmpfs_mounts.so bindself=/tmp bindself=/dev/shm target=/localscratch bind=/var/tmp/'
} else {
$plugstack = ''
}

file { '/etc/slurm/plugstack.conf':
ensure => 'present',
owner => 'slurm',
group => 'slurm',
content => @(EOT/L),
required /opt/software/slurm/lib64/slurm/cc-tmpfs_mounts.so \
bindself=/tmp bindself=/dev/shm target=/localscratch bind=/var/tmp/
|EOT
content => $plugstack,
}

pam { 'Add pam_slurm_adopt':
Expand Down

0 comments on commit 4f0e661

Please sign in to comment.