install_torchserver.sh 1.2 KB

1234567891011121314151617181920
  1. #!/bin/sh
  2. {
  3. git clone https://github.com/pytorch/serve.git
  4. # if git clone takes to long time, you should change etc/hosts refer to https://blog.csdn.net/qq_47911262/article/details/121918174:
  5. } || {
  6. echo "git clone https://github.com/pytorch/serve.git failed 🤢🤢🤢"
  7. }
  8. echo "git clone https://github.com/pytorch/serve.git successfully 😊😊😊"
  9. cd serve/docker &&
  10. echo "cd server/docker..." &&
  11. # -h, --help Show script help
  12. # -b, --branch_name Specify a branch name to use. Default: master
  13. # -g, --gpu Build image with GPU based ubuntu base image
  14. # -bt, --buildtype Which type of docker image to build. Can be one of : production(default), dev, codebuild
  15. # -t, --tag Tag name for image. If not specified, script uses torchserve default tag names.
  16. # -cv, --cudaversion Specify to cuda version to use. Supported values cu92, cu101, cu102, cu111, cu113. Default cu102
  17. # --codebuild Set if you need AWS CodeBuild(https://aws.amazon.com/cn/codebuild/)
  18. echo "./build_image.sh -g -cv cu111 -t torchserve:cuda11-1.0 -bt production -b master ..." &&
  19. ./build_image.sh -g -cv cu111 -t torchserve:1.0 -bt production -b master &&
  20. echo "install torcher_server docker finally ~"