Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: Packages

on:
push:
branches:
- main
paths:
- "proto/**"
- "packages/**"
- "tools/rust-codegen/**"
- "scripts/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/packages.yml"
- ".github/workflows/release.yml"
pull_request:
paths:
- "proto/**"
- "packages/**"
- "tools/rust-codegen/**"
- "scripts/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/packages.yml"
- ".github/workflows/release.yml"

permissions:
contents: read

jobs:
generated:
name: Generated bindings
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"

- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Install Python generator
run: python -m pip install grpcio-tools==1.81.1

- name: Check generated bindings
run: ./scripts/check-generated.sh

python:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.14"]
steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install build tools
run: python -m pip install build==1.3.0 twine==6.2.0

- name: Build distributions
run: python -m build packages/python --outdir dist/python

- name: Check distribution metadata
run: python -m twine check dist/python/*

- name: Install wheel
run: python -m pip install dist/python/*.whl

- name: Test installed bindings
run: python -m unittest discover --start-directory packages/python/tests

rust:
name: Rust ${{ matrix.toolchain }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: ["1.88.0", "stable"]
steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}

- name: Test crate
run: cargo test --locked --package openengine-proto

- name: Build publishable crate
run: cargo package --locked --package openengine-proto

- name: List packaged files
run: cargo package --locked --package openengine-proto --list

interoperability:
name: Python and Rust interoperability
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"

- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Install Python package
run: python -m pip install ./packages/python

- name: Test both serialization directions
run: ./scripts/test-cross-language.sh
155 changes: 155 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: read

jobs:
build:
name: Build and verify release
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"

- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Check release versions
run: python scripts/check_release_version.py "${GITHUB_REF_NAME}"

- name: Lint schema
uses: bufbuild/buf-action@v1
with:
version: "1.71.0"
lint: true
format: false
breaking: false
push: false
archive: false
pr_comment: false

- name: Install Python tools
run: >-
python -m pip install
build==1.3.0
grpcio-tools==1.81.1
twine==6.2.0

- name: Check generated bindings
run: ./scripts/check-generated.sh

- name: Test Rust crate
run: cargo test --locked --package openengine-proto

- name: Build Rust crate
run: cargo package --locked --package openengine-proto

- name: Build Python distributions
run: python -m build packages/python --outdir dist/python

- name: Check Python distributions
run: python -m twine check dist/python/*

- name: Install and test Python wheel
run: |
python -m pip install dist/python/*.whl
python -m unittest discover --start-directory packages/python/tests

- name: Test cross-language serialization
run: ./scripts/test-cross-language.sh

- name: Assemble release artifacts
run: |
mkdir -p dist/release
cp dist/python/* dist/release/
cp target/package/openengine-proto-*.crate dist/release/
cp packages/rust/openengine-proto/src/generated/openengine_descriptor.bin \
"dist/release/openengine-${GITHUB_REF_NAME}-descriptor.bin"
tar --create --gzip \
--file "dist/release/openengine-${GITHUB_REF_NAME}-proto.tar.gz" \
--directory proto \
openengine
cd dist/release
sha256sum openengine* > SHA256SUMS

- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
name: openengine-${{ github.ref_name }}
path: dist
if-no-files-found: error

publish-python:
name: Publish Python package
needs: build
runs-on: ubuntu-latest
environment: release
permissions:
actions: read
contents: read
id-token: write
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
name: openengine-${{ github.ref_name }}
path: dist

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/python

publish-rust:
name: Publish Rust crate
needs: build
runs-on: ubuntu-latest
environment: release
steps:
- name: Check out repository
uses: actions/checkout@v6

- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --locked --package openengine-proto

github-release:
name: Create GitHub release
needs: [publish-python, publish-rust]
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
name: openengine-${{ github.ref_name }}
path: dist

- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: >-
gh release create "${GITHUB_REF_NAME}"
dist/release/*
--generate-notes
--title "OpenEngine ${GITHUB_REF_NAME}"
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
__pycache__/
*.py[cod]

# Ignore generated Python gRPC stubs if the README example is run locally.
*_pb2.py
*_pb2_grpc.py
# Local Python environments and package artifacts
.venv/
*.egg-info/
dist/

# Rust build artifacts
target/
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--
SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
-->

# Changelog

All notable changes to the OpenEngine schema and generated packages are
documented here. OpenEngine uses the same version for its Git tag, Python
distribution, and Rust crate.

## [Unreleased]

### Added

- Generated Python protobuf and gRPC bindings.
- Generated Rust Prost and Tonic client/server bindings.
- Reproducible code generation, package CI, and tag-driven releases.

[Unreleased]: https://github.com/ai-dynamo/openengine/commits/main
27 changes: 26 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,32 @@ sending a PR.
- **Bugs / feedback / design questions**: open a [GitHub issue](https://github.com/ai-dynamo/openengine/issues).
- **Pull requests**: open against `main`. Keep changes focused (one logical change per PR).

## Signing Your Work
## Development checks

The schema under `proto/openengine/v1/` is the source of truth. Generated Python
and Rust bindings are checked in for package consumers and must be updated in
the same pull request as a schema change.

```bash
buf build
buf lint

python -m pip install grpcio-tools==1.81.1
./scripts/generate-python.sh
./scripts/generate-rust.sh
./scripts/check-generated.sh

cargo test --locked --package openengine-proto
cargo package --locked --package openengine-proto
python -m build packages/python --outdir dist/python
python -m twine check dist/python/*
./scripts/test-cross-language.sh
```

The Python generator and Rust code-generation toolchain are pinned. Do not edit
generated files by hand; update the schema or generator and regenerate them.

## Signing your work

We require that all contributors "sign off" on their commits. This certifies that
you wrote the contribution, or otherwise have the right to submit it under the
Expand Down
Loading
Loading