Procházet zdrojové kódy

Support for running experiments over ssh instead of in dockers

Ian Goldberg před 6 měsíci
rodič
revize
22a5917a40
2 změnil soubory, kde provedl 76 přidání a 0 odebrání
  1. 57 0
      Docker/run-experiment-ssh
  2. 19 0
      repro/generate_raw_data_reads_ssh.sh

+ 57 - 0
Docker/run-experiment-ssh

@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# Run an experiment using ssh to real hosts, not in dockers
+
+# We need these environment variables set:
+
+# RAMEN_SSH_P0_USERHOST: the user@host to ssh to for P0
+# RAMEN_SSH_P0_SSHOPTS: any options to ssh you need to ssh to P0
+# RAMEN_SSH_P0_IP: the IP address P0 can listen for connections on
+# RAMEN_SSH_P0_DIR: the directory relative to the homedir where the prac
+#     repo is checked out and built
+
+# RAMEN_SSH_P1_USERHOST: the user@host to ssh to for P1
+# RAMEN_SSH_P1_SSHOPTS: any options to ssh you need to ssh to P1
+# RAMEN_SSH_P1_IP: the IP address P1 can listen for connections on
+# RAMEN_SSH_P1_DIR: the directory relative to the homedir where the prac
+#     repo is checked out and built
+
+# RAMEN_SSH_P2_USERHOST: the user@host to ssh to for P2
+# RAMEN_SSH_P2_SSHOPTS: any options to ssh you need to ssh to P2
+# RAMEN_SSH_P2_IP: the IP address P2 can listen for connections on
+# RAMEN_SSH_P2_DIR: the directory relative to the homedir where the prac
+#     repo is checked out and built
+
+# Get the IP addresses
+p0addr=$RAMEN_SSH_P0_IP
+p1addr=$RAMEN_SSH_P1_IP
+p2addr=$RAMEN_SSH_P2_IP
+
+lognitems=20
+naccess=10
+
+if [ "$1" != "" ]; then
+    lognitems="$1"
+fi
+if [ "$2" != "" ]; then
+    naccess="$2"
+fi
+
+echo ===== Running ramen $lognitems $naccess
+date "+===== Start %s %F %T"
+
+savefile0=$$.p0.out
+savefile1=$$.p1.out
+savefile2=$$.p2.out
+
+ssh -n $RAMEN_SSH_P2_SSHOPTS $RAMEN_SSH_P2_USERHOST "cd $RAMEN_SSH_P2_DIR && $RAMEN_NUMA_P2 stdbuf -o 0 ./target/release/examples/bench_doram -a $naccess -i 2 -s $lognitems -l 0.0.0.0 -p 6000 -c 0:$p0addr:8000 --connect-timeout-seconds 30 > $savefile2 2>&1" &
+ssh -n $RAMEN_SSH_P1_SSHOPTS $RAMEN_SSH_P1_USERHOST "cd $RAMEN_SSH_P1_DIR && $RAMEN_NUMA_P1 stdbuf -o 0 ./target/release/examples/bench_doram -a $naccess -i 1 -s $lognitems -l 0.0.0.0 -p 7000 -c 2:$p2addr:6000 --connect-timeout-seconds 30 > $savefile1 2>&1" &
+ssh -n $RAMEN_SSH_P0_SSHOPTS $RAMEN_SSH_P0_USERHOST "cd $RAMEN_SSH_P0_DIR && $RAMEN_NUMA_P0 stdbuf -o 0 ./target/release/examples/bench_doram -a $naccess -i 0 -s $lognitems -l 0.0.0.0 -p 8000 -c 1:$p1addr:7000 --connect-timeout-seconds 30 > $savefile0 2>&1" &
+wait
+echo ===== P0 output
+ssh -n $RAMEN_SSH_P0_SSHOPTS $RAMEN_SSH_P0_USERHOST "cd $RAMEN_SSH_P0_DIR && cat $savefile0 && rm -f $savefile0"
+echo ===== P1 output
+ssh -n $RAMEN_SSH_P1_SSHOPTS $RAMEN_SSH_P1_USERHOST "cd $RAMEN_SSH_P1_DIR && cat $savefile1 && rm -f $savefile1"
+echo ===== P2 output
+ssh -n $RAMEN_SSH_P2_SSHOPTS $RAMEN_SSH_P2_USERHOST "cd $RAMEN_SSH_P2_DIR && cat $savefile2 && rm -f $savefile2"
+date "+===== End %s %F %T"

+ 19 - 0
repro/generate_raw_data_reads_ssh.sh

@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Usage: ./generate_raw_data_reads_ssh.sh [niters]
+
+nitrs=1
+if [ "$1" != "" ]; then
+    nitrs="$1"
+fi
+
+cd ..
+mkdir -p repro/data
+for itr in $(seq 1 $nitrs); do
+    for no in 1 2 3 4 6 8 10; do
+        n=$((no*48))
+        now=`date`; echo "$now: Running $n reads on size 2^9 ..."
+        Docker/run-experiment-ssh 9 ${n} >> repro/data/log_9_${n}_reads.out
+    done
+done
+