You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ci_container_test.sh 2.2 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. if [ "$MODELSCOPE_SDK_DEBUG" == "True" ]; then
  2. pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
  3. pip install -r requirements/tests.txt
  4. git config --global --add safe.directory /Maas-lib
  5. git config --global user.email tmp
  6. git config --global user.name tmp.com
  7. # linter test
  8. # use internal project for pre-commit due to the network problem
  9. if [ `git remote -v | grep alibaba | wc -l` -gt 1 ]; then
  10. pre-commit run -c .pre-commit-config_local.yaml --all-files
  11. if [ $? -ne 0 ]; then
  12. echo "linter test failed, please run 'pre-commit run --all-files' to check"
  13. echo "From the repository folder"
  14. echo "Run 'pip install -r requirements/tests.txt' install test dependencies."
  15. echo "Run 'pre-commit install' install pre-commit hooks."
  16. echo "Finally run linter with command: 'pre-commit run --all-files' to check."
  17. echo "Ensure there is no failure!!!!!!!!"
  18. exit -1
  19. fi
  20. fi
  21. awk -F: '/^[^#]/ { print $1 }' requirements/framework.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  22. awk -F: '/^[^#]/ { print $1 }' requirements/audio.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  23. awk -F: '/^[^#]/ { print $1 }' requirements/cv.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  24. awk -F: '/^[^#]/ { print $1 }' requirements/multi-modal.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  25. awk -F: '/^[^#]/ { print $1 }' requirements/nlp.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  26. awk -F: '/^[^#]/ { print $1 }' requirements/science.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  27. # test with install
  28. python setup.py install
  29. else
  30. echo "Running case in release image, run case directly!"
  31. fi
  32. if [ $# -eq 0 ]; then
  33. ci_command="python tests/run.py --subprocess"
  34. else
  35. ci_command="$@"
  36. fi
  37. echo "Running case with command: $ci_command"
  38. $ci_command