Skip to content

make pulling images faster by removing files more efficiently#6809

Open
rochdev wants to merge 9 commits intomainfrom
rochdev/faster-pull-images-cleanup
Open

make pulling images faster by removing files more efficiently#6809
rochdev wants to merge 9 commits intomainfrom
rochdev/faster-pull-images-cleanup

Conversation

@rochdev
Copy link
Copy Markdown
Member

@rochdev rochdev commented Apr 24, 2026

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

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

CODEOWNERS have been resolved as:

.github/actions/pull_images/action.yml                                  @DataDog/system-tests-core

@rochdev rochdev mentioned this pull request Apr 28, 2026
5 tasks
Comment thread .github/actions/pull_images/action.yml Outdated
@rochdev rochdev force-pushed the rochdev/faster-pull-images-cleanup branch from debad1a to bb6ef55 Compare April 29, 2026 13:11
@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented Apr 29, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: bb6ef55 | Docs | Datadog PR Page | Give us feedback!

@rochdev rochdev marked this pull request as ready for review April 29, 2026 15:18
@rochdev rochdev requested a review from a team as a code owner April 29, 2026 15:18
@rochdev rochdev changed the title make pulling images faster by removing need for file removal make pulling images faster by removing files more efficiently Apr 29, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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