2222import logging # pylint: disable=unused-import
2323import unittest
2424
25- from helpers import aarch64 , centos , centos8 , docker , ppc64le , ubuntu , ubuntu18 , ubuntu20 , ubuntu22 , x86_64
25+ from helpers import aarch64 , centos , centos8 , docker , ppc64le , ubuntu , ubuntu18 , ubuntu20 , ubuntu22 , ubuntu24 , x86_64
2626
2727from hpccm .building_blocks .hpcx import hpcx
2828
29- class Test_mlnx_ofed (unittest .TestCase ):
29+ class Test_hpcx (unittest .TestCase ):
3030 def setUp (self ):
3131 """Disable logging output messages"""
3232 logging .disable (logging .ERROR )
@@ -38,7 +38,30 @@ def test_defaults_ubuntu20(self):
3838 """Default hpcx building block"""
3939 h = hpcx ()
4040 self .assertEqual (str (h ),
41- r'''# Mellanox HPC-X version 2.19
41+ r'''# Mellanox HPC-X version 2.22.1
42+ RUN apt-get update -y && \
43+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
44+ bzip2 \
45+ libnuma1 \
46+ openssh-client \
47+ tar \
48+ wget && \
49+ rm -rf /var/lib/apt/lists/*
50+ RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.22.1/hpcx-v2.22.1-gcc-doca_ofed-ubuntu20.04-cuda12-x86_64.tbz && \
51+ mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu20.04-cuda12-x86_64.tbz -C /var/tmp -j && \
52+ cp -a /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu20.04-cuda12-x86_64 /usr/local/hpcx && \
53+ echo "source /usr/local/hpcx/hpcx-init-ompi.sh" >> /etc/bash.bashrc && \
54+ echo "hpcx_load" >> /etc/bash.bashrc && \
55+ rm -rf /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu20.04-cuda12-x86_64.tbz /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu20.04-cuda12-x86_64''' )
56+
57+ @x86_64
58+ @ubuntu24
59+ @docker
60+ def test_defaults_ubuntu24 (self ):
61+ """Default hpcx building block"""
62+ h = hpcx ()
63+ self .assertEqual (str (h ),
64+ r'''# Mellanox HPC-X version 2.22.1
4265RUN apt-get update -y && \
4366 DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4467 bzip2 \
@@ -47,19 +70,19 @@ def test_defaults_ubuntu20(self):
4770 tar \
4871 wget && \
4972 rm -rf /var/lib/apt/lists/*
50- RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.19 /hpcx-v2.19 -gcc-mlnx_ofed-ubuntu20 .04-cuda12-x86_64.tbz && \
51- mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed-ubuntu20 .04-cuda12-x86_64.tbz -C /var/tmp -j && \
52- cp -a /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed-ubuntu20 .04-cuda12-x86_64 /usr/local/hpcx && \
73+ RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.22.1 /hpcx-v2.22.1 -gcc-doca_ofed-ubuntu24 .04-cuda12-x86_64.tbz && \
74+ mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed-ubuntu24 .04-cuda12-x86_64.tbz -C /var/tmp -j && \
75+ cp -a /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed-ubuntu24 .04-cuda12-x86_64 /usr/local/hpcx && \
5376 echo "source /usr/local/hpcx/hpcx-init-ompi.sh" >> /etc/bash.bashrc && \
5477 echo "hpcx_load" >> /etc/bash.bashrc && \
55- rm -rf /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed-ubuntu20 .04-cuda12-x86_64.tbz /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed-ubuntu20 .04-cuda12-x86_64''' )
78+ rm -rf /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed-ubuntu24 .04-cuda12-x86_64.tbz /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed-ubuntu24 .04-cuda12-x86_64''' )
5679
5780 @x86_64
5881 @centos
5982 @docker
6083 def test_defaults_centos7 (self ):
61- """Default mlnx_ofed building block"""
62- h = hpcx ()
84+ """Default hpcx building block"""
85+ h = hpcx (version = '2.19' )
6386 self .assertEqual (str (h ),
6487r'''# Mellanox HPC-X version 2.19
6588RUN yum install -y \
@@ -80,23 +103,23 @@ def test_defaults_centos7(self):
80103 @centos8
81104 @docker
82105 def test_defaults_centos8 (self ):
83- """Default mlnx_ofed building block"""
106+ """Default hpcx building block"""
84107 h = hpcx ()
85108 self .assertEqual (str (h ),
86- r'''# Mellanox HPC-X version 2.19
109+ r'''# Mellanox HPC-X version 2.22.1
87110RUN yum install -y \
88111 bzip2 \
89112 numactl-libs \
90113 openssh-clients \
91114 tar \
92115 wget && \
93116 rm -rf /var/cache/yum/*
94- RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.19 /hpcx-v2.19 -gcc-mlnx_ofed -redhat8-cuda12-x86_64.tbz && \
95- mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed -redhat8-cuda12-x86_64.tbz -C /var/tmp -j && \
96- cp -a /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed -redhat8-cuda12-x86_64 /usr/local/hpcx && \
117+ RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.22.1 /hpcx-v2.22.1 -gcc-doca_ofed -redhat8-cuda12-x86_64.tbz && \
118+ mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed -redhat8-cuda12-x86_64.tbz -C /var/tmp -j && \
119+ cp -a /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed -redhat8-cuda12-x86_64 /usr/local/hpcx && \
97120 echo "source /usr/local/hpcx/hpcx-init-ompi.sh" >> /etc/bashrc && \
98121 echo "hpcx_load" >> /etc/bashrc && \
99- rm -rf /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed -redhat8-cuda12-x86_64.tbz /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed -redhat8-cuda12-x86_64''' )
122+ rm -rf /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed -redhat8-cuda12-x86_64.tbz /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed -redhat8-cuda12-x86_64''' )
100123
101124 @x86_64
102125 @ubuntu
@@ -291,7 +314,7 @@ def test_runtime(self):
291314 h = hpcx ()
292315 r = h .runtime ()
293316 self .assertEqual (r ,
294- r'''# Mellanox HPC-X version 2.19
317+ r'''# Mellanox HPC-X version 2.22.1
295318RUN apt-get update -y && \
296319 DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
297320 bzip2 \
@@ -300,9 +323,9 @@ def test_runtime(self):
300323 tar \
301324 wget && \
302325 rm -rf /var/lib/apt/lists/*
303- RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.19 /hpcx-v2.19 -gcc-mlnx_ofed -ubuntu22.04-cuda12-x86_64.tbz && \
304- mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed -ubuntu22.04-cuda12-x86_64.tbz -C /var/tmp -j && \
305- cp -a /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed -ubuntu22.04-cuda12-x86_64 /usr/local/hpcx && \
326+ RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.22.1 /hpcx-v2.22.1 -gcc-doca_ofed -ubuntu22.04-cuda12-x86_64.tbz && \
327+ mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed -ubuntu22.04-cuda12-x86_64.tbz -C /var/tmp -j && \
328+ cp -a /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed -ubuntu22.04-cuda12-x86_64 /usr/local/hpcx && \
306329 echo "source /usr/local/hpcx/hpcx-init-ompi.sh" >> /etc/bash.bashrc && \
307330 echo "hpcx_load" >> /etc/bash.bashrc && \
308- rm -rf /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed -ubuntu22.04-cuda12-x86_64.tbz /var/tmp/hpcx-v2.19 -gcc-mlnx_ofed -ubuntu22.04-cuda12-x86_64''' )
331+ rm -rf /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed -ubuntu22.04-cuda12-x86_64.tbz /var/tmp/hpcx-v2.22.1 -gcc-doca_ofed -ubuntu22.04-cuda12-x86_64''' )
0 commit comments