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

Clean up the bundle archive after extracting it #1820

Merged
merged 5 commits into from
Aug 1, 2023

Conversation

henrymercer
Copy link
Contributor

@henrymercer henrymercer commented Aug 1, 2023

Make some more disk space available to future steps by deleting the CodeQL bundle archive once we've extracted it. We tolerate this step failing since deleting files doesn't always work, particularly on Windows where an antivirus program might lock the file.

Edit: There's another saving to be had — when we cache the bundle we copy it from a temporary directory to a toolcache directory, so we can also delete the extracted CodeQL bundle from this temporary directory.

In total, we make an additional 2.3 GB available to the autobuild and analyze steps on a Linux run using a single-platform dist. The savings are better for multi-platform dists, but these are less common.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@henrymercer henrymercer requested a review from a team as a code owner August 1, 2023 16:56
adityasharad
adityasharad previously approved these changes Aug 1, 2023
CHANGELOG.md Show resolved Hide resolved
src/setup-codeql.ts Outdated Show resolved Hide resolved
src/setup-codeql.ts Outdated Show resolved Hide resolved
src/setup-codeql.ts Outdated Show resolved Hide resolved
@henrymercer
Copy link
Contributor Author

@henrymercer henrymercer merged commit 7b79062 into main Aug 1, 2023
@henrymercer henrymercer deleted the henrymercer/delete-bundle-archive branch August 1, 2023 19:16
@angelapwen
Copy link
Contributor

Just curious: how exactly did you figure out the disk space savings here?

@henrymercer
Copy link
Contributor Author

I did a fairly basic calculation: I added a bunch of print statements to dump the available disk space, and summed the amount of disk space made available by deleting the archived bundle and deleting the extracted bundle from the temporary directory.

@github-actions github-actions bot mentioned this pull request Aug 8, 2023
6 tasks
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.

3 participants