-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite.sh
84 lines (67 loc) · 2.16 KB
/
site.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
set() {
echo "$1=$2"
export $1="$2"
}
# SETUP
set BPS_SYSTEM $TACC_SYSTEM
set BPS_VERSION "1.8.12"
[[ -z $BP_DEV ]] && set BP_DEV 1
set BUILD_HASH `echo $RANDOM | md5sum | head -c 8`
set BUILD_DATE "$(date +'%Y-%m-%d %H:%m:%S')"
set BPS_VERSION_STR "${BPS_VERSION}-${BUILD_HASH}"
set PY_VERSION "3.`python3 --version | head -n 1 | cut -d '.' -f 2`"
set PY_LIB $TACC_PYTHON_LIB
set PY_MOD_LOAD 1
set PY_MOD_NAME "python3"
# USER VARIABLES [dynamic]
set BP_HOME '$HOME/benchpro'
set BP_REPO '$SCRATCH/benchpro/repo'
set BP_APPS '$SCRATCH/benchpro/apps'
set BP_RESULTS '$SCRATCH/benchpro/results'
# DB access
set DB_USER "benchpro"
set DB_HOST "benchpro.tacc.utexas.edu"
set REMOTE_PATH "/home/benchpro/benchdb/data_store"
SSH_KEY=$HOME/.ssh/id_rsa
# SYSTEM SPECIFIC
if [[ $BPS_SYSTEM = "frontera" ]]; then
ml python3
set TACC_SCRATCH "/scratch1"
SITE="${TACC_SCRATCH}/hpc_tools/benchpro"
elif [[ $BPS_SYSTEM = "vista" ]]; then
set PY_MOD_LOAD 0
set TACC_SCRATCH "/scratch"
SITE="${TACC_SCRATCH}/projects/benchpro"
SSH_KEY=$HOME/.ssh/id_ed25519
elif [[ $BPS_SYSTEM = "ls6" ]]; then
set TACC_SCRATCH "/scratch"
SITE="${TACC_SCRATCH}/projects/benchpro"
elif [[ $BPS_SYSTEM = "stampede3" ]]; then
set TACC_SCRATCH "/scratch"
SITE="${TACC_SCRATCH}/projects/benchpro"
set PY_MOD_NAME "python"
# set PY_ENV "1"
fi
# Load python module
[[ $PY_MOD_LOAD == 1 ]] && ml $PY_MOD_NAME
#BP_DEV=0
# PRODUCTION INSTALL
if [[ $BP_DEV == 0 ]]; then
printf "\n\033[0;31m!!!YOU ARE ABOUT TO REDEPLOY THE PRODUCTION SITE PACKAGE!!!\033[0m \n\n"
sleep 5
# DEV INSTALL
else
SITE="${SITE}-dev"
printf "\n\033[0;32mDEPLOYING SITE PACKAGE IN DEV MODE [BP_DEV=1]\033[0m\n\n"
sleep 2
fi
# SITE VARIABLES [static]
set BPS_HOME "${SITE}"
set BPS_COLLECT "${BPS_HOME}/collection"
set BPS_INC "${BPS_HOME}/package/benchpro"
set BPS_MODULES "${BPS_HOME}/modulefiles"
set BPS_BIN "${BPS_HOME}/python/bin"
today=`date +%Y-%m-%d_%H-%M-%S`
set BPS_LOG "${BPS_HOME}/logs/build_${today}.log"
return 0