From f4422fabfa3cb661b205d20bb6bb8875dc488b7c Mon Sep 17 00:00:00 2001 From: Chen Xin Date: Mon, 16 Oct 2023 11:05:07 +0800 Subject: [PATCH] free runner disk (#552) * free runner disk * limit cpu * docker.yml * keep swap * keep swap --- .github/workflows/docker.yml | 25 ++++++++++++------------ .github/workflows/linux-x64-gpu.yml | 30 ++++++++++++++++++++++------- .github/workflows/pypi.yml | 12 ++++++++++++ 3 files changed, 47 insertions(+), 20 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9d6d62306b..dc51108078 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -24,19 +24,18 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Check disk space - run: | - df -h - ls /opt/hostedtoolcache - rm -rf ${GITHUB_WORKSPACE}/.git - rm -rf /opt/hostedtoolcache/go - rm -rf /opt/hostedtoolcache/node - rm -rf /opt/hostedtoolcache/Ruby - rm -rf /opt/hostedtoolcache/CodeQL - cat /proc/cpuinfo | grep -ic proc - free - df -h - df . -h + - name: Free disk space + uses: jlumbroso/free-disk-space@main + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: false + docker-images: false + # All of these default to true, but feel free to set to "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: false - name: Get docker info run: | docker info diff --git a/.github/workflows/linux-x64-gpu.yml b/.github/workflows/linux-x64-gpu.yml index d2d2dbae7e..d940408ce7 100644 --- a/.github/workflows/linux-x64-gpu.yml +++ b/.github/workflows/linux-x64-gpu.yml @@ -27,14 +27,30 @@ permissions: jobs: cuda-118: runs-on: ubuntu-latest - container: openmmlab/lmdeploy-builder:cuda11.8 steps: + - name: Free disk space + uses: jlumbroso/free-disk-space@main + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: false + docker-images: false + # All of these default to true, but feel free to set to "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: false - name: Checkout repository uses: actions/checkout@v3 - name: Build - run: | - source /opt/conda/bin/activate - conda activate py38 - mkdir build && cd build - bash ../generate.sh - make -j$(nproc) && make install + uses: addnab/docker-run-action@v3 + with: + image: openmmlab/lmdeploy-builder:cuda11.8 + options: -v ${{ github.workspace }}:/work --cpus=1.8 + run: | + cd /work + source /opt/conda/bin/activate + conda activate py38 + mkdir build && cd build + bash ../generate.sh + make -j$(nproc) && make install diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index d5def5ce2b..7c56e08f7d 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -21,6 +21,18 @@ jobs: DOCKER_TAG: cuda11.8 OUTPUT_FOLDER: cuda11.8_dist steps: + - name: Free disk space + uses: jlumbroso/free-disk-space@main + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: false + docker-images: false + # All of these default to true, but feel free to set to "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: true + swap-storage: false - name: Checkout repository uses: actions/checkout@v3 - name: Build