Skip to content
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

Temporary file cleanup issue form tgz compression #92

Open
brice-thomas2209 opened this issue Jan 20, 2025 · 2 comments · May be fixed by #94
Open

Temporary file cleanup issue form tgz compression #92

brice-thomas2209 opened this issue Jan 20, 2025 · 2 comments · May be fixed by #94

Comments

@brice-thomas2209
Copy link

Description

When using tgz compression with the plugin, the current implementation copies files from the cache into a temporary folder, gzips them into the appropriate path, and leaves the temporary folder uncleaned. Over time, this causes the agent to run out of disk space.

Steps to Reproduce

  1. Configure the cache-buildkite-plugin to use compression: tgz.
  2. Trigger a pipeline that utilizes the cache.
  3. Observe that temporary folders in /tmp (or the agent’s temp directory) are not cleaned up after the cache has been uncompressed.

Impact

Agents eventually run out of disk space, requiring manual intervention to clean up unused temporary folders.

Proposed Solution

The temporary files should be cleaned up after they have been uncompressed and moved to the intended location. This ensures the plugin does not leave residual data in the agent's filesystem. The solution should be as simple as adding the --remove-files arg to the tar command.

I’d happily implement this change if the maintainers agree to the solution.

@toote toote linked a pull request Feb 1, 2025 that will close this issue
@toote
Copy link
Contributor

toote commented Feb 1, 2025

Did not realize this could happen 😱 and it is a little bit more serious because it also happens when artifacts are compressed so your proposed solution would not work in that instance.

Instead, I have implemented it in an option called keep-compressed-artifacts that is turned off by default in #94 which should solve your issue

@lswith
Copy link

lswith commented Feb 2, 2025

I've opened a PR to help this issue: #96

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 a pull request may close this issue.

3 participants