From 230987140902156edd3c5f6943baf4d60b136ced Mon Sep 17 00:00:00 2001 From: Michael <m.langguth@fz-juelich.de> Date: Thu, 4 Nov 2021 13:42:34 +0100 Subject: [PATCH] Add wrapper_container.sh which was missing in the remote repo before. --- .../env_setup/wrapper_container.sh | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 video_prediction_tools/env_setup/wrapper_container.sh diff --git a/video_prediction_tools/env_setup/wrapper_container.sh b/video_prediction_tools/env_setup/wrapper_container.sh new file mode 100755 index 00000000..4a51d0d1 --- /dev/null +++ b/video_prediction_tools/env_setup/wrapper_container.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# basic directory variables +ENV_SETUP_DIR=`pwd` +WORKING_DIR="$(dirname "$ENV_SETUP_DIR")" +EXE_DIR="$(basename "$ENV_SETUP_DIR")" +VENV_DIR=$WORKING_DIR/$1/$1 +shift # replaces $1 by $2, so that $@ does not include the name of the virtual environment anymore + +# sanity checks +if [[ "${EXE_DIR}" != "HPC_scripts" ]]; then + echo "ERROR: Run the setup-script for the enviornment from the HPC_scripts-directory!" + exit +fi + +if ! [[ -d "${VENV_DIR}" ]]; then + echo "ERROR: Could not found virtual environment under ${VENV_DIR}!" + exit +fi + +#expand PYHTONPATH +# Include site-packages from virtual environment... +unset PYTHONPATH +export PYTHONPATH=${VENV_DIR}/lib/python3.8/site-packages/:$PYTHONPATH +# ... dist-packages from container singularity... +#export PYTHONPATH=/usr/local/lib/python3.8/dist-packages:$PYTHONPATH +# ... and modules from this project +export PYTHONPATH=${WORKING_DIR}:$PYTHONPATH +export PYTHONPATH=${WORKING_DIR}/utils:$PYTHONPATH + +# Control +echo "****** Check PYTHONPATH *****" +echo $PYTHONPATH +# MPI related environmental variables +export PMIX_SECURITY_MODE="native" # default would include munge which is unavailable + +$@ -- GitLab