Skip to content

Commit

Permalink
get rid of old cvmfs2 premount setup
Browse files Browse the repository at this point in the history
  • Loading branch information
poquirion committed May 21, 2021
1 parent 5012833 commit 43c75f2
Show file tree
Hide file tree
Showing 37 changed files with 21 additions and 96 deletions.
87 changes: 21 additions & 66 deletions singularity/wrapper_genpipes/bin/container_wrapper.sh
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 removed singularity/wrapper_genpipes/bin/cvmfs2
Binary file not shown.
10 changes: 0 additions & 10 deletions singularity/wrapper_genpipes/etc/genconfig.conf

This file was deleted.

9 changes: 0 additions & 9 deletions singularity/wrapper_genpipes/etc/keys/gen/ref.mugqic.pub

This file was deleted.

9 changes: 0 additions & 9 deletions singularity/wrapper_genpipes/etc/keys/gen/soft.mugqic.pub

This file was deleted.

2 changes: 0 additions & 2 deletions singularity/wrapper_genpipes/etc/wrapper.conf
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 removed singularity/wrapper_genpipes/lib64/libc.so.6
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libcom_err.so.2
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libcom_err.so.2.1
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libcrypto.so.10
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libcvmfs_fuse.so
Binary file not shown.
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libdl.so.2
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libfuse.so.2
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libgcc_s.so.1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libk5crypto.so.3
Binary file not shown.
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libkeyutils.so.1
Binary file not shown.
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libkrb5.so.3
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libkrb5.so.3.3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libm.so.6
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libpthread.so.0
Binary file not shown.
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libresolv.so.2
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/librt.so.1
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libselinux.so.1
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libssl.so.10
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libstdc++.so.6
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libuuid.so.1
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libz.so.1
Binary file not shown.
Binary file removed singularity/wrapper_genpipes/lib64/libz.so.1.2.3
Binary file not shown.

0 comments on commit 43c75f2

Please sign in to comment.