fix(ci): isolate multi-node cache path and k8s job per run+version - #607
Open
EdwardXuy wants to merge 4 commits into
Open
fix(ci): isolate multi-node cache path and k8s job per run+version#607EdwardXuy wants to merge 4 commits into
EdwardXuy wants to merge 4 commits into
Conversation
PR-triggered A2 multi-node pipeline frequently fails with:
cp: cannot create regular file '/root/.cache/tests/sglang/CMakeLists.txt': File exists
Root cause: all matrix jobs (8.5.0, 9.0.0) and concurrent PRs share the
same fixed path /root/.cache/tests/sglang on a shared PVC, and the same
fixed k8s Volcano Job name sglang-npu-multi. When the previous job's
test pods are still terminating or the PVC has sync latency, the next
job's cp -r hits residual files and fails.
Fix in internode.yml:
- Derive unique cache path /root/.cache/tests/sglang/{RUN_ID}_{CANN_VERSION}
- Derive unique k8s job name sglang-npu-multi-{CANN_VERSION}
- Replace rm -rf path/* (misses dotfiles, races on PVC sync) with rm -rf path
- Copy hidden files (.gitmodules, .github) that cp .../* skips
- Clean up the job PVC directory in Post process
No change to workflow inputs/outputs, so daily-build-test.yml and
a2-internode-test.yml callers are unaffected. The daily pipeline also
benefits from this isolation (previously masked by the 5-7h needs delay).
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
…isolation) Previous commit (6690cc7) tried to isolate PVC path per run+version by creating subdirectory /root/.cache/tests/sglang/<run_id>_<cann_version>. This broke: runner container's /root/.cache/tests/sglang is a dedicated mount point (subPath) on the shared PVC, while the test pod mounts the entire PVC at /root/.cache. Files written to the subdirectory land on the runner's local view but are NOT visible to the test pod, causing: ERROR: Script not found at .../29888246254_8.5.0/tests/python/deepep/run_ascend_testcase.sh Revert to the fixed path /root/.cache/tests/sglang (which both runner and test pod share correctly) and solve the original "cp: File exists" race differently: 1. concurrency: drop github.ref from group -> all multi-node runs for the same soc_version serialize globally (cross-PR). Set cancel-in-progress: false so an in-progress test is not interrupted (scarce NPU resources should not be wasted on partial runs). 2. rm -rf "$sglang_source_path" (whole dir) instead of rm -rf $path/* to also clear leftover dotfiles that caused stale-state issues. Result: no two multi-node jobs write the shared path simultaneously, and each job starts from a clean directory. Daily pipeline is unaffected (it calls internode.yml with the same soc_version and will simply queue behind a PR run if one is active, which is acceptable).
Previous commits tried two approaches that both failed: 1. Path isolation in internode.yml (6690cc7): Created subdirectory /root/.cache/tests/sglang/<run_id>_<cann_version>. FAILED because runner container mounts /root/.cache/tests/sglang as a subPath, while test pod mounts the entire PVC at /root/.cache. Files in the subdirectory are invisible to the test pod: "ERROR: Script not found at .../run_ascend_testcase.sh" 2. Global concurrency in internode.yml (f020473): Changed concurrency group to ascend-nightly-multi-node-${{ inputs.soc_version }}. FAILED because concurrency in a reusable (called) workflow does NOT serialize across different caller runs. Evidence: run 29896822833 (different PR) and run 29897327319 (this PR) both executed multi-node jobs simultaneously, causing: "rm: cannot remove '/root/.cache/tests/sglang': Directory not empty" Root cause confirmed via GitHub docs and community: "You need to apply the concurrency setting to the CALLER workflow, not the reusable workflow itself." Fix: - Revert internode.yml to original (no changes from main). - Change a2-internode-test.yml concurrency: - group: a2-internode-test (was: a2-internode-test-${{ github.ref }}-${{ github.event_name }}) Removes github.ref so ALL PR runs share one global group and serialize. - cancel-in-progress: false (was: true) Don't interrupt in-progress multi-node tests (scarce NPU resources). Daily pipeline (daily-build-test.yml) is unaffected: it calls internode.yml directly, not a2-internode-test.yml, and runs once daily with a 5-7h delay from prerequisite jobs.
zuje123
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The A2 multi-node pipeline frequently fails on PR-triggered runs with:
cp: cannot create regular file '/root/.cache/tests/sglang/CMakeLists.txt': File exists
cp: cannot create regular file '/root/.cache/tests/sglang/README.md': File exists
This causes the 9.0.0 matrix job to fail in the "Prepare scripts" step within ~2.5 minutes, while the 8.5.0 job (which runs first due to max-parallel: 1) succeeds.
Root Cause
All matrix jobs (8.5.0, 9.0.0) and concurrent PRs share:
When the previous job's test pods are still terminating (Volcano Job deletion is async) or the PVC has filesystem sync latency, the next job's cp -r hits residual files and fails with "File exists".
Additionally, rm -rf /* does not match dotfiles (.gitmodules, .github), so hidden file residue is never cleaned.
Why daily-build-test.yml is not affected
The daily pipeline has needs: [run-daily-tests, run-pr-tests] before multi-node-internode, which adds a 5-7 hour delay. By the time multi-node runs, the previous day's pods have fully terminated and the PVC has synced. The PR-triggered a2-internode-test.yml has no such delay, so it hits the race.
Fix (internode.yml only)
Compatibility
Testing
Triggering a PR that runs a2-internode-test.yml should now succeed for both 8.5.0 and 9.0.0 even when: