download-server.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env bash
  2. # Licensed to the Apache Software Foundation (ASF) under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. The ASF licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. ## @description start download server
  18. ## @audience public
  19. ## @stability stable
  20. function start_download_server()
  21. {
  22. if [[ "$DOWNLOAD_SERVER_IP" != "$LOCAL_HOST_IP" ]]; then
  23. echo -e "\033[31mERROR: Only $DOWNLOAD_SERVER_IP can start the download service.\033[0m"
  24. return 1
  25. fi
  26. echo -e "You can put the install package file in the \033[34m${DOWNLOAD_DIR}\033[0m folder first, Or automatic download."
  27. echo -n "Do you want to start download http server?[y|n]"
  28. read myselect
  29. if [[ "$myselect" = "y" || "$myselect" = "Y" ]]
  30. then
  31. download_etcd_bin
  32. download_calico_bin
  33. download_docker_rpm
  34. download_nvidia_driver
  35. download_nvidia_docker_bin
  36. download_yarn_container_executor
  37. python -m SimpleHTTPServer ${DOWNLOAD_SERVER_PORT}
  38. fi
  39. }