feat(rust): add OpenEngine bindings crate - #9
connorcarpenter15 wants to merge 7 commits into
Conversation
Signed-off-by: Connor Carpenter <connorc@nvidia.com>
Signed-off-by: Connor Carpenter <connorc@nvidia.com>
Signed-off-by: Connor Carpenter <connorc@nvidia.com>
Signed-off-by: Connor Carpenter <connorc@nvidia.com>
Signed-off-by: Connor Carpenter <connorc@nvidia.com>
dagil-nvidia
left a comment
There was a problem hiding this comment.
One blocker, four judgment calls. The release workflow cannot publish as written, because crates.io rejects the User-Agent its probes send.
Blocker: Missing User-Agent on the crates.io Probes
.github/workflows/rust-release.yml:54,57 call curl with no --user-agent. crates.io blocks the default curl/8.x at the CDN edge under its data access policy and returns 403 with an empty body. There is no 403 arm in the case block, so both probes reach *) and exit 1. That fails validate, publish is skipped through needs, and every openengine-v* tag push stops there.
Only the agent changed between these two runs:
| User-Agent | Crate that exists | Crate that does not |
|---|---|---|
default curl/8.x |
403 | 403 |
openengine-release (+URL) |
200 | 404 |
The same block broke nixpkgs CI (crates.io#13482). The replacement value cannot contain the substring curl, which is blocked on its own (crates.io#13783).
One flag on both lines:
ua="openengine-release (+https://github.com/ai-dynamo/openengine)"
status="$(curl --silent --user-agent "${ua}" --output /dev/null --write-out '%{http_code}' "${url}")"Consider
rust-release.yml:57-62- the idempotency guard assumescargo packageproduces byte-identical output across two runners at two points in time. Pinning the release toolchain to an exact version removes the variable.packages/rust/openengine/src/lib.rs:11-SCHEMA_RELEASEagrees with all three doc sites today and nothing enforces it. A grep in CI would.rust.ymlpaths:filters - these four checks cannot be made required once this lands. A path-filtered check never reports on a PR it filtered out, so requiring them would block every docs-only PR.tools/rust-codegen/src/main.rs-unwrap_or(env::current_dir()?)at 7-10 evaluates its argument eagerly, andenv::set_varat 29 becomesunsafein edition 2024. Neither is reachable as a bug today.- New Rust sources carry no SPDX header, where all eight
.protofiles and every Markdown file do. This PR adds the repository's first non-proto source, so it sets the precedent.
Verified
scripts/check-generated.shreproduces both generated artifacts byte for byte on macOS arm64 under rustc 1.98, a different platform and toolchain than CI. Changing a field inlifecycle.protofails it on both the.rsand the descriptor, so it regenerates rather than only diffing.scripts/check-release-version.shaccepts a matching tag and rejects a mismatched one.cargo package --listships exactly the intended files, the crate carries its own license, the Trusted Publishing setup uses no long-lived token, and the crate name is unclaimed on crates.io.
Pre-existing
buf.yml:25 and buf-push.yml:45 pin actions/checkout@v4, and docs.yml:28,43 use @v6 tags. Not introduced here, and the new workflows are better pinned than these.
Signed-off-by: Connor Carpenter <connorc@nvidia.com>
|
I reviewed this for the intended Dynamo Rust sidecar -> TensorRT-LLM Python gRPC server integration. I found three items worth addressing or coordinating:
The Python server does not need |
Signed-off-by: tanmayv25 <tanmay2592@gmail.com>
Summary
openengineRust crate with checked-in Prost messages and Tonic client/server bindings for the currentopenengine.v1schemaopenengine-v*tag-driven crates.io Trusted Publishing with a documented first-release bootstrapWhy
Rust clients and engine implementations should be able to depend on OpenEngine without cloning the schema repository or running Buf or
protocin consumer builds.Scope
This PR publishes only the Rust crate. It does not add a Python package or Python release automation.
Public API
The initial crate version is
0.1.0and identifies immutable BSR commit768a93c7b44e40f28c692ad0b471a8f2.Validation
cargo fmt --all --checkcargo check --locked --workspace --all-targetscargo +1.90 check --locked --workspace --all-targets(oldest locally installed toolchain; CI covers declared Rust 1.88 MSRV)cargo clippy --locked --workspace --all-targets -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps --package openenginecargo package --locked --package openengineNo custom serialization tests are added: Buf validation, deterministic regeneration, Prost/Tonic compilation, and
cargo packagealready cover the generated protocol and distribution boundaries.