Skip to content

Commit aee306c

Browse files
authored
Merge pull request #1 from EESSI/2023.06-software.eessi.io
Pull Last merge from Upstream
2 parents 461c941 + 3ba1a39 commit aee306c

5 files changed

Lines changed: 113 additions & 24 deletions

File tree

easystacks/software.eessi.io/2023.06/a64fx/eessi-2023.06-eb-4.9.2-2023a.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,17 @@ easyconfigs:
44
- SciPy-bundle-2023.07-gfbf-2023a.eb
55
- ESPResSo-4.2.2-foss-2023a.eb
66
- ParaView-5.11.2-foss-2023a.eb
7+
- OpenFOAM-10-foss-2023a.eb:
8+
options:
9+
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/20958
10+
from-commit: dbadb2074464d816740ee0e95595c2cb31b6338f
11+
- OpenFOAM-11-foss-2023a.eb:
12+
options:
13+
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/20958
14+
from-commit: dbadb2074464d816740ee0e95595c2cb31b6338f
15+
- OpenFOAM-v2312-foss-2023a.eb:
16+
options:
17+
# https://github.com/easybuilders/easybuild-easyblocks/pull/3388
18+
include-easyblocks-from-commit: c8256a36e7062bc09f5ce30552a9de9827054c9e
19+
# https://github.com/easybuilders/easybuild-easyconfigs/pull/20841
20+
from-commit: f0e91e6e430ebf902f7788ebb47f0203dee60649

easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.2-2023b.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ easyconfigs:
1515
options:
1616
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/21034
1717
from-commit: 76e7fc6657bab64bfbec826540a3a8f0040258f2
18+
- STAR-2.7.11b-GCC-13.2.0.eb:
19+
options:
20+
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/21200
21+
from-commit: 765ba900daf5953e306c4dad896febe52fdd6c00
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
easyconfigs:
2+
- ReFrame-4.3.3.eb

eessi_container.sh

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ if [[ ${LIST_REPOS} -eq 1 ]]; then
254254
default_label=", default"
255255
else
256256
default_label=""
257-
fi
257+
fi
258258
echo " ${cvmfs_repo} [CVMFS config repo${default_label}]"
259259
done
260260
for cfg_repo in "${!cfg_cvmfs_repos[@]}"
@@ -323,7 +323,7 @@ do
323323
if [[ ! -n "${eessi_cvmfs_repos[${cvmfs_repo_name}]}" ]] ; then
324324
[[ ${VERBOSE} -eq 1 ]] && echo "repo '${cvmfs_repo_name}' is not an EESSI CVMFS repository..."
325325
# cvmfs_repo_name is actually a repository ID, use that to obtain
326-
# the actual name from the EESSI_REPOS_CFG_FILE
326+
# the actual name from the EESSI_REPOS_CFG_FILE
327327
cfg_repo_id=${cvmfs_repo_name}
328328
cvmfs_repo_name=$(cfg_get_value ${cfg_repo_id} "repo_name")
329329
fi
@@ -595,11 +595,11 @@ do
595595
# that the necessary information for accessing a CVMFS repository is made
596596
# available inside the container
597597
if [[ -n "${cfg_cvmfs_repos[${cvmfs_repo_name}]}" ]] ; then
598-
cfg_repo_id=${cvmfs_repo_name}
598+
cfg_repo_id=${cvmfs_repo_name}
599599

600-
# obtain CVMFS repository name from section for the given ID
600+
# obtain CVMFS repository name from section for the given ID
601601
cfg_repo_name=$(cfg_get_value ${cfg_repo_id} "repo_name")
602-
# derive domain part from (cfg_)repo_name (everything after first '.')
602+
# derive domain part from (cfg_)repo_name (everything after first '.')
603603
repo_name_domain=${repo_name#*.}
604604

605605
# cfg_cvmfs_repos is populated through reading the file pointed to by
@@ -609,15 +609,15 @@ do
609609
# copy repos.cfg to job directory --> makes it easier to inspect the job
610610
cp -a ${EESSI_REPOS_CFG_FILE} ${EESSI_TMPDIR}/repos_cfg/.
611611

612-
# cfg file should include sections (one per CVMFS repository to be mounted)
613-
# with each section containing the settings:
614-
# - repo_name,
615-
# - repo_version,
616-
# - config_bundle, and
617-
# - a map { filepath_in_bundle -> container_filepath }
612+
# cfg file should include sections (one per CVMFS repository to be mounted)
613+
# with each section containing the settings:
614+
# - repo_name,
615+
# - repo_version,
616+
# - config_bundle, and
617+
# - a map { filepath_in_bundle -> container_filepath }
618618
#
619-
# The config_bundle includes the files which are mapped ('->') to a target
620-
# location in container:
619+
# The config_bundle includes the files which are mapped ('->') to a target
620+
# location in container:
621621
# - default.local -> /etc/cvmfs/default.local
622622
# contains CVMFS settings, e.g., CVMFS_HTTP_PROXY, CVMFS_QUOTA_LIMIT, ...
623623
# - ${repo_name_domain}.conf -> /etc/cvmfs/domain.d/${repo_name_domain}.conf
@@ -641,7 +641,7 @@ do
641641
# use information to set up dir ${EESSI_TMPDIR}/repos_cfg and define
642642
# BIND mounts
643643
# check if config_bundle exists, if so, unpack it into
644-
# ${EESSI_TMPDIR}/repos_cfg; if it doesn't, exit with an error
644+
# ${EESSI_TMPDIR}/repos_cfg; if it doesn't, exit with an error
645645
# if config_bundle is relative path (no '/' at start) prepend it with
646646
# EESSI_REPOS_CFG_DIR
647647
config_bundle_path=
@@ -726,7 +726,7 @@ do
726726
if [[ ${cfg_cvmfs_repos[${cvmfs_repo_name}]} ]]; then
727727
[[ ${VERBOSE} -eq 1 ]] && echo "repo '${cvmfs_repo_name}' is not an EESSI CVMFS repository..."
728728
# cvmfs_repo_name is actually a repository ID, use that to obtain
729-
# the actual name from the EESSI_REPOS_CFG_FILE
729+
# the actual name from the EESSI_REPOS_CFG_FILE
730730
cfg_repo_id=${cvmfs_repo_name}
731731
cvmfs_repo_name=$(cfg_get_value ${cfg_repo_id} "repo_name")
732732
fi
@@ -736,15 +736,52 @@ do
736736

737737
# add fusemount options depending on requested access mode ('ro' - read-only; 'rw' - read & write)
738738
if [[ ${cvmfs_repo_access} == "ro" ]] ; then
739-
export EESSI_READONLY="container:cvmfs2 ${cvmfs_repo_name} /cvmfs/${cvmfs_repo_name}"
739+
# need to distinguish between basic "ro" access and "ro" after a "rw" session
740+
if [[ -d ${EESSI_TMPDIR}/${cvmfs_repo_name}/overlay-upper ]]; then
741+
# the overlay-upper directory is only created in a read-write-session, thus
742+
# we are resuming from such a session here (otherwise there shouldn't be such
743+
# directory yet as it is only created for read-write-sessions a bit further
744+
# below); the overlay-upper directory can only exist because it is part of
745+
# the ${RESUME} directory or tarball
746+
# to be able to see the contents of the read-write session we have to mount
747+
# the fuse-overlayfs (in read-only mode) on top of the CernVM-FS repository
748+
749+
echo "While processing '${cvmfs_repo_name}' to be mounted 'read-only' we detected an overlay-upper"
750+
echo " directory (${EESSI_TMPDIR}/${cvmfs_repo_name}/overlay-upper) likely from a previous"
751+
echo " session. Will use it as left-most directory in 'lowerdir' argument for fuse-overlayfs."
752+
753+
# make the target CernVM-FS repository available under /cvmfs_ro
754+
export EESSI_READONLY="container:cvmfs2 ${cvmfs_repo_name} /cvmfs_ro/${cvmfs_repo_name}"
755+
756+
EESSI_FUSE_MOUNTS+=("--fusemount" "${EESSI_READONLY}")
757+
758+
# now, put the overlay-upper read-only on top of the repo and make it available under the usual prefix /cvmfs
759+
EESSI_READONLY_OVERLAY="container:fuse-overlayfs"
760+
# The contents of the previous session are available under
761+
# ${EESSI_TMPDIR} which is bind mounted to ${TMP_IN_CONTAINER}.
762+
# Hence, we have to use ${TMP_IN_CONTAINER}/${cvmfs_repo_name}/overlay-upper
763+
# the left-most directory given for the lowerdir argument is put on top,
764+
# and with no upperdir=... the whole overlayfs is made available read-only
765+
EESSI_READONLY_OVERLAY+=" -o lowerdir=${TMP_IN_CONTAINER}/${cvmfs_repo_name}/overlay-upper:/cvmfs_ro/${cvmfs_repo_name}"
766+
EESSI_READONLY_OVERLAY+=" /cvmfs/${cvmfs_repo_name}"
767+
export EESSI_READONLY_OVERLAY
768+
769+
EESSI_FUSE_MOUNTS+=("--fusemount" "${EESSI_READONLY_OVERLAY}")
770+
export EESSI_FUSE_MOUNTS
771+
else
772+
# basic "ro" access that doesn't require any fuseoverlay-fs
773+
echo "Mounting '${cvmfs_repo_name}' 'read-only' without fuse-overlayfs."
740774

741-
EESSI_FUSE_MOUNTS+=("--fusemount" "${EESSI_READONLY}")
742-
export EESSI_FUSE_MOUNTS
775+
export EESSI_READONLY="container:cvmfs2 ${cvmfs_repo_name} /cvmfs/${cvmfs_repo_name}"
776+
777+
EESSI_FUSE_MOUNTS+=("--fusemount" "${EESSI_READONLY}")
778+
export EESSI_FUSE_MOUNTS
779+
fi
743780
elif [[ ${cvmfs_repo_access} == "rw" ]] ; then
744781
# use repo-specific overlay directories
745782
mkdir -p ${EESSI_TMPDIR}/${cvmfs_repo_name}/overlay-upper
746783
mkdir -p ${EESSI_TMPDIR}/${cvmfs_repo_name}/overlay-work
747-
[[ ${VERBOSE} -eq 1 ]] && echo -e "TMP directory contents:\n$(ls -l ${EESSI_TMPDIR})"
784+
[[ ${VERBOSE} -eq 1 ]] && echo -e "TMP directory contents:\n$(ls -l ${EESSI_TMPDIR})"
748785

749786
# set environment variables for fuse mounts in Singularity container
750787
export EESSI_READONLY="container:cvmfs2 ${cvmfs_repo_name} /cvmfs_ro/${cvmfs_repo_name}"
@@ -762,7 +799,7 @@ do
762799
export EESSI_FUSE_MOUNTS
763800
else
764801
echo -e "ERROR: access mode '${cvmfs_repo_access}' for CVMFS repository\n '${cvmfs_repo_name}' is not known"
765-
exit ${REPOSITORY_ERROR_EXITCODE}
802+
exit ${REPOSITORY_ERROR_EXITCODE}
766803
fi
767804
# create repo_settings.sh file in ${EESSI_TMPDIR}/${cvmfs_repo_name} to store
768805
# (intention is that the file could be just sourced to obtain the settings)

test_suite.sh

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,17 @@ fi
7474
TMPDIR=$(mktemp -d)
7575

7676
echo ">> Setting up environment..."
77-
module --force purge
78-
export EESSI_SOFTWARE_SUBDIR_OVERRIDE=$(python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS)
77+
# For this call to be succesful, it needs to be able to import archspec (which is part of EESSI)
78+
# Thus, we execute it in a subshell where EESSI is already initialized (a bit like a bootstrap)
79+
export EESSI_SOFTWARE_SUBDIR_OVERRIDE=$(source $TOPDIR/init/bash > /dev/null 2>&1; python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS)
80+
echo "EESSI_SOFTWARE_SUBDIR_OVERRIDE: $EESSI_SOFTWARE_SUBDIR_OVERRIDE"
7981

8082
source $TOPDIR/init/bash
8183

84+
# We have to ignore the LMOD cache, otherwise the software that is built in the build step cannot be found/loaded
85+
# Reason is that the LMOD cache is normally only updated on the Stratum 0, once everything is ingested
86+
export LMOD_IGNORE_CACHE=1
87+
8288
# Load the ReFrame module
8389
# Currently, we load the default version. Maybe we should somehow make this configurable in the future?
8490
module load ReFrame
@@ -136,40 +142,66 @@ echo "Configured reframe with the following environment variables:"
136142
env | grep "RFM_"
137143

138144
# Inject correct CPU/memory properties into the ReFrame config file
145+
echo "Collecting system-specific input for the ReFrame configuration file"
139146
cpuinfo=$(lscpu)
140147
if [[ "${cpuinfo}" =~ CPU\(s\):[^0-9]*([0-9]+) ]]; then
141148
cpu_count=${BASH_REMATCH[1]}
149+
echo "Detected CPU count: ${cpu_count}"
142150
else
143151
fatal_error "Failed to get the number of CPUs for the current test hardware with lscpu."
144152
fi
145153
if [[ "${cpuinfo}" =~ Socket\(s\):[^0-9]*([0-9]+) ]]; then
146154
socket_count=${BASH_REMATCH[1]}
155+
echo "Detected socket count: ${socket_count}"
147156
else
148157
fatal_error "Failed to get the number of sockets for the current test hardware with lscpu."
149158
fi
150159
if [[ "${cpuinfo}" =~ (Thread\(s\) per core:[^0-9]*([0-9]+)) ]]; then
151160
threads_per_core=${BASH_REMATCH[2]}
161+
echo "Detected threads per core: ${threads_per_core}"
152162
else
153163
fatal_error "Failed to get the number of threads per core for the current test hardware with lscpu."
154164
fi
155165
if [[ "${cpuinfo}" =~ (Core\(s\) per socket:[^0-9]*([0-9]+)) ]]; then
156166
cores_per_socket=${BASH_REMATCH[2]}
167+
echo "Detected cores per socket: ${cores_per_socket}"
157168
else
158169
fatal_error "Failed to get the number of cores per socket for the current test hardware with lscpu."
159170
fi
160-
cgroup_mem_bytes=$(cat /hostsys/fs/cgroup/memory/slurm/uid_${UID}/job_${SLURM_JOB_ID}/memory.limit_in_bytes)
171+
cgroup_v1_mem_limit="/sys/fs/cgroup/memory/$(</proc/self/cpuset)/memory.limit_in_bytes"
172+
cgroup_v2_mem_limit="/sys/fs/cgroup/$(</proc/self/cpuset)/memory.max"
173+
if [ -f "$cgroup_v1_mem_limit" ]; then
174+
cgroup_mem_bytes=$(cat "$cgroup_v1_mem_limit")
175+
else
176+
cgroup_mem_bytes=$(cat "$cgroup_v2_mem_limit")
177+
if [ "$cgroup_mem_bytes" = 'max' ]; then
178+
# In cgroupsv2, the memory.max file may contain 'max', meaning the group can use the full system memory
179+
# Here, we get the system memory from /proc/meminfo. Units are supposedly always in kb, but lets match them too
180+
cgroup_mem_kilobytes=$(grep -oP 'MemTotal:\s+\K\d+(?=\s+kB)' /proc/meminfo)
181+
if [[ $? -ne 0 ]] || [[ -z "$cgroup_mem_kilobytes" ]]; then
182+
fatal_error "Failed to get memory limit from /proc/meminfo"
183+
fi
184+
cgroup_mem_bytes=$(("$cgroup_mem_kilobytes"*1024))
185+
fi
186+
fi
161187
if [[ $? -eq 0 ]]; then
162188
# Convert to MiB
163-
cgroup_mem_mib=$((cgroup_mem_bytes/(1024*1024)))
189+
cgroup_mem_mib=$(("$cgroup_mem_bytes"/(1024*1024)))
164190
else
165191
fatal_error "Failed to get the memory limit in bytes from the current cgroup"
166192
fi
193+
echo "Detected available memory: ${cgroup_mem_mib} MiB"
194+
195+
echo "Replacing detected system information in template ReFrame config file..."
167196
cp ${RFM_CONFIG_FILE_TEMPLATE} ${RFM_CONFIG_FILES}
168197
sed -i "s/__NUM_CPUS__/${cpu_count}/g" $RFM_CONFIG_FILES
169198
sed -i "s/__NUM_SOCKETS__/${socket_count}/g" $RFM_CONFIG_FILES
170199
sed -i "s/__NUM_CPUS_PER_CORE__/${threads_per_core}/g" $RFM_CONFIG_FILES
171200
sed -i "s/__NUM_CPUS_PER_SOCKET__/${cores_per_socket}/g" $RFM_CONFIG_FILES
172201
sed -i "s/__MEM_PER_NODE__/${cgroup_mem_mib}/g" $RFM_CONFIG_FILES
202+
# Make debugging easier by printing the final config file:
203+
echo "Final config file (after replacements):"
204+
cat "${RFM_CONFIG_FILES}"
173205

174206
# Workaround for https://github.com/EESSI/software-layer/pull/467#issuecomment-1973341966
175207
export PSM3_DEVICES='self,shm' # this is enough, since we only run single node for now

0 commit comments

Comments
 (0)