Skip to content

[CI] Improve Code Prepare stability and cleanup logic#7198

Open
EmmonsCurse wants to merge 3 commits intoPaddlePaddle:developfrom
EmmonsCurse:ci_optimize_dev_0403
Open

[CI] Improve Code Prepare stability and cleanup logic#7198
EmmonsCurse wants to merge 3 commits intoPaddlePaddle:developfrom
EmmonsCurse:ci_optimize_dev_0403

Conversation

@EmmonsCurse
Copy link
Copy Markdown
Collaborator

Motivation

The Code Prepare stage has stability issues on self-hosted runners, especially when jobs are cancelled. In such cases, residual directories or root-owned files may remain in the workspace, causing subsequent runs to fail during cleanup or extraction.

The previous cleanup logic relied only on container-based deletion, which is not reliable under abnormal termination or permission inconsistency, leading to CI flakiness.

Modifications

  • Add host-level cleanup to remove residual directories using runner user
  • Introduce retry mechanism to improve cleanup reliability
  • Add container-based root cleanup as a fallback
  • Handle permission issues with force cleanup (chmod + find)
  • Improve logging for better observability and debugging
  • Add pre-check before extraction to avoid conflicts with existing directories
  • Use --no-same-owner during extraction to prevent permission issues

Usage or Command

N/A

Accuracy Tests

N/A

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@EmmonsCurse
Copy link
Copy Markdown
Collaborator Author

/skip-ci ci_iluvatar
/skip-ci ci_hpu
/skip-ci build_xpu

@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Apr 3, 2026

Thanks for your contribution!

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@da3dfe1). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #7198   +/-   ##
==========================================
  Coverage           ?   73.30%           
==========================================
  Files              ?      376           
  Lines              ?    52941           
  Branches           ?     8260           
==========================================
  Hits               ?    38811           
  Misses             ?    11414           
  Partials           ?     2716           
Flag Coverage Δ
GPU 73.30% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants