|
| 1 | +# SPDX-FileCopyrightText: 2026 The RISE Project |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | +--- |
| 4 | +# Based on upstream's own wheel build at this tag: |
| 5 | +# https://github.com/apache/sedona/blob/sedona-1.9.1/.github/workflows/python-wheel.yml |
| 6 | +name: Build apache-sedona wheels (riscv64) |
| 7 | + |
| 8 | +on: |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + version: |
| 12 | + description: 'apache-sedona version to build (git tag without leading sedona-, e.g. 1.9.1)' |
| 13 | + required: true |
| 14 | + default: '1.9.1' |
| 15 | + pull_request: |
| 16 | + paths: |
| 17 | + - '.github/workflows/build-apache-sedona.yml' |
| 18 | + |
| 19 | +concurrency: |
| 20 | + group: ${{ github.workflow }}-${{ inputs.version || '1.9.1' }}-${{ github.head_ref || github.run_id }} |
| 21 | + cancel-in-progress: true |
| 22 | + |
| 23 | +permissions: |
| 24 | + contents: read # to fetch code (actions/checkout) |
| 25 | + |
| 26 | +env: |
| 27 | + # `inputs.version` is empty on pull_request events; default to 1.9.1 there. |
| 28 | + SEDONA_VERSION: ${{ inputs.version || '1.9.1' }} |
| 29 | + MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 |
| 30 | + |
| 31 | +jobs: |
| 32 | + setup: |
| 33 | + uses: $/.github/workflows/_setup.yml |
| 34 | + |
| 35 | + build_wheels: |
| 36 | + needs: [setup] |
| 37 | + name: Build apache-sedona ${{ inputs.version || '1.9.1' }} ${{ matrix.python }}-manylinux_riscv64 |
| 38 | + runs-on: ubuntu-24.04-riscv |
| 39 | + # pyspark (a test-only dependency, pulled in via the "spark" extra) ships no |
| 40 | + # wheel anywhere and is a ~400MB sdist; give the download/install room. |
| 41 | + timeout-minutes: 90 |
| 42 | + strategy: |
| 43 | + fail-fast: false |
| 44 | + matrix: |
| 45 | + # sedona.spark.utils.geomserde_speedup is a plain CPython C extension |
| 46 | + # (not abi3), so every interpreter needs its own build, matching |
| 47 | + # upstream's own per-version wheels. musllinux is skipped: shapely (a |
| 48 | + # hard runtime dependency, pulled in when the wheel is installed) has |
| 49 | + # no riscv64 musllinux wheel anywhere, only manylinux. |
| 50 | + python: ["cp312", "cp313", "cp314", "cp314t"] |
| 51 | + |
| 52 | + steps: |
| 53 | + - name: Checkout apache/sedona sedona-${{ env.SEDONA_VERSION }} |
| 54 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 55 | + with: |
| 56 | + repository: apache/sedona |
| 57 | + ref: sedona-${{ env.SEDONA_VERSION }} |
| 58 | + persist-credentials: false |
| 59 | + |
| 60 | + - name: Build wheels |
| 61 | + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 |
| 62 | + with: |
| 63 | + package-dir: python |
| 64 | + output-dir: wheelhouse/ |
| 65 | + only: ${{ matrix.python }}-manylinux_riscv64 |
| 66 | + env: |
| 67 | + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }} |
| 68 | + # shapely (installed as a dependency of the built wheel) only has a |
| 69 | + # riscv64 wheel on our own registry, not on public PyPI. |
| 70 | + CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ |
| 71 | + # sedona.spark.utils (which the test below imports through) hard-requires |
| 72 | + # pyspark to import at all, even though the base wheel doesn't declare it - |
| 73 | + # only the "spark" extra does. pyspark itself ships no wheel on any arch |
| 74 | + # (sdist only), but is pure Python + bundled jars, so it builds trivially. |
| 75 | + # Importing sedona.spark also reaches sedona.spark.sql.functions, which |
| 76 | + # imports pandas directly (undeclared anywhere in sedona's own metadata). |
| 77 | + CIBW_TEST_EXTRAS: spark |
| 78 | + CIBW_TEST_REQUIRES: pytest pandas |
| 79 | + # pandas has no cp314t wheel on our registry yet, and it's needed |
| 80 | + # transitively to even import the test module; skip testing that leg |
| 81 | + # (the wheel itself still builds). |
| 82 | + CIBW_TEST_SKIP: cp314t-* |
| 83 | + # geomserde_speedup's own suite: exercises (de)serialization through the |
| 84 | + # compiled extension without needing a JVM/Spark session, unlike the rest |
| 85 | + # of the test tree (see .github/workflows/python-extension.yml upstream). |
| 86 | + CIBW_TEST_SOURCES: python/tests/utils/test_geomserde_speedup.py |
| 87 | + CIBW_TEST_COMMAND: python -m pytest python/tests/utils/test_geomserde_speedup.py -v |
| 88 | + |
| 89 | + - name: Check the compiled extension made it into the wheel |
| 90 | + run: | |
| 91 | + python3 - wheelhouse/*.whl <<'EOF' |
| 92 | + import sys, zipfile |
| 93 | + for whl in sys.argv[1:]: |
| 94 | + names = zipfile.ZipFile(whl).namelist() |
| 95 | + assert any(n.endswith(".so") and "geomserde_speedup" in n for n in names), \ |
| 96 | + f"no geomserde_speedup extension in {whl}" |
| 97 | + print(whl, "ok") |
| 98 | + EOF |
| 99 | +
|
| 100 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 101 | + with: |
| 102 | + name: apache-sedona-${{ env.SEDONA_VERSION }}-${{ matrix.python }}-manylinux_riscv64 |
| 103 | + path: wheelhouse/*.whl |
| 104 | + if-no-files-found: error |
| 105 | + |
| 106 | + publish: |
| 107 | + name: Publish apache-sedona ${{ inputs.version || '1.9.1' }} |
| 108 | + needs: [setup, build_wheels] |
| 109 | + permissions: |
| 110 | + contents: write |
| 111 | + pull-requests: write |
| 112 | + uses: $/.github/workflows/_publish-wheel.yml |
| 113 | + with: |
| 114 | + artifact-pattern: apache-sedona-${{ inputs.version || '1.9.1' }}-*-manylinux_riscv64 |
0 commit comments