#!/usr/bin/env bash
#
# Set up environment to run experiments on cluster.

set -o errexit
set -o pipefail
set -o nounset

readonly CONDA_ENV_NAME='masterarbeit_env'

echo 'Set up cluster node for experiments'

echo 'Loading bash settings (not automatically loaded on cluster)'
# Disable shellcheck warning about using source with a variable.
# shellcheck disable=SC1091
source /home/rodrigo/.bashrc

echo "Activating conda environment '$CONDA_ENV_NAME' created in script/bootstrap-cluster"
conda activate "$CONDA_ENV_NAME"

# Without these lines, cluster node fails with '!ref: unbound variable' on TAB completion.
# Source: https://unix.stackexchange.com/questions/539375/autocompletion-fails-on-tab-with-bash-ref-unbound-variable
set +o nounset
set +o errexit
set +o pipefail
