diff --git a/scripts/xp1 b/scripts/xp-instance-runner similarity index 85% rename from scripts/xp1 rename to scripts/xp-instance-runner index ab06b4f..e5da46a 100755 --- a/scripts/xp1 +++ b/scripts/xp-instance-runner @@ -1,12 +1,13 @@ #!/bin/bash # Create workdir -XP_FOLDER=`mktemp -d -p . xp1-XXXXXXXXXXXXXXXX` +XP_NAME=$1 +XP_FOLDER=`mktemp -d -p . ${XP_NAME}-XXXXXXXXXXXXXXXX` XP_ID=`echo $XP_FOLDER|cut -c 3-` cd $XP_FOLDER -COUNT=$1 -INTERVAL=$2 -SIZE=$3 +COUNT=$2 +INTERVAL=$3 +SIZE=$4 ALLOWED_BOOTSTRAP=190 ALLOWED_TIME=`expr $(expr ${COUNT} * ${INTERVAL}) / 1000 + ${ALLOWED_BOOTSTRAP}` echo "Will run for ${ALLOWED_TIME} (count=$1, interval=$2)" @@ -27,7 +28,7 @@ docker run \ -v `pwd`/shared:/home/donar/shared \ -v `pwd`/log:/home/donar/log \ registry.gitlab.inria.fr/qdufour/donar \ - xp1-server & + ${XP_NAME}-server & sleep 10 @@ -40,7 +41,7 @@ docker run \ -v `pwd`/shared:/home/donar/shared \ -v `pwd`/log:/home/donar/log \ registry.gitlab.inria.fr/qdufour/donar \ - xp1-client $COUNT $INTERVAL $SIZE & + ${XP_NAME}-client $COUNT $INTERVAL $SIZE & sleep $ALLOWED_TIME diff --git a/scripts/xp2 b/scripts/xp2 deleted file mode 100755 index cc823f2..0000000 --- a/scripts/xp2 +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# Create workdir -XP_FOLDER=`mktemp -d -p . xp2-XXXXXXXXXXXXXXXX` -XP_ID=`echo $XP_FOLDER|cut -c 3-` -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 -docker run \ - --rm \ - -ti \ - -v `pwd`:/mnt \ - ubuntu \ - bash -c "cd /mnt; mkdir -p ./{shared,log,res}; chown -R 1000 ./{shared,log,res}" - -# Run server -docker run \ - --privileged \ - --rm \ - --name "$XP_ID-server" \ - -v `pwd`/shared:/home/donar/shared \ - -v `pwd`/log:/home/donar/log \ - registry.gitlab.inria.fr/qdufour/donar \ - xp2-server & - -sleep 10 - -# Run client -docker run \ - --privileged \ - --rm \ - --name "$XP_ID-client" \ - -v `pwd`/res:/home/donar/res \ - -v `pwd`/shared:/home/donar/shared \ - -v `pwd`/log:/home/donar/log \ - registry.gitlab.inria.fr/qdufour/donar \ - xp2-client $COUNT $INTERVAL $SIZE & - -sleep $ALLOWED_TIME - -# Kill -docker kill "$XP_ID-client" || true -docker kill "$XP_ID-server" || true