Commit e462c42
authored
[CI] Add OBS cache for pre-commit hooks (vllm-project#12857)
## What this PR does / why we need it?
Add OBS-based caching for pre-commit hooks to speed up PR CI.
### Changes:
1. **Add push_build_precommit_cache.yaml** (new file):
- Triggers on push to main when .pre-commit-config.yaml or
equirements-lint.txt changes
- Runs pre-commit to populate the cache, then uploads to OBS
(^Gscend-ci-cache-hk bucket)
- Uses sha256sum for cache key (not hashFiles() which returns empty on
self-hosted runners)
- Uses /tmp/pre-commit-cache (ephemeral) instead of ~/.cache/pre-commit
(PVC) to ensure cache comes from OBS, not local disk residue
- Requires secrets HW_OBS_AK_HK and HW_OBS_SK_HK to be configured in
repository settings
2. **Modify pr_test.yaml**:
- Add uns-on/cache/restore@v5 step before "Run pre-commit" to restore
cache from OBS
- Fork PRs can read the cache using the runner's built-in read-only
AK/SK (no secrets needed)
- Same PRE_COMMIT_HOME: /tmp/pre-commit-cache path
### Principle:
- **Write cache**: only on main branch (push trigger), using GitHub
secrets for write credentials
- **Read cache**: all PRs (including fork PRs), using runner's built-in
read-only AK/SK
### Prerequisites:
- Configure HW_OBS_AK_HK and HW_OBS_SK_HK secrets in repository settings
(Actions → Secrets)
- Ensure runners have obs-cache-credentials secret in their pod template
for read-only access
## Does this PR introduce any user-facing change?
No.
## How was this patch tested?
Verified on ^Gscend-gha-runners/vllm-ascend fork — cache write and read
both confirmed working.
- vLLM version: v0.25.1
- vLLM main:
vllm-project/vllm@fe784ff
---------
Signed-off-by: ZhangYang <1079854335@qq.com>1 parent 2a607f0 commit e462c42
2 files changed
Lines changed: 114 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
149 | 167 | | |
150 | 168 | | |
151 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
0 commit comments