-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.sh
48 lines (38 loc) · 1.32 KB
/
constants.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
shopt -s expand_aliases
# Set global configuration
export LANG=C.UTF-8
export PYTHONPATH=".:./src"
export GPG_TTY=$(tty)
# Load environment
if [ -e env.sh ]; then
source env.sh
fi
# Check required configuration
_=${DATASET:?"No dataset selected!"}
_=${VERSION:?"No version selected!"}
# Shorthands and configuration options
export RUNNER=${RUNNER:-"docker"}
export DATASETS_DIR=${DATASETS_DIR:-"./datasets"}
export CROSSWALKING_TABLES_DIR=${CROSSWALKING_TABLES_DIR:-"./crosswalking-tables"}
export RAW_DATA_DIR=${RAW_DATA_DIR:-"./raw-data"}
export OUTPUT_DIR="$RAW_DATA_DIR/$DATASET/$VERSION"
export DATA_REPO_DIR="$RAW_DATA_DIR/data-repo"
export CACHE_DIR="$RAW_DATA_DIR/tmp"
export MODELS_DIR="$RAW_DATA_DIR/models"
export SRC_DIR="./src"
# Absolute path to project. Used when starting slurm jobs
export PROJECT_DIR=${PROJECT_DIR:-"/N/project/hra/hra-workflows-runner"}
export SIF_CACHE_DIR=${SIF_CACHE_DIR:-"/N/project/hra/sif-cache"}
export TEMP=${TEMP:-"$PROJECT_DIR/tmp/"}
# Configure apptainer
export APPTAINER_TMPDIR="$TEMP"
# Configure slurm
export SLURM_UMASK="ug+rw"
# Load dataset configuration
source $DATASETS_DIR/$DATASET/config.sh
# Check required dataset configuration
_=${DATASET_COLUMN_ID:?"No dataset list identifier column set!"}
# Load shared functions
for SCRIPT in $SRC_DIR/shell_util/*.sh; do
source $SCRIPT
done