forked from NVIDIA/deepops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request NVIDIA#1100 from ajdecon/mofed-role
Add a basic playbook for installing Mellanox OFED
- Loading branch information
Showing
10 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ jobs: | |
- openshift | ||
- rsyslog_client | ||
- rsyslog_server | ||
- mofed | ||
- singularity_wrapper | ||
- slurm | ||
- spack | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Installs NVIDIA Mellanox OFED, a collection of software packages to enable | ||
# high-speed networking with InfiniBand or RoCE on NVIDIA Mellanox networking | ||
# adapters. | ||
# | ||
# This playbook automates the software installation process outlined in the | ||
# MLNX_OFED documentation, here: | ||
# https://community.mellanox.com/s/article/howto-install-mlnx-ofed-driver | ||
--- | ||
- hosts: "{{ hostlist | default('all') }}" | ||
become: yes | ||
roles: | ||
- mofed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
mofed_version: "5.6-2.0.9.0" | ||
|
||
mofed_download_dir: "/tmp/mofed-install" | ||
mofed_download_dest: "mofed.tgz" | ||
mofed_download_name: "MLNX_OFED_LINUX-{{ mofed_version }}-{{ mofed_distro }}{{ ansible_distribution_version }}-{{ ansible_architecture }}" | ||
mofed_download_url: "http://www.mellanox.com/downloads/ofed/MLNX_OFED-{{ mofed_version }}/{{ mofed_download_name }}.tgz" | ||
|
||
mofed_install_flags: "--all --without-fw-update" | ||
|
||
mofed_cleanup_install_dir: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include mofed" | ||
include_role: | ||
name: "mofed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: mofed-ubuntu-1804 | ||
image: geerlingguy/docker-ubuntu1804-ansible | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
command: /sbin/init | ||
pre_build_image: true | ||
privileged: true | ||
- name: mofed-ubuntu-2004 | ||
image: geerlingguy/docker-ubuntu2004-ansible | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
command: /sbin/init | ||
pre_build_image: true | ||
privileged: true | ||
- name: mofed-centos-7 | ||
image: geerlingguy/docker-centos7-ansible | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
command: /sbin/init | ||
pre_build_image: true | ||
privileged: true | ||
- name: mofed-centos-8 | ||
image: geerlingguy/docker-centos8-ansible | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
command: /sbin/init | ||
pre_build_image: true | ||
privileged: true | ||
provisioner: | ||
name: ansible | ||
ansible_args: | ||
- -vv | ||
inventory: | ||
group_vars: | ||
all: | ||
mofed_install_flags: "--all --without-fw-update --user-space-only" | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
# This is an example playbook to execute Ansible tests. | ||
|
||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Example assertion | ||
assert: | ||
that: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
- name: include vars if ubuntu | ||
include_vars: ubuntu.yml | ||
when: ansible_distribution == "Ubuntu" | ||
|
||
- name: include vars if redhat-compatible | ||
include_vars: rhel{{ ansible_distribution_major_version }}.yml | ||
when: ansible_os_family == "RedHat" | ||
|
||
- name: ensure perl is installed | ||
package: | ||
name: perl | ||
state: present | ||
|
||
- name: ensure rhel prereqs are installed | ||
yum: | ||
name: "{{ mofed_pkg_prereqs }}" | ||
state: present | ||
when: ansible_os_family == "RedHat" | ||
|
||
- name: attempt to get installed ofed version # noqa risky-shell-pipe | ||
shell: ofed_info | head -n1 | ||
register: ofed_info | ||
changed_when: ofed_info.rc != 0 | ||
|
||
- name: default to skipping install | ||
set_fact: | ||
mofed_do_install: false | ||
|
||
- name: check ofed version against desired version # noqa no-handler | ||
set_fact: | ||
mofed_do_install: true | ||
when: ofed_info.changed or (mofed_version not in ofed_info.stdout) | ||
|
||
- name: create download directory | ||
file: | ||
path: "{{ mofed_download_dir }}" | ||
state: "directory" | ||
owner: "root" | ||
group: "root" | ||
mode: "0755" | ||
when: mofed_do_install | ||
|
||
- name: download mofed distribution | ||
get_url: | ||
url: "{{ mofed_download_url }}" | ||
dest: "{{ mofed_download_dir }}/{{ mofed_download_dest }}" | ||
when: mofed_do_install | ||
|
||
- name: extract mofed distribution | ||
unarchive: | ||
src: "{{ mofed_download_dir }}/{{ mofed_download_dest }}" | ||
remote_src: true | ||
dest: "{{ mofed_download_dir }}" | ||
when: mofed_do_install | ||
|
||
- name: execute mlnxofedinstall | ||
shell: | ||
cmd: yes | ./mlnxofedinstall {{ mofed_install_flags }} | ||
chdir: "{{ mofed_download_dir }}/{{ mofed_download_name }}" | ||
environment: | ||
TERM: "xterm" | ||
when: mofed_do_install | ||
|
||
- name: clean up install dir | ||
file: | ||
path: "{{ mofed_download_dir }}" | ||
state: "absent" | ||
when: mofed_do_install and mofed_cleanup_install_dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
mofed_distro: "rhel" | ||
mofed_pkg_prereqs: | ||
- pciutils-libs | ||
- numactl-libs | ||
- gcc-gfortran | ||
- tcsh | ||
- libusbx | ||
- libnl3 | ||
- tcl | ||
- fuse-libs | ||
- tk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
mofed_distro: "rhel" | ||
mofed_pkg_prereqs: | ||
- tcsh | ||
- gcc-gfortran | ||
- numactl-libs | ||
- kernel-modules-extra | ||
- tcl | ||
- tk | ||
- fuse-libs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
mofed_distro: "ubuntu" |