Skip to content

Commit

Permalink
Try to prevent CI failure by cleaning the build image
Browse files Browse the repository at this point in the history
  • Loading branch information
richiejp committed Apr 16, 2024
1 parent b4eff3a commit 5630b37
Showing 1 changed file with 43 additions and 11 deletions.
54 changes: 43 additions & 11 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,13 @@ env:
IMAGE_DOMAIN: premai
jobs:
build-and-push:
runs-on: Ubuntu-22.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# ADD NEW Dockerfile directories HERE!!!
contexts: [deepspeed-mii]
steps:
- name: Install dependencies
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
run: |
sudo apt-get update \
&& sudo apt-get install -y software-properties-common \
&& sudo apt-get update \
&& sudo add-apt-repository -y ppa:git-core/ppa \
&& sudo apt-get update \
&& sudo apt-get install -y git wget make curl
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- uses: actions/setup-go@v4
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
with:
Expand Down Expand Up @@ -57,6 +47,48 @@ jobs:
flavor: |
prefix=
suffix=
# Taken from LocalAI
- name: Release space from worker
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
run: |
echo "Listing top largest packages"
pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr)
head -n 30 <<< "${pkgs}"
echo
df -h
echo
sudo apt-get remove -y '^llvm-.*|^libllvm.*' || true
sudo apt-get remove --auto-remove android-sdk-platform-tools || true
sudo apt-get purge --auto-remove android-sdk-platform-tools || true
sudo rm -rf /usr/local/lib/android
sudo apt-get remove -y '^dotnet-.*|^aspnetcore-.*' || true
sudo rm -rf /usr/share/dotnet
sudo apt-get remove -y '^mono-.*' || true
sudo apt-get remove -y '^ghc-.*' || true
sudo apt-get remove -y '.*jdk.*|.*jre.*' || true
sudo apt-get remove -y 'php.*' || true
sudo apt-get remove -y hhvm powershell firefox monodoc-manual msbuild || true
sudo apt-get remove -y '^google-.*' || true
sudo apt-get remove -y azure-cli || true
sudo apt-get remove -y '^mongo.*-.*|^postgresql-.*|^mysql-.*|^mssql-.*' || true
sudo apt-get remove -y '^gfortran-.*' || true
sudo apt-get remove -y microsoft-edge-stable || true
sudo apt-get remove -y firefox || true
sudo apt-get remove -y powershell || true
sudo apt-get remove -y r-base-core || true
sudo apt-get autoremove -y
sudo apt-get clean
echo
echo "Listing top largest packages"
pkgs=$(dpkg-query -Wf '${Installed-Size}\t${Package}\t${Status}\n' | awk '$NF == "installed"{print $1 "\t" $2}' | sort -nr)
head -n 30 <<< "${pkgs}"
echo
sudo rm -rfv build || true
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /opt/ghc || true
sudo rm -rf "/usr/local/share/boost" || true
sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true
df -h
- name: Build and push Docker image
if: startsWith(github.ref, format('refs/tags/{0}/v', matrix.contexts))
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
Expand Down

0 comments on commit 5630b37

Please sign in to comment.