From 108e8183e136dc54f6817622772b6a9d4c4c481a Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Wed, 2 Dec 2026 03:09:15 +0800 Subject: [PATCH] fix(ci): increase swap for Linux ARM Python wheels (#5333) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both Linux aarch64 wheel variants intermittently lose the final `lancedb-python` rustc process during fat LTO. The affected runners reported 31 GiB of RAM and 16 GiB of configured swap, and the logged Docker invocation supplies no explicit memory cap. The same runner image has also completed wheel builds, so the historical logs leave the source of SIGKILL undetermined. [Standard wheel failure](https://github.com/lancedb/lancedb/actions/runs/46692473826/job/142804749599) ยท [Free-threaded release failure](https://github.com/lancedb/lancedb/actions/runs/46648917509/job/142722631114) Give the two native ARM wheel builds 32 GiB of swap through their shared composite action. This keeps fat LTO and one codegen unit, which preserve release wheel size headroom, and keeps the existing manylinux platform and ABI tags. Record the build container's memory and swap peaks and OOM counters on exit, with kernel and systemd-oomd logs on failed native ARM jobs. --- .../workflows/build_linux_wheel/action.yml | 19 ++++++++++++++++++ .github/workflows/pypi-publish.yml | 20 ------------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_linux_wheel/action.yml b/.github/workflows/build_linux_wheel/action.yml index 1ec5d1a70..d3b142db5 100644 --- a/.github/workflows/build_linux_wheel/action.yml +++ b/.github/workflows/build_linux_wheel/action.yml @@ -74,6 +74,17 @@ runs: unzip /tmp/protoc.zip -d /usr/local rm /tmp/protoc.zip /usr/local/bin/protoc --version + - name: Add swap for native Arm wheel builds + if: ${{ inputs.arm-build == 'true' && runner.arch == 'ARM64' }} + shell: bash + run: | + # Give the final fat-LTO rustc process room to spill beyond host RAM. + swap_file="$RUNNER_TEMP/lancedb-swap" + sudo fallocate --length 32G "$swap_file" + sudo chmod 600 "$swap_file" + sudo mkswap "$swap_file" + sudo swapon "$swap_file" + free -h - name: Build Arm Manylinux Wheel if: ${{ inputs.arm-build == 'true' }} uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0 @@ -87,9 +98,17 @@ runs: args: ${{ inputs.args }} before-script-linux: | set -e + # Report peak usage and OOM counters before Docker removes the container. + trap 'grep -H . /sys/fs/cgroup/memory.{max,peak,swap.max,swap.peak,events} 2>/dev/null || true' EXIT yum install -y clang curl -fsSL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-aarch_64.zip -o /tmp/protoc.zip echo "${PROTOC_SHA256} /tmp/protoc.zip" | sha256sum -c - unzip /tmp/protoc.zip -d /usr/local rm /tmp/protoc.zip /usr/local/bin/protoc --version + - name: Report host memory failures + if: ${{ failure() && inputs.arm-build == 'true' && runner.arch == 'ARM64' }} + shell: bash + run: | + sudo journalctl -k -b --no-pager --grep='oom-kill|Out of memory|Killed process' || true + sudo journalctl -u systemd-oomd -b --no-pager --grep='Killed' || true diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 86e5374f9..b52a5c57f 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -79,16 +79,6 @@ jobs: uses: actions/setup-python@v6 with: python-version: "3.11" - - name: Add swap for Arm fat LTO - if: matrix.config.platform == 'aarch64' - shell: bash - run: | - swap_file="$RUNNER_TEMP/lancedb-swap" - sudo fallocate --length 16G "$swap_file" - sudo chmod 600 "$swap_file" - sudo mkswap "$swap_file" - sudo swapon "$swap_file" - free -h - uses: ./.github/workflows/build_linux_wheel with: python-minor-version: 10 @@ -194,16 +184,6 @@ jobs: uses: actions/setup-python@v6 with: python-version: "3.15t" - - name: Add swap for Arm fat LTO - if: matrix.config.platform == 'aarch64' - shell: bash - run: | - swap_file="$RUNNER_TEMP/lancedb-swap" - sudo fallocate --length 16G "$swap_file" - sudo chmod 600 "$swap_file" - sudo mkswap "$swap_file" - sudo swapon "$swap_file" - free -h - uses: ./.github/workflows/build_linux_wheel with: python-minor-version: 15