Skip to content

Commit

Permalink
Modified ansible-playbook to create a cluster based on RockyLinux 9 and
Browse files Browse the repository at this point in the history
OpenHPC3.X.
  • Loading branch information
luluzhu committed Nov 5, 2024
1 parent 8298304 commit 2972e34
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 41 deletions.
8 changes: 7 additions & 1 deletion create_compute_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,17 @@
- "ntp0.cac.cornell.edu iburst"
- "ntp1.cac.cornell.edu iburst"
- "ntp2.cac.cornell.edu iburst"
ntp_cron_handler_enabled: true
ntp_cron_handler_enabled: false

tasks:
- import_tasks: tasks/install_compute_packages.yml

- name: Make sure firewall is running
service:
name: firewalld
state: started
enabled: true

- name: Allow incoming traffic from cluster network
ansible.posix.firewalld:
source: "{{ cluster_network_cidr }}"
Expand Down
3 changes: 3 additions & 0 deletions files/my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
22 changes: 19 additions & 3 deletions provision_headnode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@
enabled: true

tasks:
- import_tasks: tasks/install_headnode_packages.yml

- import_tasks: tasks/install_openstack_client.yml

- import_tasks: tasks/install_headnode_packages.yml
# - import_tasks: tasks/install_headnode_packages.yml

- import_tasks: tasks/install_oneapi.yml
when: install_intel_oneapi
Expand All @@ -81,6 +83,12 @@
* soft memlock unlimited
* hard memlock unlimited
- name: Make sure firewall is running
service:
name: firewalld
state: started
enabled: true

- name: Allow incoming traffic from cluster network
ansible.posix.firewalld:
source: "{{ cluster_network_cidr }}"
Expand Down Expand Up @@ -134,6 +142,14 @@
name: python3-PyMySQL
state: present

- name: Copy .my.cnf
copy:
src: files/my.cnf
dest: /root/.my.cnf
owner: root
group: root
mode: '0644'

- name: Create slurm_acct_db MySQL database
community.mysql.mysql_db:
name: slurm_acct_db
Expand Down Expand Up @@ -197,9 +213,9 @@
state: started
enabled: true
with_items:
- slurmctld
- slurmdbd
- munge
- slurmdbd
- slurmctld

- name: Gather munge.key
fetch:
Expand Down
14 changes: 7 additions & 7 deletions tasks/install_compute_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@
- dnf-plugins-core
state: present

- name: Enable PowerTools repo
lineinfile:
path: "/etc/yum.repos.d/{{ yum_repo_prefix[ansible_facts.distribution] }}-PowerTools.repo"
regexp: '^enabled=0'
line: 'enabled=1'

- name: Add OpenHPC repo
dnf:
name: http://repos.openhpc.community/OpenHPC/2/CentOS_8/x86_64/ohpc-release-2-1.el8.x86_64.rpm
name: http://repos.openhpc.community/OpenHPC/3/EL_9/x86_64/ohpc-release-3-1.el9.x86_64.rpm
disable_gpg_check: true
state: present

Expand All @@ -25,3 +19,9 @@
- ohpc-slurm-client
- lmod-ohpc
state: present

- name: Install user packages
dnf:
name:
- firewalld
state: present
8 changes: 1 addition & 7 deletions tasks/install_headnode_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@
- dnf-plugins-core
state: present

- name: Enable PowerTools repo
lineinfile:
path: "/etc/yum.repos.d/{{ yum_repo_prefix[ansible_facts.distribution] }}-PowerTools.repo"
regexp: '^enabled=0'
line: 'enabled=1'

- name: Add OpenHPC repo
dnf:
name: http://repos.openhpc.community/OpenHPC/2/CentOS_8/x86_64/ohpc-release-2-1.el8.x86_64.rpm
name: http://repos.openhpc.community/OpenHPC/3/EL_9/x86_64/ohpc-release-3-1.el9.x86_64.rpm
disable_gpg_check: true
state: present

Expand Down
2 changes: 1 addition & 1 deletion templates/slurm.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ SchedulerType=sched/backfill
#SchedulerPort=
#SchedulerRootFilter=
#SelectType=select/linear
SelectType=select/cons_res
SelectType=select/cons_tres
SelectTypeParameters=CR_CPU
#PriorityType=priority/multifactor
#PriorityDecayHalfLife=14-0
Expand Down
46 changes: 24 additions & 22 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
# Cluster general info
#
cluster_name: "cluster1"
image_name: "rocky-8.7"
image_name: "rocky-9.4"
image_init_user: "rocky"
yum_repo_prefix:
Rocky: "Rocky"
CentOS: "CentOS-Linux"

#
# Heade node
Expand All @@ -19,28 +16,33 @@ head_node_flavor: c1.m8
head_node_disk_size_gb: 50
head_node_user_packages:
- ohpc-autotools
- ohpc-gnu12-io-libs
- ohpc-gnu12-openmpi4-io-libs
- ohpc-gnu12-openmpi4-parallel-libs
- ohpc-gnu12-parallel-libs
- ohpc-gnu12-python3-libs
- gnu12-compilers-ohpc
- openmpi4-gnu12-ohpc
- lmod-defaults-gnu12-openmpi4-ohpc
- ohpc-gnu13-io-libs
- ohpc-gnu13-openmpi5-io-libs
- ohpc-gnu13-openmpi5-parallel-libs
- ohpc-gnu13-parallel-libs
- ohpc-gnu13-python3-libs
- gnu13-compilers-ohpc
- openmpi5-gnu13-ohpc
- lmod-defaults-gnu13-openmpi5-ohpc
- automake-ohpc
- autoconf-ohpc
- cmake-ohpc
- libtool-ohpc
- python3-scipy-gnu12-openmpi4-ohpc
- python3-numpy-gnu12-ohpc
- python3-mpi4py-gnu12-openmpi4-ohpc
- pnetcdf-gnu12-openmpi4-ohpc
- gsl-gnu12-ohpc
- openblas-gnu12-ohpc
- boost-gnu12-openmpi4-ohpc
- fftw-gnu12-openmpi4-ohpc
- hypre-gnu12-openmpi4-ohpc
- scalapack-gnu12-openmpi4-ohpc
- python3.11-scipy-gnu13-openmpi5-ohpc
- python3.11-numpy-gnu13-ohpc
- python3.11-mpi4py-gnu13-openmpi5-ohpc
- pnetcdf-gnu13-openmpi5-ohpc
- gsl-gnu13-ohpc
- openblas-gnu13-ohpc
- boost-gnu13-openmpi5-ohpc
- fftw-gnu13-openmpi5-ohpc
- hypre-gnu13-openmpi5-ohpc
- scalapack-gnu13-openmpi5-ohpc
- python3.11
- python3.11-pip
- python3
- python3-pip
- firewalld
mysql_user: slurm
mysql_password: slurmdb
# Set install_intel_oneapi to true to install Intel OneAPI (minimum head_node_disk_size_gb 60 )
Expand Down

0 comments on commit 2972e34

Please sign in to comment.