ci: cache HF hub for base-a-test-cpu to avoid Hub 429 flakes (#27092)
This commit is contained in:
@@ -267,6 +267,8 @@ jobs:
|
||||
(needs.check-changes.outputs.main_package == 'true')
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 240
|
||||
env:
|
||||
HF_HOME: ${{ github.workspace }}/.hf-cache
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: ${{ fromJson(needs.check-changes.outputs.partitions)['base-a-test-cpu'].max_parallel }}
|
||||
@@ -316,6 +318,16 @@ jobs:
|
||||
run: |
|
||||
uv pip install -e "python[dev]" --index-strategy unsafe-best-match --prerelease allow
|
||||
|
||||
# Hosted runners are ephemeral, so models are re-fetched every run and the
|
||||
# Hub occasionally returns 429s. Persist the HF cache in GitHub's cache
|
||||
# storage (rolling key + restore-keys) so warm runs never hit the network.
|
||||
- name: Cache HF hub
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ github.workspace }}/.hf-cache
|
||||
key: hf-cpu-${{ matrix.partition }}-${{ github.run_id }}
|
||||
restore-keys: hf-cpu-${{ matrix.partition }}-
|
||||
|
||||
- name: Run test
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user