Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/misc_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ __Arguments__

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


## set_singularity_version
Expand Down
8 changes: 4 additions & 4 deletions docs/primitives.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ is `docker` (Singularity specific).
- ___distro__: The underlying Linux distribution of the base image.
Valid values are `centos`, `centos7`, `centos8`, `redhat`, `rhel`,
`rhel7`, `rhel8`, `rockylinux8`, `rockylinux9`, `rockylinux10`,
`ubuntu`, `ubuntu16`, `ubuntu18`, `ubuntu20`, `ubuntu22`, and `ubuntu24`.
By default, the primitive attempts to figure out the Linux distribution
by inspecting the image identifier, and falls back to `ubuntu` if unable
to determine the Linux distribution automatically.
`ubuntu`, `ubuntu16`, `ubuntu18`, `ubuntu20`, `ubuntu22`, `ubuntu24`,
and `ubuntu26`. By default, the primitive attempts to figure out the
Linux distribution by inspecting the image identifier, and falls back
to `ubuntu` if unable to determine the Linux distribution automatically.

- ___docker_env__: Boolean specifying whether to load the Docker base
image environment, i.e., source
Expand Down
4 changes: 3 additions & 1 deletion hpccm/building_blocks/ofed.py
Original file line number Diff line number Diff line change
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('24.0'):
if hpccm.config.g_linux_version >= Version('26.0'):
self.__extra_opts = ['-t resolute']
elif 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']
Expand Down
9 changes: 6 additions & 3 deletions hpccm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ def set_linux_distro(distro):

distro (string): Valid values are `centos7`, `centos8`, `rhel7`,
`rhel8`, `rockylinux8`, `rockylinux9`, `rockylinux10`, `ubuntu16`,
`ubuntu18`, `ubuntu20`, `ubuntu22`, and `ubuntu24`. `ubuntu` is an
alias for `ubuntu16`, `centos` is an alias for `centos7`, and `rhel`
is an alias for `rhel7`.
`ubuntu18`, `ubuntu20`, `ubuntu22`, `ubuntu24`, and `ubuntu26`.
`ubuntu` is an alias for `ubuntu16`, `centos` is an alias for `centos7`,
and `rhel` is an alias for `rhel7`.

"""
this = sys.modules[__name__]
Expand Down Expand Up @@ -227,6 +227,9 @@ def set_linux_distro(distro):
elif distro == 'ubuntu24':
this.g_linux_distro = linux_distro.UBUNTU
this.g_linux_version = Version('24.04')
elif distro == 'ubuntu26':
this.g_linux_distro = linux_distro.UBUNTU
this.g_linux_version = Version('26.04')
else:
logging.warning('Unable to determine the Linux distribution, defaulting to Ubuntu')
this.g_linux_distro = linux_distro.UBUNTU
Expand Down
12 changes: 8 additions & 4 deletions hpccm/primitives/baseimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ class baseimage(object):
_distro: The underlying Linux distribution of the base image.
Valid values are `centos`, `centos7`, `centos8`, `redhat`, `rhel`,
`rhel7`, `rhel8`, `rockylinux8`, `rockylinux9`, `rockylinux10`,
`ubuntu`, `ubuntu16`, `ubuntu18`, `ubuntu20`, `ubuntu22`, and `ubuntu24`.
By default, the primitive attempts to figure out the Linux distribution
by inspecting the image identifier, and falls back to `ubuntu` if unable
to determine the Linux distribution automatically.
`ubuntu`, `ubuntu16`, `ubuntu18`, `ubuntu20`, `ubuntu22`, `ubuntu24`,
and `ubuntu26`. By default, the primitive attempts to figure out the
Linux distribution by inspecting the image identifier, and falls back
to `ubuntu` if unable to determine the Linux distribution automatically.

_docker_env: Boolean specifying whether to load the Docker base
image environment, i.e., source
Expand Down Expand Up @@ -123,6 +123,8 @@ def __init__(self, **kwargs):
hpccm.config.set_linux_distro('ubuntu22')
elif self.__distro == 'ubuntu24':
hpccm.config.set_linux_distro('ubuntu24')
elif self.__distro == 'ubuntu26':
hpccm.config.set_linux_distro('ubuntu26')
elif self.__distro == 'centos':
hpccm.config.set_linux_distro('centos')
elif self.__distro == 'centos7':
Expand Down Expand Up @@ -167,6 +169,8 @@ def __init__(self, **kwargs):
hpccm.config.set_linux_distro('ubuntu22')
elif re.search(r'ubuntu:?24', self.image):
hpccm.config.set_linux_distro('ubuntu24')
elif re.search(r'ubuntu:?26', self.image):
hpccm.config.set_linux_distro('ubuntu26')
elif re.search(r'ubuntu', self.image):
hpccm.config.set_linux_distro('ubuntu')
else:
Expand Down
9 changes: 9 additions & 0 deletions test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ def wrapper(*args, **kwargs):

return wrapper

def ubuntu26(function):
"""Decorator to set the Linux distribution to Ubuntu 26.04"""
def wrapper(*args, **kwargs):
hpccm.config.g_linux_distro = linux_distro.UBUNTU
hpccm.config.g_linux_version = Version('26.04')
return function(*args, **kwargs)

return wrapper

def x86_64(function):
"""Decorator to set the CPU architecture to x86_64"""
def wrapper(*args, **kwargs):
Expand Down
7 changes: 7 additions & 0 deletions test/test_baseimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,13 @@ def test_distro_ubuntu24(self):
self.assertEqual(hpccm.config.g_linux_distro, linux_distro.UBUNTU)
self.assertEqual(hpccm.config.g_linux_version, Version('24.04'))

@docker
def test_distro_ubuntu26(self):
"""Base image Linux distribution specification"""
b = baseimage(image='foo', _distro='ubuntu26')
self.assertEqual(hpccm.config.g_linux_distro, linux_distro.UBUNTU)
self.assertEqual(hpccm.config.g_linux_version, Version('26.04'))

@docker
def test_distro_centos(self):
"""Base image Linux distribution specification"""
Expand Down
28 changes: 27 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, rockylinux9, ubuntu, ubuntu18, ubuntu20, ubuntu22, ubuntu24, ppc64le, x86_64
from helpers import aarch64, centos, centos8, docker, rockylinux9, ubuntu, ubuntu18, ubuntu20, ubuntu22, ubuntu24, ubuntu26, ppc64le, x86_64

from hpccm.building_blocks.ofed import ofed

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

@x86_64
@ubuntu26
@docker
def test_defaults_ubuntu26(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 resolute \
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
Loading