Repository navigation
ci: free disk space before CI jobs - #25
Merged
Merged
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
🛡️ The following IaC misconfigurations have been detected
| NAME | FILE | ||
|---|---|---|---|
| Pip Install Without Pinned Package Version | Dockerfile | View in code |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Frees disk space on the CI runners before the image builds, and stops shipping pip's download cache inside the Docker images.
Free Disk Space action
Adds a local composite action,
.github/actions/free-disk-space, and runs it right after checkout in both build jobs (build-imageandbuild-custom-image).gh-releaseis skipped because it doesn't check out the repo.Both jobs run on GitHub's Ubuntu 26.04 x64 image. The jobs only need git, Docker/buildx and the Python 3.11 that
setup-pythontakes from the tool cache, so the action deletes toolchains they never use:insightsengineering/disk-space-reclaimerremoves the Android SDK and .NET.haskellis off because the reclaimer only deletes/opt/ghc, which 26.04 doesn't have.rm -rfstep removes GHCup, Swift, the JDKs, PowerShell/Edge, Azure and Google Cloud CLIs, Chrome/Chromium, Rust, Homebrew, vcpkg, and CodeQL/PyPy/Go/Node/Ruby from the tool cache. It's much faster than the apt-basedlarge-packagesoption.setup-python), swap (build-imageloadsbge-reranker-v2-m3), and the apt-installed compilers and databases (removing them takes minutes).This mostly helps
build-custom-image, which runs on standardubuntu-latest. On tag builds it builds the image once locally, then again for amd64 and arm64 with buildx.build-imagealready runs on 4-core larger runners, which have more disk.--no-cache-dirin the DockerfilesDockerfileandcustom.Dockerfileranpip installwithout--no-cache-dir, leaving a 3.1 GB pip download cache (/root/.cache/pip) in every image. Both pip steps now skip the cache. In a local arm64 build withms-marco-TinyBERT-L-2-v2, the image went from 9.67 GB to 6.38 GB, and the smoke tests pass. This makes the published images about 3 GB smaller per architecture.Verify on this PR's run
The reclaimer step logs
dfbefore and after, and the new step printsdf -h /at the end, so this PR's CI run shows how much space is actually freed.