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

fix running command as 'easybuild' user in generated Singularity definition file #3347

Merged
merged 2 commits into from
May 25, 2020
Merged
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
9 changes: 5 additions & 4 deletions easybuild/tools/containers/singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@
}
EOF

# change to 'easybuild' user
su - easybuild
# switch to 'easybuild' user for following commands
# quotes around EOF delimiter are important to ensure environment variables are not expanded prematurely!
su - easybuild << 'EOF'

# verbose commands, exit on first error
set -ve
Expand All @@ -122,8 +123,8 @@
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
# end of set of commands to run as 'easybuild' user
EOF

# cleanup, everything in /scratch is assumed to be temporary
rm -rf /scratch/*
Expand Down