Skip to content

Commit

Permalink
Merge pull request #37 from grycap/devel
Browse files Browse the repository at this point in the history
Add cgroup.conf file
  • Loading branch information
micafer authored Oct 25, 2023
2 parents a820266 + e6532e3 commit 158fa4f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ The variables that can be passed to this role and a brief description about them
SlurmdLogFile: /var/log/slurm/slurmd.log
# SLURM user configuration options
slurm_conf_options: {}
# SLURM configuration options for cgroup
slurm_cgroup_conf_options:
CgroupPlugin: cgroup/v1

Example Playbook
----------------
Expand Down
5 changes: 4 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,7 @@ slurm_default_conf_options:
SlurmdDebug: debug5
SlurmdLogFile: /var/log/slurm/slurmd.log
# SLURM user configuration options
slurm_conf_options: {}
slurm_conf_options: {}
# SLURM configuration options for cgroup
slurm_cgroup_conf_options:
CgroupPlugin: cgroup/v1
7 changes: 5 additions & 2 deletions tasks/front.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@
done
- name: Create the slurm.conf file
template: dest={{ SLURM_CONF }} src=slurm.conf.j2
template: dest={{ SLURM_CONF_DIR }}/slurm.conf src=slurm.conf.j2

- name: Create the cgroup.conf file
template: dest={{ SLURM_CONF_DIR }}/cgroup.conf src=cgroup.conf.j2

- name: Create the gres.conf file
template: dest={{ GRES_CONF }} src=gres.conf.j2
template: dest={{ SLURM_CONF_DIR }}/gres.conf src=gres.conf.j2
when: slurm_wn_gres != ""

- name: Create slurmctld systemd unit file
Expand Down
9 changes: 3 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,23 @@

- name: Set SLURM conf file path as fact RH
set_fact:
SLURM_CONF: "/etc/slurm/slurm.conf"
SLURM_CONF_DIR: "/etc/slurm"
SLURM_SERVICE: "/usr/sbin/slurmctld"
SLURM_DAEMON: "/usr/sbin/slurmd"
GRES_CONF: "/etc/slurm/gres.conf"
when: ansible_os_family == "RedHat"

- name: Set SLURM conf file path as fact Debian apt
set_fact:
SLURM_CONF: "/etc/slurm-llnl/slurm.conf"
SLURM_CONF_DIR: "/etc/slurm-llnl"
SLURM_SERVICE: "/usr/sbin/slurmctld"
SLURM_DAEMON: "/usr/sbin/slurmd"
GRES_CONF: "/etc/slurm-llnl/gres.conf"
when: ansible_os_family == "Debian" and not install_from_source

- name: Set SLURM conf file path as fact Debian source
set_fact:
SLURM_CONF: "/usr/local/etc/slurm.conf"
SLURM_CONF_DIR: "/usr/local/etc"
SLURM_SERVICE: "/usr/local/sbin/slurmctld"
SLURM_DAEMON: "/usr/local/sbin/slurmd"
GRES_CONF: "/usr/local/etc/gres.conf"
when: ansible_os_family == "Debian" and install_from_source

- name: create slurm user and group
Expand Down
9 changes: 6 additions & 3 deletions tasks/wn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@

- name: Wait for master
wait_for:
path: "{{ SLURM_CONF }}"
path: "{{ SLURM_CONF_DIR }}/slurm.conf"
delegate_to: "{{slurm_server_name}}"
when: TEST is not defined

- name: copy slurm.conf file from the frontend
copy: src={{ SLURM_CONF }} dest={{ SLURM_CONF }} force=yes
copy: src={{ SLURM_CONF_DIR }}/slurm.conf dest={{ SLURM_CONF_DIR }}/slurm.conf force=yes

- name: copy cgroup.conf file from the frontend
copy: src={{ SLURM_CONF_DIR }}/cgroup.conf dest={{ SLURM_CONF_DIR }}/cgroup.conf force=yes

- name: copy gres.conf file from the frontend
copy: src={{ GRES_CONF }} dest={{ GRES_CONF }} force=yes
copy: src={{ SLURM_CONF_DIR }}/gres.conf dest={{ SLURM_CONF_DIR }}/gres.conf force=yes
when: slurm_wn_gres != ""

- name: Wait 5 secs to enable slurm to start
Expand Down
3 changes: 3 additions & 0 deletions templates/cgroup.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% for key, value in slurm_cgroup_conf_options.items() %}
{{key}}={{value}}
{% endfor %}

0 comments on commit 158fa4f

Please sign in to comment.