easimon / maximize-build-space

Github action to maximize the available disk space on Github runners
MIT License
367 stars 74 forks source link

are LVM operations required #28

Closed sifive-benjamin-morse closed 1 week ago

sifive-benjamin-morse commented 11 months ago

Are the LVM operations required? Would it be possible to just remove the software and skip the LVM step? I only ask because I'm not sure what maximum value I should provide for the root-reserve-mb option. Thanks.

easimon commented 11 months ago

While it would be possible to just remove the software, the LVM setup merges mostly unused temp disk space with the free space of the main disk, adding about 9 GB available space alone. Since these are different disks on the VM, LVM is required to do the merge.

At the moment, skipping this step is not implemented, and I also don't plan it, TBH.

Have you just tried the default for root-reserve-mb of 1024 == 1GB? Does it fail for you?

ZdenekM commented 7 months ago

In my case, the most space is needed on the root, as I'm installing some system packages and building Docker images (well, I can change their location also). In this case, it might also make sense to skip LVM setup.

easimon commented 1 week ago

sorry for the late answer, maybe you already figured that:

the software removal is really mostly a rm -rf on a few directories... you could add that easily directly to your workflow directly and not rely on this action.

For reference: these are the commands used for the packages "known" to the action as remove-*:

          echo "Removing unwanted software... "
          if [[ ${{ inputs.remove-dotnet }} == 'true' ]]; then
            sudo rm -rf /usr/share/dotnet
          fi
          if [[ ${{ inputs.remove-android }} == 'true' ]]; then
            sudo rm -rf /usr/local/lib/android
          fi
          if [[ ${{ inputs.remove-haskell }} == 'true' ]]; then
            sudo rm -rf /opt/ghc
          fi
          if [[ ${{ inputs.remove-codeql }} == 'true' ]]; then
            sudo rm -rf /opt/hostedtoolcache/CodeQL
          fi
          if [[ ${{ inputs.remove-docker-images }} == 'true' ]]; then
            sudo docker image prune --all --force
          fi
          echo "... done"