docs: Update projects (#2494) #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2026 The RISE Project | |
| # SPDX-License-Identifier: MIT | |
| --- | |
| # This workflow is based on: https://github.com/openvinotoolkit/openvino/blob/2026.3.1/.github/workflows/manylinux_2_28.yml | |
| # (the recipe behind the published PyPI wheels) with the riscv64 cmake options of | |
| # https://github.com/openvinotoolkit/openvino/blob/2026.3.1/.github/workflows/linux_riscv.yml | |
| name: Build openvino wheels (riscv64) | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version glob to (re)build; empty builds every version of docs/packages/openvino.yaml not released yet' | |
| required: false | |
| default: '' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-openvino.yml' | |
| - 'docs/packages/openvino.yaml' | |
| - 'patches/openvino/**' | |
| push: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/build-openvino.yml' | |
| - 'docs/packages/openvino.yaml' | |
| - 'patches/openvino/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| env: | |
| # Upstream's AzureCR build image isn't public; manylinux is the closest equivalent. | |
| MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64 | |
| jobs: | |
| setup: | |
| uses: $/.github/workflows/_setup.yml | |
| with: | |
| package: openvino | |
| version: ${{ inputs.version }} | |
| build_wheels: | |
| needs: [setup] | |
| if: needs.setup.outputs.versions != '[]' | |
| name: Build openvino ${{ matrix.version }} manylinux_riscv64 | |
| runs-on: ubuntu-24.04-riscv | |
| timeout-minutes: 1440 # 24h | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| env: | |
| OPENVINO_VERSION: ${{ matrix.version }} | |
| # Upstream builds the runtime once, then loops the interpreters over src/bindings/python. | |
| PYTHON_TAGS: cp312 cp313 cp314 cp314t | |
| steps: | |
| - name: Checkout openvino ${{ matrix.version }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| repository: openvinotoolkit/openvino | |
| ref: ${{ env.OPENVINO_VERSION }} | |
| submodules: true | |
| persist-credentials: false | |
| path: openvino | |
| - name: Checkout python-wheels | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| path: python-wheels | |
| persist-credentials: false | |
| - name: Patch openvino source | |
| working-directory: openvino | |
| run: git apply -v ../python-wheels/patches/openvino/${{ env.OPENVINO_VERSION }}/*.patch | |
| - name: Write container script | |
| run: | | |
| mkdir -p build install | |
| cat > openvino/riscv64-build-and-test.sh <<'EOF' | |
| #!/bin/bash | |
| set -e -x | |
| # Vendored snappy and xbyak_riscv predate CMake 4's floor; upstream calls /usr/bin/cmake too. | |
| # Retried: a mirrorlist hiccup here otherwise throws away a multi-hour runner slot. | |
| for i in 1 2 3; do dnf install -y cmake && break || sleep 30; done | |
| # gcc-14 bug, as in upstream's manylinux job: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107532 | |
| export CXXFLAGS="-Wno-dangling-reference" | |
| case "$1" in | |
| build|test) ;; | |
| *) echo "usage: $0 <build|test>" >&2; exit 1 ;; | |
| esac | |
| if [ "$1" = build ]; then | |
| # cmake/dependencies.cmake downloads a prebuilt oneTBB for riscv64 | |
| # (oneapi-tbb-2022.3.0-lin-riscv-release.tgz) that is a T-Head Xuantie | |
| # toolchain build carrying vendor CUSTOM-0 opcodes (CLAUDE.md gotcha 449), | |
| # not portable off this fleet. Build the same oneTBB release from source | |
| # with this image's own generic rv64gc toolchain and point OpenVINO at it | |
| # via -DTBB_DIR, which ov_find_package_tbb() honors ahead of ever calling | |
| # ov_download_tbb(). | |
| git clone --branch v2022.3.0 --depth 1 https://github.com/oneapi-src/oneTBB.git /tmp/onetbb | |
| /usr/bin/cmake \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_INSTALL_PREFIX=/opt/onetbb \ | |
| -DCMAKE_INSTALL_LIBDIR=lib \ | |
| -DTBB_TEST=OFF \ | |
| -DTBB_EXAMPLES=OFF \ | |
| -DTBB_STRICT=OFF \ | |
| -S /tmp/onetbb \ | |
| -B /tmp/onetbb-build | |
| /usr/bin/cmake --build /tmp/onetbb-build --parallel "$(nproc)" | |
| /usr/bin/cmake --install /tmp/onetbb-build | |
| # oneDNN compiles all of itself with -march=rv64gcv whenever the compiler can, with no | |
| # runtime gate; its static initializers then SIGILL at plugin dlopen on non-RVV-1.0 cores. | |
| /usr/bin/cmake \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DCAN_COMPILE_RVV_INTRINSICS=OFF \ | |
| -DENABLE_INTEL_GPU=OFF \ | |
| -DENABLE_INTEL_NPU=OFF \ | |
| -DENABLE_SAMPLES=OFF \ | |
| -DENABLE_NCC_STYLE=OFF \ | |
| -DENABLE_PYTHON=OFF \ | |
| -DENABLE_JS=OFF \ | |
| -DENABLE_OV_JAX_FRONTEND=OFF \ | |
| -DENABLE_STRICT_DEPENDENCIES=OFF \ | |
| -DTBB_DIR=/opt/onetbb/lib/cmake/TBB \ | |
| -S /openvino \ | |
| -B /build | |
| /usr/bin/cmake --build /build --parallel "$(nproc)" | |
| fi | |
| for python_tag in ${PYTHON_TAGS}; do | |
| case "${python_tag}" in | |
| *t) python_impl="${python_tag%t}" ;; | |
| *) python_impl="${python_tag}" ;; | |
| esac | |
| python_exe="/opt/python/${python_impl}-${python_tag}/bin/python" | |
| if [ "$1" = build ]; then | |
| "${python_exe}" -m pip install -r /openvino/src/bindings/python/wheel/requirements-dev.txt | |
| gil_option=() | |
| if [ "${python_tag}" != "${python_impl}" ]; then | |
| gil_option=(-DENABLE_GIL_PYTHON_API=OFF) | |
| fi | |
| /usr/bin/cmake \ | |
| -DCMAKE_BUILD_TYPE=Release \ | |
| -DPython3_EXECUTABLE="${python_exe}" \ | |
| -DOpenVINODeveloperPackage_DIR=/build \ | |
| -DENABLE_PYTHON=ON \ | |
| -DENABLE_WHEEL=ON \ | |
| "${gil_option[@]}" \ | |
| -S /openvino/src/bindings/python \ | |
| -B "/build/python_${python_tag}" | |
| /usr/bin/cmake --build "/build/python_${python_tag}" --parallel "$(nproc)" | |
| /usr/bin/cmake --install "/build/python_${python_tag}" --prefix /install --component python_wheels | |
| else | |
| wheel=(/install/wheels/openvino-*-"${python_impl}"-"${python_tag}"-*.whl) | |
| "${python_exe}" -m pip install "${wheel[0]}" pytest pillow | |
| # Run from /tmp so the checkout's src/bindings/python tree cannot shadow the wheel. | |
| cd /tmp | |
| "${python_exe}" -c ' | |
| import numpy as np | |
| import openvino as ov | |
| from openvino import opset14 as ops | |
| print(ov.get_version()) | |
| assert ov._pyopenvino.__file__.endswith(".so"), ov._pyopenvino.__file__ | |
| core = ov.Core() | |
| print(core.available_devices) | |
| assert "CPU" in core.available_devices | |
| param = ops.parameter([1, 4], ov.Type.f32) | |
| model = ov.Model(ops.relu(param), [param], "relu") | |
| compiled = core.compile_model(model, "CPU") | |
| result = compiled(np.array([[-2.0, -1.0, 0.0, 3.0]], dtype=np.float32))[0] | |
| assert np.array_equal(result, [[0.0, 0.0, 0.0, 3.0]]), result' | |
| # cp314t passes the smoke check above but deadlocked in test_start_async (a Python | |
| # callback run from an inference worker thread) for 11h; the GIL builds pass all 7019. | |
| if [ "${python_tag}" = "${python_impl}" ]; then | |
| tests=/openvino/src/bindings/python/tests | |
| "${python_exe}" -m pytest -v \ | |
| "${tests}/test_runtime" \ | |
| "${tests}/test_graph" \ | |
| "${tests}/test_transformations" \ | |
| -m 'not template_extension' | |
| fi | |
| fi | |
| done | |
| EOF | |
| - name: Build wheels | |
| run: | | |
| podman run -t \ | |
| --log-driver=none \ | |
| --network=host \ | |
| -v "${PWD}/openvino":/openvino \ | |
| -v "${PWD}/build":/build \ | |
| -v "${PWD}/install":/install \ | |
| --workdir /openvino \ | |
| -e PYTHON_TAGS="${PYTHON_TAGS}" \ | |
| -e PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ \ | |
| --pull=newer \ | |
| "${MANYLINUX_RISCV64_IMAGE}" \ | |
| bash /openvino/riscv64-build-and-test.sh build | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: openvino-${{ env.OPENVINO_VERSION }}-wheels-manylinux_riscv64 | |
| path: install/wheels/*.whl | |
| if-no-files-found: error | |
| - name: Test wheels | |
| timeout-minutes: 60 # upstream's job_python_api_tests.yml caps its own run at 30 | |
| run: | | |
| podman run -t \ | |
| --log-driver=none \ | |
| --network=host \ | |
| -v "${PWD}/openvino":/openvino \ | |
| -v "${PWD}/install":/install \ | |
| --workdir /openvino \ | |
| -e PYTHON_TAGS="${PYTHON_TAGS}" \ | |
| -e PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ \ | |
| "${MANYLINUX_RISCV64_IMAGE}" \ | |
| bash /openvino/riscv64-build-and-test.sh test | |
| publish: | |
| name: Publish openvino ${{ matrix.version }} | |
| needs: [setup, build_wheels] | |
| if: needs.setup.outputs.versions != '[]' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| version: ${{ fromJSON(needs.setup.outputs.versions) }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| uses: $/.github/workflows/_publish-wheel.yml | |
| secrets: | |
| app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }} | |
| with: | |
| artifact-pattern: openvino-${{ matrix.version }}-*-manylinux_riscv64 |