-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathmain.yml
More file actions
41 lines (36 loc) · 1.34 KB
/
main.yml
File metadata and controls
41 lines (36 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- name: Get facts about CUDA installation
import_role:
name: cuda
tasks_from: facts.yml
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
- name: Set fact containing slurm package facts
set_fact:
slurm_package: "{{ ansible_facts.packages['slurm-slurmd-ohpc'].0 }}"
- name: Recompile and install slurm packages
shell: |
#!/bin/bash
source /etc/profile
set -eux
dnf download -y --source slurm-slurmd-ohpc-{{ slurm_package.version }}-{{ slurm_package.release }}
rpm -i slurm-ohpc-*.src.rpm
cd /root/rpmbuild/SPECS
dnf builddep -y slurm.spec
rpmbuild -bb{% if slurm_recompile_with_nvml | bool %} -D "_with_nvml --with-nvml=/usr/local/cuda-{{ cuda_facts_version_short }}/targets/x86_64-linux/"{% endif %} slurm.spec
dnf reinstall -y /root/rpmbuild/RPMS/x86_64/*.rpm
become: true
- name: Workaround missing symlink
# Workaround path issue: https://groups.google.com/g/slurm-users/c/cvGb4JnK8BY
command: ln -s /lib64/libnvidia-ml.so.1 /lib64/libnvidia-ml.so
args:
creates: /lib64/libnvidia-ml.so
when: slurm_recompile_with_nvml | bool
- name: Cleanup Dependencies
shell: |
#!/bin/bash
set -eux
set -o pipefail
dnf history list | grep Install | grep 'builddep -y slurm.spec' | head -n 1 | awk '{print $1}' | xargs dnf history -y undo
become: true