Skip to content

Commit f37df6f

Browse files
authored
Merge pull request #151 from bedroge/container_no_repos
Add option that disables all CVMFS mounts in the EESSI container
2 parents c6a57dc + 98e2c9b commit f37df6f

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/test_eessi_container_script.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- help
1818
- listrepos_default
1919
- listrepos_custom
20+
- no_cvmfs_mounts
2021
- run
2122
- shell
2223
- container
@@ -70,6 +71,14 @@ jobs:
7071
./eessi_container.sh --verbose --list-repos | tee ${outfile2}
7172
grep "EESSI/20AB.CD" ${outfile2}
7273
74+
# test use of --repository None
75+
elif [[ ${{matrix.SCRIPT_TEST}} == 'no_cvmfs_mounts' ]]; then
76+
outfile=out_nocvmfs.txt
77+
./eessi_container.sh --verbose --repository None --mode run mount | tee ${outfile}
78+
# make sure that there are no CVMFS mounts in the container, i.e. mount does not have any lines line:
79+
# cvmfs2 on /cvmfs/...
80+
! grep "^cvmfs" ${outfile}
81+
7382
# test use of --mode run
7483
elif [[ ${{matrix.SCRIPT_TEST}} == 'run' ]]; then
7584
outfile=out_run.txt

eessi_container.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ display_help() {
9898
echo " -r | --repository CFG - configuration file or identifier defining the"
9999
echo " repository to use; can be given multiple times;"
100100
echo " CFG may include suffixes ',access={ro,rw},mode={bind,fuse}' to"
101-
echo " overwrite the global access and/or mount mode for this repository"
101+
echo " overwrite the global access and/or mount mode for this repository;"
102+
echo " use 'None' to not mount any repositories"
102103
echo " [default: software.eessi.io via CVMFS config available"
103104
echo " via default container, see --container]"
104105
echo " -u | --resume DIR/TGZ - resume a previous run from a directory or tarball,"
@@ -353,6 +354,14 @@ if [[ ${#REPOSITORIES[@]} -eq 0 ]]; then
353354
REPOSITORIES+=(${eessi_default_cvmfs_repo})
354355
fi
355356

357+
# if the first element of REPOSITORIES is "none" (case-insensitive),
358+
# make sure it is an empty list from here on, i.e. no repositories will be mounted
359+
if [[ ${REPOSITORIES[0],,} == "none" ]]; then
360+
REPOSITORIES=()
361+
# also prevent the cvmfs-config repo from being mounted
362+
EESSI_DO_NOT_MOUNT_CVMFS_CONFIG_CERN_CH=1
363+
fi
364+
356365
# 1. check if argument values are valid
357366
# (arg -a|--access) check if ACCESS is supported
358367
# use the value as global setting, suffix to --repository can specify an access mode per repository

0 commit comments

Comments
 (0)