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')
|
(needs.check-changes.outputs.main_package == 'true')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 240
|
timeout-minutes: 240
|
||||||
|
env:
|
||||||
|
HF_HOME: ${{ github.workspace }}/.hf-cache
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
max-parallel: ${{ fromJson(needs.check-changes.outputs.partitions)['base-a-test-cpu'].max_parallel }}
|
max-parallel: ${{ fromJson(needs.check-changes.outputs.partitions)['base-a-test-cpu'].max_parallel }}
|
||||||
@@ -316,6 +318,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
uv pip install -e "python[dev]" --index-strategy unsafe-best-match --prerelease allow
|
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
|
- name: Run test
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user