Add run-2 script

This commit is contained in:
Quentin 2019-05-15 15:53:09 +02:00
parent 772960b67c
commit c3ca830601

View file

@ -1,49 +1,79 @@
#!/bin/bash
WAITFOR=2280 # 38min
echo "Spawn containers..."
for i in {1..10}; do
echo "Create output folder..."
docker run \
--rm \
--user root \
-v `pwd`/out:/home/donar \
registry.gitlab.inria.fr/qdufour/donar \
chown -R 1000:1000 /home/donar
for i in {1..7}; do
echo "Spawning container $i..."
docker run \
--rm \
-d \
--name "donarxp-server-${i}" \
-v `pwd`/shared:/home/donar/shared \
--name "donarxp_server_${i}" \
-e HOME='/tmp' \
-v `pwd`/out:/home/donar \
registry.gitlab.inria.fr/qdufour/donar \
tor -f /etc/torrc
docker run \
--rm \
-d \
--name "donarxp-client-${i}" \
-v `pwd`/shared:/home/donar/shared \
--name "donarxp_client_${i}" \
-e HOME='/tmp' \
-v `pwd`/out:/home/donar \
registry.gitlab.inria.fr/qdufour/donar \
tor -f /etc/torrc
docker ps
done
sleep 10
echo "Run xp..."
for i in j {1..100}; do
for j in {1..100}; do
echo "Run xp $j..."
run_fold=`mktemp -up . XXXXXXXXXXXXXXXX`
echo "Reset containers... As tor has PID 1, it is not affected by kill -9"
for i in {1..10}; do
docker exec donarxp-client-${i} bash -c 'ls /proc|grep -Po "^\d+$"|while read p; do kill -9 $p; done'
docker exec donarxp-server-${i} bash -c 'ls /proc|grep -Po "^\d+$"|while read p; do kill -9 $p; done'
echo "Reset containers..."
for i in {1..7}; do
docker exec donarxp_client_${i} sh -c 'killall -9 bash; killall -9 donar; killall -9 measlat; killall -9 udpecho'
docker exec donarxp_server_${i} sh -c 'killall -9 bash; killall -9 donar; killall -9 measlat; killall -9 udpecho'
done
echo "Launch servers..."
docker exec donarxp-server-2 rrhr-server ${run_fold}-rrhr-2 &
docker exec donarxp-server-3 dup2-server ${run_fold}-dup2-3 &
docker exec donarxp_server_2 rrhr-server ${run_fold}-rrhr-2 &
docker exec donarxp_server_3 dup2-server ${run_fold}-dup2-3 &
docker exec donarxp_server_4 rrhr-server ${run_fold}-rrhr-4 &
docker exec donarxp_server_5 dup2-server ${run_fold}-dup2-5 &
docker exec donarxp_server_4 rrhr-server ${run_fold}-rrhr-6 &
docker exec donarxp_server_5 dup2-server ${run_fold}-dup2-7 &
sleep 10
echo "Launch measures..."
timeout $WAITFOR bash <<EOF
docker exec donarxp-client-1 witness2-client 6000 100 100 ${run_fold}-witness2-1 &
docker exec donarxp_client_1 witness2-client 6000 100 100 ${run_fold}-witness2-1 &
sleep 10
docker exec donarxp-client-2 rrhr-client 6000 100 100 ${run_fold}-rhhr-2 &
docker exec donarxp_client_2 rrhr-client 6000 100 100 ${run_fold}-rrhr-2 &
sleep 10
docker exec donarxp-client-3 dup2-client 6000 100 100 ${run_fold}-dup2-3 &
docker exec donarxp_client_3 dup2-client 6000 100 100 ${run_fold}-dup2-3 &
sleep 10
docker exec donarxp_client_4 rrhr-client 6000 100 100 ${run_fold}-rrhr-4 &
sleep 10
docker exec donarxp_client_5 dup2-client 6000 100 100 ${run_fold}-dup2-5 &
sleep 10
docker exec donarxp_client_6 rrhr-client 6000 100 100 ${run_fold}-rrhr-6 &
sleep 10
docker exec donarxp_client_7 dup2-client 6000 100 100 ${run_fold}-dup2-7 &
wait;
EOF
done
echo "Unspawn containers..."
for i in {1..7}; do
docker kill "donarxp_server_${i}"
docker kill "donarxp_client_${i}"
done