Skip to content

Commit 631180c

Browse files
authored
Bump default Conda version to 25.1.1-2 and add Arm support (#517)
1 parent a1a3cca commit 631180c

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

docs/building_blocks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,10 @@ Anaconda should be installed. The default is False.
598598

599599
- __python_subversion__: The Python version to install. This value is
600600
ignored if the Conda version is less than 4.8. The default is
601-
`py310` if using Python 3, and `py27` if using Python 2.
601+
`py312` if using Python 3, and `py27` if using Python 2.
602602

603603
- __version__: The version of Anaconda to download. The default value
604-
is `23.1.0-1` if using Python 3, and `4.8.3` if using Python 2.
604+
is `25.1.1-2` if using Python 3, and `4.8.3` if using Python 2.
605605

606606
__Examples__
607607

hpccm/building_blocks/conda.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ class conda(bb_base, hpccm.templates.rm, hpccm.templates.wget):
6666
6767
python_subversion: The Python version to install. This value is
6868
ignored if the Conda version is less than 4.8. The default is
69-
`py310` if using Python 3, and `py27` if using Python 2.
69+
`py312` if using Python 3, and `py27` if using Python 2.
7070
7171
version: The version of Anaconda to download. The default value
72-
is `23.1.0-1` if using Python 3, and `4.8.3` if using Python 2.
72+
is `25.1.1-2` if using Python 3, and `4.8.3` if using Python 2.
7373
7474
# Examples
7575
@@ -109,8 +109,8 @@ def __init__(self, **kwargs):
109109
self.__python2 = kwargs.get('python2', False)
110110
self.__python_version = '2' if self.__python2 else '3'
111111
self.__python_subversion = kwargs.get(
112-
'python_subversion', 'py27' if self.__python2 else 'py310')
113-
self.__version = kwargs.get('version', '4.8.3' if self.__python2 else '23.1.0-1')
112+
'python_subversion', 'py27' if self.__python2 else 'py312')
113+
self.__version = kwargs.get('version', '4.8.3' if self.__python2 else '25.1.1-2')
114114

115115
self.__commands = [] # Filled in by __setup()
116116
self.__wd = kwargs.get('wd', hpccm.config.g_wd) # working directory
@@ -141,7 +141,9 @@ def __cpu_arch(self):
141141
"""Based on the CPU architecture, set values accordingly. A user
142142
specified value overrides any defaults."""
143143

144-
if hpccm.config.g_cpu_arch == cpu_arch.PPC64LE:
144+
if hpccm.config.g_cpu_arch == cpu_arch.AARCH64:
145+
self.__arch_pkg = 'aarch64'
146+
elif hpccm.config.g_cpu_arch == cpu_arch.PPC64LE:
145147
self.__arch_pkg = 'ppc64le'
146148
elif hpccm.config.g_cpu_arch == cpu_arch.X86_64:
147149
self.__arch_pkg = 'x86_64'

test/test_conda.py

Lines changed: 29 additions & 7 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 centos, docker, ppc64le, ubuntu, x86_64
25+
from helpers import aarch64, centos, docker, ppc64le, ubuntu, x86_64
2626

2727
from hpccm.building_blocks.conda import conda
2828

@@ -44,15 +44,15 @@ def test_defaults_ubuntu(self):
4444
ca-certificates \
4545
wget && \
4646
rm -rf /var/lib/apt/lists/*
47-
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://repo.anaconda.com/miniconda/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh && \
48-
bash /var/tmp/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh -b -p /usr/local/anaconda && \
47+
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://repo.anaconda.com/miniconda/Miniconda3-py312_25.1.1-2-Linux-x86_64.sh && \
48+
bash /var/tmp/Miniconda3-py312_25.1.1-2-Linux-x86_64.sh -b -p /usr/local/anaconda && \
4949
/usr/local/anaconda/bin/conda init && \
5050
ln -s /usr/local/anaconda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
5151
. /usr/local/anaconda/etc/profile.d/conda.sh && \
5252
conda activate base && \
5353
conda install -y numpy && \
5454
/usr/local/anaconda/bin/conda clean -afy && \
55-
rm -rf /var/tmp/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh''')
55+
rm -rf /var/tmp/Miniconda3-py312_25.1.1-2-Linux-x86_64.sh''')
5656

5757
@x86_64
5858
@centos
@@ -66,15 +66,37 @@ def test_defaults_centos(self):
6666
ca-certificates \
6767
wget && \
6868
rm -rf /var/cache/yum/*
69-
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://repo.anaconda.com/miniconda/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh && \
70-
bash /var/tmp/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh -b -p /usr/local/anaconda && \
69+
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://repo.anaconda.com/miniconda/Miniconda3-py312_25.1.1-2-Linux-x86_64.sh && \
70+
bash /var/tmp/Miniconda3-py312_25.1.1-2-Linux-x86_64.sh -b -p /usr/local/anaconda && \
7171
/usr/local/anaconda/bin/conda init && \
7272
ln -s /usr/local/anaconda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
7373
. /usr/local/anaconda/etc/profile.d/conda.sh && \
7474
conda activate base && \
7575
conda install -y numpy && \
7676
/usr/local/anaconda/bin/conda clean -afy && \
77-
rm -rf /var/tmp/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh''')
77+
rm -rf /var/tmp/Miniconda3-py312_25.1.1-2-Linux-x86_64.sh''')
78+
79+
@aarch64
80+
@centos
81+
@docker
82+
def test_aarch64(self):
83+
"""Default conda building block"""
84+
c = conda(eula=True, packages=['numpy'], version='25.1.1-2')
85+
self.assertEqual(str(c),
86+
r'''# Anaconda
87+
RUN yum install -y \
88+
ca-certificates \
89+
wget && \
90+
rm -rf /var/cache/yum/*
91+
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp http://repo.anaconda.com/miniconda/Miniconda3-py312_25.1.1-2-Linux-aarch64.sh && \
92+
bash /var/tmp/Miniconda3-py312_25.1.1-2-Linux-aarch64.sh -b -p /usr/local/anaconda && \
93+
/usr/local/anaconda/bin/conda init && \
94+
ln -s /usr/local/anaconda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
95+
. /usr/local/anaconda/etc/profile.d/conda.sh && \
96+
conda activate base && \
97+
conda install -y numpy && \
98+
/usr/local/anaconda/bin/conda clean -afy && \
99+
rm -rf /var/tmp/Miniconda3-py312_25.1.1-2-Linux-aarch64.sh''')
78100

79101
@ppc64le
80102
@ubuntu

0 commit comments

Comments
 (0)