-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[CI] Add workflow to cleanup L2 ccache weekly #77250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SigureMo
merged 11 commits into
PaddlePaddle:develop
from
cattidea:ci/add-workflow-to-cleanup-l2-ccache-weekly
Jan 7, 2026
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e8f7c31
[CI] Add workflow to cleanup L2 ccache weekly
SigureMo 655e05b
trim CCACHE_SECONDARY_STORAGE
SigureMo 3980899
use du stats
SigureMo b478b2b
skip install ccache
SigureMo 7cb6d6a
cleanup l1 stats
SigureMo e5e1ffe
try trim
SigureMo 8ca768b
add concurrency
SigureMo 8b669e5
fix path
SigureMo 9205c55
update schedule
SigureMo 2d92171
remove pr event
SigureMo 94bbb1b
sunday 00:00
SigureMo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| name: Cleanup ccache | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [develop] # Remove before merge, just for testing | ||
| schedule: | ||
| - cron: "0 0 * * 0" # Weekly on Sundays | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| TASK: cleanup-ccache-weekly | ||
| no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn" | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| jobs: | ||
| cleanup-ccache: | ||
| name: Cleanup L2 ccache | ||
| runs-on: | ||
| group: GZ_BD-CPU | ||
|
|
||
| steps: | ||
| - name: Launch container | ||
| env: | ||
| work_dir: /paddle | ||
| PADDLE_ROOT: /paddle | ||
| CCACHE_MAXSIZE: 50G | ||
| CCACHE_LIMIT_MULTIPLE: 0.8 | ||
| CCACHE_DIR: "/home/data/cfs/.ccache/l2" | ||
| run: | | ||
| set -x | ||
| container_name=${TASK}-$(date +%s) | ||
| echo "container_name=${container_name}" >> ${{ github.env }} | ||
SigureMo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| docker_image=ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:cuda129-coverage-test | ||
| docker run -d -t --name ${container_name} \ | ||
| -v "/home/data/cfs:/home/data/cfs" \ | ||
| -v "/home/data/cfs/.cache:/root/.cache" \ | ||
| -v "/home/data/shared:/home/data/shared" \ | ||
| -v "/dev/shm:/dev/shm" \ | ||
| -v "${{ github.workspace }}/../../..:${{ github.workspace }}/../../.." \ | ||
| -v ${{ github.workspace }}:/paddle \ | ||
| -e work_dir \ | ||
| -e PADDLE_ROOT \ | ||
| -e GITHUB_ENV \ | ||
SigureMo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| -e CACHE_DIR \ | ||
SigureMo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| -e CCACHE_DIR \ | ||
| -e CCACHE_SECONDARY_STORAGE \ | ||
SigureMo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| -e CCACHE_MAXSIZE \ | ||
| -e CCACHE_LIMIT_MULTIPLE \ | ||
| -e no_proxy \ | ||
| -w /paddle --network host ${docker_image} | ||
|
|
||
| - name: Install ccache inside container | ||
| run: | | ||
| docker exec -t ${container_name} bash -c ' | ||
| source ${{ github.workspace }}/../../../proxy | ||
| apt-get update | ||
| apt-get install -y ccache | ||
| ' | ||
|
|
||
| - name: Cleanup L2 ccache inside container | ||
| run: | | ||
| docker exec -t ${container_name} bash -c ' | ||
| # Show current ccache stats | ||
| echo "Current ccache stats before cleanup:" | ||
| ccache -s | ||
| # Trim L2 ccache to free up space, trim all caches exceeding 15days | ||
| ccache --evict-older-than 15d | ||
| # Show ccache stats after cleanup | ||
| echo "Current ccache stats after cleanup:" | ||
| ccache -s | ||
| ' | ||
|
|
||
| - name: Terminate and delete the container | ||
| if: always() | ||
| run: | | ||
| set +e | ||
| docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*' | ||
SigureMo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| docker stop ${{ env.container_name }} | ||
| docker rm ${{ env.container_name }} | ||
SigureMo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be removed before merging to production as indicated by the inline comment. The pull_request trigger on the develop branch appears to be for testing purposes only and should not be present in the final merged version.