diff --git a/batch/hpc_init.sh b/batch/hpc_init.sh index cb04a4568..36a7a5c81 100644 --- a/batch/hpc_init.sh +++ b/batch/hpc_init.sh @@ -45,12 +45,11 @@ fi # Conda init if [ -z "${FLEPI_CONDA}" ]; then - echo -n "An explicit \$FLEPI_CONDA was not provided, please set one (or press enter to use '$USERDIR/flepimop-env'): " + echo -n "An explicit \$FLEPI_CONDA was not provided, please set one (or press enter to use 'flepimop-env'): " read FLEPI_CONDA if [ -z "${FLEPI_CONDA}" ]; then - export FLEPI_CONDA="$USERDIR/flepimop-env" + export FLEPI_CONDA="flepimop-env" fi - export FLEPI_CONDA=$( realpath "$FLEPI_CONDA" ) echo "Using '$FLEPI_CONDA' for \$FLEPI_CONDA." fi conda activate $FLEPI_CONDA @@ -116,6 +115,7 @@ Otherwise make sure this diagnostic info looks correct before continuing: * Cluster: $1 * User directory: $USERDIR * Work directory: $WORKDIR +* Flepi conda: $FLEPI_CONDA * Flepi path: $FLEPI_PATH * Project path: $PROJECT_PATH * Python: $WHICH_PYTHON diff --git a/build/hpc_install_or_update.sh b/build/hpc_install_or_update.sh index 3c343b6d6..b3379a4f3 100755 --- a/build/hpc_install_or_update.sh +++ b/build/hpc_install_or_update.sh @@ -68,24 +68,25 @@ fi # Setup the conda environment if [ -z "${FLEPI_CONDA}" ]; then - echo -n "An explicit \$FLEPI_CONDA was not provided, please set one (or press enter to use '$USERDIR/flepimop-env'): " + echo -n "An explicit \$FLEPI_CONDA was not provided, please set one (or press enter to use 'flepimop-env'): " read FLEPI_CONDA if [ -z "${FLEPI_CONDA}" ]; then - export FLEPI_CONDA="$USERDIR/flepimop-env" + export FLEPI_CONDA="flepimop-env" fi - export FLEPI_CONDA=$( realpath "$FLEPI_CONDA" ) echo "Using '$FLEPI_CONDA' for \$FLEPI_CONDA." fi -if [ ! -d $FLEPI_CONDA ]; then -conda env create --prefix $FLEPI_CONDA --file $FLEPI_PATH/environment.yml -cat << EOF > $FLEPI_CONDA/conda-meta/pinned -r-arrow==17.0.0 -arrow==17.0.0 -EOF +FLEPI_CONDA_ENV_MATCHES=$( conda info --envs | awk '{print $1}' | grep -x "$FLEPI_CONDA" | wc -l ) +if [ "$FLEPI_CONDA_ENV_MATCHES" -eq 0 ]; then +conda env create --name $FLEPI_CONDA --file $FLEPI_PATH/environment.yml fi # Load the conda environment conda activate $FLEPI_CONDA +[ -e "$CONDA_PREFIX/conda-meta/pinned" ] && rm $CONDA_PREFIX/conda-meta/pinned +cat << EOF > $CONDA_PREFIX/conda-meta/pinned +r-arrow==17.0.0 +arrow==17.0.0 +EOF # Install the gempyor package from local pip install --editable --force-reinstall $FLEPI_PATH/flepimop/gempyor_pkg