run-experiment 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # Get the IP addresses
  3. Daddr=$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' oram_D)
  4. Eaddr=$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' oram_E)
  5. # The ORAM size
  6. size=26
  7. iters=128
  8. if [ "$1" != "" ]; then
  9. size="$1"
  10. fi
  11. if [ "$2" != "" ]; then
  12. iters="$2"
  13. fi
  14. echo ===== Running oram $size $iters
  15. date "+===== Start %s %F %T"
  16. # Run, saving the output
  17. savefileC=$$.C.out
  18. savefileD=$$.D.out
  19. savefileE=$$.E.out
  20. docker exec -w /root/oram oram_C bash -c "perl -lp -i -e 's/addrBits: (\d+)/addrBits: '$size'/; s/iters: (\d+)/iters: '$iters'/' config/config.yaml"
  21. docker exec -w /root/oram oram_D bash -c "perl -lp -i -e 's/addrBits: (\d+)/addrBits: '$size'/; s/iters: (\d+)/iters: '$iters'/' config/config.yaml"
  22. docker exec -w /root/oram oram_E bash -c "perl -lp -i -e 's/addrBits: (\d+)/addrBits: '$size'/; s/iters: (\d+)/iters: '$iters'/' config/config.yaml"
  23. docker exec -w /root/oram oram_E bash -c "$ORAM_NUMA_E stdbuf -o 0 java -cp bin:lib/* ui/CLI -protocol pirrtv -debbie_ip $Daddr -eddie_ip $Eaddr eddie > $savefileE 2>&1" &
  24. sleep 2
  25. docker exec -w /root/oram oram_D bash -c "$ORAM_NUMA_D stdbuf -o 0 java -cp bin:lib/* ui/CLI -protocol pirrtv -debbie_ip $Daddr -eddie_ip $Eaddr debbie > $savefileD 2>&1" &
  26. sleep 2
  27. docker exec -w /root/oram oram_C bash -c "$ORAM_NUMA_C stdbuf -o 0 java -cp bin:lib/* ui/CLI -protocol pirrtv -debbie_ip $Daddr -eddie_ip $Eaddr charlie > $savefileC 2>&1" &
  28. wait
  29. echo ===== C output
  30. docker exec -w /root/oram oram_C cat $savefileC
  31. docker exec -w /root/oram oram_C rm -f $savefileC
  32. echo ===== D output
  33. docker exec -w /root/oram oram_D cat $savefileD
  34. docker exec -w /root/oram oram_D rm -f $savefileD
  35. echo ===== E output
  36. docker exec -w /root/oram oram_E cat $savefileE
  37. docker exec -w /root/oram oram_E rm -f $savefileE
  38. date "+===== End %s %F %T"