SIGN IN SIGN UP

[CI] Route doctest pip/apt traffic through in-cluster cache service (#15167)

## What this PR does / why we need it?

The doctest (`002-pip-binary-installation-test.sh`) that installs
vllm-ascend from PyPI was downloading Ascend packages (e.g.
triton-ascend ~270 MB) and PyTorch CPU wheels directly from external
mirrors (`mirrors.huaweicloud.com`, `download.pytorch.org`). On the
self-hosted runners this results in extremely slow downloads (observed
38 kB/s for triton-ascend 3.2.2) and corrupted/invalid wheel files,
causing the doctest to fail with:

```
ERROR: Wheel 'triton-ascend' located at /tmp/pip-unpack-.../triton_ascend-3.2.2-....whl is invalid.
```

The in-cluster nginx cache service already proxies all three upstreams
needed by this test:

| Cache path | Port | Upstream |
|---|---|---|
| `/pypi/simple` | 80 | `repo.huaweicloud.com/repository/pypi` +
`pypi.org` fallback |
| `/ascend/repos` | 80 | `repo.huaweicloud.com/ascend/repos`
(triton-ascend, torch-npu, etc.) |
| `/whl/cpu` | 80 | `download.pytorch.org` / `download-r2.pytorch.org` |
| APT cache | 8081 | `ports.ubuntu.com` / `archive.ubuntu.com` |

This PR routes all pip `extra-index-url` and apt mirror traffic through
the cache service so that large wheels are served from the local cache
instead of being re-downloaded over a slow external connection on every
CI run.

## Changes

- **`pip index-url`**: `mirrors.tuna.tsinghua.edu.cn` → in-cluster cache
`/pypi/simple`
- **`pip extra-index-url`**: `mirrors.huaweicloud.com/ascend/repos/pypi`
→ cache `/ascend/repos/pypi`; `download.pytorch.org/whl/cpu/` → cache
`/whl/cpu`
- **`pip trusted-host`**: added for the cache service hostname
- **apt mirror**: `mirrors.tuna.tsinghua.edu.cn` → cache port 8081
(ubuntu); also added openEuler/centos support via port 8081
- **Call order**: `config_pip_mirror` is now called before
`install_system_packages` so that `apt-get update` also uses the cached
mirror

## Does this PR introduce *any* user-facing change?

No. This only affects the CI doctest script that runs on self-hosted
runners with access to the in-cluster cache service.

## How was this patch tested?

- Verified that the cache service nginx configuration
(`nginx-conf.yaml`) already has `/ascend/repos` and `/whl` locations
that proxy the required upstreams.
- The nginx config comment explicitly mentions triton-ascend as a use
case for the `/ascend/repos` location.
- Other CI workflows (e.g. `_npu-pr-test-stage.yml` in sglang) already
use the same cache paths successfully.

## Note

Several other CI workflow files (`.github/workflows/*.yaml`) and nightly
test scripts also reference `mirrors.huaweicloud.com/ascend/repos/pypi`
and `download.pytorch.org/whl/cpu/` directly. Those can be migrated to
the cache service in follow-up PRs to keep this change focused.

- vLLM version: v0.27.1
- vLLM main:
https://github.com/vllm-project/vllm/commit/ba07e4a48fc951300d97eb506217dd530583dea3

---------

Signed-off-by: Wenl4ng <15861868579@163.com>
G
Goalina committed
f1c4e0d463005b9372b5fc32dd8c254ffb10f2e4
Parent: 81057d3
Committed by GitHub <noreply@github.com> on 8/28/2026, 10:00:43 AM