Skip to content

Commit

Permalink
Update Inbox OFED building block for latest distros (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
samcmill committed Sep 19, 2024
1 parent e712954 commit 405efdb
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/building_blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -3335,7 +3335,7 @@ they are not available. For Ubuntu 16.04 and ppc64le processors,
the `libibcm1` and `libibcm-dev` packages are not installed
because they are not available.

For Ubuntu 18.04, the following packages are installed:
For Ubuntu 18.04 and later, the following packages are installed:
`dapl2-utils`, `ibutils`, `ibverbs-providers`, `ibverbs-utils`,
`infiniband-diags`, `libdapl2`, `libdapl-dev`, `libibmad5`,
`libibmad-dev`, `libibverbs1`, `libibverbs-dev`, `librdmacm1`,
Expand All @@ -3347,7 +3347,7 @@ installed: `dapl`, `dapl-devel`, `ibutils`, `libibcm`, `libibmad`,
`libibverbs-utils`, `librdmacm`, `rdma-core`, and
`rdma-core-devel`.

For RHEL-based 8.x distributions, the following packages are
For RHEL-based 8.x distributions and later, the following packages are
installed: `libibmad`, `libibmad-devel`, `libmlx5`, `libibumad`,
`libibverbs`, `libibverbs-utils`, `librdmacm`, `rdma-core`, and
`rdma-core-devel`.
Expand Down
11 changes: 7 additions & 4 deletions hpccm/building_blocks/ofed.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ofed(bb_base):
the `libibcm1` and `libibcm-dev` packages are not installed
because they are not available.
For Ubuntu 18.04, the following packages are installed:
For Ubuntu 18.04 and later, the following packages are installed:
`dapl2-utils`, `ibutils`, `ibverbs-providers`, `ibverbs-utils`,
`infiniband-diags`, `libdapl2`, `libdapl-dev`, `libibmad5`,
`libibmad-dev`, `libibverbs1`, `libibverbs-dev`, `librdmacm1`,
Expand All @@ -60,7 +60,7 @@ class ofed(bb_base):
`libibverbs-utils`, `librdmacm`, `rdma-core`, and
`rdma-core-devel`.
For RHEL-based 8.x distributions, the following packages are
For RHEL-based 8.x distributions and later, the following packages are
installed: `libibmad`, `libibmad-devel`, `libmlx5`, `libibumad`,
`libibverbs`, `libibverbs-utils`, `librdmacm`, `rdma-core`, and
`rdma-core-devel`.
Expand Down Expand Up @@ -113,7 +113,9 @@ def __distro(self):
if hpccm.config.g_linux_version >= Version('18.0'):
# Give priority to packages from the Ubuntu repositories over
# vendor repositories
if hpccm.config.g_linux_version >= Version('22.0'):
if hpccm.config.g_linux_version >= Version('24.0'):
self.__extra_opts = ['-t noble']
elif hpccm.config.g_linux_version >= Version('22.0'):
self.__extra_opts = ['-t jammy']
elif hpccm.config.g_linux_version >= Version('20.0'):
self.__extra_opts = ['-t focal']
Expand Down Expand Up @@ -165,7 +167,8 @@ def __distro(self):
'libibverbs-utils', 'libmlx5',
'librdmacm',
'rdma-core', 'rdma-core-devel']
self.__powertools = True
if hpccm.config.g_linux_version < Version('9.0'):
self.__powertools = True
else:
self.__deppackages = ['libnl', 'libnl3', 'numactl-libs']
self.__ospackages = ['dapl', 'dapl-devel', 'ibutils',
Expand Down
9 changes: 9 additions & 0 deletions test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ def wrapper(*args, **kwargs):

return wrapper

def rockylinux9(function):
"""Decorator to set the Linux distribution to Rockylinux 9"""
def wrapper(*args, **kwargs):
hpccm.config.g_linux_distro = linux_distro.CENTOS
hpccm.config.g_linux_version = Version('9.0')
return function(*args, **kwargs)

return wrapper

def singularity(function):
"""Decorator to set the global container type to singularity"""
def wrapper(*args, **kwargs):
Expand Down
74 changes: 73 additions & 1 deletion test/test_ofed.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import logging # pylint: disable=unused-import
import unittest

from helpers import aarch64, centos, centos8, docker, ubuntu, ubuntu18, ubuntu20, ppc64le, x86_64
from helpers import aarch64, centos, centos8, docker, rockylinux9, ubuntu, ubuntu18, ubuntu20, ubuntu22, ubuntu24, ppc64le, x86_64

from hpccm.building_blocks.ofed import ofed

Expand Down Expand Up @@ -114,6 +114,58 @@ def test_defaults_ubuntu20(self):
rdmacm-utils && \
rm -rf /var/lib/apt/lists/*''')

@x86_64
@ubuntu22
@docker
def test_defaults_ubuntu22(self):
"""Default ofed building block"""
o = ofed()
self.assertEqual(str(o),
r'''# OFED
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -t jammy \
dapl2-utils \
ibutils \
ibverbs-providers \
ibverbs-utils \
infiniband-diags \
libdapl-dev \
libdapl2 \
libibmad-dev \
libibmad5 \
libibverbs-dev \
libibverbs1 \
librdmacm-dev \
librdmacm1 \
rdmacm-utils && \
rm -rf /var/lib/apt/lists/*''')

@x86_64
@ubuntu24
@docker
def test_defaults_ubuntu24(self):
"""Default ofed building block"""
o = ofed()
self.assertEqual(str(o),
r'''# OFED
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -t noble \
dapl2-utils \
ibutils \
ibverbs-providers \
ibverbs-utils \
infiniband-diags \
libdapl-dev \
libdapl2 \
libibmad-dev \
libibmad5 \
libibverbs-dev \
libibverbs1 \
librdmacm-dev \
librdmacm1 \
rdmacm-utils && \
rm -rf /var/lib/apt/lists/*''')

@x86_64
@centos
@docker
Expand Down Expand Up @@ -160,6 +212,26 @@ def test_defaults_centos8(self):
rdma-core-devel && \
rm -rf /var/cache/yum/*''')

@x86_64
@rockylinux9
@docker
def test_defaults_rockylinux9(self):
"""Default ofed building block"""
o = ofed()
self.assertEqual(str(o),
r'''# OFED
RUN yum install -y --disablerepo=mlnx\* \
libibmad \
libibmad-devel \
libibumad \
libibverbs \
libibverbs-utils \
libmlx5 \
librdmacm \
rdma-core \
rdma-core-devel && \
rm -rf /var/cache/yum/*''')

@x86_64
@ubuntu
@docker
Expand Down

0 comments on commit 405efdb

Please sign in to comment.