Skip to content

Commit 3a4c2c2

Browse files
authored
Bump default DOCA OFED version to 3.2.0 and add support for Rockylinux 10 (#531)
1 parent 0fe4deb commit 3a4c2c2

3 files changed

Lines changed: 58 additions & 27 deletions

File tree

docs/building_blocks.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -655,14 +655,13 @@ processors and `arm64-sbsa` for aarch64 processors.
655655
- __oslabel__: The Linux distribution label assigned by Mellanox to the
656656
package repository. For Ubuntu, the default value is
657657
`ubuntuXX.04` where `XX` is derived from the base image. For
658-
RHEL-base Linux distributions, the default value is `rhelX.Y`
659-
where `X.Y` is `9.2` for RHEL 9.x and `8.6` for RHEL 8.x.
658+
RHEL-base Linux distributions, the default value is `rhelX`.
660659

661660
- __ospackages__: List of OS packages to install prior to installing
662661
DOCA OFED. The default values are `ca-certificates`, `gnupg`, and
663662
`wget`.
664663

665-
- __packages__: List of packages to install from Mellanox OFED. For
664+
- __packages__: List of packages to install from DOCA. For
666665
Ubuntu, the default values are `ibverbs-providers`,
667666
`ibverbs-utils` `libibmad-dev`, `libibmad5`, `libibumad3`,
668667
`libibumad-dev`, `libibverbs-dev` `libibverbs1`, `librdmacm-dev`,
@@ -671,13 +670,13 @@ values are `libibumad`, `libibverbs`, `libibverbs-utils`,
671670
`librdmacm`, `rdma-core`, and `rdma-core-devel`.
672671

673672
- __version__: The version of DOCA OFED to download. The default value
674-
is `2.10.0`.
673+
is `3.2.0`.
675674

676675
__Examples__
677676

678677

679678
```python
680-
doca_ofed(version='2.10.0')
679+
doca_ofed(version='3.2.0')
681680
```
682681

683682

hpccm/building_blocks/doca_ofed.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,13 @@ class doca_ofed(bb_base, hpccm.templates.annotate, hpccm.templates.rm,
4949
oslabel: The Linux distribution label assigned by Mellanox to the
5050
package repository. For Ubuntu, the default value is
5151
`ubuntuXX.04` where `XX` is derived from the base image. For
52-
RHEL-base Linux distributions, the default value is `rhelX.Y`
53-
where `X.Y` is `9.2` for RHEL 9.x and `8.6` for RHEL 8.x.
52+
RHEL-base Linux distributions, the default value is `rhelX`.
5453
5554
ospackages: List of OS packages to install prior to installing
5655
DOCA OFED. The default values are `ca-certificates`, `gnupg`, and
5756
`wget`.
5857
59-
packages: List of packages to install from Mellanox OFED. For
58+
packages: List of packages to install from DOCA. For
6059
Ubuntu, the default values are `ibverbs-providers`,
6160
`ibverbs-utils` `libibmad-dev`, `libibmad5`, `libibumad3`,
6261
`libibumad-dev`, `libibverbs-dev` `libibverbs1`, `librdmacm-dev`,
@@ -65,12 +64,12 @@ class doca_ofed(bb_base, hpccm.templates.annotate, hpccm.templates.rm,
6564
`librdmacm`, `rdma-core`, and `rdma-core-devel`.
6665
6766
version: The version of DOCA OFED to download. The default value
68-
is `2.10.0`.
67+
is `3.2.0`.
6968
7069
# Examples
7170
7271
```python
73-
doca_ofed(version='2.10.0')
72+
doca_ofed(version='3.2.0')
7473
```
7574
7675
"""
@@ -81,12 +80,13 @@ def __init__(self, **kwargs):
8180
super(doca_ofed, self).__init__(**kwargs)
8281

8382
self.__archlabel = kwargs.get('archlabel', '') # Filled in by __cpu_arch
83+
self.__extra_opts = []
8484
self.__key = 'https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub'
8585
self.__oslabel = kwargs.get('oslabel', '') # Filled in by __distro
8686
self.__ospackages = kwargs.get('ospackages',
8787
['ca-certificates', 'gnupg', 'wget'])
8888
self.__packages = kwargs.get('packages', []) # Filled in by __distro
89-
self.__version = kwargs.get('version', '2.10.0')
89+
self.__version = kwargs.get('version', '3.2.0')
9090

9191
# Add annotation
9292
self.add_annotation('version', self.__version)
@@ -109,9 +109,10 @@ def __instructions(self):
109109

110110
self += packages(
111111
apt_keys=[self.__key],
112-
apt_repositories=['deb [signed-by=/usr/share/keyrings/{3}] https://linux.mellanox.com/public/repo/doca/{0}/{1}/{2}/ ./'.format(self.__version, self.__oslabel, self.__archlabel, posixpath.basename(self.__key).replace('.pub', '.gpg'))],
112+
apt_repositories=['deb [signed-by=/usr/share/keyrings/{3}] https://linux.mellanox.com/public/repo/doca/{0}/{1}/{2}/ ./'.format(self.__version, self.__oslabel, self.__archlabel, posixpath.basename(self.__key).replace('.pub', '.gpg')) if self.__key else None],
113+
extra_opts=self.__extra_opts,
113114
ospackages=self.__packages,
114-
yum_keys=[self.__key],
115+
yum_keys=[self.__key] if self.__key else None,
115116
yum_repositories=['https://linux.mellanox.com/public/repo/doca/{0}/{1}/{2}'.format(self.__version, self.__oslabel, self.__archlabel)])
116117

117118
self += label(metadata=self.annotate_step())
@@ -150,10 +151,17 @@ def __distro(self):
150151

151152
elif hpccm.config.g_linux_distro == linux_distro.CENTOS:
152153
if not self.__oslabel:
153-
if hpccm.config.g_linux_version >= Version('9.0'):
154-
self.__oslabel = 'rhel9.2'
154+
if hpccm.config.g_linux_version >= Version('10.0'):
155+
self.__oslabel = 'rhel10'
156+
# The DOCA OFED GPG key is rejected by the Rockylinux 10
157+
# security policy as insecure. Do not check the
158+
# package signatures.
159+
self.__key = None
160+
self.__extra_opts = ['--nogpgcheck']
161+
elif hpccm.config.g_linux_version >= Version('9.0'):
162+
self.__oslabel = 'rhel9'
155163
else:
156-
self.__oslabel = 'rhel8.6'
164+
self.__oslabel = 'rhel8'
157165

158166
if not self.__packages:
159167
self.__packages = ['libibverbs', 'libibverbs-utils',

test/test_doca_ofed.py

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import logging # pylint: disable=unused-import
2323
import unittest
2424

25-
from helpers import aarch64, centos8, docker, rockylinux9, ubuntu20, ubuntu22, ubuntu24, x86_64
25+
from helpers import aarch64, centos8, docker, rockylinux9, rockylinux10, ubuntu20, ubuntu22, ubuntu24, x86_64
2626

2727
from hpccm.building_blocks.doca_ofed import doca_ofed
2828

@@ -38,7 +38,7 @@ def test_defaults_ubuntu20(self):
3838
"""Default doca_ofed building block"""
3939
doca = doca_ofed()
4040
self.assertMultiLineEqual(str(doca),
41-
r'''# DOCA OFED version 2.10.0
41+
r'''# DOCA OFED version 3.2.0
4242
RUN apt-get update -y && \
4343
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4444
ca-certificates \
@@ -48,7 +48,7 @@ def test_defaults_ubuntu20(self):
4848
RUN mkdir -p /usr/share/keyrings && \
4949
rm -f /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
5050
wget -qO - https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub | gpg --dearmor -o /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
51-
echo "deb [signed-by=/usr/share/keyrings/GPG-KEY-Mellanox.gpg] https://linux.mellanox.com/public/repo/doca/2.10.0/ubuntu20.04/x86_64/ ./" >> /etc/apt/sources.list.d/hpccm.list && \
51+
echo "deb [signed-by=/usr/share/keyrings/GPG-KEY-Mellanox.gpg] https://linux.mellanox.com/public/repo/doca/3.2.0/ubuntu20.04/x86_64/ ./" >> /etc/apt/sources.list.d/hpccm.list && \
5252
apt-get update -y && \
5353
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
5454
ibverbs-providers \
@@ -70,7 +70,7 @@ def test_defaults_ubuntu22(self):
7070
"""Default doca_ofed building block"""
7171
doca = doca_ofed()
7272
self.assertMultiLineEqual(str(doca),
73-
r'''# DOCA OFED version 2.10.0
73+
r'''# DOCA OFED version 3.2.0
7474
RUN apt-get update -y && \
7575
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7676
ca-certificates \
@@ -80,7 +80,7 @@ def test_defaults_ubuntu22(self):
8080
RUN mkdir -p /usr/share/keyrings && \
8181
rm -f /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
8282
wget -qO - https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub | gpg --dearmor -o /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
83-
echo "deb [signed-by=/usr/share/keyrings/GPG-KEY-Mellanox.gpg] https://linux.mellanox.com/public/repo/doca/2.10.0/ubuntu22.04/arm64-sbsa/ ./" >> /etc/apt/sources.list.d/hpccm.list && \
83+
echo "deb [signed-by=/usr/share/keyrings/GPG-KEY-Mellanox.gpg] https://linux.mellanox.com/public/repo/doca/3.2.0/ubuntu22.04/arm64-sbsa/ ./" >> /etc/apt/sources.list.d/hpccm.list && \
8484
apt-get update -y && \
8585
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
8686
ibverbs-providers \
@@ -102,7 +102,7 @@ def test_defaults_ubuntu24(self):
102102
"""Default doca_ofed building block"""
103103
doca = doca_ofed()
104104
self.assertMultiLineEqual(str(doca),
105-
r'''# DOCA OFED version 2.10.0
105+
r'''# DOCA OFED version 3.2.0
106106
RUN apt-get update -y && \
107107
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
108108
ca-certificates \
@@ -112,7 +112,7 @@ def test_defaults_ubuntu24(self):
112112
RUN mkdir -p /usr/share/keyrings && \
113113
rm -f /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
114114
wget -qO - https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub | gpg --dearmor -o /usr/share/keyrings/GPG-KEY-Mellanox.gpg && \
115-
echo "deb [signed-by=/usr/share/keyrings/GPG-KEY-Mellanox.gpg] https://linux.mellanox.com/public/repo/doca/2.10.0/ubuntu24.04/x86_64/ ./" >> /etc/apt/sources.list.d/hpccm.list && \
115+
echo "deb [signed-by=/usr/share/keyrings/GPG-KEY-Mellanox.gpg] https://linux.mellanox.com/public/repo/doca/3.2.0/ubuntu24.04/x86_64/ ./" >> /etc/apt/sources.list.d/hpccm.list && \
116116
apt-get update -y && \
117117
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
118118
ibverbs-providers \
@@ -134,15 +134,15 @@ def test_defaults_rockylinux9(self):
134134
"""Default doca_ofed building block"""
135135
doca = doca_ofed()
136136
self.assertMultiLineEqual(str(doca),
137-
r'''# DOCA OFED version 2.10.0
137+
r'''# DOCA OFED version 3.2.0
138138
RUN yum install -y \
139139
ca-certificates \
140140
gnupg \
141141
wget && \
142142
rm -rf /var/cache/yum/*
143143
RUN rpm --import https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub && \
144144
yum install -y dnf-utils && \
145-
yum-config-manager --add-repo https://linux.mellanox.com/public/repo/doca/2.10.0/rhel9.2/x86_64 && \
145+
yum-config-manager --add-repo https://linux.mellanox.com/public/repo/doca/3.2.0/rhel9/x86_64 && \
146146
yum install -y \
147147
libibumad \
148148
libibverbs \
@@ -152,22 +152,46 @@ def test_defaults_rockylinux9(self):
152152
rdma-core-devel && \
153153
rm -rf /var/cache/yum/*''')
154154

155+
@x86_64
156+
@rockylinux10
157+
@docker
158+
def test_defaults_rockylinux10(self):
159+
"""Default doca_ofed building block"""
160+
doca = doca_ofed()
161+
self.assertMultiLineEqual(str(doca),
162+
r'''# DOCA OFED version 3.2.0
163+
RUN yum install -y \
164+
ca-certificates \
165+
gnupg \
166+
wget && \
167+
rm -rf /var/cache/yum/*
168+
RUN yum install -y dnf-utils && \
169+
yum-config-manager --add-repo https://linux.mellanox.com/public/repo/doca/3.2.0/rhel10/x86_64 && \
170+
yum install -y --nogpgcheck \
171+
libibumad \
172+
libibverbs \
173+
libibverbs-utils \
174+
librdmacm \
175+
rdma-core \
176+
rdma-core-devel && \
177+
rm -rf /var/cache/yum/*''')
178+
155179
@x86_64
156180
@centos8
157181
@docker
158182
def test_defaults_rockylinux8(self):
159183
"""Default doca_ofed building block"""
160184
doca = doca_ofed()
161185
self.assertMultiLineEqual(str(doca),
162-
r'''# DOCA OFED version 2.10.0
186+
r'''# DOCA OFED version 3.2.0
163187
RUN yum install -y \
164188
ca-certificates \
165189
gnupg \
166190
wget && \
167191
rm -rf /var/cache/yum/*
168192
RUN rpm --import https://linux.mellanox.com/public/repo/doca/GPG-KEY-Mellanox.pub && \
169193
yum install -y dnf-utils && \
170-
yum-config-manager --add-repo https://linux.mellanox.com/public/repo/doca/2.10.0/rhel8.6/x86_64 && \
194+
yum-config-manager --add-repo https://linux.mellanox.com/public/repo/doca/3.2.0/rhel8/x86_64 && \
171195
yum install -y \
172196
libibumad \
173197
libibverbs \

0 commit comments

Comments
 (0)