runner icon indicating copy to clipboard operation
runner copied to clipboard

_tool directory does not run clean up

Open alexiaizenberg opened this issue 2 years ago • 5 comments

Describe the bug _work/_tool is growing in space and does not remove old versions.,

To Reproduce Steps to reproduce the behavior:

  1. Check the size of _tool directory especially gcloud and CodeQL

Expected behavior Post install of a newer version of tool/runner the old versions should be removed.

Runner Version and Platform

Version of your runner? 2.303.0

OS of the machine running the runner? Linux x86

What's not working?

Size of the _tool directory is nearly 100GB.

Job Log Output

root@imvbuild10:/home/ghrunner1/actions-runner/_work/_tool# du -sh *
32G     CodeQL
63G     gcloud
3.6G    ndk
359M    node
root@imvbuild10:/home/ghrunner1/actions-runner/_work/_tool# cd gcloud/
root@imvbuild10:/home/ghrunner1/actions-runner/_work/_tool/gcloud# ll
total 176
drwxr-xr-x 44 root root 4096 Apr  4 17:11 ./
drwxr-xr-x  6 root root 4096 Nov 25 23:22 ../
drwxr-xr-x  3 root root 4096 May 27  2022 387.0.0/
drwxr-xr-x  3 root root 4096 Jun  3  2022 388.0.0/
drwxr-xr-x  3 root root 4096 Jun  8  2022 389.0.0/
drwxr-xr-x  3 root root 4096 Jun 16  2022 390.0.0/
drwxr-xr-x  3 root root 4096 Jun 22  2022 391.0.0/
drwxr-xr-x  3 root root 4096 Jun 28  2022 392.0.0/
drwxr-xr-x  3 root root 4096 Jul 12  2022 393.0.0/
drwxr-xr-x  3 root root 4096 Jul 20  2022 394.0.0/
drwxr-xr-x  3 root root 4096 Jul 26  2022 395.0.0/
drwxr-xr-x  3 root root 4096 Aug  2  2022 396.0.0/
drwxr-xr-x  3 root root 4096 Aug  9  2022 397.0.0/
drwxr-xr-x  3 root root 4096 Aug 17  2022 398.0.0/
drwxr-xr-x  3 root root 4096 Aug 24  2022 399.0.0/
drwxr-xr-x  3 root root 4096 Aug 30  2022 400.0.0/
drwxr-xr-x  3 root root 4096 Sep  7  2022 401.0.0/
drwxr-xr-x  3 root root 4096 Sep 13  2022 402.0.0/
drwxr-xr-x  3 root root 4096 Sep 21  2022 403.0.0/
drwxr-xr-x  3 root root 4096 Sep 27  2022 404.0.0/
drwxr-xr-x  3 root root 4096 Oct  4  2022 405.0.0/
drwxr-xr-x  3 root root 4096 Oct 15 05:05 405.0.1/
drwxr-xr-x  3 root root 4096 Oct 18 07:26 406.0.0/
drwxr-xr-x  3 root root 4096 Oct 25 19:34 407.0.0/
drwxr-xr-x  3 root root 4096 Nov  1 18:46 408.0.0/
drwxr-xr-x  3 root root 4096 Nov  3 05:40 408.0.1/
drwxr-xr-x  3 root root 4096 Nov  8 21:04 409.0.0/
drwxr-xr-x  3 root root 4096 Nov 16 06:41 410.0.0/
drwxr-xr-x  3 root root 4096 Dec  6 20:02 411.0.0/
drwxr-xr-x  3 root root 4096 Dec 13 17:47 412.0.0/
drwxr-xr-x  3 root root 4096 Jan 10 15:03 413.0.0/
drwxr-xr-x  3 root root 4096 Jan 18 18:22 414.0.0/
drwxr-xr-x  3 root root 4096 Jan 24 17:59 415.0.0/
drwxr-xr-x  3 root root 4096 Jan 31 16:36 416.0.0/
drwxr-xr-x  3 root root 4096 Feb  7 17:33 417.0.0/
drwxr-xr-x  3 root root 4096 Feb  8 21:21 417.0.1/
drwxr-xr-x  3 root root 4096 Feb 15 07:49 418.0.0/
drwxr-xr-x  3 root root 4096 Feb 22 19:45 419.0.0/
drwxr-xr-x  3 root root 4096 Feb 28 16:41 420.0.0/
drwxr-xr-x  3 root root 4096 Mar  8 07:59 421.0.0/
drwxr-xr-x  3 root root 4096 Mar 14 15:41 422.0.0/
drwxr-xr-x  3 root root 4096 Mar 21 13:51 423.0.0/
drwxr-xr-x  3 root root 4096 Mar 29 04:03 424.0.0/
drwxr-xr-x  3 root root 4096 Apr  4 17:11 425.0.0/

alexiaizenberg avatar Apr 05 '23 16:04 alexiaizenberg

Can you provide any solution or workaround?

mariocmourao avatar Mar 05 '24 19:03 mariocmourao

+1

wclarkpk avatar Oct 22 '24 18:10 wclarkpk

same here with runner version 2.314.1

andreas-sch-b avatar Dec 20 '24 08:12 andreas-sch-b

We added a job in the cicd workflow file to clean up the _tool and _temp directories after deploy.

Existing code

jobs:
  deploy:
    runs-on: self-hosted

    container:
      image: google/cloud-sdk:slim

    steps:
      - ...

Added code

  cleanup:
    runs-on: self-hosted
    needs: deploy
    steps:
      - name: Cleanup files from self-hosted runner
        run: |
          cd ${{ github.workspace }}
          cd ../..
          rm -rf _temp _tool

AveryChan avatar Mar 14 '25 07:03 AveryChan

It should remove all but the last version because anyways you are going to use the latest version downloaded or a new version that will be downloaded. Eventually I embedded a version of the action itself in the workflow and I periodically promote the version to the latest available.

alexiaizenberg avatar Mar 14 '25 14:03 alexiaizenberg