Skip to content

Commit e8837e7

Browse files
Merge pull request #3961 from easybuilders/4.5.x
release EasyBuild v4.5.3
2 parents c1740d2 + e19356d commit e8837e7

File tree

14 files changed

+221
-78
lines changed

14 files changed

+221
-78
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions
2+
name: Tests for container support
3+
on: [push, pull_request]
4+
jobs:
5+
build:
6+
# stick to Ubuntu 18.04, where we can still easily install yum via 'apt-get install'
7+
runs-on: ubuntu-18.04
8+
strategy:
9+
matrix:
10+
python: [2.7, 3.6]
11+
fail-fast: false
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{matrix.python}}
19+
architecture: x64
20+
21+
- name: install OS & Python packages
22+
run: |
23+
# for building Singularity images
24+
sudo apt-get install rpm
25+
sudo apt-get install yum
26+
# for modules tool
27+
sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
28+
# fix for lua-posix packaging issue, see https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082
29+
# needed for Ubuntu 18.04, but not for Ubuntu 20.04, so skipping symlinking if posix.so already exists
30+
if [ ! -e /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so ] ; then
31+
sudo ln -s /usr/lib/x86_64-linux-gnu/lua/5.2/posix_c.so /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so
32+
fi
33+
34+
- name: install Lmod
35+
run: |
36+
# avoid downloading modules tool sources into easybuild-framework dir
37+
cd $HOME
38+
export INSTALL_DEP=$GITHUB_WORKSPACE/easybuild/scripts/install_eb_dep.sh
39+
# install Lmod
40+
source $INSTALL_DEP Lmod-8.4.27 $HOME
41+
# changes in environment are not passed to other steps, so need to create files...
42+
echo $MOD_INIT > mod_init
43+
echo $PATH > path
44+
if [ ! -z $MODULESHOME ]; then echo $MODULESHOME > moduleshome; fi
45+
46+
# see https://github.com/apptainer/singularity/issues/5390#issuecomment-899111181
47+
- name: install Singularity
48+
run: |
49+
# install alien, which can be used to convert RPMs to Debian packages
50+
sudo apt-get install alien
51+
alien --version
52+
# determine latest version of Singularity available in EPEL, and download RPM
53+
singularity_rpm=$(curl -sL https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/s/ | grep singularity | sed 's/.*singularity/singularity/g' | sed 's/rpm.*/rpm/g')
54+
curl -OL https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/s/${singularity_rpm}
55+
# convert Singularity RPM to Debian package, and install it
56+
sudo alien -d ${singularity_rpm}
57+
sudo apt install ./singularity*.deb
58+
singularity --version
59+
60+
- name: install sources
61+
run: |
62+
# install from source distribution tarball, to test release as published on PyPI
63+
python setup.py sdist
64+
ls dist
65+
export PREFIX=/tmp/$USER/$GITHUB_SHA
66+
pip install --prefix $PREFIX dist/easybuild-framework*tar.gz
67+
pip install --prefix $PREFIX https://github.com/easybuilders/easybuild-easyblocks/archive/develop.tar.gz
68+
69+
- name: run test
70+
run: |
71+
# run tests *outside* of checked out easybuild-framework directory,
72+
# to ensure we're testing installed version (see previous step)
73+
cd $HOME
74+
# initialize environment for modules tool
75+
if [ -f $HOME/moduleshome ]; then export MODULESHOME=$(cat $HOME/moduleshome); fi
76+
source $(cat $HOME/mod_init); type module
77+
# make sure 'eb' is available via $PATH, and that $PYTHONPATH is set (some tests expect that);
78+
# also pick up changes to $PATH set by sourcing $MOD_INIT
79+
export PREFIX=/tmp/$USER/$GITHUB_SHA
80+
export PATH=$PREFIX/bin:$(cat $HOME/path)
81+
export PYTHONPATH=$PREFIX/lib/python${{matrix.python}}/site-packages:$PYTHONPATH
82+
eb --version
83+
# create $HOME/.rpmmacros, see also https://github.com/apptainer/singularity/issues/241
84+
echo '%_var /var' > $HOME/.rpmmacros
85+
echo '%_dbpath %{_var}/lib/rpm' >> $HOME/.rpmmacros
86+
# build CentOS 7 container image for bzip2 1.0.8 using EasyBuild;
87+
# see https://docs.easybuild.io/en/latest/Containers.html
88+
curl -OL https://raw.githubusercontent.com/easybuilders/easybuild-easyconfigs/develop/easybuild/easyconfigs/b/bzip2/bzip2-1.0.8.eb
89+
export EASYBUILD_CONTAINERPATH=$PWD
90+
export EASYBUILD_CONTAINER_CONFIG='bootstrap=yum,osversion=7'
91+
eb bzip2-1.0.8.eb --containerize --experimental --container-build-image
92+
singularity exec bzip2-1.0.8.sif command -v bzip2 | grep '/app/software/bzip2/1.0.8/bin/bzip2' || (echo "Path to bzip2 '$which_bzip2' is not correct" && exit 1)
93+
singularity exec bzip2-1.0.8.sif bzip2 --help

.github/workflows/linting.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
- uses: actions/checkout@v2
88

99
- name: set up Python
10-
uses: actions/setup-python@v1
10+
uses: actions/setup-python@v2
1111
with:
1212
python-version: 3.8
1313

RELEASE_NOTES

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ For more detailed information, please see the git log.
44
These release notes can also be consulted at https://easybuild.readthedocs.io/en/latest/Release_notes.html.
55

66

7+
v4.5.3 (February 11th 2022)
8+
---------------------------
9+
10+
update/bugfix release
11+
12+
- various enhancements, including:
13+
- also check for git in --check-eb-deps (#3954)
14+
- add end2end test for 'eb --containerize' (#3958)
15+
- various bug fixes, including:
16+
- take into account that patch files can also be zipped when checking filename extension for patches (#3936)
17+
- initialize BACKUP_PKG_URL with empty string in install_eb_dep.sh script (#3939)
18+
- fix get_os_name and get_os_version to avoid reporting UNKNOWN in output of eb --show-system-info (#3942)
19+
- consistently use actions/setup-python@v2 in CI workflows (#3944)
20+
- switch to using pip3 for installing EasyBuild in container recipes generated by EasyBuild (#3945)
21+
- specify easybuild.io as EasyBuild homepage in setup.py (#3947)
22+
- avoid crash in get_os_version on modern SLES-based OSs (#3955)
23+
- other changes:
24+
- indicate compatibility with Python 3.10 in setup.py (#3940)
25+
26+
727
v4.5.2 (January 24th 2022)
828
--------------------------
929

easybuild/scripts/install_eb_dep.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ PKG_VERSION="${PKG##*-}"
1616
CONFIG_OPTIONS=
1717
PRECONFIG_CMD=
1818

19+
BACKUP_PKG_URL=
20+
1921
if [ "$PKG_NAME" == 'modules' ]; then
2022
PKG_URL="http://prdownloads.sourceforge.net/modules/${PKG}.tar.gz"
2123
BACKUP_PKG_URL="https://sources.easybuild.io/e/EnvironmentModules/${PKG}.tar.gz"

easybuild/tools/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
JOB_DEPS_TYPE_ABORT_ON_ERROR = 'abort_on_error'
135135
JOB_DEPS_TYPE_ALWAYS_RUN = 'always_run'
136136

137-
DOCKER_BASE_IMAGE_UBUNTU = 'ubuntu:16.04'
137+
DOCKER_BASE_IMAGE_UBUNTU = 'ubuntu:20.04'
138138
DOCKER_BASE_IMAGE_CENTOS = 'centos:7'
139139

140140
LOCAL_VAR_NAMING_CHECK_ERROR = 'error'

easybuild/tools/containers/docker.py

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from easybuild.tools.containers.base import ContainerGenerator
3636
from easybuild.tools.containers.utils import det_os_deps
3737
from easybuild.tools.filetools import remove_dir
38+
from easybuild.tools.module_naming_scheme.easybuild_mns import EasyBuildMNS
3839
from easybuild.tools.run import run_cmd
3940

4041

@@ -44,9 +45,9 @@
4445
"""
4546

4647
DOCKER_INSTALL_EASYBUILD = """\
47-
RUN pip install -U pip setuptools && \\
48-
hash -r pip && \\
49-
pip install -U easybuild
48+
RUN pip3 install -U pip setuptools && \\
49+
hash -r pip3&& \\
50+
pip3 install -U easybuild
5051
5152
RUN mkdir /app && \\
5253
mkdir /scratch && \\
@@ -61,37 +62,43 @@
6162
6263
RUN set -x && \\
6364
. /usr/share/lmod/lmod/init/sh && \\
64-
eb %(eb_opts)s --installpath=/app/ --prefix=/scratch --tmpdir=/scratch/tmp
65+
eb --robot %(eb_opts)s --installpath=/app/ --prefix=/scratch --tmpdir=/scratch/tmp
6566
66-
RUN touch ${HOME}/.profile && \\
67-
echo '\\n# Added by easybuild docker packaging' >> ${HOME}/.profile && \\
68-
echo 'source /usr/share/lmod/lmod/init/bash' >> ${HOME}/.profile && \\
69-
echo 'module use %(init_modulepath)s' >> ${HOME}/.profile && \\
70-
echo 'module load %(mod_names)s' >> ${HOME}/.profile
67+
RUN touch ${HOME}/.bashrc && \\
68+
echo '' >> ${HOME}/.bashrc && \\
69+
echo '# Added by easybuild docker packaging' >> ${HOME}/.bashrc && \\
70+
echo 'source /usr/share/lmod/lmod/init/bash' >> ${HOME}/.bashrc && \\
71+
echo 'module use %(init_modulepath)s' >> ${HOME}/.bashrc && \\
72+
echo 'module load %(mod_names)s' >> ${HOME}/.bashrc
7173
7274
CMD ["/bin/bash", "-l"]
7375
"""
7476

75-
DOCKER_UBUNTU1604_INSTALL_DEPS = """\
77+
DOCKER_UBUNTU2004_INSTALL_DEPS = """\
7678
RUN apt-get update && \\
77-
apt-get install -y python python-pip lmod curl wget
79+
DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip lmod \\
80+
curl wget git bzip2 gzip tar zip unzip xz-utils \\
81+
patch automake git debianutils \\
82+
g++ libdata-dump-perl libthread-queue-any-perl libssl-dev
7883
7984
RUN OS_DEPS='%(os_deps)s' && \\
80-
test -n "${OS_DEPS}" && \\
8185
for dep in ${OS_DEPS}; do apt-get -qq install ${dep} || true; done
8286
"""
8387

8488
DOCKER_CENTOS7_INSTALL_DEPS = """\
8589
RUN yum install -y epel-release && \\
86-
yum install -y python python-pip Lmod curl wget git
90+
yum install -y python3 python3-pip Lmod curl wget git \\
91+
bzip2 gzip tar zip unzip xz \\
92+
patch make git which \\
93+
gcc-c++ perl-Data-Dumper perl-Thread-Queue openssl-dev
8794
8895
RUN OS_DEPS='%(os_deps)s' && \\
8996
test -n "${OS_DEPS}" && \\
9097
yum --skip-broken install -y "${OS_DEPS}" || true
9198
"""
9299

93100
DOCKER_OS_INSTALL_DEPS_TMPLS = {
94-
DOCKER_BASE_IMAGE_UBUNTU: DOCKER_UBUNTU1604_INSTALL_DEPS,
101+
DOCKER_BASE_IMAGE_UBUNTU: DOCKER_UBUNTU2004_INSTALL_DEPS,
95102
DOCKER_BASE_IMAGE_CENTOS: DOCKER_CENTOS7_INSTALL_DEPS,
96103
}
97104

@@ -125,9 +132,12 @@ def resolve_template_data(self):
125132

126133
ec = self.easyconfigs[-1]['ec']
127134

128-
init_modulepath = os.path.join("/app/modules/all", *self.mns.det_init_modulepaths(ec))
135+
# We are using the default MNS inside the container
136+
docker_mns = EasyBuildMNS()
137+
138+
init_modulepath = os.path.join("/app/modules/all", *docker_mns.det_init_modulepaths(ec))
129139

130-
mod_names = [e['ec'].full_mod_name for e in self.easyconfigs]
140+
mod_names = [docker_mns.det_full_module_name(e['ec']) for e in self.easyconfigs]
131141

132142
eb_opts = [os.path.basename(e['spec']) for e in self.easyconfigs]
133143

easybuild/tools/containers/singularity.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ def resolve_template_data(self):
272272
# EPEL is required for installing Lmod & python-pip
273273
'epel-release',
274274
# EasyBuild requirements
275-
'python setuptools Lmod',
276-
# pip is used to install EasyBuild packages
277-
'python-pip',
275+
'python3 setuptools Lmod',
276+
# pip3 is used to install EasyBuild packages
277+
'python3-pip',
278278
# useful utilities
279279
'bzip2 gzip tar zip unzip xz', # extracting sources
280280
'curl wget', # downloading
@@ -308,13 +308,13 @@ def resolve_template_data(self):
308308
template_data['install_os_deps'] = '\n'.join(install_os_deps)
309309

310310
# install (latest) EasyBuild in container image
311-
# use 'pip install', unless custom commands are specified via 'install_eb' keyword
311+
# use 'pip3 install', unless custom commands are specified via 'install_eb' keyword
312312
if 'install_eb' not in template_data:
313313
template_data['install_eb'] = '\n'.join([
314-
"# install EasyBuild using pip",
314+
"# install EasyBuild using pip3",
315315
# upgrade pip
316-
"pip install -U pip",
317-
"pip install easybuild",
316+
"pip3 install -U pip",
317+
"pip3 install easybuild",
318318
])
319319

320320
# if no custom value is specified for 'post_commands' keyword,

easybuild/tools/filetools.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@
163163
'.sh': "cp -a %(filepath)s .",
164164
}
165165

166+
ZIPPED_PATCH_EXTS = ('.bz2', '.gz', '.xz')
167+
166168
# global set of names of locks that were created in this session
167169
global_lock_names = set()
168170

@@ -1493,8 +1495,11 @@ def create_patch_info(patch_spec):
14931495
str(patch_spec))
14941496

14951497
elif isinstance(patch_spec, string_type):
1496-
if not patch_spec.endswith('.patch'):
1497-
_log.deprecated("Use of patch file with filename that doesn't end with .patch: %s" % patch_spec, '5.0')
1498+
allowed_patch_exts = ['.patch' + x for x in ('',) + ZIPPED_PATCH_EXTS]
1499+
if not any(patch_spec.endswith(x) for x in allowed_patch_exts):
1500+
msg = "Use of patch file with filename that doesn't end with correct extension: %s " % patch_spec
1501+
msg += "(should be any of: %s)" % (', '.join(allowed_patch_exts))
1502+
_log.deprecated(msg, '5.0')
14981503
patch_info = {'name': patch_spec}
14991504
else:
15001505
error_msg = "Wrong patch spec, should be string of 2-tuple with patch name + argument: %s"
@@ -1548,7 +1553,7 @@ def apply_patch(patch_file, dest, fn=None, copy=False, level=None, use_git_am=Fa
15481553
# split in stem (filename w/o extension) + extension
15491554
patch_stem, patch_extension = os.path.splitext(os.path.split(abs_patch_file)[1])
15501555
# Supports only bz2, gz and xz. zip can be archives which are not supported.
1551-
if patch_extension in ['.gz', '.bz2', '.xz']:
1556+
if patch_extension in ZIPPED_PATCH_EXTS:
15521557
# split again to get the second extension
15531558
patch_subextension = os.path.splitext(patch_stem)[1]
15541559
if patch_subextension == ".patch":

easybuild/tools/systemtools.py

Lines changed: 25 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
'7z': "extracting sources (.iso)",
169169
'bunzip2': "decompressing sources (.bz2, .tbz, .tbz2, ...)",
170170
DPKG: "checking OS dependencies (Debian, Ubuntu, ...)",
171+
'git': "downloading sources using 'git clone'",
171172
'gunzip': "decompressing source files (.gz, .tgz, ...)",
172173
'make': "build tool",
173174
'patch': "applying patch files",
@@ -697,9 +698,6 @@ def get_os_name():
697698
res = name_regex.search(os_release_txt)
698699
if res:
699700
os_name = res.group('name')
700-
else:
701-
# no easy way to determine name of Linux distribution
702-
os_name = None
703701

704702
os_name_map = {
705703
'red hat enterprise linux server': 'RHEL',
@@ -742,44 +740,33 @@ def get_os_version():
742740
res = version_regex.search(os_release_txt)
743741
if res:
744742
os_version = res.group('version')
745-
else:
746-
os_version = None
747743

748744
if os_version:
749-
if get_os_name() in ["suse", "SLES"]:
750-
751-
# SLES subversions can only be told apart based on kernel version,
752-
# see http://wiki.novell.com/index.php/Kernel_versions
753-
version_suffixes = {
754-
'11': [
755-
('2.6.27', ''),
756-
('2.6.32', '_SP1'),
757-
('3.0.101-63', '_SP4'),
758-
# not 100% correct, since early SP3 had 3.0.76 - 3.0.93, but close enough?
759-
('3.0.101', '_SP3'),
760-
# SP2 kernel versions range from 3.0.13 - 3.0.101
761-
('3.0', '_SP2'),
762-
],
763-
764-
'12': [
765-
('3.12.28', ''),
766-
('3.12.49', '_SP1'),
767-
],
768-
}
769-
745+
# older SLES subversions can only be told apart based on kernel version,
746+
# see http://wiki.novell.com/index.php/Kernel_versions
747+
sles_version_suffixes = {
748+
'11': [
749+
('2.6.27', ''),
750+
('2.6.32', '_SP1'),
751+
('3.0.101-63', '_SP4'),
752+
# not 100% correct, since early SP3 had 3.0.76 - 3.0.93, but close enough?
753+
('3.0.101', '_SP3'),
754+
# SP2 kernel versions range from 3.0.13 - 3.0.101
755+
('3.0', '_SP2'),
756+
],
757+
758+
'12': [
759+
('3.12.28', ''),
760+
('3.12.49', '_SP1'),
761+
],
762+
}
763+
if get_os_name() in ['suse', 'SLES'] and os_version in sles_version_suffixes:
770764
# append suitable suffix to system version
771-
if os_version in version_suffixes.keys():
772-
kernel_version = platform.uname()[2]
773-
known_sp = False
774-
for (kver, suff) in version_suffixes[os_version]:
775-
if kernel_version.startswith(kver):
776-
os_version += suff
777-
known_sp = True
778-
break
779-
if not known_sp:
780-
suff = '_UNKNOWN_SP'
781-
else:
782-
raise EasyBuildError("Don't know how to determine subversions for SLES %s", os_version)
765+
kernel_version = platform.uname()[2]
766+
for (kver, suff) in sles_version_suffixes[os_version]:
767+
if kernel_version.startswith(kver):
768+
os_version += suff
769+
break
783770

784771
return os_version
785772
else:

easybuild/tools/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# recent setuptools versions will *TRANSFORM* something like 'X.Y.Zdev' into 'X.Y.Z.dev0', with a warning like
4444
# UserWarning: Normalizing '2.4.0dev' to '2.4.0.dev0'
4545
# This causes problems further up the dependency chain...
46-
VERSION = LooseVersion('4.5.2')
46+
VERSION = LooseVersion('4.5.3')
4747
UNKNOWN = 'UNKNOWN'
4848

4949

0 commit comments

Comments
 (0)