|
8 | 8 | runs: |
9 | 9 | using: 'composite' |
10 | 10 | steps: |
| 11 | + # The default runners have TONS of crud on them... |
| 12 | + - name: Free up disk space on runner |
| 13 | + shell: bash |
| 14 | + run: | |
| 15 | + set -xeuo pipefail |
| 16 | + sudo df -h |
| 17 | + unwanted_pkgs=('^aspnetcore-.*' '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' |
| 18 | + azure-cli google-chrome-stable firefox mono-devel) |
| 19 | + unwanted_dirs=(/usr/share/dotnet /opt/ghc /usr/local/lib/android /opt/hostedtoolcache/CodeQL) |
| 20 | + # Start background removal operations as systemd units; if this causes |
| 21 | + # races in the future around disk space we can look at waiting for cleanup |
| 22 | + # before starting further jobs, but right now we spent a lot of time waiting |
| 23 | + # on the network and scripts and such below, giving these plenty of time to run. |
| 24 | + n=0 |
| 25 | + runcleanup() { |
| 26 | + sudo systemd-run -r -u action-cleanup-${n} -- "$@" |
| 27 | + n=$(($n + 1)) |
| 28 | + } |
| 29 | + runcleanup docker image prune --all --force |
| 30 | + for x in ${unwanted_dirs[@]}; do |
| 31 | + runcleanup rm -rf "$x" |
| 32 | + done |
| 33 | + # Apt removals in foreground, as we can't parallelize these |
| 34 | + for x in ${unwanted_pkgs[@]}; do |
| 35 | + /bin/time -f '%E %C' sudo apt-get remove -y $x |
| 36 | + done |
11 | 37 | # We really want support for heredocs |
12 | 38 | - name: Update podman and install just |
13 | 39 | shell: bash |
|
18 | 44 | test "${IDV}" = "ubuntu-24.04" |
19 | 45 | # plucky is the next release |
20 | 46 | echo 'deb http://azure.archive.ubuntu.com/ubuntu plucky universe main' | sudo tee /etc/apt/sources.list.d/plucky.list |
21 | | - sudo apt update |
| 47 | + /bin/time -f '%E %C' sudo apt update |
22 | 48 | # skopeo is currently older in plucky for some reason hence --allow-downgrades |
23 | | - sudo apt install -y --allow-downgrades crun/plucky podman/plucky skopeo/plucky just |
24 | | - # The default runners have TONS of crud on them... |
25 | | - - name: Free up disk space on runner |
26 | | - shell: bash |
27 | | - run: | |
28 | | - set -xeuo pipefail |
29 | | - sudo df -h |
30 | | - unwanted=('^aspnetcore-.*' '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*' |
31 | | - azure-cli google-chrome-stable firefox mono-devel) |
32 | | - for x in ${unwanted[@]}; do |
33 | | - sudo apt-get remove -y $x |
34 | | - done |
35 | | - # Start other removal operations in parallel |
36 | | - sudo docker image prune --all --force |
37 | | - sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android |
38 | | - sudo df -h |
| 49 | + /bin/time -f '%E %C' sudo apt install -y --allow-downgrades crun/plucky podman/plucky skopeo/plucky just |
39 | 50 | # This is the default on e.g. Fedora derivatives, but not Debian |
40 | 51 | - name: Enable unprivileged /dev/kvm access |
41 | 52 | shell: bash |
@@ -67,18 +78,24 @@ runs: |
67 | 78 | run: | |
68 | 79 | set -xeuo pipefail |
69 | 80 | export BCVK_VERSION=0.5.3 |
70 | | - sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-utils qemu-kvm virtiofsd libvirt-daemon-system |
| 81 | + /bin/time -f '%E %C' sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-utils qemu-kvm virtiofsd libvirt-daemon-system |
71 | 82 | # Something in the stack is overriding this, but we want session right now for bcvk |
72 | 83 | echo LIBVIRT_DEFAULT_URI=qemu:///session >> $GITHUB_ENV |
73 | 84 | td=$(mktemp -d) |
74 | 85 | cd $td |
75 | 86 | # Install bcvk |
76 | 87 | target=bcvk-$(arch)-unknown-linux-gnu |
77 | | - curl -LO https://github.com/bootc-dev/bcvk/releases/download/v${BCVK_VERSION}/${target}.tar.gz |
| 88 | + /bin/time -f '%E %C' curl -LO https://github.com/bootc-dev/bcvk/releases/download/v${BCVK_VERSION}/${target}.tar.gz |
78 | 89 | tar xzf ${target}.tar.gz |
79 | 90 | sudo install -T ${target} /usr/bin/bcvk |
80 | 91 | cd - |
81 | 92 | rm -rf "$td" |
82 | 93 |
|
83 | 94 | # Also bump the default fd limit as a workaround for https://github.com/bootc-dev/bcvk/issues/65 |
84 | 95 | sudo sed -i -e 's,^\* hard nofile 65536,* hard nofile 524288,' /etc/security/limits.conf |
| 96 | + - name: Cleanup status |
| 97 | + shell: bash |
| 98 | + run: | |
| 99 | + set -xeuo pipefail |
| 100 | + systemctl list-units 'action-cleanup*' |
| 101 | + df -h |
0 commit comments