-
-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to clear persistent cache dirs on self-hosted runners (#…
…20755) We have a few long-lived runners that have cache directories that grow and grow until the machine runs out of space. This workflow is a stop-gap measure that makes it easier for anyone to give the machine more space, by making workflow to do it, rather than requiring someone with credentials to SSH in and do it manually. For instance, on March 18, the macOS 11 runner had: | directory | size (GB) | |------------------------|-----------| | `~/Library/Caches/nce` | 113 | | `~/.cache` | 34 | | `~/.rustup` | 12 | | `~/.pex` | 8.8 | | `~/.nce` | 1.2 | This PR set-ups automatic deletion of these directories with some logging.
- Loading branch information
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
.github/workflows/clear_self_hosted_persistent_caches.yaml
This file contains 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,67 @@ | ||
# GENERATED, DO NOT EDIT! | ||
# To change, edit `src/python/pants_release/generate_github_workflows.py` and run: | ||
# ./pants run src/python/pants_release/generate_github_workflows.py | ||
|
||
|
||
jobs: | ||
- name: clear_linux_arm64 | ||
runs-on: | ||
- self-hosted | ||
- Linux | ||
- ARM64 | ||
steps: | ||
- name: df before | ||
run: df -h | ||
- name: Deleting ~/Library/Caches | ||
run: du -sh ~/Library/Caches || true; rm -rf ~/Library/Caches | ||
- name: Deleting ~/.cache | ||
run: du -sh ~/.cache || true; rm -rf ~/.cache | ||
- name: Deleting ~/.nce | ||
run: du -sh ~/.nce || true; rm -rf ~/.nce | ||
- name: Deleting ~/.rustup | ||
run: du -sh ~/.rustup || true; rm -rf ~/.rustup | ||
- name: Deleting ~/.pex | ||
run: du -sh ~/.pex || true; rm -rf ~/.pex | ||
- name: df after | ||
run: df -h | ||
- name: clear_macos10_15_x86_64 | ||
runs-on: | ||
- self-hosted | ||
- macOS-10.15-X64 | ||
steps: | ||
- name: df before | ||
run: df -h | ||
- name: Deleting ~/Library/Caches | ||
run: du -sh ~/Library/Caches || true; rm -rf ~/Library/Caches | ||
- name: Deleting ~/.cache | ||
run: du -sh ~/.cache || true; rm -rf ~/.cache | ||
- name: Deleting ~/.nce | ||
run: du -sh ~/.nce || true; rm -rf ~/.nce | ||
- name: Deleting ~/.rustup | ||
run: du -sh ~/.rustup || true; rm -rf ~/.rustup | ||
- name: Deleting ~/.pex | ||
run: du -sh ~/.pex || true; rm -rf ~/.pex | ||
- name: df after | ||
run: df -h | ||
- name: clear_macos11_arm64 | ||
runs-on: | ||
- self-hosted | ||
- macOS-11-ARM64 | ||
steps: | ||
- name: df before | ||
run: df -h | ||
- name: Deleting ~/Library/Caches | ||
run: du -sh ~/Library/Caches || true; rm -rf ~/Library/Caches | ||
- name: Deleting ~/.cache | ||
run: du -sh ~/.cache || true; rm -rf ~/.cache | ||
- name: Deleting ~/.nce | ||
run: du -sh ~/.nce || true; rm -rf ~/.nce | ||
- name: Deleting ~/.rustup | ||
run: du -sh ~/.rustup || true; rm -rf ~/.rustup | ||
- name: Deleting ~/.pex | ||
run: du -sh ~/.pex || true; rm -rf ~/.pex | ||
- name: df after | ||
run: df -h | ||
name: Clear persistent caches on long-lived self-hosted runners | ||
'on': | ||
workflow_dispatch: {} |
This file contains 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