From cc0663c862019e58e955bf1adef3d3a2b1233fc5 Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Mon, 2 Dec 2024 16:05:08 -0700 Subject: [PATCH] Update MOFED examples - Update for Rocky Linux 8 - Additional example for Rocky Linux 9 Signed-off-by: Jonathon Anderson --- examples/rockylinux-8-mofed/Containerfile | 26 +++++++++++++++++++++++ examples/rockylinux-8-mofed/README.md | 16 ++++++++++++++ examples/rockylinux-9-mofed/Containerfile | 9 +++++--- examples/rockylinux-9-mofed/README.md | 2 +- 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 examples/rockylinux-8-mofed/Containerfile create mode 100644 examples/rockylinux-8-mofed/README.md diff --git a/examples/rockylinux-8-mofed/Containerfile b/examples/rockylinux-8-mofed/Containerfile new file mode 100644 index 0000000..41e39c9 --- /dev/null +++ b/examples/rockylinux-8-mofed/Containerfile @@ -0,0 +1,26 @@ +FROM ghcr.io/warewulf/warewulf-rockylinux:8.10 + +ARG MOFED_TGZ + +RUN dnf -y install \ + kernel-{core,devel,headers,modules-extra} \ + autoconf \ + patch \ + libtool \ + rpm-build \ + kernel-rpm-macros \ + gdb-headless \ + automake \ + gcc-gfortran \ + tcl \ + tk \ + libnl3 \ + lsof \ + numactl-libs \ + python36 \ + && dnf -y remove $(dnf repoquery --installonly --latest-limit=-1 -q) \ + && dnf clean all + +RUN (cd /tmp && tar -xf /mnt/$MOFED_TGZ) \ + && (cd /tmp/MLNX_OFED_LINUX* && ./mlnxofedinstall --distro rhel8.10 --skip-repo --kernel $(rpm -q kernel-core --qf '%{version}-%{release}.%{arch}\n' | tail -n 1) --add-kernel-support --hpc) \ + && rm -rf /tmp/MLNX_OFED_LINUX* diff --git a/examples/rockylinux-8-mofed/README.md b/examples/rockylinux-8-mofed/README.md new file mode 100644 index 0000000..74e6880 --- /dev/null +++ b/examples/rockylinux-8-mofed/README.md @@ -0,0 +1,16 @@ +# Rocky Linux with the Mellanox OFED + +This container definition demonstrates building a Rocky Linux based container +incorporating the Mellanox OFED for InfiniBand support. + +This definition requires that the [Mellanox OFED .tgz][1] for the desired +version be placed in the `rockylinux-8-mofed` directory. + +[1]: https://network.nvidia.com/products/infiniband-drivers/linux/mlnx_ofed/ + +With that in place, the container may be built with Podman. + +```shell + +podman build . --volume $PWD:/mnt:ro --build-arg MOFED_TGZ=MLNX_OFED_LINUX-24.10-0.7.0.0-rhel8.10-aarch64.tgz --file Containerfile +``` diff --git a/examples/rockylinux-9-mofed/Containerfile b/examples/rockylinux-9-mofed/Containerfile index 05f9eca..af9770f 100644 --- a/examples/rockylinux-9-mofed/Containerfile +++ b/examples/rockylinux-9-mofed/Containerfile @@ -1,4 +1,6 @@ -FROM ghcr.io/warewulf/warewulf-rockylinux:9.2 +FROM ghcr.io/warewulf/warewulf-rockylinux:9.4 + +ARG MOFED_TGZ RUN dnf -y install \ gcc \ @@ -12,6 +14,7 @@ RUN dnf -y install \ python3-devel \ elfutils-libelf-devel \ gcc-gfortran \ + libnl3 \ tk \ kernel-{core,devel,headers,modules-extra} \ perl-sigtrap \ @@ -20,6 +23,6 @@ RUN dnf -y install \ && dnf -y remove $(dnf repoquery --installonly --latest-limit=-1 -q) \ && dnf clean all -RUN (cd /tmp && tar -xf /mnt/MLNX_OFED_LINUX-5.8-3.0.7.0-rhel9.2-x86_64.tgz) \ - && (cd /tmp/MLNX_OFED_LINUX-5.8-3.0.7.0-rhel9.2-x86_64 && ./mlnxofedinstall --distro rhel9.2 --skip-repo --kernel $(rpm -q kernel-core --qf '%{version}-%{release}.%{arch}\n' | tail -n 1) --add-kernel-support --hpc) \ +RUN (cd /tmp && tar -xf /mnt/$MOFED_TGZ) \ + && (cd /tmp/MLNX_OFED_LINUX* && ./mlnxofedinstall --distro rhel9.4 --skip-repo --kernel $(rpm -q kernel-core --qf '%{version}-%{release}.%{arch}\n' | tail -n 1) --add-kernel-support --hpc) \ && rm -rf /tmp/MLNX_OFED_LINUX* diff --git a/examples/rockylinux-9-mofed/README.md b/examples/rockylinux-9-mofed/README.md index 1457a3f..65e19ae 100644 --- a/examples/rockylinux-9-mofed/README.md +++ b/examples/rockylinux-9-mofed/README.md @@ -12,5 +12,5 @@ With that in place, the container may be built with Podman. ```shell -podman build . --volume $PWD:/mnt:ro --file Containerfile +podman build . --volume $PWD:/mnt:ro --build-arg MOFED_TGZ=MLNX_OFED_LINUX-24.10-0.7.0.0-rhel9.4-aarch64.tgz --file Containerfile ```