-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get rid of old cvmfs2 premount setup
- Loading branch information
Showing
37 changed files
with
21 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,29 @@ | ||
#!/bin/bash | ||
|
||
|
||
# Do not modify this file modify ${SCRIPTPATH}/etc/wrapper.conf instead! | ||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" | ||
SCRIPTPATH=${SCRIPTPATH%%bin} | ||
SCRIPTPATH=${SCRIPTPATH%%/} | ||
GEN_SHARED_CVMFS=/tmp/cvmfs-cache | ||
|
||
source ${SCRIPTPATH}/etc/wrapper.conf | ||
TMPDIR=${TMPDIR:-/tmp} | ||
|
||
export GEN_LOCAL_CVMFS=$(mktemp -d $TMPDIR/cvmfs_XXXXX) | ||
|
||
GEN_REF=${GEN_LOCAL_CVMFS}/mnt/ref.mugqic | ||
GEN_SOFT=${GEN_LOCAL_CVMFS}/mnt/soft.mugqic | ||
|
||
mkdir -p ${GEN_SOFT} | ||
mkdir -p ${GEN_REF} | ||
|
||
chmod 777 ${GEN_SOFT} ${GEN_REF} | ||
|
||
cleaup () { | ||
# echo unmounting ${GEN_LOCAL_CVMFS}/mnt | ||
|
||
try=0 | ||
while true ; do | ||
fusermount -u ${GEN_REF} 2>/dev/null | ||
ret=$? | ||
if [[ ${ret} -eq 0 || ${try} -ge ${UMOUNT_RETRY} ]]; then | ||
break | ||
fi | ||
try=$(($try+1)) | ||
sleep 1 | ||
done | ||
|
||
while true ; do | ||
fusermount -u ${GEN_SOFT} 2>/dev/null | ||
ret=$? | ||
if [[ ${ret} -eq 0 || ${try} -ge ${UMOUNT_RETRY} ]]; then | ||
break | ||
fi | ||
try=$(($try+1)) | ||
sleep 1 | ||
done | ||
|
||
rm -r ${GEN_LOCAL_CVMFS} 2>/dev/null | ||
} | ||
|
||
#trap cleaup EXIT | ||
|
||
export CVMFS_KEYS_DIR=${SCRIPTPATH}/etc/keys/gen | ||
export CVMFS_ALIEN_CACHE=${GEN_SHARED_CVMFS}/alien_cache/soft.mugqic | ||
mkdir -p $CVMFS_ALIEN_CACHE | ||
chmod 777 $CVMFS_ALIEN_CACHE | ||
chmod 777 ${GEN_SHARED_CVMFS}/alien_cache | ||
cvmfs2 -o config=${SCRIPTPATH}/etc/genconfig.conf -o libfuse=3 soft.mugqic \ | ||
${GEN_SOFT} | ||
|
||
export CVMFS_ALIEN_CACHE=${GEN_SHARED_CVMFS}/alien_cache/ref.mugqic | ||
mkdir -p $CVMFS_ALIEN_CACHE | ||
chmod 777 $CVMFS_ALIEN_CACHE | ||
cvmfs2 -o config=${SCRIPTPATH}/etc/genconfig.conf -o libfuse=3 ref.mugqic \ | ||
${GEN_REF} | ||
|
||
|
||
#if [ -z ${BIND_LIST+x} ]; then | ||
# singularity run --cleanenv -B ${GEN_LOCAL_CVMFS}/mnt:/cvmfs \ | ||
# ${SCRIPTPATH}/images/genpipes.sif \ | ||
# "$@" | ||
#else | ||
# singularity run --cleanenv -B ${GEN_LOCAL_CVMFS}/mnt:/cvmfs -B "$BIND_LIST" \ | ||
# ${SCRIPTPATH}/images/genpipes.sif \ | ||
# "$@" | ||
|
||
#fi | ||
mkdir -p ${GEN_SHARED_CVMFS} | ||
|
||
|
||
if [ -z ${BIND_LIST+x} ]; then | ||
singularity run --cleanenv -S /var/run/cvmfs -B ${GEN_SHARED_CVMFS}:/cvmfs-cache \ | ||
--fusemount \ | ||
"container:cvmfs2 cvmfs-config.computecanada.ca /cvmfs/cvmfs-config.computecanada.ca" \ | ||
--fusemount "container:cvmfs2 soft.mugqic /cvmfs/soft.mugqic" \ | ||
--fusemount "container:cvmfs2 ref.mugqic /cvmfs/ref.mugqic" \ | ||
${SCRIPTPATH}/images/genpipes.sif "$@" | ||
else | ||
singularity run --cleanenv -S /var/run/cvmfs -B ${GEN_SHARED_CVMFS}:/cvmfs-cache \ | ||
-B "$BIND_LIST" \ | ||
--fusemount \ | ||
"container:cvmfs2 cvmfs-config.computecanada.ca /cvmfs/cvmfs-config.computecanada.ca" \ | ||
--fusemount "container:cvmfs2 soft.mugqic /cvmfs/soft.mugqic" \ | ||
--fusemount "container:cvmfs2 ref.mugqic /cvmfs/ref.mugqic" \ | ||
${SCRIPTPATH}/images/genpipes.sif "$@" | ||
fi |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# GEN_SHARED_CVMFS should have a sufficient amount of space to load full reference files | ||
export GEN_SHARED_CVMFS=$HOME/cvmfs | ||
TMPDIR=/tmp | ||
export UMOUNT_RETRY=5 | ||
BIND_LIST= |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.