CI: reusable_build: implement HACK to freeup some space in Host Image#81
Merged
robimarko merged 1 commit intoopenwrt:mainfrom Jan 15, 2026
Merged
CI: reusable_build: implement HACK to freeup some space in Host Image#81robimarko merged 1 commit intoopenwrt:mainfrom
robimarko merged 1 commit intoopenwrt:mainfrom
Conversation
Implement an HACK to freeup some space in the Github Host Image. It was discovered that lots of space is wasted by all the dependency installed by default in the ubuntu-latest image and it's not possible to delete them when the workflow is run directly with a container image. To handle this we run the container in privileged mode and assing the same pid of the host machine. This way with the help of the nsenter command and some magic/reverse of the Github Action shell variable, we can execute command directly in the host machine permiting to delete all kind of unwanted files. This permits to gain extra space of about 20+ GB by removing Android Swift and dotnet files. We use rsync with the empty directory to speed up deletion of all these files (normal rm takes 2 minutes with rsync taking max 30-40 seconds) Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Failed checksIssues marked with an ❌ are failing checks. Commit 53722a8
For more details, see the full job log. Something broken? Consider providing feedback. |
Member
|
Nice combination of hacks |
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.
Implement an HACK to freeup some space in the Github Host Image.
It was discovered that lots of space is wasted by all the dependency installed by default in the ubuntu-latest image and it's not possible to delete them when the workflow is run directly with a container image.
To handle this we run the container in privileged mode and assing the same pid of the host machine.
This way with the help of the nsenter command and some magic/reverse of the Github Action shell variable, we can execute command directly in the host machine permiting to delete all kind of unwanted files.
This permits to gain extra space of about 20+ GB by removing Android Swift and dotnet files.
We use rsync with the empty directory to speed up deletion of all these files (normal rm takes 2 minutes with rsync taking max 30-40 seconds)