-
Notifications
You must be signed in to change notification settings - Fork 20
/
rollout.sh
executable file
·109 lines (101 loc) · 3.58 KB
/
rollout.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
set -e
PWD=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source $PWD/functions.sh
source_bashrc
GEN_DATA_SCALE="$1"
EXPLAIN_ANALYZE="$2"
RANDOM_DISTRIBUTION="$3"
MULTI_USER_COUNT="$4"
RUN_COMPILE_TPCH="$5"
RUN_GEN_DATA="$6"
RUN_INIT="$7"
RUN_DDL="$8"
RUN_LOAD="$9"
RUN_SQL="${10}"
RUN_SINGLE_USER_REPORT="${11}"
RUN_MULTI_USER="${12}"
RUN_MULTI_USER_REPORT="${13}"
SINGLE_USER_ITERATIONS="${14}"
if [[ "$GEN_DATA_SCALE" == "" || "$EXPLAIN_ANALYZE" == "" || "$RANDOM_DISTRIBUTION" == "" || "$MULTI_USER_COUNT" == "" || "$RUN_COMPILE_TPCH" == "" || "$RUN_GEN_DATA" == "" || "$RUN_INIT" == "" || "$RUN_DDL" == "" || "$RUN_LOAD" == "" || "$RUN_SQL" == "" || "$RUN_SINGLE_USER_REPORT" == "" || "$RUN_MULTI_USER" == "" || "$RUN_MULTI_USER_REPORT" == "" || "$SINGLE_USER_ITERATIONS" == "" ]]; then
echo "Parameters: scale, explain T/F, random T/F, multi-user count, run compile T/F, run gen_data T/F, run init T/F, run DDL T/F, run load T/F, run SQL T/F, run single report T/F, run multi-user T/F, run multi report T/F, and single user iterations count."
echo "Example: ./rollout.sh 100 false false 5 true true true true true true true true true 1"
exit 1
fi
QUIET=$5
create_directories()
{
if [ ! -d $LOCAL_PWD/log ]; then
echo "Creating log directory"
mkdir $LOCAL_PWD/log
fi
}
create_directories
echo "############################################################################"
echo "TPC-H Script for Pivotal Greenplum Database and Pivotal HAWQ."
echo "############################################################################"
echo ""
echo "############################################################################"
echo "GEN_DATA_SCALE: $GEN_DATA_SCALE"
echo "EXPLAIN_ANALYZE: $EXPLAIN_ANALYZE"
echo "RANDOM_DISTRIBUTION: $RANDOM_DISTRIBUTION"
echo "MULTI_USER_COUNT: $MULTI_USER_COUNT"
echo "RUN_COMPILE_TPCH: $RUN_COMPILE_TPCH"
echo "RUN_GEN_DATA: $RUN_GEN_DATA"
echo "RUN_INIT: $RUN_INIT"
echo "RUN_DDL: $RUN_DDL"
echo "RUN_LOAD: $RUN_LOAD"
echo "RUN_SQL: $RUN_SQL"
echo "SINGLE_USER_ITERATIONS: $SINGLE_USER_ITERATIONS"
echo "RUN_SINGLE_USER_REPORT: $RUN_SINGLE_USER_REPORT"
echo "RUN_MULTI_USER: $RUN_MULTI_USER"
echo "RUN_MULTI_USER_REPORT: $RUN_MULTI_USER_REPORT"
echo "############################################################################"
echo ""
if [ "$RUN_COMPILE_TPCH" == "true" ]; then
rm -f $PWD/log/end_compile_tpch.log
fi
if [ "$RUN_GEN_DATA" == "true" ]; then
rm -f $PWD/log/end_gen_data.log
fi
if [ "$RUN_INIT" == "true" ]; then
rm -f $PWD/log/end_init.log
fi
if [ "$RUN_DDL" == "true" ]; then
rm -f $PWD/log/end_ddl.log
fi
if [ "$RUN_LOAD" == "true" ]; then
rm -f $PWD/log/end_load.log
fi
if [ "$RUN_SQL" == "true" ]; then
rm -f $PWD/log/end_sql.log
fi
if [ "$RUN_SINGLE_USER_REPORT" == "true" ]; then
rm -f $PWD/log/end_single_user_reports.log
fi
if [ "$RUN_MULTI_USER" == "true" ]; then
rm -f $PWD/log/end_testing_*.log
fi
if [ "$RUN_MULTI_USER_REPORT" == "true" ]; then
rm -f $PWD/log/end_multi_user_reports.log
fi
get_version
if [[ "$VERSION" == *"gpdb"* || "$VERSION" == "*oss*" ]]; then
echo "INFO: ssh keys are exchanged as part of database setup."
else
echo "INFO: Make sure passwordless ssh is allowed."
if [ ! -d ~/.ssh ]; then
echo "mkdir ~/.ssh"
mkdir ~/.ssh
fi
if [ ! -f ~/.ssh/id_rsa ]; then
echo "ssh-keygen -t rsa -N \"\" -f ~/.ssh/id_rsa"
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
echo "cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys"
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
fi
fi
for i in $(ls -d $PWD/0*); do
echo "$i/rollout.sh"
$i/rollout.sh $GEN_DATA_SCALE $EXPLAIN_ANALYZE $RANDOM_DISTRIBUTION $MULTI_USER_COUNT $SINGLE_USER_ITERATIONS
done