Skip to content

Commit c2e6f26

Browse files
[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

File tree

.github/workflows/pr_test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ jobs:
156156
157157
- name: Run pre-commit
158158
env:
159+
PRE_COMMIT_HOME: /tmp/pre-commit-cache
159160
PRE_COMMIT_COLOR: always
160161
FORCE_COLOR: "1"
161162
TERM: xterm-256color

0 commit comments

Comments
 (0)