diff --git a/.dev_scripts/ci_container_test.sh b/.dev_scripts/ci_container_test.sh index 004d6537bb..48ac8dab23 100644 --- a/.dev_scripts/ci_container_test.sh +++ b/.dev_scripts/ci_container_test.sh @@ -1,6 +1,6 @@ if [ "$MODELSCOPE_SDK_DEBUG" == "True" ]; then - # pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple - pip install -r requirements/tests.txt -i https://mirrors.aliyun.com/pypi/simple/ + pip install uv + uv pip install -r requirements/tests.txt git config --global --add safe.directory /ms-swift git config --global user.email tmp git config --global user.name tmp.com @@ -20,17 +20,17 @@ if [ "$MODELSCOPE_SDK_DEBUG" == "True" ]; then fi fi - pip install -r requirements/framework.txt -U -i https://mirrors.aliyun.com/pypi/simple/ - pip install decord einops -U -i https://mirrors.aliyun.com/pypi/simple/ + uv pip install -r requirements/framework.txt -U + uv pip install decord einops -U pip uninstall autoawq -y - pip install optimum - pip install diffusers - pip install "transformers<5.0" + uv pip install optimum + uv pip install diffusers + uv pip install "transformers<5.0" # pip install autoawq -U --no-deps # test with install - pip install . - pip install auto_gptq bitsandbytes deepspeed -U -i https://mirrors.aliyun.com/pypi/simple/ + uv pip install . + uv pip install auto_gptq bitsandbytes deepspeed -U else echo "Running case in release image, run case directly!" fi diff --git a/.dev_scripts/dockerci.sh b/.dev_scripts/dockerci.sh index f42e819fb4..db59227dca 100644 --- a/.dev_scripts/dockerci.sh +++ b/.dev_scripts/dockerci.sh @@ -49,6 +49,11 @@ do -e MODEL_TAG_URL=$MODEL_TAG_URL \ -e MODELSCOPE_API_TOKEN=$MODELSCOPE_API_TOKEN \ -e PR_CHANGED_FILES=$PR_CHANGED_FILES \ + -e UV_INDEX_URL=$UV_INDEX_URL \ + -e UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL \ + -e UV_INDEX_STRATEGY=$UV_INDEX_STRATEGY \ + -e UV_NO_CACHE=$UV_NO_CACHE \ + -e UV_SYSTEM_PYTHON=$UV_SYSTEM_PYTHON \ --workdir=$CODE_DIR_IN_CONTAINER \ ${IMAGE_NAME}:${IMAGE_VERSION} \ $CI_COMMAND @@ -73,6 +78,11 @@ do -e MODEL_TAG_URL=$MODEL_TAG_URL \ -e MODELSCOPE_API_TOKEN=$MODELSCOPE_API_TOKEN \ -e PR_CHANGED_FILES=$PR_CHANGED_FILES \ + -e UV_INDEX_URL=$UV_INDEX_URL \ + -e UV_EXTRA_INDEX_URL=$UV_EXTRA_INDEX_URL \ + -e UV_INDEX_STRATEGY=$UV_INDEX_STRATEGY \ + -e UV_NO_CACHE=$UV_NO_CACHE \ + -e UV_SYSTEM_PYTHON=$UV_SYSTEM_PYTHON \ --workdir=$CODE_DIR_IN_CONTAINER \ ${IMAGE_NAME}:${IMAGE_VERSION} \ $CI_COMMAND diff --git a/.github/workflows/citest.yaml b/.github/workflows/citest.yaml index 101e9f3b1a..447e945df9 100644 --- a/.github/workflows/citest.yaml +++ b/.github/workflows/citest.yaml @@ -71,6 +71,12 @@ jobs: run: git lfs checkout - name: Run unittest shell: bash + env: + UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple" + UV_EXTRA_INDEX_URL: "https://mirrors.huaweicloud.com/ascend/repos/pypi" + UV_INDEX_STRATEGY: "unsafe-best-match" + UV_NO_CACHE: 1 + UV_SYSTEM_PYTHON: 1 run: | set -e source /mnt/modelscope/ci_env.sh diff --git a/.github/workflows/citest_npu.yaml b/.github/workflows/citest_npu.yaml index eb30bcc2c2..71237be96c 100644 --- a/.github/workflows/citest_npu.yaml +++ b/.github/workflows/citest_npu.yaml @@ -43,12 +43,17 @@ jobs: timeout-minutes: 240 container: image: 'ascendai/cann:8.3.rc2-910b-ubuntu22.04-py3.11' + env: + UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple" + UV_EXTRA_INDEX_URL: "https://mirrors.huaweicloud.com/ascend/repos/pypi" + UV_INDEX_STRATEGY: "unsafe-best-match" + UV_NO_CACHE: 1 + UV_SYSTEM_PYTHON: 1 steps: - name: Config mirrors run: | sed -Ei 's@(ports|archive).ubuntu.com@cache-service.nginx-pypi-cache.svc.cluster.local:8081@g' /etc/apt/sources.list - pip config set global.index-url http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple - pip config set global.trusted-host cache-service.nginx-pypi-cache.svc.cluster.local + pip install uv - name: Checkout uses: actions/checkout@v3