Skip to content

Commit b3b4f44

Browse files
authored
Merge pull request #101 from stackhpc/fix/accounting_storage
Fix accounting storage
2 parents 50961a1 + 5588835 commit b3b4f44

File tree

6 files changed

+17
-15
lines changed

6 files changed

+17
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.swp
22
*.retry
33
*.pyc
4+
venv

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ package in the image.
6565

6666
#### Accounting
6767

68-
By default, the accounting plugin will use the `accounting_storage/filetxt` storage type. However,
69-
this only supports a subset of `sacct` commands.
70-
71-
To deploy and configure `slurmdbd`:
68+
By default, no accounting storage is configured. OpenHPC v1.x and un-updated OpenHPC v2.0 clusters support file-based accounting storage which can be selected by setting the role variable `openhpc_slurm_accounting_storage_type` to `accounting_storage/filetxt`<sup id="accounting_storage">[1](#slurm_ver_footnote)</sup>. Accounting for OpenHPC v2.1 and updated OpenHPC v2.0 clusters requires the Slurm database daemon, `slurmdbd`. To enable this:
7269

7370
* Configure a mariadb or mysql server as described in the slurm accounting [documentation](https://slurm.schedmd.com/accounting.html) on one of the nodes in your inventory and set `openhpc_enable.database `to `true` for this node.
7471
* Set `openhpc_slurm_accounting_storage_type` to `accounting_storage/slurmdbd`.
@@ -80,13 +77,9 @@ The role will take care of configuring the following variables for you:
8077

8178
`openhpc_slurm_accounting_storage_port`: Which port to use to connect to the accounting storage.
8279

83-
`openhpc_slurm_accounting_storage_type`: How accounting records are stored. Can be one of `accounting_storage/none`,
84-
`accounting_storage/slurmdbd` or `accounting_storage/filetxt`.
85-
8680
`openhpc_slurm_accounting_storage_user`: Username for authenticating with the accounting storage.
8781

8882
`openhpc_slurm_accounting_storage_pass`: Mungekey or database password to use for authenticating.
89-
with the accounting storage
9083

9184
For more advanced customisation or to configure another storage type, you might want to modify these values manually.
9285

@@ -212,3 +205,7 @@ To drain nodes, for example, before scaling down the cluster to 6 nodes:
212205
drain: "{{ inventory_hostname not in desired_state }}"
213206
resume: "{{ inventory_hostname in desired_state }}"
214207
...
208+
209+
---
210+
211+
<b id="slurm_ver_footnote">1</b> Slurm 20.11 removed `accounting_storage/filetxt` as an option. This version of Slurm was introduced in OpenHPC v2.1 but the OpenHPC repos are common to all OpenHPC v2.x releases. [](#accounting_storage)

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ openhpc_munge_key_path: ''
1616
# Accounting
1717
openhpc_slurm_accounting_storage_host: "{{ openhpc_slurmdbd_host }}"
1818
openhpc_slurm_accounting_storage_port: 6819
19-
openhpc_slurm_accounting_storage_type: accounting_storage/filetxt
19+
openhpc_slurm_accounting_storage_type: accounting_storage/none
2020
# NOTE: You only need to set these if using accounting_storage/mysql
2121
openhpc_slurm_accounting_storage_user: slurm
2222
#openhpc_slurm_accounting_storage_pass:

molecule/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ test11 | 1 | N | As for #5 but then deletes a n
2222

2323
# Local Installation & Running
2424

25-
Local installation on a Centos7 machine looks like:
25+
Local installation on a CentOS 8 machine looks like:
2626

2727
sudo yum install -y gcc python3-pip python3-devel openssl-devel python3-libselinux
2828
sudo yum install -y yum-utils
2929
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3030
sudo yum install -y docker-ce docker-ce-cli containerd.io
31-
pip3 install -r molecule/requirements.txt --user
31+
python3 -m venv venv
32+
. venv/bin/activate
33+
pip install -U pip
34+
pip install -r molecule/requirements.txt
3235

3336
sudo systemctl start docker
3437
sudo usermod -aG docker ${USER}

molecule/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pip
22
setuptools
3-
molecule[docker,lint]
3+
molecule[docker,lint,ansible]

tasks/runtime.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
src: slurmdbd.conf.j2
4949
dest: /etc/slurm/slurmdbd.conf
5050
mode: "0600"
51-
owner: root
52-
group: root
51+
owner: slurm
52+
group: slurm
5353
notify: Restart slurmdbd service
5454
when: openhpc_enable.database | default(false) | bool
5555

@@ -108,7 +108,8 @@
108108
state: "{{ 'started' if openhpc_slurm_service_started | bool else 'stopped' }}"
109109
when: openhpc_enable.database | default(false) | bool
110110

111-
- meta: flush_handlers # as then subsequent "ensure" is a no-op if slurm services bounced
111+
- name: flush handler
112+
meta: flush_handlers # as then subsequent "ensure" is a no-op if slurm services bounced
112113

113114
- name: Ensure Slurm service state
114115
service:

0 commit comments

Comments
 (0)