[CI][NPU] use internal HTTP cache for Rust toolchain via RUSTUP_CACHE (#24801)
This commit is contained in:
@@ -102,9 +102,8 @@ jobs:
|
|||||||
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
||||||
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
||||||
RUSTUP_DIST_SERVER: "https://rsproxy.cn"
|
RUSTUP_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local:8082"
|
||||||
RUSTUP_UPDATE_ROOT: "https://rsproxy.cn/rustup"
|
|
||||||
run: |
|
run: |
|
||||||
# speed up by using infra cache services
|
# speed up by using infra cache services
|
||||||
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
||||||
@@ -156,9 +155,8 @@ jobs:
|
|||||||
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
||||||
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
||||||
RUSTUP_DIST_SERVER: "https://rsproxy.cn"
|
RUSTUP_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local:8082"
|
||||||
RUSTUP_UPDATE_ROOT: "https://rsproxy.cn/rustup"
|
|
||||||
run: |
|
run: |
|
||||||
# speed up by using infra cache services
|
# speed up by using infra cache services
|
||||||
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
||||||
@@ -206,9 +204,8 @@ jobs:
|
|||||||
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
||||||
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
||||||
RUSTUP_DIST_SERVER: "https://rsproxy.cn"
|
RUSTUP_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local:8082"
|
||||||
RUSTUP_UPDATE_ROOT: "https://rsproxy.cn/rustup"
|
|
||||||
run: |
|
run: |
|
||||||
# speed up by using infra cache services
|
# speed up by using infra cache services
|
||||||
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
||||||
@@ -257,9 +254,8 @@ jobs:
|
|||||||
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
||||||
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
||||||
RUSTUP_DIST_SERVER: "https://rsproxy.cn"
|
RUSTUP_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local:8082"
|
||||||
RUSTUP_UPDATE_ROOT: "https://rsproxy.cn/rustup"
|
|
||||||
run: |
|
run: |
|
||||||
# speed up by using infra cache services
|
# speed up by using infra cache services
|
||||||
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
||||||
@@ -305,9 +301,8 @@ jobs:
|
|||||||
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
||||||
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
||||||
RUSTUP_DIST_SERVER: "https://rsproxy.cn"
|
RUSTUP_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local:8082"
|
||||||
RUSTUP_UPDATE_ROOT: "https://rsproxy.cn/rustup"
|
|
||||||
run: |
|
run: |
|
||||||
# speed up by using infra cache services
|
# speed up by using infra cache services
|
||||||
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
||||||
@@ -327,25 +322,25 @@ jobs:
|
|||||||
SGLANG_USE_MODELSCOPE: true
|
SGLANG_USE_MODELSCOPE: true
|
||||||
SGLANG_IS_IN_CI: true
|
SGLANG_IS_IN_CI: true
|
||||||
HF_ENDPOINT: https://hf-mirror.com
|
HF_ENDPOINT: https://hf-mirror.com
|
||||||
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
||||||
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
||||||
STREAMS_PER_DEVICE: 32
|
STREAMS_PER_DEVICE: 32
|
||||||
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
||||||
run: |
|
run: |
|
||||||
export PATH="/usr/local/Ascend/8.3.RC1/compiler/bishengir/bin:${PATH}"
|
export PATH="/usr/local/Ascend/8.3.RC1/compiler/bishengir/bin:${PATH}"
|
||||||
cd python
|
cd python
|
||||||
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 1-npu
|
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 1-npu
|
||||||
|
|
||||||
- name: Upload diffusion failure artifacts
|
- name: Upload diffusion failure artifacts
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: diffusion-failures-npu-1-${{ github.run_attempt }}
|
name: diffusion-failures-npu-1-${{ github.run_attempt }}
|
||||||
path: diffusion-failures/
|
path: diffusion-failures/
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
multimodal-gen-test-2-npu-a3:
|
multimodal-gen-test-2-npu-a3:
|
||||||
needs: [check-changes, pr-gate]
|
needs: [check-changes, pr-gate]
|
||||||
if: needs.check-changes.outputs.multimodal_gen == 'true'
|
if: needs.check-changes.outputs.multimodal_gen == 'true'
|
||||||
runs-on: linux-aarch64-a3-16
|
runs-on: linux-aarch64-a3-16
|
||||||
@@ -364,9 +359,8 @@ jobs:
|
|||||||
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
||||||
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
||||||
RUSTUP_DIST_SERVER: "https://rsproxy.cn"
|
RUSTUP_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local:8082"
|
||||||
RUSTUP_UPDATE_ROOT: "https://rsproxy.cn/rustup"
|
|
||||||
run: |
|
run: |
|
||||||
# speed up by using infra cache services
|
# speed up by using infra cache services
|
||||||
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
||||||
@@ -386,25 +380,25 @@ jobs:
|
|||||||
SGLANG_USE_MODELSCOPE: true
|
SGLANG_USE_MODELSCOPE: true
|
||||||
SGLANG_IS_IN_CI: true
|
SGLANG_IS_IN_CI: true
|
||||||
HF_ENDPOINT: https://hf-mirror.com
|
HF_ENDPOINT: https://hf-mirror.com
|
||||||
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
||||||
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
||||||
STREAMS_PER_DEVICE: 32
|
STREAMS_PER_DEVICE: 32
|
||||||
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
||||||
run: |
|
run: |
|
||||||
export PATH="/usr/local/Ascend/8.3.RC1/compiler/bishengir/bin:${PATH}"
|
export PATH="/usr/local/Ascend/8.3.RC1/compiler/bishengir/bin:${PATH}"
|
||||||
cd python
|
cd python
|
||||||
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 2-npu
|
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 2-npu
|
||||||
|
|
||||||
- name: Upload diffusion failure artifacts
|
- name: Upload diffusion failure artifacts
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: diffusion-failures-npu-2-${{ github.run_attempt }}
|
name: diffusion-failures-npu-2-${{ github.run_attempt }}
|
||||||
path: diffusion-failures/
|
path: diffusion-failures/
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
multimodal-gen-test-8-npu-a3:
|
multimodal-gen-test-8-npu-a3:
|
||||||
needs: [check-changes, pr-gate]
|
needs: [check-changes, pr-gate]
|
||||||
if: needs.check-changes.outputs.multimodal_gen == 'true'
|
if: needs.check-changes.outputs.multimodal_gen == 'true'
|
||||||
runs-on: linux-aarch64-a3-8
|
runs-on: linux-aarch64-a3-8
|
||||||
@@ -423,9 +417,8 @@ jobs:
|
|||||||
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
TORCH_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/whl/cpu"
|
||||||
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
PYPI_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
UV_INDEX_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local/pypi/simple"
|
||||||
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
GITHUB_PROXY_URL: "https://gh-proxy.test.osinfra.cn/"
|
||||||
RUSTUP_DIST_SERVER: "https://rsproxy.cn"
|
RUSTUP_CACHE_URL: "http://cache-service.nginx-pypi-cache.svc.cluster.local:8082"
|
||||||
RUSTUP_UPDATE_ROOT: "https://rsproxy.cn/rustup"
|
|
||||||
run: |
|
run: |
|
||||||
# speed up by using infra cache services
|
# speed up by using infra cache services
|
||||||
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
CACHING_URL="cache-service.nginx-pypi-cache.svc.cluster.local"
|
||||||
@@ -445,24 +438,24 @@ jobs:
|
|||||||
SGLANG_USE_MODELSCOPE: true
|
SGLANG_USE_MODELSCOPE: true
|
||||||
SGLANG_IS_IN_CI: true
|
SGLANG_IS_IN_CI: true
|
||||||
HF_ENDPOINT: https://hf-mirror.com
|
HF_ENDPOINT: https://hf-mirror.com
|
||||||
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
TORCH_EXTENSIONS_DIR: /tmp/torch_extensions
|
||||||
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
PYTORCH_NPU_ALLOC_CONF: "expandable_segments:True"
|
||||||
STREAMS_PER_DEVICE: 32
|
STREAMS_PER_DEVICE: 32
|
||||||
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
SGLANG_DIFFUSION_ARTIFACT_DIR: ${{ github.workspace }}/diffusion-failures
|
||||||
run: |
|
run: |
|
||||||
cd python
|
cd python
|
||||||
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 8-npu
|
python3 sglang/multimodal_gen/test/run_suite_npu.py --suite 8-npu
|
||||||
|
|
||||||
- name: Upload diffusion failure artifacts
|
- name: Upload diffusion failure artifacts
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: diffusion-failures-npu-8-${{ github.run_attempt }}
|
name: diffusion-failures-npu-8-${{ github.run_attempt }}
|
||||||
path: diffusion-failures/
|
path: diffusion-failures/
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
pr-test-npu-finish:
|
pr-test-npu-finish:
|
||||||
needs:
|
needs:
|
||||||
[
|
[
|
||||||
check-changes,
|
check-changes,
|
||||||
|
|||||||
@@ -4,8 +4,12 @@
|
|||||||
# setuptools-rust. Minimum supported version is 1.85 (edition 2024).
|
# setuptools-rust. Minimum supported version is 1.85 (edition 2024).
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
# Pick up cargo if rustup was installed in a previous CI step.
|
# Make cargo/rustc visible to the rest of this shell and to subsequent
|
||||||
|
# GitHub Actions steps in the same job.
|
||||||
export PATH="${CARGO_HOME:-$HOME/.cargo}/bin:${PATH}"
|
export PATH="${CARGO_HOME:-$HOME/.cargo}/bin:${PATH}"
|
||||||
|
if [ -n "${GITHUB_PATH:-}" ]; then
|
||||||
|
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> "${GITHUB_PATH}"
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v cargo >/dev/null 2>&1 && command -v rustc >/dev/null 2>&1; then
|
if command -v cargo >/dev/null 2>&1 && command -v rustc >/dev/null 2>&1; then
|
||||||
echo "rust already installed: $(rustc --version), $(cargo --version)"
|
echo "rust already installed: $(rustc --version), $(cargo --version)"
|
||||||
@@ -27,14 +31,25 @@ if ! command -v curl >/dev/null 2>&1; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl --proto '=https' --tlsv1.2 --retry 3 --retry-delay 2 -sSf https://sh.rustup.rs \
|
if [ -n "${RUSTUP_CACHE_URL:-}" ]; then
|
||||||
| sh -s -- -y --no-modify-path
|
# An in-cluster HTTP mirror is available (e.g. on NPU runners).
|
||||||
|
export RUSTUP_DIST_SERVER="${RUSTUP_CACHE_URL}/rustup"
|
||||||
# Make cargo/rustc visible to the rest of this shell and to subsequent
|
export RUSTUP_UPDATE_ROOT="${RUSTUP_CACHE_URL}/rustup/rustup"
|
||||||
# GitHub Actions steps in the same job.
|
case "$(uname -m)" in
|
||||||
export PATH="${CARGO_HOME:-$HOME/.cargo}/bin:${PATH}"
|
x86_64) RUSTUP_ARCH="x86_64-unknown-linux-gnu" ;;
|
||||||
if [ -n "${GITHUB_PATH:-}" ]; then
|
aarch64) RUSTUP_ARCH="aarch64-unknown-linux-gnu" ;;
|
||||||
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> "${GITHUB_PATH}"
|
*) echo "ERROR: unsupported arch $(uname -m)"; exit 1 ;;
|
||||||
|
esac
|
||||||
|
RUSTUP_TMP="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "${RUSTUP_TMP}"' EXIT
|
||||||
|
curl --retry 3 --retry-delay 2 -sSfL \
|
||||||
|
"${RUSTUP_UPDATE_ROOT}/dist/${RUSTUP_ARCH}/rustup-init" \
|
||||||
|
-o "${RUSTUP_TMP}/rustup-init"
|
||||||
|
chmod +x "${RUSTUP_TMP}/rustup-init"
|
||||||
|
"${RUSTUP_TMP}/rustup-init" -y --no-modify-path
|
||||||
|
else
|
||||||
|
curl --proto '=https' --tlsv1.2 --retry 3 --retry-delay 2 -sSf https://sh.rustup.rs \
|
||||||
|
| sh -s -- -y --no-modify-path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rustc --version
|
rustc --version
|
||||||
|
|||||||
Reference in New Issue
Block a user