forked from docc-lab/dsb_k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-dsb-k8s.sh
executable file
·48 lines (34 loc) · 1002 Bytes
/
setup-dsb-k8s.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
#!/bin/bash
set -x
. "`dirname $0`/setup-lib.sh"
if [ -f $OURDIR/dsb-done ]; then
exit 0
fi
logtstart "dsb"
# Variables
REPO_URL="https://github.com/docc-lab/DeathStarBench.git"
DOCKER_IMAGE="deathstarbench/hotel-reservation"
KUBERNETES_DIR="hotelReservation/kubernetes" # Path to the Kubernetes directory within the repo
echo "setup deathstarbench in k8s"
# Clone the repository
cd /local
git clone $REPO_URL
# Prepare workload generator
cd /local/DeathStarBench/wrk2
git submodule update --init --recursive ./deps/luajit/
sudo apt-get update
sudo apt-get install -y libssl-dev
sudo apt-get install -y libz-dev
sudo apt-get install -y luarocks
sudo luarocks install luasocket
sudo -H pip install asyncio
sudo -H pip install aiohttp
make all
# Pull hotelreservation docker images
sudo docker pull $DOCKER_IMAGE
# Setup kubernetes cluster
sudo kubectl apply -Rf /local/DeathStarBench/$KUBERNETES_DIR
echo "deathstarbench-k8s setup complete"
logtend "dsb"
touch $OURDIR/dsb-done
exit 0