Skip to content
Snippets Groups Projects
Commit a256a1a4 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Merge branch 'update_install' into 'master'

update install.sh for JLAB

See merge request !54
parents 4c8e1ed0 c1f2c1e9
Branches
Tags
1 merge request!54update install.sh for JLAB
#!/bin/bash
CONTAINER=jug_xl
VERSION=3.0.1
CONTAINER="jug_xl"
VERSION="3.0-stable"
## Simple setup script that installs the container
## in your local environment under $PWD/local/lib
......@@ -10,24 +10,58 @@ VERSION=3.0.1
## with the $ATHENA_PREFIX variable pointing
## to the $PWD/local directory
## get the python installer and run the old-style install
#cp ../../current/eic_container/install.py .
wget https://eicweb.phy.anl.gov/containers/eic_container/-/raw/master/install.py
chmod +x install.py
./install.py -c $CONTAINER -v $VERSION $PWD/local
## ensure the container is executable
chmod +x $PWD/local/lib/${CONTAINER}.sif.${VERSION}
## Don't place eic-shell in local/bin as this may
## conflict with things we install inside the container
rm $PWD/local/bin/eic-shell
## Cleanup
rm -rf __pycache__ install.py
mkdir -p local/lib || exit 1
## check for a singularity install
if [ $(type -P singularity ) ]; then
SINGULARITY=$(which singularity)
#if [ -z $SINGULARITY ]; then
else
## jlab singularity
if [ -d "/apps/singularity/3.7.1/bin/" ]; then
SINGULARITY="/apps/singularity/3.7.1/bin/singularity"
## cvmfs singularity
elif [ -f "/cvmfs/oasis.opensciencegrid.org/mis/singularity/bin/singularity" ]; then
SINGULARITY="/cvmfs/oasis.opensciencegrid.org/mis/singularity/bin/singularity"
else
echo "ERROR: no singularity found, please make sure you have singularity in your \$PATH"
exit 1
fi
fi
echo "Found singularity at $SINGULARITY"
SIF=
## check if we can just use cvmfs for the image
if [ -f /cvmfs/eic.opensciencegrid.org/singularity/athena/jug_xl_v${VERSION}.sif ]; then
ln -sf /cvmfs/eic.opensciencegrid.org/singularity/athena/jug_xl_v${VERSION}.sif local/lib
SIF="$PWD/local/lib/jug_xl_v${VERSION}.sif"
## if not, download the container to the system
else
## get the python installer and run the old-style install
wget https://eicweb.phy.anl.gov/containers/eic_container/-/raw/master/install.py
chmod +x install.py
./install.py -c $CONTAINER -v $VERSION $PWD/local
## Don't place eic-shell in local/bin as this may
## conflict with things we install inside the container
rm $PWD/local/bin/eic-shell
## Cleanup
rm -rf __pycache__ install.py
SIF=$PWD/local/lib/${CONTAINER}.sif.${VERSION}
fi
if [ -z $SIF -o ! -f $SIF ]; then
echo "ERROR: no singularity image found"
else
echo "Using ${CONTAINER} image: $SIF"
fi
## create a new top-level eic-shell launcher script
## that sets the ATHENA_PREFIX and then starts singularity
cat << EOF > eic-shell
#!/bin/bash
export ATHENA_PREFIX=$PWD/local
$PWD/local/lib/${CONTAINER}.sif.${VERSION}
$SINGULARITY run $SIF
EOF
chmod +x eic-shell
echo "Created custom eic-shell excecutable"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment