Skip to content

Commit b9a71b0

Browse files
authored
Support tuned in compute-init (#570)
* document which roles require an image build for compute_init * fix compute-init docs for node-exporter * reorder compute-init docs notes * add tuned into stackhpc image * match /mnt/cluster permissions before and after mount, so ansible-init reruns don't fail * support tuned in ansible-init * enable tuned for stackhpc rebuilds * allow injecting ark creds even during site.yml, for development use * bump CI image
1 parent 8b04846 commit b9a71b0

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

ansible/bootstrap.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@
126126
ansible.builtin.assert:
127127
that: dnf_repos_password is undefined
128128
fail_msg: Passwords should not be templated into repofiles during configure, unset 'dnf_repos_password'
129-
when: appliances_mode == 'configure'
129+
when:
130+
- appliances_mode == 'configure'
131+
- not (dnf_repos_allow_insecure_creds | default(false)) # useful for development
130132

131133
- hosts: squid
132134
tags: squid

ansible/roles/compute_init/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ it also requires an image build with the role name added to the
4949
| bootstrap.yml | sshd | None at present | No |
5050
| bootstrap.yml | dnf_repos | None at present [2] | - |
5151
| bootstrap.yml | squid | Not relevant for compute nodes | n/a |
52-
| bootstrap.yml | tuned | None | - |
52+
| bootstrap.yml | tuned | Fully supported | No |
5353
| bootstrap.yml | freeipa_server | Not relevant for compute nodes | n/a |
5454
| bootstrap.yml | cockpit | None required - use image build | No |
5555
| bootstrap.yml | firewalld | Not relevant for compute nodes | n/a |

ansible/roles/compute_init/files/compute-init.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
enable_compute: "{{ os_metadata.meta.compute | default(false) | bool }}"
1010
enable_resolv_conf: "{{ os_metadata.meta.resolv_conf | default(false) | bool }}"
1111
enable_etc_hosts: "{{ os_metadata.meta.etc_hosts | default(false) | bool }}"
12+
enable_tuned: "{{ os_metadata.meta.tuned | default(false) | bool }}"
1213
enable_nfs: "{{ os_metadata.meta.nfs | default(false) | bool }}"
1314
enable_manila: "{{ os_metadata.meta.manila | default(false) | bool }}"
1415
enable_basic_users: "{{ os_metadata.meta.basic_users | default(false) | bool }}"
@@ -17,6 +18,12 @@
1718
# TODO: "= role defaults" - could be moved to a vars_file: on play with similar precedence effects
1819
resolv_conf_nameservers: []
1920

21+
tuned_profile_baremetal: hpc-compute
22+
tuned_profile_vm: virtual-guest
23+
tuned_profile: "{{ tuned_profile_baremetal if ansible_virtualization_role != 'guest' else tuned_profile_vm }}"
24+
tuned_enabled: true
25+
tuned_started: true
26+
2027
nfs_client_mnt_point: "/mnt"
2128
nfs_client_mnt_options:
2229
nfs_client_mnt_state: mounted
@@ -59,9 +66,9 @@
5966
file:
6067
path: /mnt/cluster
6168
state: directory
62-
owner: root
69+
owner: slurm
6370
group: root
64-
mode: u=rwX,go= # is sensitive
71+
mode: u=rX,g=rwX,o=
6572

6673
- name: Mount /mnt/cluster
6774
mount:
@@ -125,6 +132,10 @@
125132
mode: 0644
126133
when: enable_etc_hosts
127134

135+
- name: Configure tuned
136+
include_tasks: tasks/tuned.yml
137+
when: enable_tuned
138+
128139
# NFS client mount
129140
- name: If nfs-clients is present
130141
include_tasks: tasks/nfs-clients.yml

ansible/roles/compute_init/tasks/install.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
dest: files/NetworkManager-dns-none.conf
3333
- src: ../../basic_users/filter_plugins/filter_keys.py
3434
dest: filter_plugins/filter_keys.py
35+
- src: ../../tuned/tasks/configure.yml
36+
dest: tasks/tuned.yml
3537
- src: ../../stackhpc.nfs/tasks/nfs-clients.yml
3638
dest: tasks/nfs-clients.yml
3739

environments/.stackhpc/inventory/extra_groups

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ cluster
2424
login
2525
compute
2626

27+
[tuned:children]
28+
# Install tuned into fat image
29+
builder
30+
2731
[squid:children]
2832
# Install squid into fat image
2933
builder
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cluster_image": {
3-
"RL8": "openhpc-RL8-250130-1126-8f2a7703",
4-
"RL9": "openhpc-RL9-250130-1127-8f2a7703"
3+
"RL8": "openhpc-RL8-250211-1540-a0b4a57e",
4+
"RL9": "openhpc-RL9-250211-1540-a0b4a57e"
55
}
66
}

environments/.stackhpc/tofu/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module "cluster" {
8080
standard: { # NB: can't call this default!
8181
nodes: ["compute-0", "compute-1"]
8282
flavor: var.other_node_flavor
83-
compute_init_enable: ["compute", "etc_hosts", "nfs", "basic_users", "eessi"]
83+
compute_init_enable: ["compute", "etc_hosts", "nfs", "basic_users", "eessi", "tuned"]
8484
ignore_image_changes: true
8585
}
8686
# Example of how to add another partition:

0 commit comments

Comments
 (0)