build_and_upload_docker.sh 728 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. set -e
  3. # NOTE(alpin): These are the default values for my own machine.
  4. MAX_JOBS=96
  5. NVCC_THREADS=96
  6. while [[ "$#" -gt 0 ]]; do
  7. case $1 in
  8. --max_jobs) MAX_JOBS="$2"; shift ;;
  9. --nvcc_threads) NVCC_THREADS="$2"; shift ;;
  10. *) echo "Unknown parameter passed: $1"; exit 1 ;;
  11. esac
  12. shift
  13. done
  14. DOCKER_BUILDKIT=1 docker build -f Dockerfile . --target aphrodite-openai --tag alpindale/aphrodite-openai \
  15. --build-arg max_jobs=${MAX_JOBS} --build-arg nvcc_threads=${NVCC_THREADS}
  16. commit=$(git rev-parse --short HEAD)
  17. docker tag alpindale/aphrodite-openai alpindale/aphrodite-openai:${commit}
  18. docker push alpindale/aphrodite-openai:${commit}
  19. docker push alpindale/aphrodite-openai:latest