|
| 1 | +# SPDX-FileCopyrightText: 2026 The RISE Project |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | +--- |
| 4 | +# Based on upstream's own wheel build: |
| 5 | +# https://github.com/rapidsai/ucx-wheels/blob/eb5c51bc99469b337766454e3df7bc1506f9fa23/.github/workflows/build_and_test.yaml |
| 6 | +# https://github.com/rapidsai/ucx-wheels/blob/eb5c51bc99469b337766454e3df7bc1506f9fa23/ci/build_wheel.sh |
| 7 | +# https://github.com/rapidsai/ucx-wheels/blob/eb5c51bc99469b337766454e3df7bc1506f9fa23/ci/test_wheel.sh |
| 8 | +name: Build libucx-cu12 wheels (riscv64) |
| 9 | + |
| 10 | +on: |
| 11 | + workflow_dispatch: |
| 12 | + inputs: |
| 13 | + version: |
| 14 | + description: 'Version glob to (re)build; empty builds every version of docs/packages/libucx-cu12.yaml not released yet' |
| 15 | + required: false |
| 16 | + default: '' |
| 17 | + pull_request: |
| 18 | + branches: [main] |
| 19 | + paths: |
| 20 | + - '.github/workflows/build-libucx-cu12.yml' |
| 21 | + - 'docs/packages/libucx-cu12.yaml' |
| 22 | + push: |
| 23 | + branches: [main] |
| 24 | + paths: |
| 25 | + - '.github/workflows/build-libucx-cu12.yml' |
| 26 | + - 'docs/packages/libucx-cu12.yaml' |
| 27 | + |
| 28 | +concurrency: |
| 29 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 30 | + cancel-in-progress: true |
| 31 | + |
| 32 | +permissions: |
| 33 | + contents: read # to fetch code (actions/checkout) |
| 34 | + |
| 35 | +env: |
| 36 | + # rapidsai/ucx-wheels pushes no tags; this is "Release 1.21.0 (#45)", the |
| 37 | + # libucx/GIT_COMMIT recorded in the 1.21.0 PyPI wheels. Update alongside LIBUCX_CU12_VERSION. |
| 38 | + LIBUCX_CU12_REF: eb5c51bc99469b337766454e3df7bc1506f9fa23 |
| 39 | + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 |
| 40 | + |
| 41 | +jobs: |
| 42 | + setup: |
| 43 | + uses: $/.github/workflows/_setup.yml |
| 44 | + with: |
| 45 | + package: libucx-cu12 |
| 46 | + version: ${{ inputs.version }} |
| 47 | + |
| 48 | + build_wheels: |
| 49 | + needs: [setup] |
| 50 | + if: needs.setup.outputs.versions != '[]' |
| 51 | + name: Build libucx-cu12 ${{ matrix.version }} py3-none-manylinux_riscv64 |
| 52 | + runs-on: ubuntu-24.04-riscv |
| 53 | + timeout-minutes: 240 |
| 54 | + strategy: |
| 55 | + fail-fast: false |
| 56 | + matrix: |
| 57 | + version: ${{ fromJSON(needs.setup.outputs.versions) }} |
| 58 | + |
| 59 | + env: |
| 60 | + LIBUCX_CU12_VERSION: ${{ matrix.version }} |
| 61 | + |
| 62 | + steps: |
| 63 | + - name: Checkout rapidsai/ucx-wheels ${{ env.LIBUCX_CU12_VERSION }} |
| 64 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 65 | + with: |
| 66 | + repository: rapidsai/ucx-wheels |
| 67 | + ref: ${{ env.LIBUCX_CU12_REF }} |
| 68 | + persist-credentials: false |
| 69 | + |
| 70 | + - name: Checkout python-wheels |
| 71 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 72 | + with: |
| 73 | + path: python-wheels |
| 74 | + persist-credentials: false |
| 75 | + |
| 76 | + - name: Patch ucx-wheels source |
| 77 | + run: | |
| 78 | + git apply python-wheels/patches/libucx-cu12/${{ env.LIBUCX_CU12_VERSION }}/*.patch |
| 79 | +
|
| 80 | + # The wheel ships UCX's libraries but upstream only includes the packaging repo's LICENSE. |
| 81 | + - name: Stage UCX licence |
| 82 | + run: | |
| 83 | + curl -fsSL --retry 5 "https://raw.githubusercontent.com/openucx/ucx/v${LIBUCX_CU12_VERSION}/LICENSE" -o python/libucx/LICENSE.ucx |
| 84 | +
|
| 85 | + - name: Pull manylinux_riscv64 image |
| 86 | + run: docker pull "${MANYLINUX_RISCV64_IMAGE}" |
| 87 | + |
| 88 | + - name: Build and repair the wheel |
| 89 | + run: | |
| 90 | + docker run --rm -v "$(pwd):/work" -w /work -e PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ "${MANYLINUX_RISCV64_IMAGE}" bash -c ' |
| 91 | + set -euxo pipefail |
| 92 | + dnf install -y --enablerepo=crb autoconf automake libtool |
| 93 | + git config --global --add safe.directory /work |
| 94 | + export PATH=/opt/python/cp314-cp314/bin:$PATH |
| 95 | +
|
| 96 | + python -m pip wheel python/libucx/ -w python/libucx/dist -v --no-deps --disable-pip-version-check |
| 97 | +
|
| 98 | + auditwheel repair \ |
| 99 | + -w wheelhouse \ |
| 100 | + --exclude "libucm.so.0" \ |
| 101 | + --exclude "libuct.so.0" \ |
| 102 | + --exclude "libucs.so.0" \ |
| 103 | + --exclude "libucp.so.0" \ |
| 104 | + python/libucx/dist/* |
| 105 | + ' |
| 106 | +
|
| 107 | + - name: Test the wheel |
| 108 | + run: | |
| 109 | + docker run --rm -v "$(pwd):/work" -w /tmp "${MANYLINUX_RISCV64_IMAGE}" bash -c ' |
| 110 | + set -euxo pipefail |
| 111 | + for pydir in cp312-cp312 cp313-cp313 cp314-cp314 cp314-cp314t; do |
| 112 | + pybin=/opt/python/$pydir/bin |
| 113 | + "$pybin/pip" install -q /work/wheelhouse/*.whl |
| 114 | + "$pybin/python" -c "import libucx; assert all(libucx.load_library()); print(\"Loaded libucx libraries successfully!\")" |
| 115 | + done |
| 116 | + ucx_bin=$("$pybin/python" -c "import libucx, os; print(os.path.join(os.path.dirname(libucx.__file__), \"bin\"))") |
| 117 | + "$ucx_bin/ucx_info" -v |
| 118 | + "$ucx_bin/ucx_info" -d |
| 119 | + ' |
| 120 | +
|
| 121 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 122 | + with: |
| 123 | + name: libucx-cu12-${{ env.LIBUCX_CU12_VERSION }}-py3-none-manylinux_riscv64 |
| 124 | + path: wheelhouse/*.whl |
| 125 | + if-no-files-found: error |
| 126 | + |
| 127 | + gpl_sources: |
| 128 | + needs: [setup] |
| 129 | + if: needs.setup.outputs.versions != '[]' |
| 130 | + name: Collect GPL sources for libucx-cu12 ${{ matrix.version }} |
| 131 | + runs-on: ubuntu-24.04-riscv |
| 132 | + strategy: |
| 133 | + fail-fast: false |
| 134 | + matrix: |
| 135 | + version: ${{ fromJSON(needs.setup.outputs.versions) }} |
| 136 | + |
| 137 | + env: |
| 138 | + LIBUCX_CU12_VERSION: ${{ matrix.version }} |
| 139 | + |
| 140 | + steps: |
| 141 | + - name: Checkout python-wheels |
| 142 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 143 | + with: |
| 144 | + persist-credentials: false |
| 145 | + |
| 146 | + - uses: ./actions/collect-gpl-sources |
| 147 | + with: |
| 148 | + image: ${{ env.MANYLINUX_RISCV64_IMAGE }} |
| 149 | + output: gpl-sources.tar |
| 150 | + |
| 151 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 152 | + with: |
| 153 | + name: libucx-cu12-${{ env.LIBUCX_CU12_VERSION }}-gpl-sources |
| 154 | + path: gpl-sources.tar |
| 155 | + if-no-files-found: error |
| 156 | + |
| 157 | + publish: |
| 158 | + name: Publish libucx-cu12 ${{ matrix.version }} |
| 159 | + needs: [setup, build_wheels, gpl_sources] |
| 160 | + if: needs.setup.outputs.versions != '[]' |
| 161 | + strategy: |
| 162 | + fail-fast: false |
| 163 | + matrix: |
| 164 | + version: ${{ fromJSON(needs.setup.outputs.versions) }} |
| 165 | + permissions: |
| 166 | + contents: write |
| 167 | + pull-requests: write |
| 168 | + uses: $/.github/workflows/_publish-wheel.yml |
| 169 | + secrets: |
| 170 | + app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} |
| 171 | + with: |
| 172 | + artifact-pattern: libucx-cu12-${{ matrix.version }}-*-manylinux_riscv64 |
| 173 | + gpl-sources-artifact: libucx-cu12-${{ matrix.version }}-gpl-sources |
| 174 | + gpl-sources-description: gcc |
0 commit comments