make pulling images faster by removing files more efficiently#6809
make pulling images faster by removing files more efficiently#6809
Conversation
|
|
debad1a to
bb6ef55
Compare
🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: bb6ef55 | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb6ef5514d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| remove_tool_cache: false # Decent savings but not fast enough | ||
| remove_packages: false # By far the slowest option | ||
| remove_packages_one_command: true | ||
| remove_folders: "/usr/share/swift /usr/share/az* /usr/local/share/chromium" |
There was a problem hiding this comment.
Avoid wildcard path in remove_folders configuration
remove_folders includes /usr/share/az*, but this action passes each folder argument quoted (run_rm -f "${FOLDER}" in the pinned endersonmenezes/free-disk-space script), so globbing does not occur and the literal * path is not removed. On runners where Azure directories are present, this silently reclaims less space than expected and can leave docker compose pull vulnerable to running out of disk.
Useful? React with 👍 / 👎.
Motivation
The current cleanup strategy takes anywhere from 1 to 2 minutes. We tried larger machines before which worked perfectly, but is more costly and made configuration more difficult.
Changes
Make pulling images faster by removing files more efficiently and focusing on less larger files instead of more smaller ones.
Before: >1 minute for 10gb
After: <10 seconds for 13gb
See https://github.com/endersonmenezes/free-disk-space for the action that was used for this.
See https://github.com/DataDog/dd-trace-js/actions/runs/25087471665/job/73506075117 for a sample run (had to do it in another repo since the action is not allowed yet).
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present