Skip to content

Commit

Permalink
ci: Free up disk space in a more robust way.
Browse files Browse the repository at this point in the history
Use apt patterns [0] to only try to remove real packages.  Also unify
the way we free up disk space for all workflows.

[0] https://manpages.ubuntu.com/manpages/focal/man7/apt-patterns.7.html

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Ales Musil <amusil@redhat.com>
  • Loading branch information
dceara committed Oct 6, 2023
1 parent c48b198 commit 440751a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
15 changes: 15 additions & 0 deletions .ci/linux-util.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

function free_up_disk_space_ubuntu()
{
local pkgs='azure-cli aspnetcore-* dotnet-* ghc-* firefox*
google-chrome-stable google-cloud-sdk libmono-* llvm-*
microsoft-edge-stable mono-* msbuild mysql-server-core-*
php-* php7* powershell* temurin-* zulu-*'

# Use apt patterns to only select real packages that match the names
# in the list above.
local pkgs=$(echo $pkgs | sed 's/[^ ]* */~n&/g')

sudo apt update && sudo apt-get --auto-remove -y purge $pkgs
}
7 changes: 6 additions & 1 deletion .github/workflows/ovn-fake-multinode-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,18 @@ jobs:
XDG_RUNTIME_DIR: ''

steps:
- name: Check out ovn
uses: actions/checkout@v3

- name: install required dependencies
run: |
sudo apt update || true
sudo apt install -y ${{ env.dependencies }}
- name: Free up disk space
run: sudo eatmydata apt-get remove --auto-remove -y aspnetcore-* dotnet-* libmono-* mono-* msbuild php-* php7* ghc-* zulu-*
run: |
. .ci/linux-util.sh
free_up_disk_space_ubuntu
- uses: actions/download-artifact@v3
with:
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/ovn-kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,14 @@ jobs:
KIND_IPV6_SUPPORT: "${{ matrix.ipfamily == 'IPv6' || matrix.ipfamily == 'dualstack' }}"
steps:

- name: Free up disk space
run: |
sudo eatmydata apt-get purge --auto-remove -y \
azure-cli aspnetcore-* dotnet-* ghc-* firefox \
google-chrome-stable google-cloud-sdk \
llvm-* microsoft-edge-stable mono-* \
msbuild mysql-server-core-* php-* php7* \
powershell temurin-* zulu-*
- name: Check out ovn
uses: actions/checkout@v3

- name: Free up disk space
run: |
. .ci/linux-util.sh
free_up_disk_space_ubuntu
- name: Check out ovn-kubernetes
uses: actions/checkout@v3
with:
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ EXTRA_DIST = \
.ci/dpdk-build.sh \
.ci/dpdk-prepare.sh \
.ci/linux-build.sh \
.ci/linux-util.sh \
.ci/osx-build.sh \
.ci/osx-prepare.sh \
.ci/ovn-kubernetes/Dockerfile \
Expand Down

0 comments on commit 440751a

Please sign in to comment.