build_devel.sh 1.0 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. #
  3. # This file puts you in a Docker sub-shell where you can build SyntaxNet
  4. # targets. It is intended for development, as the Dockerfile (build file) does
  5. # not actually build any of SyntaxNet, but instead mounts it in a volume.
  6. script_path="$(readlink -f "$0")"
  7. root_path="$(dirname "$(dirname "${script_path}")")"
  8. set -e
  9. if [[ -z "$(docker images -q dragnn-oss)" ]]; then
  10. docker build -t dragnn-oss .
  11. else
  12. echo "NOTE: dragnn-oss image already exists, not re-building." >&2
  13. echo "Please run \`docker build -t dragnn-oss .\` if you need." >&2
  14. fi
  15. echo -e "\n\nRun bazel commands like \`bazel test syntaxnet/...\`"
  16. # NOTE: Unfortunately, we need to mount /tensorflow over /syntaxnet/tensorflow
  17. # (which happens via devel_entrypoint.sh). This requires privileged mode.
  18. syntaxnet_base="/opt/tensorflow/syntaxnet"
  19. docker run --rm -ti \
  20. -v "${root_path}"/syntaxnet:"${syntaxnet_base}"/syntaxnet \
  21. -v "${root_path}"/dragnn:"${syntaxnet_base}"/dragnn \
  22. -v "${root_path}"/examples:"${syntaxnet_base}"/examples \
  23. -p 127.0.0.1:8888:8888 \
  24. dragnn-oss "$@"