Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure Lmod w.r.t. spider cache in generated Singularity container recipes + also install OS pkgs for OpenSSL & IB libs #2910

Merged
merged 4 commits into from
Jun 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions easybuild/tools/containers/singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,29 @@

%(post_commands)s

# install Lmod RC file
cat > /etc/lmodrc.lua << EOF
scDescriptT = {
{
["dir"] = "/app/lmodcache",
["timestamp"] = "/app/lmodcache/timestamp",
},
}
EOF

# change to 'easybuild' user
su - easybuild

# verbose commands
set -v

# use EasyBuild to install specified software
eb %(easyconfigs)s --robot --installpath=/app/ --prefix=/scratch --tmpdir=/scratch/tmp

# update Lmod cache
mkdir -p /app/lmodcache
$LMOD_DIR/update_lmod_system_cache_files -d /app/lmodcache -t /app/lmodcache/timestamp /app/modules/all

# exit from 'easybuild' user
exit

Expand All @@ -98,8 +116,17 @@
eval "$@"

%%environment
# make sure that 'module' and 'ml' commands are defined
source /etc/profile
# increase threshold time for Lmod to write cache in $HOME (which we don't want to do)
export LMOD_SHORT_TIME=86400
# purge any modules that may be loaded outside container
module --force purge
# avoid picking up modules from outside of container
module unuse $MODULEPATH
boegel marked this conversation as resolved.
Show resolved Hide resolved
# pick up modules installed in /app
module use /app/modules/all
# load module(s) corresponding to installed software
module load %(mod_names)s

%%labels
Expand Down Expand Up @@ -235,6 +262,8 @@ def resolve_template_data(self):
'python-pip',
# additional packages that EasyBuild relies on (for now)
'gcc-c++', # C/C++ components of GCC (gcc, g++)
('libibverbs-dev', 'libibverbs-devel', 'rdma-core-devel'), # for OpenMPI
('openssl-devel', 'libssl-dev', 'libopenssl-devel'), # for CMake, Python, ...
'perl-Data-Dumper', # required for GCC build
# required for Automake build, see https://github.com/easybuilders/easybuild-easyconfigs/issues/1822
'perl-Thread-Queue',
Expand Down