Sfoglia il codice sorgente

Merge pull request #869 from DeepikaKrishnaiah/devel

Install slurm on Leap OS
Sujit Jadhav 3 anni fa
parent
commit
350dea07e1

+ 15 - 2
roles/slurm_common/tasks/main.yml

@@ -1,4 +1,4 @@
-#  Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
+#  Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
@@ -57,10 +57,23 @@
     name: "{{ common_packages }}"
     state: present
   tags: install
+  when: os_supported_leap not in compute_os
+
+- name: Install packages for slurm
+  package:
+    name: "{{ leap_common_packages }}"
+    state: present
+  when: os_supported_leap in compute_os
 
 - name: Create munge key
   command: "{{ munge_cmd }}"
   changed_when: true
+  when: os_supported_leap not in compute_os
+
+- name: Create munge key
+  shell: dd if=/dev/random bs=1 count=1024 >/etc/munge/munge.key
+  changed_when: true
+  when: os_supported_leap in compute_os
 
 - name: Copy munge key
   copy:
@@ -218,4 +231,4 @@
     state: restarted
     enabled: yes
   tags: install
-  failed_when: false
+  failed_when: false

+ 9 - 2
roles/slurm_common/vars/main.yml

@@ -1,4 +1,4 @@
-#  Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
+#  Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
@@ -23,6 +23,12 @@ common_packages:
    - mariadb-devel
    - man2html
 
+leap_common_packages:
+   - slurm
+   - munge
+   - mariadb
+   - slurm-munge
+
 common_python2_packages:
    - MySQL-python
    - python-netaddr
@@ -59,4 +65,5 @@ slurmd_log: "/var/log/slurm/slurmd.log"
 
 os_centos: 'centos'
 os_rocky: 'rocky'
-os_version: '8.0'
+os_version: '8.0'
+os_supported_leap: "leap"

+ 9 - 0
roles/slurm_manager/tasks/main.yml

@@ -52,12 +52,21 @@
     name: "{{ slurm_packages }}"
     state: present
   tags: install
+  when: os_supported_leap not in compute_os
+
+- name: Install packages for slurm
+  package:
+    name: "{{ leap_slurm_packages }}"
+    state: present
+  tags: install
+  when: os_supported_leap in compute_os
 
 - name: Install development tools
   package:
     name: "{{ dev_tools }}"
     state: present
   tags: install
+  when: os_supported_leap not in compute_os
 
 - name: Get the hostname
   command: hostname

+ 9 - 1
roles/slurm_manager/vars/main.yml

@@ -45,6 +45,10 @@ log_files_manager:
    - slurm_jobacct.log
    - slurm_jobcomp.log
 
+leap_slurm_packages:
+   - slurm-slurmdbd
+   - git
+
 tmp_mode: "0755"
 cluster_state_path: "/var/spool/slurm/cluster_state"
 spool_slurmctld_pth: "/var/spool/slurmctld"
@@ -71,4 +75,8 @@ dbd_host: "localhost"
 logfile: "/var/log/slurm/slurmdbd.log"
 pidfile: "/var/run/slurmdbd.pid"
 buffer_path: "/tmp/slurm.conf"
-slurm_mode: "0644"
+slurm_mode: "0644"
+
+os_centos: 'centos'
+os_rocky: 'rocky'
+os_supported_leap: "leap"

+ 1 - 0
roles/slurm_restd/files/slurm-restd-custom.service

@@ -2,6 +2,7 @@
 Description = Start slurm restd
 
 [Service]
+Environment = SLURM_JWT=bvijavojviqjkenilejvkejfvvjfjv
 ExecStart = slurmrestd -a rest_auth/jwt -s openapi/v0.0.36 "0.0.0.0:6820"
 Restart = always
 RestartSec = 15

+ 14 - 3
roles/slurm_restd/tasks/install_jansson.yml

@@ -18,6 +18,14 @@
     name: "{{ slurm_restd_packages }}"
     state: present
   tags: install
+  when: os_supported_leap not in compute_os
+
+- name: Install packages for slurm restd on leap
+  package:
+    name: "{{ slurm_restd_packages_leap }}"
+    state: present
+  tags: install
+  when: os_supported_leap in compute_os
 
 - name: Download and untar jansson package
   unarchive:
@@ -25,9 +33,12 @@
     dest: "{{ jansson_download_dir }}"
     remote_src: yes
 
-- name: Go to jansson directory
-  command: cd "{{ jansson_dir_path }}"
-  changed_when: false
+- name: Install required C packages
+  zypper:
+    name: "{{ slurm_gcc_leap }}"
+    state: present
+    type: pattern
+  when: os_supported_leap in compute_os
 
 - name: Execute autoreconf
   shell:  set -o pipefail && cd "{{ jansson_dir_path }}" && autoreconf -i

+ 12 - 0
roles/slurm_restd/vars/main.yml

@@ -21,11 +21,23 @@ slurm_restd_packages:
    - libtool
    - make
 
+slurm_restd_packages_leap:
+   - slurm-rest
+   - libjson-c-devel
+   - http-parser-devel
+   - libtool
+   - make
+   - libopenssl-devel
+
+slurm_gcc_leap:
+  - devel_basis
+
 fil_mode: "0755"
 jansson_download_dir: /var/lib/
 jansson_src_url: https://github.com/akheron/jansson/archive/refs/tags/v2.14.tar.gz
 jansson_path: /usr/local/lib/pkgconfig
 jansson_dir_path: /var/lib/jansson-2.14/
+os_supported_leap: "leap"
 
 # Usage: install_libjwt.yml
 libjwt_repo: https://github.com/benmcollins/libjwt.git

+ 4 - 2
roles/slurm_workers/tasks/main.yml

@@ -1,4 +1,4 @@
-#  Copyright 2021 Dell Inc. or its subsidiaries. All Rights Reserved.
+#  Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
 #
 #  Licensed under the Apache License, Version 2.0 (the "License");
 #  you may not use this file except in compliance with the License.
@@ -81,12 +81,14 @@
     name: "{{ slurm_packages }}"
     state: present
   tags: install
+  when: os_supported_leap not in compute_os
 
 - name: Install development tools
   package:
     name: "{{ dev_tools }}"
     state: present
   tags: install
+  when: os_supported_leap not in compute_os
 
 - name: Get the hostname
   command: hostname
@@ -158,4 +160,4 @@
   fetch:
     src: "{{ slurm_confpth }}"
     dest: "{{ buffer_path }}"
-    flat: true
+    flat: true