-
Notifications
You must be signed in to change notification settings - Fork 1
/
00a_install.sh
50 lines (40 loc) · 1.28 KB
/
00a_install.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
49
50
#!/usr/bin/env bash
set -e
THIS_FOLDER=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
set -a; source .env; set +a
PY_ENV_FOLDER="$THIS_FOLDER/.venvs/py"
conda env remove -p ${PY_ENV_FOLDER}
conda env create -p ${PY_ENV_FOLDER} -f "$THIS_FOLDER/environment_py.yml"
DREXML_ENV_FOLDER="$THIS_FOLDER/.venvs/drexml"
if [[ -z "$USE_GPU" ]]; then
n_gpus=0
else
n_gpus=$USE_GPU
fi
if [[ "$n_gpus" -gt 0 ]]; then
if [ "$UPDATE" = false ] ; then
env_file="environment_drexml_gpu.yml"
else
env_file="environment_update_drexml_gpu.yml"
fi
else
if [ "$UPDATE" = false ] ; then
env_file="environment_drexml.yml"
else
env_file="environment_update_drexml.yml"
fi
fi
echo "using ${env_file}"
conda env remove -p ${DREXML_ENV_FOLDER}
conda env create -p ${DREXML_ENV_FOLDER} -f "${THIS_FOLDER}/${env_file}"
R_ENV_FOLDER="$THIS_FOLDER/.venvs/r"
conda env remove -p ${R_ENV_FOLDER}
conda env create -p ${R_ENV_FOLDER} -f "$THIS_FOLDER/environment_r.yml"
# create data folders
mkdir -p "$THIS_FOLDER/data/raw"
mkdir -p "$THIS_FOLDER/data/interim"
mkdir -p "$THIS_FOLDER/data/final"
mkdir -p "$THIS_FOLDER/results/tables"
mkdir -p "$THIS_FOLDER/results/ml"
mkdir -p "$THIS_FOLDER/results/rds"
mkdir -p "$THIS_FOLDER/results/figures"