Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publisher: Clean up disk space before building #271

Merged
merged 9 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions .github/workflows/push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: Push Docker image
image-name:
description: Docker image to build
required: true
default: slc8-builder
default: slc9-builder

permissions:
contents: read
Expand All @@ -20,27 +20,40 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# GitHub seems to install an odd version of docker on the host, so run in a
# container and only connect to the host's docker daemon.
container:
image: ubuntu:22.04
volumes:
# Connect to host's docker daemon so we don't run docker inside docker.
- /var/run/docker.sock:/var/run/docker.sock
runs-on: ubuntu-22.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Some images are too large and we run out of disk space, so try to free some
- name: Free disk space
run: |
# https://github.com/jlumbroso/free-disk-space
set -ex
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/local/.ghcup || true
sudo docker image prune --all --force || true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need only the last line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to remove as many things from the default builder as possible because the slc9-gpu-builder is huge. It still doesn't fit, I'll have to find more space to regain...

==> docker: Stderr: Error response from daemon: write /opt/rocm-6.2.4/lib/rocfft/rocfft_kernel_cache.db: no space left on device

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine, but do we have:

          sudo rm -rf /usr/local/lib/android || true
          sudo rm -rf /usr/share/dotnet || true
           sudo rm -rf /opt/ghc || true
           sudo rm -rf /usr/local/.ghcup || true

in the first place? I mean, Haskell ? CSharp?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, the images come with basically everything preinstalled, to make them easier to use (and even several versions of some things, like 5 or 6 Pythons...). It's a questionable approach in my opinion, but at least it means we have some space to regain

https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely questionable... Merging..

sudo rm -rf "$AGENT_TOOLSDIRECTORY" || true

- name: Install prerequisites
run: |
apt update -y
apt install -y software-properties-common
add-apt-repository universe
apt install -y docker.io packer
# packer plugins install github.com/hashicorp/docker
sudo apt update -y
sudo apt install -y software-properties-common
sudo add-apt-repository universe

# containerd.io conflicts with docker.io
sudo apt-get remove containerd.io
sudo apt install -y docker.io

# The packer provided by Ubuntu repos is ancient
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install packer
packer plugins install github.com/hashicorp/docker
env:
DEBIAN_FRONTEND: noninteractive

Expand Down
Loading