-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
161 lines (127 loc) · 3.93 KB
/
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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/bin/bash
set -e
set -o pipefail
########################
# CPU Microbenchmark
########################
# Install dependencies
sudo apt-get install make texinfo gcc g++ xz-utils bzip2 build-essential tcl libjemalloc-dev maven htop -y
# CPU Microbenchmark
git clone https://github.com/eembc/coremark-pro
cd coremark-pro
make TARGET=linux64 build
cd ..
########################
# Filesystem Microbenchmark
########################
# Installing iozone on the board is really slow:
# Therefore we download the cross compiled program from a remove destination
mkdir keystone-iozone
cd keystone-iozone
wget -O iozone https://polybox.ethz.ch/index.php/s/MwscmB3UjHHWqa0/download
chmod 777 iozone
cd ..
# git clone https://github.com/keystone-enclave/keystone-iozone
# cd keystone-iozone
#
# git clone https://github.com/richfelker/musl-cross-make
# cd musl-cross-make
#
# TARGET=riscv64-linux-musl make -j$(nproc)
# TARGET=riscv64-linux-musl make install
#
# cd ..
#
# git checkout 1378a4fb920e8177a2293c4600ab494ab51de6b8
# CCRV=musl-cross-make/output/bin/riscv64-linux-musl-gcc make keystone
#
# cd ..
########################
# Network Microbenchmark
########################
sudo apt install automake autoconf texinfo -y
git clone https://github.com/HewlettPackard/netperf/
cd netperf
# Replace confiuration files - files are too old for riscv
rm config.guess
rm config.sub
wget -O config.guess http://git.savannah.gnu.org/cgit/config.git/plain/config.guess
wget -O config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub
# Install
./autogen.sh
./configure
make CFLAGS="-fcommon"
sudo make install
cd ..
########################
# SSH server
########################
# Install the ssh client for the experiments
sudo apt-get install openssh-server -y
sudo systemctl enable ssh
sudo systemctl start ssh
########################
# Memcached
########################
# Install memcached
sudo apt-get install memcached -y
# Change configuration to receive connections from the outside world
sudo sed -i 's/^-l\s*.*/-l 0.0.0.0/' /etc/memcached.conf
sudo systemctl start memcached
sudo systemctl enable memcached
########################
# Redis
########################
# Install redis
wget https://download.redis.io/redis-stable.tar.gz
tar -xzvf redis-stable.tar.gz
cd redis-stable
make -j$(nproc)
sudo make install
cd ..
# Remove the protected mode
redis-cli CONFIG SET protected-mode no
# Install the sampler
git clone http://github.com/brianfrankcooper/YCSB.git
# Finally give the access right to the other scripts for ssh measurements
chmod 777 microbenchmark_cpu.sh
chmod 777 microbenchmark_fs.sh
chmod 777 microbenchmark_network.sh
########################
# Mysql
########################
# Install mysql
sudo apt install mysql-server -y
sudo systemctl start mysql
sudo systemctl enable mysql
# Alter the configuration file to receive connections from the outside world
sudo sed -i 's/^bind-address\s*=.*/bind-address = 0.0.0.0/' /etc/mysql/mysql.conf.d/mysqld.cnf
sudo sed -i 's/^mysqlx-bind-address\s*=.*/mysqlx-bind-address = 0.0.0.0/' /etc/mysql/mysql.conf.d/mysqld.cnf
# Setup new user and database in mysql
sudo mysql -e "CREATE USER 'user'@'%' IDENTIFIED BY 'user';"
sudo mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'user'@'%';"
sudo mysql -e "FLUSH PRIVILEGES;"
sudo mysql -e "CREATE DATABASE sbtest;"
# Restart mysql (now ready for the benchmarks)
sudo systemctl restart mysql
# Load the data in the database
sysbench \
--db-driver=mysql --mysql-host=$(echo "$ADDRESS" | cut -d'@' -f2-) --mysql-port=3306 \
--mysql-user=user --mysql-password=user --mysql-db=sbtest \
--tables=10 --table-size=100000 oltp_read_write prepare
########################
# Firewall
########################
sudo apt install ufw -y
sudo systemctl enable ufw
sudo systemctl start ufw
sudo ufw allow ssh
# Redis
sudo ufw allow 6379
# Netperf
sudo ufw allow 12865
# Mysql
sudo ufw allow 3306
# Memcached
sudo ufw allow 11211
sudo systemctl restart ufw