Skip to content

Commit

Permalink
added docker option
Browse files Browse the repository at this point in the history
  • Loading branch information
tome215 committed Oct 1, 2024
1 parent 0fa0a82 commit 30c720c
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 3 deletions.
9 changes: 9 additions & 0 deletions profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
portal.ParameterType.INTEGER,0,
[(0,"Any"),(1000000,"1Gb/s"),(10000000,"10Gb/s"),(25000000,"25Gb/s"),(40000000,"40Gb/s"),(100000000,"100Gb/s")],
longDescription="A specific link speed to use for each link/LAN. All experiment network interfaces will request this speed.")
pc.defineParameter(
"application","Application Used for Experiment",
portal.ParameterType.INTEGER,0,
[(0,"Hotel Reservation (K8S)"),(1,"Social Network (Docker)")],
longDescription="The application to be used by this experiment. Depending on the application, either K8S or Docker will be used.")
pc.defineParameter(
"diskImage","Disk Image",
portal.ParameterType.STRING,
Expand Down Expand Up @@ -370,6 +375,10 @@
j += 1
if TBCMD is not None:
node.addService(RSpec.Execute(shell="sh",command=TBCMD))
if params.application == 0:
node.addService(RSpec.Execute(shell="sh",command="sudo echo \"K8S\" > /local/setup/app-type"))
else:
node.addService(RSpec.Execute(shell="sh",command="sudo echo \"DOCKER\" > /local/setup/app-type"))
if disableTestbedRootKeys:
node.installRootKeys(False, False)
nodes[nodename] = node
Expand Down
19 changes: 19 additions & 0 deletions setup-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install -y docker-ce
sudo systemctl status docker --no-pager

for user in $(ls /users)
do
sudo usermod -aG docker $user
done

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo docker-compose --version
sudo echo -e '\n\nexport PATH=$PATH:/usr/local/bin' >> .bashrc
source .bashrc
7 changes: 4 additions & 3 deletions setup-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ set -x
ln -s /local/logs/setup.log /local/setup/setup-driver.log

ALLNODESCRIPTS="setup-ssh.sh setup-disk-space.sh"
HEADNODESCRIPTS="setup-nfs-server.sh setup-nginx.sh setup-ssl.sh setup-kubespray.sh setup-kubernetes-extra.sh setup-dsb.sh setup-end.sh"
HEADNODESCRIPTS_K8S="setup-nfs-server.sh setup-nginx.sh setup-ssl.sh setup-kubespray.sh setup-kubernetes-extra.sh setup-dsb-k8s.sh setup-end.sh"
HEADNODESCRIPTS_DOCKER="setup-nfs-server.sh setup-nginx.sh setup-ssl.sh setup-docker.sh setup-dsb-docker.sh setup-end.sh"
WORKERNODESCRIPTS="setup-nfs-client.sh"
#HEADNODESUDOS="setup-cacti.sh"

export SRC=`dirname $0`
cd $SRC
. $SRC/setup-lib.sh

chmod +x $SRC/setup-dsb.sh
chmod +x $SRC/setup-dsb-k8s.sh

# Don't run setup-driver.sh twice
if [ -f $OURDIR/setup-driver-done ]; then
Expand All @@ -30,7 +31,7 @@ for script in $ALLNODESCRIPTS ; do
fi
done
if [ "$HOSTNAME" = "node-0" ]; then
for script in $HEADNODESCRIPTS
for script in $HEADNODESCRIPTS_$(cat /local/setup/app-type)
do
cd $SRC
$SRC/$script | tee - /local/logs/${script}.log 2>&1
Expand Down
42 changes: 42 additions & 0 deletions setup-dsb-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/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 docker"

# 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
make all

# Pull hotelreservation docker images
#sudo docker pull $DOCKER_IMAGE

# Setup kubernetes cluster
#sudo kubectl apply -Rf /local/DeathStarBench/$KUBERNETES_DIR

echo "deathstarbench-docker setup complete"

logtend "dsb"

touch $OURDIR/dsb-done
exit 0
0 setup-dsb.sh → setup-dsb-k8s.sh
100644 → 100755
File renamed without changes.

0 comments on commit 30c720c

Please sign in to comment.