From 5e4cfbe0e19c46a3cc02234400ae6485dd51364a Mon Sep 17 00:00:00 2001 From: "Claude Sonnet 4.5" Date: Wed, 15 Jul 2026 20:22:04 +0200 Subject: [PATCH] ci: fix XPU image build (disk space + torch 2.13) and idempotent release The v0.4.0 XPU Docker job failed for two reasons; also harden the release step: - build-xpu ran the runner out of disk mid-extract of the torch-xpu wheel (os error 28). Add a "Free disk space" step reclaiming ~25 GB of unused preinstalled toolchains (dotnet/android/ghc/boost/tool-cache) + a docker image prune before the build. - Dockerfile.xpu still pinned torch==2.11.0; bump to torch==2.13.0 + torchvision==0.28.0 (verified on the PyTorch XPU index) to match the lockfile. Drop the explicit torchaudio (not a project dep) and triton-xpu pin (torch pulls the matching pytorch-triton-xpu itself on the Linux base). - python-publish "Create GitHub Release" now upserts: if the release already exists (e.g. cut manually) it uploads the dists with --clobber instead of failing the whole workflow. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/docker-publish.yml | 9 +++++++++ .github/workflows/python-publish.yml | 14 +++++++++----- docker/Dockerfile.xpu | 6 ++++-- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 85f3a1e..974488d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -100,6 +100,15 @@ jobs: steps: - uses: actions/checkout@v6 + # The XPU image bundles the large torch-xpu wheel (SYCL/MKL/OneCCL); + # the stock runner runs out of disk mid-extract (os error 28). Reclaim + # ~25 GB of preinstalled toolchains we don't need before building. + - name: Free disk space + run: | + sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \ + /usr/local/share/boost "$AGENT_TOOLSDIRECTORY" + sudo docker image prune -af + - uses: docker/setup-buildx-action@v4 - name: Log in to GHCR diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index bd69c90..e13c2c6 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -76,14 +76,18 @@ jobs: - name: Extract version from tag id: version run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT - - name: Create GitHub Release + - name: Create or update GitHub Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release create ${{ github.ref_name }} \ - --title "Release ${{ steps.version.outputs.VERSION }}" \ - --generate-notes \ - dist/* + if gh release view ${{ github.ref_name }} >/dev/null 2>&1; then + gh release upload ${{ github.ref_name }} dist/* --clobber + else + gh release create ${{ github.ref_name }} \ + --title "Release ${{ steps.version.outputs.VERSION }}" \ + --generate-notes \ + dist/* + fi - name: Trigger docker-publish workflow env: diff --git a/docker/Dockerfile.xpu b/docker/Dockerfile.xpu index eba2bc5..8b84c74 100644 --- a/docker/Dockerfile.xpu +++ b/docker/Dockerfile.xpu @@ -45,9 +45,11 @@ USER 1000 RUN uv sync --no-dev --extra all # Replace PyPI torch with the XPU build (bundles SYCL runtime, MKL, OneCCL). -# triton-xpu is Linux-only; Linux-only base image makes the marker moot. +# torch pulls its matching pytorch-triton-xpu itself; the Linux base resolves +# that dependency's sys_platform marker, so no explicit triton pin is needed. +# torchaudio is not a project dependency — dropped to save image space. RUN uv pip install --index-url https://download.pytorch.org/whl/xpu \ - torch==2.11.0 torchvision==0.26.0 torchaudio==2.11.0 triton-xpu==3.7.0 + torch==2.13.0 torchvision==0.28.0 ENV VIRTUAL_ENV=/app/.venv ENV PATH="$VIRTUAL_ENV/bin:$PATH"