Commit c2e6f26
authored
[CI] Set PRE_COMMIT_HOME environment variable for pre-commit (vllm-project#11595)
### What this PR does / why we need it?
Fixes an intermittent CI failure in the `lint-and-select-tests` job
where the `Run pre-commit` step fails with errors like:
FileNotFoundError: [Errno 2] No such file or directory:
'.../linux64-s390x/no-asm/include'
InvalidManifestError:
=====> .../repo2jwlna9l/.pre-commit-hooks.yaml is not a file
**Root Cause:** `/root/.cache/pre-commit/` is mounted from a shared NFS
PVC (`vllm-project-hk001`, SFS Turbo). Multiple runner pods within the
`vllm-project` namespace run pre-commit concurrently. Pre-commit uses
`fcntl.flock` on `/root/.cache/pre-commit/.lock` to serialize hook
environment installations, but
`flock` does not work across NFS clients. This allows concurrent writes
to the same hook environment directory (e.g.,
`repo2jwlna9l/node_env-default/` for markdownlint-cli), corrupting
`nodeenv`'s `copytree` output.
**Fix:** Set `PRE_COMMIT_HOME=/tmp/pre-commit-cache` to redirect the
pre-commit cache to a pod-local tmpfs, isolating each pod's cache and
eliminating the cross-pod race condition. The trade-off is ~30s
additional hook environment installation time per run (acceptable for a
CI lint job), in exchange for
deterministic results.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
- Confirmed the shared PVC configuration by inspecting the
EphemeralRunner pod spec:
```yaml
volumeMounts:
- mountPath: /root/.cache
name: shared-volume
volumes:
- name: shared-volume
persistentVolumeClaim:
claimName: vllm-project-hk001
- Confirmed flock unreliability on NFS by examining the shared
pre-commit.log, which captured a InvalidManifestError caused by
concurrent manifest reads/writes (/root/.cache/pre-commit/pre-commit.log
on the shared volume).
- Verified that different CI runs on different pods hit different
missing files (e.g., linux64-s390x/no-asm/include vs
.pre-commit-hooks.yaml), consistent with race-condition timing rather
than a deterministic code bug.
- The fix will be validated by the E2E workflow passing consistently
after merge.
- vLLM version: v0.23.0
- vLLM main:
vllm-project/vllm@1f486d9
Signed-off-by: ZhangYang <1079854335@qq.com>1 parent b659959 commit c2e6f26
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
| |||
0 commit comments