build-all-dockers 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. # Use this script to build the five docker images: one for PRAC (our
  3. # work), and one each for Duoram, Floram, 3P Circuit ORAM, and Ramen
  4. # (the four systems we compare against). We made the dockerization
  5. # scripts for these latter systems as well.
  6. # cd into the directory containing this script (from the bash faq 028)
  7. if [[ $BASH_SOURCE = */* ]]; then
  8. cd -- "${BASH_SOURCE%/*}/" || exit
  9. fi
  10. mkdir -p comps
  11. # Clone the given repo or update it
  12. # Args: repo_url dirname branch_or_tag
  13. clone_or_update() {
  14. repourl="$1"
  15. repodir="$2"
  16. tag="$3"
  17. if [ -d comps/${repodir}/.git ]; then
  18. ( cd comps/${repodir} && git fetch --tags -f origin && \
  19. git checkout $tag && git pull ) || exit 1
  20. else
  21. ( cd comps && git clone ${repourl} ${repodir} && cd ${repodir} && \
  22. git checkout $tag ) || exit 1
  23. fi
  24. }
  25. # See if we need to clone those other four repos
  26. clone_or_update \
  27. https://git-crysp.uwaterloo.ca/avadapal/floram-repro-prac \
  28. floram master
  29. clone_or_update \
  30. https://git-crysp.uwaterloo.ca/avadapal/3p-circuit-oram-prac-repro \
  31. circuit-oram master
  32. clone_or_update \
  33. https://git-crysp.uwaterloo.ca/avadapal/ramen-dockerization \
  34. ramen master
  35. clone_or_update \
  36. https://git-crysp.uwaterloo.ca/iang/duoram-prac-repro \
  37. duoram prac_repro
  38. # Stop any existing dockers
  39. ./stop-all-dockers
  40. # Build the five docker images
  41. echo "Building PRAC docker..."
  42. echo
  43. ( cd ../docker && ./build-docker ) || exit 1
  44. echo
  45. echo "Building Duoram docker..."
  46. echo
  47. ( cd comps/duoram/Docker && ./build-docker ) || exit 1
  48. echo
  49. echo "Building Floram docker..."
  50. echo
  51. ( cd comps/floram && ./build-docker ) || exit 1
  52. echo
  53. echo "Building Circuit ORAM docker..."
  54. echo
  55. ( cd comps/circuit-oram/docker && ./build-docker ) || exit 1
  56. echo
  57. echo "Building Ramen docker..."
  58. echo
  59. ( cd comps/ramen/Docker && ./build-docker ) || exit 1
  60. echo
  61. echo "Done."