Skip to content

Commit 53ae53c

Browse files
authored
Base support for Ubuntu 26.04 (#539)
Base support for Ubuntu 26.04
1 parent 37f7b95 commit 53ae53c

8 files changed

Lines changed: 67 additions & 16 deletions

File tree

docs/misc_api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ __Arguments__
9191

9292
- __distro (string)__: Valid values are `centos7`, `centos8`, `rhel7`,
9393
`rhel8`, `rockylinux8`, `rockylinux9`, `rockylinux10`, `ubuntu16`,
94-
`ubuntu18`, `ubuntu20`, `ubuntu22`, and `ubuntu24`. `ubuntu` is an
95-
alias for `ubuntu16`, `centos` is an alias for `centos7`, and `rhel`
96-
is an alias for `rhel7`.
94+
`ubuntu18`, `ubuntu20`, `ubuntu22`, `ubuntu24`, and `ubuntu26`.
95+
`ubuntu` is an alias for `ubuntu16`, `centos` is an alias for `centos7`,
96+
and `rhel` is an alias for `rhel7`.
9797

9898

9999
## set_singularity_version

docs/primitives.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ is `docker` (Singularity specific).
2323
- ___distro__: The underlying Linux distribution of the base image.
2424
Valid values are `centos`, `centos7`, `centos8`, `redhat`, `rhel`,
2525
`rhel7`, `rhel8`, `rockylinux8`, `rockylinux9`, `rockylinux10`,
26-
`ubuntu`, `ubuntu16`, `ubuntu18`, `ubuntu20`, `ubuntu22`, and `ubuntu24`.
27-
By default, the primitive attempts to figure out the Linux distribution
28-
by inspecting the image identifier, and falls back to `ubuntu` if unable
29-
to determine the Linux distribution automatically.
26+
`ubuntu`, `ubuntu16`, `ubuntu18`, `ubuntu20`, `ubuntu22`, `ubuntu24`,
27+
and `ubuntu26`. By default, the primitive attempts to figure out the
28+
Linux distribution by inspecting the image identifier, and falls back
29+
to `ubuntu` if unable to determine the Linux distribution automatically.
3030

3131
- ___docker_env__: Boolean specifying whether to load the Docker base
3232
image environment, i.e., source

hpccm/building_blocks/ofed.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ def __distro(self):
113113
if hpccm.config.g_linux_version >= Version('18.0'):
114114
# Give priority to packages from the Ubuntu repositories over
115115
# vendor repositories
116-
if hpccm.config.g_linux_version >= Version('24.0'):
116+
if hpccm.config.g_linux_version >= Version('26.0'):
117+
self.__extra_opts = ['-t resolute']
118+
elif hpccm.config.g_linux_version >= Version('24.0'):
117119
self.__extra_opts = ['-t noble']
118120
elif hpccm.config.g_linux_version >= Version('22.0'):
119121
self.__extra_opts = ['-t jammy']

hpccm/config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ def set_linux_distro(distro):
176176
177177
distro (string): Valid values are `centos7`, `centos8`, `rhel7`,
178178
`rhel8`, `rockylinux8`, `rockylinux9`, `rockylinux10`, `ubuntu16`,
179-
`ubuntu18`, `ubuntu20`, `ubuntu22`, and `ubuntu24`. `ubuntu` is an
180-
alias for `ubuntu16`, `centos` is an alias for `centos7`, and `rhel`
181-
is an alias for `rhel7`.
179+
`ubuntu18`, `ubuntu20`, `ubuntu22`, `ubuntu24`, and `ubuntu26`.
180+
`ubuntu` is an alias for `ubuntu16`, `centos` is an alias for `centos7`,
181+
and `rhel` is an alias for `rhel7`.
182182
183183
"""
184184
this = sys.modules[__name__]
@@ -227,6 +227,9 @@ def set_linux_distro(distro):
227227
elif distro == 'ubuntu24':
228228
this.g_linux_distro = linux_distro.UBUNTU
229229
this.g_linux_version = Version('24.04')
230+
elif distro == 'ubuntu26':
231+
this.g_linux_distro = linux_distro.UBUNTU
232+
this.g_linux_version = Version('26.04')
230233
else:
231234
logging.warning('Unable to determine the Linux distribution, defaulting to Ubuntu')
232235
this.g_linux_distro = linux_distro.UBUNTU

hpccm/primitives/baseimage.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ class baseimage(object):
5151
_distro: The underlying Linux distribution of the base image.
5252
Valid values are `centos`, `centos7`, `centos8`, `redhat`, `rhel`,
5353
`rhel7`, `rhel8`, `rockylinux8`, `rockylinux9`, `rockylinux10`,
54-
`ubuntu`, `ubuntu16`, `ubuntu18`, `ubuntu20`, `ubuntu22`, and `ubuntu24`.
55-
By default, the primitive attempts to figure out the Linux distribution
56-
by inspecting the image identifier, and falls back to `ubuntu` if unable
57-
to determine the Linux distribution automatically.
54+
`ubuntu`, `ubuntu16`, `ubuntu18`, `ubuntu20`, `ubuntu22`, `ubuntu24`,
55+
and `ubuntu26`. By default, the primitive attempts to figure out the
56+
Linux distribution by inspecting the image identifier, and falls back
57+
to `ubuntu` if unable to determine the Linux distribution automatically.
5858
5959
_docker_env: Boolean specifying whether to load the Docker base
6060
image environment, i.e., source
@@ -123,6 +123,8 @@ def __init__(self, **kwargs):
123123
hpccm.config.set_linux_distro('ubuntu22')
124124
elif self.__distro == 'ubuntu24':
125125
hpccm.config.set_linux_distro('ubuntu24')
126+
elif self.__distro == 'ubuntu26':
127+
hpccm.config.set_linux_distro('ubuntu26')
126128
elif self.__distro == 'centos':
127129
hpccm.config.set_linux_distro('centos')
128130
elif self.__distro == 'centos7':
@@ -167,6 +169,8 @@ def __init__(self, **kwargs):
167169
hpccm.config.set_linux_distro('ubuntu22')
168170
elif re.search(r'ubuntu:?24', self.image):
169171
hpccm.config.set_linux_distro('ubuntu24')
172+
elif re.search(r'ubuntu:?26', self.image):
173+
hpccm.config.set_linux_distro('ubuntu26')
170174
elif re.search(r'ubuntu', self.image):
171175
hpccm.config.set_linux_distro('ubuntu')
172176
else:

test/helpers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,15 @@ def wrapper(*args, **kwargs):
230230

231231
return wrapper
232232

233+
def ubuntu26(function):
234+
"""Decorator to set the Linux distribution to Ubuntu 26.04"""
235+
def wrapper(*args, **kwargs):
236+
hpccm.config.g_linux_distro = linux_distro.UBUNTU
237+
hpccm.config.g_linux_version = Version('26.04')
238+
return function(*args, **kwargs)
239+
240+
return wrapper
241+
233242
def x86_64(function):
234243
"""Decorator to set the CPU architecture to x86_64"""
235244
def wrapper(*args, **kwargs):

test/test_baseimage.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ def test_distro_ubuntu24(self):
316316
self.assertEqual(hpccm.config.g_linux_distro, linux_distro.UBUNTU)
317317
self.assertEqual(hpccm.config.g_linux_version, Version('24.04'))
318318

319+
@docker
320+
def test_distro_ubuntu26(self):
321+
"""Base image Linux distribution specification"""
322+
b = baseimage(image='foo', _distro='ubuntu26')
323+
self.assertEqual(hpccm.config.g_linux_distro, linux_distro.UBUNTU)
324+
self.assertEqual(hpccm.config.g_linux_version, Version('26.04'))
325+
319326
@docker
320327
def test_distro_centos(self):
321328
"""Base image Linux distribution specification"""

test/test_ofed.py

Lines changed: 27 additions & 1 deletion
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, centos, centos8, docker, rockylinux9, ubuntu, ubuntu18, ubuntu20, ubuntu22, ubuntu24, ppc64le, x86_64
25+
from helpers import aarch64, centos, centos8, docker, rockylinux9, ubuntu, ubuntu18, ubuntu20, ubuntu22, ubuntu24, ubuntu26, ppc64le, x86_64
2626

2727
from hpccm.building_blocks.ofed import ofed
2828

@@ -166,6 +166,32 @@ def test_defaults_ubuntu24(self):
166166
rdmacm-utils && \
167167
rm -rf /var/lib/apt/lists/*''')
168168

169+
@x86_64
170+
@ubuntu26
171+
@docker
172+
def test_defaults_ubuntu26(self):
173+
"""Default ofed building block"""
174+
o = ofed()
175+
self.assertEqual(str(o),
176+
r'''# OFED
177+
RUN apt-get update -y && \
178+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -t resolute \
179+
dapl2-utils \
180+
ibutils \
181+
ibverbs-providers \
182+
ibverbs-utils \
183+
infiniband-diags \
184+
libdapl-dev \
185+
libdapl2 \
186+
libibmad-dev \
187+
libibmad5 \
188+
libibverbs-dev \
189+
libibverbs1 \
190+
librdmacm-dev \
191+
librdmacm1 \
192+
rdmacm-utils && \
193+
rm -rf /var/lib/apt/lists/*''')
194+
169195
@x86_64
170196
@centos
171197
@docker

0 commit comments

Comments
 (0)