Skip to content

docs: Update projects #29

docs: Update projects

docs: Update projects #29

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on the `Package`/`PackageSmoke` jobs of
# https://github.com/NVIDIA/NeMo-Relay/blob/0.8.4/.github/workflows/ci_python.yml
name: Build nemo-relay wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/nemo-relay.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-nemo-relay.yml'
- 'docs/packages/nemo-relay.yaml'
- 'patches/nemo-relay/**'
push:
branches: [main]
paths:
- '.github/workflows/build-nemo-relay.yml'
- 'docs/packages/nemo-relay.yaml'
- 'patches/nemo-relay/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
env:
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: nemo-relay
version: ${{ inputs.version }}
build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
name: Build nemo-relay ${{ matrix.version }} cp311-abi3-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 360
env:
NEMO_RELAY_VERSION: ${{ matrix.version }}
steps:
- name: Checkout nemo-relay ${{ env.NEMO_RELAY_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: NVIDIA/NeMo-Relay
ref: ${{ env.NEMO_RELAY_VERSION }}
persist-credentials: false
- name: Checkout python-wheels
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: python-wheels
persist-credentials: false
- name: Apply patches
run: |
git apply python-wheels/patches/nemo-relay/${{ env.NEMO_RELAY_VERSION }}/00*.patch
- name: Set the released version
# The committed workspace version can trail the release tag (0.8.0 at
# the 0.8.4 tag) -- nemo-relay's own package-python recipe does the
# same substitution via set_cargo_workspace_version before invoking
# maturin, which resolves pyproject.toml's dynamic = ["version"] from
# this field.
run: sed -i "s/^version = \".*\"/version = \"${NEMO_RELAY_VERSION}\"/" Cargo.toml
- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
env:
# pyo3's abi3-py311 feature (crates/python/Cargo.toml) makes this one
# wheel; it is built on cp311, the oldest interpreter its tag claims,
# and re-tested on cp312/cp313/cp314 via find_compatible_wheel.
# musllinux is dropped: rustup.rs ships no riscv64 musl toolchain.
CIBW_BUILD: >-
cp311-manylinux_riscv64 cp312-manylinux_riscv64
cp313-manylinux_riscv64 cp314-manylinux_riscv64
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
# nemo-relay ships no [tool.cibuildwheel], so the Rust toolchain its
# maturin backend needs is installed in-container here.
CIBW_BEFORE_ALL_LINUX: >-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# crates/worker-proto generates code with prost/tonic; Rocky 10's CRB
# repo (enabled in the image) carries protoc where protoc-bin-vendored
# (patched to fall back here) does not ship a riscv64 binary.
CIBW_BEFORE_BUILD: yum install -y protobuf-compiler protobuf-devel
# PROTOC_INCLUDE is needed because CRB's protoc 3.19 resolves
# google/protobuf/*.proto from disk rather than from the binary.
CIBW_ENVIRONMENT_LINUX: >-
PATH="$PATH:$HOME/.cargo/bin"
PROTOC_INCLUDE=/usr/include
CIBW_TEST_REQUIRES: pytest>=8 pytest-asyncio>=0.26 pydantic>=2 typing_extensions
CIBW_TEST_SOURCES: pyproject.toml python/tests
# python/tests/integrations needs optional framework extras nemo-relay
# ships as PyPI extras (upstream's own test-python excludes this
# directory too); python/tests/plugin and test_dynamic_plugin_host.py
# exercise out-of-process gRPC worker plugins that spawn a
# cargo-built fixture binary from the full source tree -- out of
# scope for a wheel-level smoke of the compiled extension.
CIBW_TEST_COMMAND: >-
python -c "import nemo_relay._native as m; assert m.__file__.endswith('.so'), m.__file__" &&
python -m pytest -v python/tests
--ignore python/tests/integrations
--ignore python/tests/plugin
--ignore python/tests/test_dynamic_plugin_host.py
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: nemo-relay-${{ env.NEMO_RELAY_VERSION }}-cp311-abi3-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish nemo-relay ${{ 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: nemo-relay-${{ matrix.version }}-*-manylinux_riscv64