2019-03-06 15:39:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Create workdir
|
2019-03-28 15:42:02 +00:00
|
|
|
XP_NAME=$1
|
|
|
|
XP_FOLDER=`mktemp -d -p . ${XP_NAME}-XXXXXXXXXXXXXXXX`
|
2019-03-15 08:39:23 +00:00
|
|
|
XP_ID=`echo $XP_FOLDER|cut -c 3-`
|
2019-03-06 15:39:39 +00:00
|
|
|
cd $XP_FOLDER
|
2019-03-28 15:42:02 +00:00
|
|
|
COUNT=$2
|
|
|
|
INTERVAL=$3
|
|
|
|
SIZE=$4
|
2019-03-15 08:39:23 +00:00
|
|
|
ALLOWED_BOOTSTRAP=190
|
2019-03-06 15:39:39 +00:00
|
|
|
|
|
|
|
# Create folders
|
2019-03-06 17:32:19 +00:00
|
|
|
docker run \
|
|
|
|
--rm \
|
|
|
|
-ti \
|
|
|
|
-v `pwd`:/mnt \
|
|
|
|
ubuntu \
|
|
|
|
bash -c "cd /mnt; mkdir -p ./{shared,log,res}; chown -R 1000 ./{shared,log,res}"
|
2019-03-06 15:39:39 +00:00
|
|
|
|
|
|
|
# Run server
|
|
|
|
docker run \
|
|
|
|
--privileged \
|
|
|
|
--rm \
|
2019-04-01 14:11:47 +00:00
|
|
|
-d \
|
2019-03-15 08:39:23 +00:00
|
|
|
--name "$XP_ID-server" \
|
2019-03-06 15:39:39 +00:00
|
|
|
-v `pwd`/shared:/home/donar/shared \
|
|
|
|
-v `pwd`/log:/home/donar/log \
|
|
|
|
registry.gitlab.inria.fr/qdufour/donar \
|
2019-04-18 14:36:14 +00:00
|
|
|
${XP_NAME}-server
|
2019-03-06 15:39:39 +00:00
|
|
|
|
2019-03-15 08:39:23 +00:00
|
|
|
sleep 10
|
2019-04-18 14:36:14 +00:00
|
|
|
docker ps
|
2019-03-06 15:39:39 +00:00
|
|
|
|
|
|
|
# Run client
|
|
|
|
docker run \
|
|
|
|
--privileged \
|
|
|
|
--rm \
|
2019-03-15 08:39:23 +00:00
|
|
|
--name "$XP_ID-client" \
|
2019-04-18 12:34:38 +00:00
|
|
|
$( [[ "${XP_NAME}" == 'witness' ]] && echo "--net=container:$XP_ID-server" ) \
|
2019-03-06 15:39:39 +00:00
|
|
|
-v `pwd`/res:/home/donar/res \
|
|
|
|
-v `pwd`/shared:/home/donar/shared \
|
|
|
|
-v `pwd`/log:/home/donar/log \
|
|
|
|
registry.gitlab.inria.fr/qdufour/donar \
|
2019-04-18 14:36:14 +00:00
|
|
|
${XP_NAME}-client $COUNT $INTERVAL $SIZE
|
2019-03-06 17:32:19 +00:00
|
|
|
|
2019-03-15 08:39:23 +00:00
|
|
|
# Kill
|
2019-04-02 13:35:17 +00:00
|
|
|
#docker kill "$XP_ID-client" || true
|
2019-03-15 08:39:23 +00:00
|
|
|
docker kill "$XP_ID-server" || true
|