Skip to content

Conversation

aminvakil
Copy link
Collaborator

I do not know where I'm going with this PR.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@aminvakil aminvakil changed the title Fix swap usage WIP: Fix swap usage Sep 26, 2025
@aminvakil
Copy link
Collaborator Author

aminvakil commented Sep 26, 2025

Yep, my suspicion was right, latest ubuntu image have less free space, therefore failing.

/dev/root        72G   57G   15G  80% /

@aminvakil aminvakil changed the title WIP: Fix swap usage WIP: Fix swap allocation in integration test Sep 26, 2025
@BYK
Copy link
Member

BYK commented Sep 26, 2025

@aminvakil how do we fix it? 😅

@aminvakil
Copy link
Collaborator Author

@aminvakil how do we fix it? 😅

I'm trying to purge jdk packages right now :)

@aminvakil
Copy link
Collaborator Author

aminvakil commented Sep 26, 2025

@BYK I had another problem in aminvakil/lamp@0d793ff which was breaking mysql installation in docker :) It's fine to remove packages which we do not use in runner image IMO.

@BYK
Copy link
Member

BYK commented Sep 26, 2025

So the issue is we running out of disk space due to swap?

@aminvakil
Copy link
Collaborator Author

Removing packages like this is not enough.

I'm looking at this repository: https://github.com/endersonmenezes/free-disk-space particularly android section and wonder if I should just copy

    sudo rm -rf /usr/local/lib/android || true
    sudo rm -rf /opt/android || true
    sudo rm -rf /usr/local/android-sdk || true
    sudo rm -rf /home/runner/Android || true

or use their action.

cc @endersonmenezes

@aminvakil
Copy link
Collaborator Author

Testing

    sudo rm -rf /usr/local/lib/android || true
    sudo rm -rf /opt/android || true
    sudo rm -rf /usr/local/android-sdk || true
    sudo rm -rf /home/runner/Android || true

here:
https://github.com/aminvakil/docker-tagtest/actions/runs/18038333118/job/51330491808
It increases job time about 1m 30s :(

@aminvakil
Copy link
Collaborator Author

https://github.com/aminvakil/docker-tagtest/actions/runs/18038439461/job/51330843317 :

The one which really reduces disk usage is sudo rm -rf /usr/local/lib/android, on second attempt it took almost three minutes though!

@endersonmenezes
Copy link

@aminvakil thx for mention!

If you want to use the Action directly on the commit hash, it can improve code maintenance and even eliminate other things you may not need.

We're present on Telegram and other large projects, always ethically and trustworthy. Any PRs are also welcome.

@aminvakil
Copy link
Collaborator Author

https://github.com/aminvakil/docker-tagtest/actions/runs/18038684596/job/51331642431 :

I've tested haskell directory removal here ^ and figured it out the one which really matters is
sudo rm -rf /usr/local/.ghcup
and it takes less than 5 seconds to get executed and frees 7GB disk space which is enough.

Also || true has been removed in contrast to original project as rm -rf does not really need that and returns 0 if directory does not exist anyway.

This is a better approach than including all of their action, remove more stuff which does not reduce disk space significantly IMHO.

@endersonmenezes Thanks for your project!

@aminvakil
Copy link
Collaborator Author

Also for future reference:
https://github.com/actions/runner-images/blob/9da76c777a49886ca3ee062ad347d7768459a5b9/images/ubuntu/scripts/build/install-haskell.sh#L13-L15

Here is where haskell gets installed on ubuntu runner images.

@aminvakil aminvakil changed the title WIP: Fix swap allocation in integration test Fix swap allocation in integration test Sep 26, 2025
@aminvakil
Copy link
Collaborator Author

TLDR;

This PR removes a large directory containing haskell stuff which will not get used in self-hosted ever, in order to free up space for swap commands to execute successfully.

@BYK @aldy505

Copy link
Collaborator

@aldy505 aldy505 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow. Really, wow.

@aldy505 aldy505 merged commit 37918fb into getsentry:master Sep 26, 2025
10 checks passed
@aminvakil aminvakil deleted the troubleshoot_swap branch September 26, 2025 13:58
@BYK
Copy link
Member

BYK commented Sep 26, 2025

There's also this action I found: https://github.com/marketplace/actions/maximize-build-disk-space

That said the main question is: why do we need so much swap space???

@aminvakil
Copy link
Collaborator Author

There's also this action I found: https://github.com/marketplace/actions/maximize-build-disk-space

Interesting! It uses a different approach, although I still like to remove a large directory instead of changing partition layout.

That said the main question is: why do we need so much swap space???

I had a little research (getsentry/sentry-docs#14698) about memory usage of self-hosted. Testing on a clean environment, its memory usage peaked at 28GB.

Maybe we can decrease swap size for errors-only profile though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants