Skip to content

Fix accounting storage #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.swp
*.retry
*.pyc
venv
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ package in the image.

#### Accounting

By default, the accounting plugin will use the `accounting_storage/filetxt` storage type. However,
this only supports a subset of `sacct` commands.

To deploy and configure `slurmdbd`:
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:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm it might be a matter of personal preference but footnote in markdown seems to make it less readable.


* 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.
* Set `openhpc_slurm_accounting_storage_type` to `accounting_storage/slurmdbd`.
Expand All @@ -80,13 +77,9 @@ The role will take care of configuring the following variables for you:

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

`openhpc_slurm_accounting_storage_type`: How accounting records are stored. Can be one of `accounting_storage/none`,
`accounting_storage/slurmdbd` or `accounting_storage/filetxt`.

`openhpc_slurm_accounting_storage_user`: Username for authenticating with the accounting storage.

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

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

Expand Down Expand Up @@ -212,3 +205,7 @@ To drain nodes, for example, before scaling down the cluster to 6 nodes:
drain: "{{ inventory_hostname not in desired_state }}"
resume: "{{ inventory_hostname in desired_state }}"
...

---

<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)
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ openhpc_munge_key_path: ''
# Accounting
openhpc_slurm_accounting_storage_host: "{{ openhpc_slurmdbd_host }}"
openhpc_slurm_accounting_storage_port: 6819
openhpc_slurm_accounting_storage_type: accounting_storage/filetxt
openhpc_slurm_accounting_storage_type: accounting_storage/none
# NOTE: You only need to set these if using accounting_storage/mysql
openhpc_slurm_accounting_storage_user: slurm
#openhpc_slurm_accounting_storage_pass:
Expand Down
7 changes: 5 additions & 2 deletions molecule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ test11 | 1 | N | As for #5 but then deletes a n

# Local Installation & Running

Local installation on a Centos7 machine looks like:
Local installation on a CentOS 8 machine looks like:

sudo yum install -y gcc python3-pip python3-devel openssl-devel python3-libselinux
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
pip3 install -r molecule/requirements.txt --user
python3 -m venv venv
. venv/bin/activate
pip install -U pip
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python3 -m pip

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pip gets you the pip from the venv here.

pip install -r molecule/requirements.txt

sudo systemctl start docker
sudo usermod -aG docker ${USER}
Expand Down
2 changes: 1 addition & 1 deletion molecule/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pip
setuptools
molecule[docker,lint]
molecule[docker,lint,ansible]
7 changes: 4 additions & 3 deletions tasks/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
src: slurmdbd.conf.j2
dest: /etc/slurm/slurmdbd.conf
mode: "0600"
owner: root
group: root
owner: slurm
group: slurm
notify: Restart slurmdbd service
when: openhpc_enable.database | default(false) | bool

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

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

- name: Ensure Slurm service state
service:
Expand Down