-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove slurm_openstack_tools collection (#537)
* remove slurm_openstack_tools collection * bump CI images * remove unused pytest role files * remove unused reboot validation * rename pytools to slurm_tools * tidy slurm_tools * fix slurm stats play
- Loading branch information
Showing
13 changed files
with
165 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
stackhpc.slurm_openstack_tools.slurm-stats | ||
========================================== | ||
|
||
Configures slurm-stats from https://github.com/stackhpc/slurm-openstack-tools.git which | ||
transforms sacct output into a form that is more amenable for importing into elasticsearch/loki. | ||
|
||
Requirements | ||
------------ | ||
|
||
Role Variables | ||
-------------- | ||
|
||
See `defaults/main.yml`. | ||
|
||
Dependencies | ||
------------ | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
- hosts: compute | ||
tasks: | ||
- import_role: | ||
name: stackhpc.slurm_openstack_tools.slurm-stats | ||
|
||
|
||
License | ||
------- | ||
|
||
Apache-2.0 | ||
|
||
Author Information | ||
------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
#################### | ||
# log rotate options | ||
#################### | ||
|
||
# These options affect the contents of the log-rotate file. | ||
# See: man logrotate | ||
|
||
# Log files are rotated count times before being removed | ||
slurm_stats_log_rotate_content_rotate: 7 | ||
|
||
# How frequently are the log files rotated. Can be one of daily, monthly, ... | ||
slurm_stats_log_rotate_content_frequency: daily |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
|
||
- name: Setup slurm tools | ||
include_role: | ||
name: slurm_tools | ||
|
||
- name: Create a directory to house the log files | ||
file: | ||
state: directory | ||
path: /var/log/slurm-stats | ||
become: true | ||
|
||
- name: Create cron job | ||
cron: | ||
name: Generate slurm stats | ||
minute: "*/5" | ||
user: root | ||
# NOTE: lasttimestamp is stored at /root/lasttimestamp | ||
job: "TZ=UTC /opt/slurm-tools/bin/slurm-stats >> /var/log/slurm-stats/finished_jobs.json" | ||
cron_file: slurm-stats | ||
become: true | ||
|
||
- name: Setup log rotate | ||
copy: | ||
content: | | ||
# WARNING: This file is managed by ansible, do not modify. | ||
/var/log/slurm-stats/finished_jobs.json { | ||
{{ slurm_stats_log_rotate_content_frequency }} | ||
rotate {{ slurm_stats_log_rotate_content_rotate }} | ||
compress | ||
delaycompress | ||
} | ||
dest: /etc/logrotate.d/slurm-stats | ||
become: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
language: python | ||
python: "2.7" | ||
|
||
# Use the new container infrastructure | ||
sudo: false | ||
|
||
# Install ansible | ||
addons: | ||
apt: | ||
packages: | ||
- python-pip | ||
|
||
install: | ||
# Install ansible | ||
- pip install ansible | ||
|
||
# Check ansible version | ||
- ansible --version | ||
|
||
# Create ansible.cfg with correct roles_path | ||
- printf '[defaults]\nroles_path=../' >ansible.cfg | ||
|
||
script: | ||
# Basic role syntax check | ||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check | ||
|
||
notifications: | ||
webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
slurm_tools | ||
========= | ||
|
||
Install python-based tools from https://github.com/stackhpc/slurm-openstack-tools.git into `/opt/slurm-tools/bin/`. | ||
|
||
Role Variables | ||
-------------- | ||
|
||
- `pytools_editable`: Optional bool. Whether to install the package using `pip`'s | ||
editable mode (installing source to `/opt/slurm-tools/src`). Default `false`. | ||
- `pytools_gitref`: Optional. Git branch/tag/commit etc to install. Default `master`. | ||
- `pytools_user`: Optional user to install as. Default `root`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
pytools_editable: false | ||
pytools_gitref: master | ||
pytools_user: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
- name: install python3 | ||
package: | ||
name: python3,git | ||
become: true | ||
|
||
- name: Create virtualenv directory | ||
file: | ||
path: /opt/slurm-tools | ||
owner: "{{ pytools_user }}" | ||
group: "{{ pytools_user }}" | ||
state: directory | ||
become: true | ||
|
||
- block: | ||
- name: Upgrade pip | ||
# This needs to a separate step so that we use the updated version | ||
# to install the packages below. | ||
pip: | ||
name: pip | ||
|
||
- name: Create virtualenv | ||
pip: | ||
name: "git+https://github.com/stackhpc/slurm-openstack-tools.git@{{ pytools_gitref }}#egg=slurm_openstack_tools" | ||
editable: "{{ pytools_editable }}" | ||
|
||
module_defaults: | ||
ansible.builtin.pip: | ||
virtualenv: /opt/slurm-tools | ||
virtualenv_command: python3 -m venv | ||
state: latest | ||
become: true | ||
become_user: "{{ pytools_user }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
environments/.stackhpc/terraform/cluster_image.auto.tfvars.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"cluster_image": { | ||
"RL8": "openhpc-RL8-250114-1627-bccc88b5", | ||
"RL9": "openhpc-RL9-250114-1626-bccc88b5" | ||
"RL8": "openhpc-RL8-250115-1510-99f67c6d", | ||
"RL9": "openhpc-RL9-250115-1510-99f67c6d" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters