-
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 all commits
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,71 @@ | ||
| name: Cleanup ccache | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 16 * * Sat" # Weekly on Sunday at 00:00 UTC+8 | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }} | ||
| cancel-in-progress: true | ||
|
|
||
| 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/shared/.ccache/l1" # L1 cache on machine shared dir | ||
| CCACHE_SECONDARY_STORAGE: "file:///home/data/cfs/.ccache/l2" # L2 cache on cfs | ||
| run: | | ||
| set -x | ||
| container_name=${TASK}-$(date +%s) | ||
| echo "container_name=${container_name}" >> ${{ github.env }} | ||
| 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: Cleanup L2 ccache inside container | ||
| run: | | ||
| docker exec -t ${container_name} bash -c ' | ||
| CFS_CCACHE_DIR="${CCACHE_SECONDARY_STORAGE#file://}" | ||
| ccache --trim-dir ${CFS_CCACHE_DIR} --trim-max-size 200G | ||
| ' | ||
|
|
||
| - 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.
Uh oh!
There was an error while loading. Please reload this page.