-
Notifications
You must be signed in to change notification settings - Fork 356
fix(ci): Clean up GH environment so there is more disk space for workflows #1108
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
fix(ci): Clean up GH environment so there is more disk space for workflows #1108
Conversation
Signed-off-by: Fabian Gonzalez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces disk space cleanup mechanisms to prevent test-e2e workflow failures caused by insufficient disk space on GitHub Actions runners.
- Adds a new composite GitHub Action that removes unused packages and Docker images before workflow execution
- Integrates cache cleanup commands in Python sample Dockerfiles to reduce image size
- Implements systematic cleanup of common space-consuming directories on GitHub runners
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
.github/actions/initialize-environment/action.yaml |
New composite action that performs disk cleanup by removing unused packages, tools, and Docker images |
.github/workflows/ci.yaml |
Integrates the new initialize-environment action before the test-e2e job |
python/samples/langgraph/currency/Dockerfile |
Adds apt-get clean and uv cache clean commands to reduce Docker image size |
python/samples/crewai/research-crew/Dockerfile |
Adds apt-get clean and uv cache clean commands to reduce Docker image size |
python/samples/crewai/poem_flow/Dockerfile |
Adds apt-get clean and uv cache clean commands to reduce Docker image size |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| build-essential \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| && apt-get clean |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] apt-get clean is redundant after rm -rf /var/lib/apt/lists/*. The rm -rf /var/lib/apt/lists/* command already removes the package lists, and apt-get clean removes downloaded package files from /var/cache/apt/archives/, which is already a minimal operation. Since the standard practice is to use rm -rf /var/lib/apt/lists/* alone in Dockerfiles for size reduction, the additional apt-get clean doesn't provide meaningful benefit and can be removed.
| && apt-get clean |
| && rm -rf /var/lib/apt/lists/* \ | ||
| && apt-get clean | ||
|
|
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] apt-get clean is redundant after rm -rf /var/lib/apt/lists/*. The rm -rf /var/lib/apt/lists/* command already removes the package lists, and apt-get clean removes downloaded package files from /var/cache/apt/archives/, which is already a minimal operation. Since the standard practice is to use rm -rf /var/lib/apt/lists/* alone in Dockerfiles for size reduction, the additional apt-get clean doesn't provide meaningful benefit and can be removed.
| && rm -rf /var/lib/apt/lists/* \ | |
| && apt-get clean | |
| && rm -rf /var/lib/apt/lists/* |
| && rm -rf /var/lib/apt/lists/* \ | ||
| && apt-get clean | ||
|
|
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] apt-get clean is redundant after rm -rf /var/lib/apt/lists/*. The rm -rf /var/lib/apt/lists/* command already removes the package lists, and apt-get clean removes downloaded package files from /var/cache/apt/archives/, which is already a minimal operation. Since the standard practice is to use rm -rf /var/lib/apt/lists/* alone in Dockerfiles for size reduction, the additional apt-get clean doesn't provide meaningful benefit and can be removed.
| && rm -rf /var/lib/apt/lists/* \ | |
| && apt-get clean | |
| && rm -rf /var/lib/apt/lists/* |
Signed-off-by: Fabian Gonzalez <[email protected]>
Changes
Context
I have recently seen instances (1, 2, +2 others), where
test-e2eis failing when setting up the test agents, since it runs out of space during a build. this PR is meant to hopefully completely mitigate that by clearing up space.Note(s)
The cleanup action is lifted from kgateway go prep action, without the additional setup there, since this PR is currently focused on clearing space before before running workflows. This is similar to others actions in solo(org)-managed products, so it's a pattern followed.
Before & After
Before clearing disk space:
Filesystem Size Used Avail Use% Mounted on
/dev/root 72G 53G 19G 74% /
tmpfs 7.9G 84K 7.9G 1% /dev/shm
tmpfs 3.2G 1.1M 3.2G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sdb16 881M 62M 758M 8% /boot
/dev/sdb15 105M 6.2M 99M 6% /boot/efi
/dev/sda1 74G 4.1G 66G 6% /mnt
tmpfs 1.6G 12K 1.6G 1% /run/user/1001
After clearing disk space:
Filesystem Size Used Avail Use% Mounted on
/dev/root 72G 34G 38G 48% /
tmpfs 7.9G 84K 7.9G 1% /dev/shm
tmpfs 3.2G 1.1M 3.2G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/sdb16 881M 62M 758M 8% /boot
/dev/sdb15 105M 6.2M 99M 6% /boot/efi
/dev/sda1 74G 4.1G 66G 6% /mnt
tmpfs 1.6G 12K 1.6G 1% /run/user/1001
Summary: