Skip to content
Snippets Groups Projects
Commit 96e69070 authored by easybuild's avatar easybuild
Browse files

fix

parent 0748755c
No related branches found
No related tags found
No related merge requests found
......@@ -10,4 +10,4 @@ if [ -z "$1" ]; then
exit 1
fi
singularity exec --bind /scratch --bind /apps $IMAGE_PATH_LOCAL "$@"
apptainer exec --bind /scratch --bind /apps $IMAGE_PATH_LOCAL "$@"
......@@ -7,15 +7,15 @@ fi
VERSION=$(\ls -t $IMAGE_ROOT | grep ".sif\|.simg" | head -1)
if [ ! -d "$HOME/.singularity/images" ]; then
mkdir -p $HOME/.singularity/images
if [ ! -d "$HOME/.apptainer/images" ]; then
mkdir -p $HOME/.apptainer/images
fi
LOCAL=$(\ls $HOME/.singularity/images | grep $IMAGE_OS-$IMAGE_VERSION | head -1)
LOCAL=$(\ls $HOME/.apptainer/images | grep $IMAGE_OS-$IMAGE_VERSION | head -1)
if [[ -z "$LOCAL" ]]; then
echo -ne "\e[33mPreparing image \e[0m"
rsync --progress -h $IMAGE_ROOT/$VERSION $HOME/.singularity/images/$VERSION
rsync --progress -h $IMAGE_ROOT/$VERSION $HOME/.apptainer/images/$VERSION
LOCAL=$VERSION
fi
......@@ -25,9 +25,9 @@ if [ "$LOCAL" \< "$VERSION" ]; then
read CONTINUE
if [ "$CONTINUE" == "y" ] || [ "$CONTINUE" == "Y" ]; then
echo -ne "\e[32mUpdating image\e[0m "
rsync --progress -h $IMAGE_ROOT/$VERSION $HOME/.singularity/images/$VERSION
echo -e "\e[32mNew version is ready.\e[0m ($HOME/.singularity/images/$VERSION)"
[ -f $HOME/.singularity/images/$LOCAL ] && rm $HOME/.singularity/images/$LOCAL
rsync --progress -h $IMAGE_ROOT/$VERSION $HOME/.apptainer/images/$VERSION
echo -e "\e[32mNew version is ready.\e[0m ($HOME/.apptainer/images/$VERSION)"
[ -f $HOME/.apptainer/images/$LOCAL ] && rm $HOME/.apptainer/images/$LOCAL
LOCAL=$VERSION
else
echo -e "\e[31mIgnoring new version...\e[0m ($VERSION)."
......@@ -38,11 +38,11 @@ if [ "$LOCAL" \< "$VERSION" ]; then
fi
if [ "$1" == "shell" ]; then
export IMAGE_PATH_LOCAL="$HOME/.singularity/images/$LOCAL"
singularity shell --bind /scratch --bind /apps $HOME/.singularity/images/$LOCAL
export IMAGE_PATH_LOCAL="$HOME/.apptainer/images/$LOCAL"
apptainer shell --bind /scratch --bind /apps $HOME/.apptainer/images/$LOCAL
SYS=`/bin/cat /etc/centos-release`
echo -e "\e[33mWelcome to the normal operating system ($SYS)\e[0m"
else
export IMAGE_PATH_LOCAL="$HOME/.singularity/images/$LOCAL"
echo -e "\e[33mYour image of $IMAGE_OS/$IMAGE_VERSION is at location:\e[0m $HOME/.singularity/images/$LOCAL"
export IMAGE_PATH_LOCAL="$HOME/.apptainer/images/$LOCAL"
echo -e "\e[33mYour image of $IMAGE_OS/$IMAGE_VERSION is at location:\e[0m $HOME/.apptainer/images/$LOCAL"
fi
......@@ -48,6 +48,4 @@ done
PARAM=$(echo "$PARAM" | sed -e 's/ */ /g' -e 's/^ *\(.*\) *$/\1/')
#echo "mpirun $PARAM singularity exec --bind /scratch --bind /apps --writable $IMAGE_PATH_LOCAL $EXEC"
mpirun ${PARAM} singularity exec --bind /scratch --bind /apps "$IMAGE_PATH_LOCAL" "$EXEC"
mpirun ${PARAM} apptainer exec --bind /scratch --bind /apps "$IMAGE_PATH_LOCAL" "$EXEC"
......@@ -5,4 +5,4 @@ if [ -z "IMAGE_PATH_LOCAL" ]; then
exit 1
fi
singularity run --bind /scratch --bind /apps $IMAGE_PATH_LOCAL "$@"
apptainer run --bind /scratch --bind /apps $IMAGE_PATH_LOCAL "$@"
......@@ -5,4 +5,4 @@ if [ -z "IMAGE_PATH_LOCAL" ]; then
exit 1
fi
singularity shell --bind /scratch --bind /apps $IMAGE_PATH_LOCAL $@
apptainer shell --bind /scratch --bind /apps $IMAGE_PATH_LOCAL $@
......@@ -7,18 +7,18 @@ fi
APPS_VERSION=$(ls -t $IMAGE_ROOT | grep ".sif\|.simg" | head -1)
LOCAL_VERSION=$(ls $HOME/.singularity/images | grep $IMAGE_OS-$IMAGE_VERSION* | head -1)
LOCAL_VERSION=$(ls $HOME/.apptainer/images | grep $IMAGE_OS-$IMAGE_VERSION* | head -1)
if [ "$LOCAL_VERSION" \< "$APPS_VERSION" ]; then
echo -ne "\e[33mNew version of CentOS image was found.\e[0m (\e[33mNew:\e[0m $APPS_VERSION \e[33mOld:\e[0m $LOCAL_VERSION)\nDo you want to update local copy? (\e[31mWARNING all user modification will be deleted\e[0m) [y/N]: "
read CONTINUE
if [ "$CONTINUE" == "y" ] || [ "$CONTINUE" == "Y" ]; then
echo -ne "\e[33mUpdating image \e[0m "
rsync --progress -h $IMAGE_ROOT/$APPS_VERSION $HOME/.singularity/images/$APPS_VERSION
echo -e "\e[32mNew version is ready.\e[0m ($HOME/.singularity/images/$APPS_VERSION)"
rsync --progress -h $IMAGE_ROOT/$APPS_VERSION $HOME/.apptainer/images/$APPS_VERSION
echo -e "\e[32mNew version is ready.\e[0m ($HOME/.apptainer/images/$APPS_VERSION)"
unset IMAGE_PATH_LOCAL
export IMAGE_PATH_LOCAL="$HOME/.singularity/images/$APPS_VERSION"
[ -f $HOME/.singularity/images/$LOCAL_VERSION ] && rm $HOME/.singularity/images/$LOCAL_VERSION
export IMAGE_PATH_LOCAL="$HOME/.apptainer/images/$APPS_VERSION"
[ -f $HOME/.apptainer/images/$LOCAL_VERSION ] && rm $HOME/.apptainer/images/$LOCAL_VERSION
else
echo "Exiting..."
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment