Browse Source

Support for running experiments over ssh instead of in dockers

Ian Goldberg 5 months ago
parent
commit
b4a6a529a0
2 changed files with 77 additions and 0 deletions
  1. 60 0
      docker/run-experiment-ssh
  2. 17 0
      prac/generate_raw_data_reads_ssh.sh

+ 60 - 0
docker/run-experiment-ssh

@@ -0,0 +1,60 @@
+#!/bin/bash
+
+# Run an experiment using ssh to real hosts, not in dockers
+
+# We need these environment variables set:
+
+# ORAM_SSH_C_USERHOST: the user@host to ssh to for C
+# ORAM_SSH_C_SSHOPTS: any options to ssh you need to ssh to C
+# ORAM_SSH_C_DIR: the directory relative to the homedir where the prac
+#     repo is checked out and built
+
+# ORAM_SSH_D_USERHOST: the user@host to ssh to for D
+# ORAM_SSH_D_SSHOPTS: any options to ssh you need to ssh to D
+# ORAM_SSH_D_IP: the IP address D can listen for connections on
+# ORAM_SSH_D_DIR: the directory relative to the homedir where the prac
+#     repo is checked out and built
+
+# ORAM_SSH_E_USERHOST: the user@host to ssh to for E
+# ORAM_SSH_E_SSHOPTS: any options to ssh you need to ssh to E
+# ORAM_SSH_E_IP: the IP address E can listen for connections on
+# ORAM_SSH_E_DIR: the directory relative to the homedir where the prac
+#     repo is checked out and built
+
+# Get the IP addresses
+Daddr=$ORAM_SSH_D_IP
+Eaddr=$ORAM_SSH_E_IP
+
+# The ORAM size
+size=26
+iters=128
+if [ "$1" != "" ]; then
+    size="$1"
+fi
+if [ "$2" != "" ]; then
+    iters="$2"
+fi
+
+echo ===== Running oram $size $iters
+date "+===== Start %s %F %T"
+
+# Run, saving the output
+savefileC=$$.C.out
+savefileD=$$.D.out
+savefileE=$$.E.out
+ssh -n $ORAM_SSH_C_SSHOPTS $ORAM_SSH_C_USERHOST "cd $ORAM_SSH_C_DIR && perl -lp -i -e 's/addrBits: (\d+)/addrBits: '$size'/; s/iters: (\d+)/iters: '$iters'/' config/config.yaml"
+ssh -n $ORAM_SSH_D_SSHOPTS $ORAM_SSH_D_USERHOST "cd $ORAM_SSH_D_DIR && perl -lp -i -e 's/addrBits: (\d+)/addrBits: '$size'/; s/iters: (\d+)/iters: '$iters'/' config/config.yaml"
+ssh -n $ORAM_SSH_E_SSHOPTS $ORAM_SSH_E_USERHOST "cd $ORAM_SSH_E_DIR && perl -lp -i -e 's/addrBits: (\d+)/addrBits: '$size'/; s/iters: (\d+)/iters: '$iters'/' config/config.yaml"
+ssh -n $ORAM_SSH_E_SSHOPTS $ORAM_SSH_E_USERHOST "cd $ORAM_SSH_E_DIR && $ORAM_NUMA_E stdbuf -o 0 java -cp bin:lib/* ui/CLI -protocol pirrtv -debbie_ip $Daddr -eddie_ip $Eaddr eddie > $savefileE 2>&1" &
+sleep 5
+ssh -n $ORAM_SSH_D_SSHOPTS $ORAM_SSH_D_USERHOST "cd $ORAM_SSH_D_DIR && $ORAM_NUMA_D stdbuf -o 0 java -cp bin:lib/* ui/CLI -protocol pirrtv -debbie_ip $Daddr -eddie_ip $Eaddr debbie > $savefileD 2>&1" &
+sleep 5
+ssh -n $ORAM_SSH_C_SSHOPTS $ORAM_SSH_C_USERHOST "cd $ORAM_SSH_C_DIR && $ORAM_NUMA_C stdbuf -o 0 java -cp bin:lib/* ui/CLI -protocol pirrtv -debbie_ip $Daddr -eddie_ip $Eaddr charlie > $savefileC 2>&1" &
+wait
+echo ===== C output
+ssh -n $ORAM_SSH_C_SSHOPTS $ORAM_SSH_C_USERHOST "cd $ORAM_SSH_C_DIR && cat $savefileC && rm -f $savefileC"
+echo ===== D output
+ssh -n $ORAM_SSH_D_SSHOPTS $ORAM_SSH_D_USERHOST "cd $ORAM_SSH_D_DIR && cat $savefileD && rm -f $savefileD"
+echo ===== E output
+ssh -n $ORAM_SSH_E_SSHOPTS $ORAM_SSH_E_USERHOST "cd $ORAM_SSH_E_DIR && cat $savefileE && rm -f $savefileE"
+date "+===== End %s %F %T"

+ 17 - 0
prac/generate_raw_data_reads_ssh.sh

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