clone-fig9-livenet 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. # Clone the PRAC, 3P-Circuit-ORAM, and Ramen code on the host, not in a
  3. # docker. Run this on the local control machine to get the scripts to
  4. # run the Figure 9 experiments, or on the MPC machines to get the code
  5. # to build and run.
  6. # Does not assume it's running as root. Be sure to have git installed.
  7. # cd into the directory containing this script (from the bash faq 028)
  8. if [[ $BASH_SOURCE = */* ]]; then
  9. cd -- "${BASH_SOURCE%/*}/" || exit
  10. fi
  11. mkdir -p comps
  12. # Clone the given repo or update it
  13. # Args: repo_url dirname branch_or_tag
  14. clone_or_update() {
  15. repourl="$1"
  16. repodir="$2"
  17. tag="$3"
  18. if [ -d comps/${repodir}/.git ]; then
  19. ( cd comps/${repodir} && git fetch --tags -f origin && \
  20. git checkout $tag && git pull ) || exit 1
  21. else
  22. ( cd comps && git clone ${repourl} ${repodir} && cd ${repodir} && \
  23. git checkout $tag ) || exit 1
  24. fi
  25. }
  26. # See if we need to clone those other two repos
  27. clone_or_update \
  28. https://git-crysp.uwaterloo.ca/avadapal/3p-circuit-oram-prac-repro \
  29. circuit-oram master
  30. clone_or_update \
  31. https://git-crysp.uwaterloo.ca/avadapal/ramen-dockerization \
  32. ramen master