Rework experiment logic

This commit is contained in:
Quentin Dufour 2019-03-15 09:39:23 +01:00
parent 621b0bfeab
commit cf9914e18a

View file

@ -2,8 +2,14 @@
# Create workdir # Create workdir
XP_FOLDER=`mktemp -d -p . xp1-XXXXXXXXXXXXXXXX` XP_FOLDER=`mktemp -d -p . xp1-XXXXXXXXXXXXXXXX`
mkdir -p $XP_FOLDER XP_ID=`echo $XP_FOLDER|cut -c 3-`
cd $XP_FOLDER cd $XP_FOLDER
COUNT=$1
INTERVAL=$2
SIZE=$3
ALLOWED_BOOTSTRAP=190
ALLOWED_TIME=`expr $(expr ${COUNT} * ${INTERVAL}) / 1000 + ${ALLOWED_BOOTSTRAP}`
echo "Will run for ${ALLOWED_TIME} (count=$1, interval=$2)"
# Create folders # Create folders
docker run \ docker run \
@ -17,23 +23,27 @@ docker run \
docker run \ docker run \
--privileged \ --privileged \
--rm \ --rm \
--name "$XP_ID-server" \
-v `pwd`/shared:/home/donar/shared \ -v `pwd`/shared:/home/donar/shared \
-v `pwd`/log:/home/donar/log \ -v `pwd`/log:/home/donar/log \
registry.gitlab.inria.fr/qdufour/donar \ registry.gitlab.inria.fr/qdufour/donar \
xp1-server & xp1-server &
sleep 30 sleep 10
# Run client # Run client
docker run \ docker run \
--privileged \ --privileged \
--rm \ --rm \
--name "$XP_ID-client" \
-v `pwd`/res:/home/donar/res \ -v `pwd`/res:/home/donar/res \
-v `pwd`/shared:/home/donar/shared \ -v `pwd`/shared:/home/donar/shared \
-v `pwd`/log:/home/donar/log \ -v `pwd`/log:/home/donar/log \
registry.gitlab.inria.fr/qdufour/donar \ registry.gitlab.inria.fr/qdufour/donar \
xp1-client $1 $2 $3 xp1-client $COUNT $INTERVAL $SIZE &
# Kill server sleep $ALLOWED_TIME
kill %1
# Kill
docker kill "$XP_ID-client" || true
docker kill "$XP_ID-server" || true