Skip to content

Commit d967a90

Browse files
authored
Merge pull request #168 from VectorInstitute/fix_disk_space_docker_build
Fix disk space blowup by adding cache clean
2 parents 4e4e8e1 + de83788 commit d967a90

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

.github/workflows/docker.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
pull_request:
1414
branches:
1515
- main
16+
- f/sglang-support
1617
paths:
1718
- Dockerfile
1819
- .github/workflows/docker.yml
@@ -22,8 +23,7 @@ jobs:
2223
push_to_registry:
2324
name: Push Docker image to Docker Hub
2425
runs-on:
25-
- self-hosted
26-
- docker
26+
- ubuntu-latest
2727
steps:
2828
- name: Checkout repository
2929
uses: actions/[email protected]
@@ -34,6 +34,24 @@ jobs:
3434
VERSION=$(grep -A 1 'name = "vllm"' uv.lock | grep version | cut -d '"' -f 2)
3535
echo "version=$VERSION" >> $GITHUB_OUTPUT
3636
37+
- name: Maximize build space
38+
run: |
39+
echo "Disk space before cleanup:"
40+
df -h
41+
# Remove unnecessary pre-installed software
42+
sudo rm -rf /usr/share/dotnet
43+
sudo rm -rf /usr/local/lib/android
44+
sudo rm -rf /opt/ghc
45+
sudo rm -rf /opt/hostedtoolcache/CodeQL
46+
sudo rm -rf /usr/local/share/boost
47+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
48+
# Clean apt cache
49+
sudo apt-get clean
50+
# Remove docker images
51+
docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true
52+
echo "Disk space after cleanup:"
53+
df -h
54+
3755
- name: Set up Docker Buildx
3856
uses: docker/setup-buildx-action@v3
3957

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ WORKDIR /vec-inf
5757
COPY . /vec-inf
5858

5959
# Install project dependencies with build requirements
60-
RUN uv pip install --system -e .[dev] --prerelease=allow
60+
# Use --no-cache to prevent uv from storing both downloaded and extracted packages
61+
RUN uv pip install --system -e .[dev] --prerelease=allow --no-cache && \
62+
rm -rf /root/.cache/uv /tmp/*
6163

6264
# Install a single, system NCCL (from NVIDIA CUDA repo in base image)
6365
RUN apt-get update && apt-get install -y --allow-change-held-packages\

0 commit comments

Comments
 (0)