diff --git a/18_experiment_ss_overhead.sh b/18_experiment_ss_overhead.sh index 985216b..0e6eb8e 100755 --- a/18_experiment_ss_overhead.sh +++ b/18_experiment_ss_overhead.sh @@ -1,3 +1,3 @@ #!/bin/bash -./run_clients_distributed.sh ../odin/hosts.txt 3 6 11 NO_OP +./run_clients_distributed.sh ../odin/hosts.txt 2 9 8 NO_OP diff --git a/experiment_ss_overhead.sh b/experiment_ss_overhead.sh index ff443a9..6fd5adb 100755 --- a/experiment_ss_overhead.sh +++ b/experiment_ss_overhead.sh @@ -5,4 +5,4 @@ if [ "$#" -ne 1 ]; then exit 1 fi -./run_clients_distributed.sh ../odin/hosts.txt $1 6 34 NO_OP +./run_clients_distributed.sh ../odin/hosts.txt $1 6 34 APPEND diff --git a/experiment_ss_overhead_aws.sh b/experiment_ss_overhead_aws.sh new file mode 100755 index 0000000..ece605c --- /dev/null +++ b/experiment_ss_overhead_aws.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [ "$#" -ne 1 ]; then + echo "Run as ./experiment_ss_overhead [scale_factor]" + exit 1 +fi + +./run_clients_distributed_aws.sh ../odin/hosts.txt $1 6 34 NO_OP diff --git a/run_clients_distributed.sh b/run_clients_distributed.sh index e3aa5ff..1058d25 100755 --- a/run_clients_distributed.sh +++ b/run_clients_distributed.sh @@ -16,6 +16,7 @@ do ID=$(echo $line | tr ',' ' ' | awk '{print $1}') HOST=$(echo $line | tr ',' ' ' | awk '{print $2}') CMD="cd /practicalbft/BFTList-client && source ./env/bin/activate && HOSTS_PATH=/practicalbft/BFTList/conf/hosts.txt python client/client.py $ID $3 $4 $2 $5" + echo $CMD echo "Launcher ==> Launching client on ${HOST}" ssh -o StrictHostKeyChecking=no -l ${SLICE:-$DEF_SLICE} -i ${SSH_KEY:-$DEF_SSH_KEY} ${HOST} ${CMD} &> /dev/null & pids[${ID}]=$! diff --git a/run_clients_distributed_aws.sh b/run_clients_distributed_aws.sh new file mode 100755 index 0000000..8362586 --- /dev/null +++ b/run_clients_distributed_aws.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# NOTE that nbr_of_clients must be a multiple of the number of nodes + +if [ "$#" -ne 5 ]; then + echo "Run as SLICE=slice_name SSH_KEY=abs_path_to_ssh_key ./run_clients [abs_path_to_hosts_file] [scale_factor] [nbr_of_clients] [reqs_per_client] [operation]" + exit 1 +fi + +DEF_SLICE=ec2-user +DEF_SSH_KEY=~/.ssh/aws_bftlist.pem + +echo "Launcher ==> Launching clients on AWS nodes" +declare -a pids +cat $1 | awk "NR % $2 == 0" | tr ',' ' ' | awk '{print $1","$2}' | while read line +do + ID=$(echo $line | tr ',' ' ' | awk '{print $1}') + HOST=$(echo $line | tr ',' ' ' | awk '{print $2}') + CMD="cd /practicalbft/BFTList-client && source ./env/bin/activate && HOSTS_PATH=/practicalbft/BFTList/conf/hosts.txt python client/client.py $ID $3 $4 $2 $5" + echo $CMD + echo "Launcher ==> Launching client on ${HOST}" + ssh -o StrictHostKeyChecking=no -l ${SLICE:-$DEF_SLICE} -i ${SSH_KEY:-$DEF_SSH_KEY} ${HOST} ${CMD} &> /dev/null & + # ssh -o StrictHostKeyChecking=no -l ${SLICE:-$DEF_SLICE} -i ${SSH_KEY:-$DEF_SSH_KEY} ${HOST} ${CMD} + pids[${ID}]=$! +done +echo "Launcher ==> Clients launched on PlanetLab nodes!"