From a454cd3da3b5f69fdd5c385f5ee4a66f706e90a9 Mon Sep 17 00:00:00 2001 From: Alex Cheema Date: Thu, 12 Feb 2026 09:52:48 -0800 Subject: [PATCH] fix: reduce Docker image size and free more CI disk space Clean up Rust target/ and cargo registry after uv sync in the same RUN command so build artifacts aren't committed to the layer (~1-2 GB saved). Also remove more unused toolchains from the CI runner. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/e2e.yml | 4 +++- e2e/Dockerfile | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 89bc2188..afbdfe1a 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -14,7 +14,9 @@ jobs: steps: - name: Free up disk space run: | - sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache + sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \ + /opt/hostedtoolcache /usr/local/share/boost /usr/share/swift \ + /opt/microsoft /opt/az docker system prune -af df -h / diff --git a/e2e/Dockerfile b/e2e/Dockerfile index 40ddacf2..f08f1924 100644 --- a/e2e/Dockerfile +++ b/e2e/Dockerfile @@ -39,8 +39,9 @@ COPY resources/ ./resources/ # Copy built dashboard from stage 1 COPY --from=dashboard /app/dashboard/build ./dashboard/build/ -# Install Python deps and build Rust bindings -RUN uv sync +# Install Python deps and build Rust bindings, then clean up build artifacts +# to keep the layer small (Rust target/ and cargo registry can be 1-2 GB) +RUN uv sync && rm -rf /app/rust/target /root/.cargo/registry /root/.cargo/git # Wrap g++ with -fpermissive to fix MLX CPU JIT compilation with GCC 14 # (GCC 14 treats _Float128/_Float32/_Float64 as built-in types, conflicting with MLX-generated code)