Add prefix to run multiple xp in parallel
This commit is contained in:
parent
4027b8ef75
commit
a3c41400ec
1 changed files with 13 additions and 12 deletions
|
@ -5,6 +5,7 @@
|
|||
|
||||
die() { echo "$*" 1>&2 ; exit 1; }
|
||||
|
||||
DOCKNAME=`mktemp -u XXXXX`
|
||||
WAITFOR=7200 # 2 hours
|
||||
|
||||
# SPLIT CLIENT AND SERVER TARGETS
|
||||
|
@ -54,14 +55,14 @@ echo "__reset containers"
|
|||
for i in $(seq 0 $(expr $instances - 1)); do
|
||||
|
||||
echo "____clear $i"
|
||||
docker container inspect donarxp_server_${i} > /dev/null 2>&1 && docker kill donarxp_server_${i}
|
||||
docker container inspect donarxp_client_${i} > /dev/null 2>&1 && docker kill donarxp_client_${i}
|
||||
docker container inspect ${DOCKNAME}_donarxp_server_${i} > /dev/null 2>&1 && docker kill ${DOCKNAME}_donarxp_server_${i}
|
||||
docker container inspect ${DOCKNAME}_donarxp_client_${i} > /dev/null 2>&1 && docker kill ${DOCKNAME}_donarxp_client_${i}
|
||||
|
||||
echo "____spawning container for instance=$i..."
|
||||
docker run \
|
||||
--rm \
|
||||
-d \
|
||||
--name "donarxp_server_${i}" \
|
||||
--name "${DOCKNAME}_donarxp_server_${i}" \
|
||||
--privileged \
|
||||
--cap-add=SYS_PTRACE \
|
||||
--security-opt seccomp=unconfined \
|
||||
|
@ -76,15 +77,15 @@ for i in $(seq 0 $(expr $instances - 1)); do
|
|||
--privileged \
|
||||
--cap-add=SYS_PTRACE \
|
||||
--security-opt seccomp=unconfined \
|
||||
--name "donarxp_client_${i}" \
|
||||
--name "${DOCKNAME}_donarxp_client_${i}" \
|
||||
-e HOME='/tmp' \
|
||||
-v `pwd`/out:/home/donar/out \
|
||||
registry.gitlab.inria.fr/qdufour/donar \
|
||||
${TOR_DAEMON_CLIENT[$i]}
|
||||
|
||||
echo "____create folder struct..."
|
||||
docker exec donarxp_client_${i} sh -c "mkdir -p $run_fold-$i; echo repeat=$REPEAT,identifier=$IDENTIFIER > $run_fold-$i/info.txt"
|
||||
docker exec donarxp_client_${i} sh -c "echo instance=$i - server=${SERVER_TARGETS[$i]} - client=${CLIENT_TARGETS[$i]} - tor server=${TOR_DAEMON_SERVER[$i]} - tor client=${TOR_DAEMON_CLIENT[$i]}>> $run_fold-$i/info.txt"
|
||||
docker exec ${DOCKNAME}_donarxp_client_${i} sh -c "mkdir -p $run_fold-$i; echo repeat=$REPEAT,identifier=$IDENTIFIER > $run_fold-$i/info.txt"
|
||||
docker exec ${DOCKNAME}_donarxp_client_${i} sh -c "echo instance=$i - server=${SERVER_TARGETS[$i]} - client=${CLIENT_TARGETS[$i]} - tor server=${TOR_DAEMON_SERVER[$i]} - tor client=${TOR_DAEMON_CLIENT[$i]}>> $run_fold-$i/info.txt"
|
||||
done
|
||||
|
||||
sleep 10
|
||||
|
@ -92,7 +93,7 @@ sleep 10
|
|||
echo "__launch servers"
|
||||
for i in $(seq 0 $(expr $instances - 1)); do
|
||||
echo " instance=$i - exec=${SERVER_TARGETS[$i]}"
|
||||
docker exec donarxp_server_$i ${SERVER_TARGETS[$i]} ${run_fold}-$i &
|
||||
docker exec ${DOCKNAME}_donarxp_server_$i ${SERVER_TARGETS[$i]} ${run_fold}-$i &
|
||||
sleep 1
|
||||
done
|
||||
|
||||
|
@ -103,15 +104,15 @@ echo "__launch clients"
|
|||
(sleep $WAITFOR; echo " timeout"; kill -9 $subshellpid) &
|
||||
(for i in $(seq 0 $(expr $instances - 1)); do
|
||||
echo " instance=$i - exec=${CLIENT_TARGETS[$i]}"
|
||||
docker exec donarxp_client_$i ${CLIENT_TARGETS[$i]} ${run_fold}-$i &
|
||||
docker exec ${DOCKNAME}_donarxp_client_$i ${CLIENT_TARGETS[$i]} ${run_fold}-$i &
|
||||
sleep 1
|
||||
done;
|
||||
wait;
|
||||
echo " ok";
|
||||
|
||||
for i in $(seq 0 $(expr $instances - 1)); do
|
||||
docker exec donarxp_client_${i} killall -15 donar;
|
||||
docker exec donarxp_server_${i} killall -15 donar;
|
||||
docker exec ${DOCKNAME}_donarxp_client_${i} killall -15 donar;
|
||||
docker exec ${DOCKNAME}_donarxp_server_${i} killall -15 donar;
|
||||
done;
|
||||
|
||||
kill -15 $subshellpid
|
||||
|
@ -124,6 +125,6 @@ done
|
|||
echo ":: Clear Resources"
|
||||
for i in $(seq 0 $(expr $instances - 1)); do
|
||||
echo "clear $i"
|
||||
docker kill "donarxp_server_${i}"
|
||||
docker kill "donarxp_client_${i}"
|
||||
docker kill "${DOCKNAME}_donarxp_server_${i}"
|
||||
docker kill "${DOCKNAME}_donarxp_client_${i}"
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue