Repository navigation
[Conductor] Add Rust client API - #4651
Merged
Merged
Conversation
Expose ConductorClient through a C ABI (conductor_c.h) and wrap it in a
safe Rust crate at mooncake-conductor/rust, following the Mooncake Store
Rust bindings: bindgen-generated FFI over the C ABI, static linking of
libconductor_cpp_core, and C-allocated outputs released by *_free.
- C ABI: create/destroy, setup/close, health_check, query, register,
unregister, get_global_view and list_services. Return codes equal the
ErrorCode values, and outputs are left zeroed on failure.
- Rust crate: ConductorClient (Send + Sync; the C++ client serializes
calls on its mutex), typed request/result structs mirroring the Python
client, and ConductorError mapped from the C return codes.
- CMake: WITH_CONDUCTOR_RUST option (OFF by default, requires
WITH_CONDUCTOR) adding build_mooncake_conductor_rust{,_tests}.
- Tests: ConductorCApiTest checks the C ABI against the C++ client on an
in-process conductor; tests/minimal_smoke.rs covers server-free errors
and, with MC_RUST_CONDUCTOR_RUN_INTEGRATION=1, a round trip against a
running mooncake_conductor.
Co-Authored-By: Claude Code <noreply@anthropic.com>
Chase-Rong
self-requested a review
October 18, 2026 05:22
Chase-Rong
reviewed
Oct 19, 2026
Chase-Rong
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the PR. The C ABI's memory conventions are consistent (zeroed outputs, counts set right after each allocation, *_free safe on partial/failed outputs) and the Rust Output RAII wrapper is clean.
Verified locally (standalone conductor build + mooncake_conductor server):
- conductor_test: 250/250 pass, including the 5 new ConductorCApiTest.*
- cargo build --release --locked, cargo test (lib + tests), cargo fmt --check, cargo clippy --all-targets: clean
- smoke_round_trip with MC_RUST_CONDUCTOR_RUN_INTEGRATION=1 against a live conductor: pass
Two things I'd like addressed (can be a follow-up PR), plus a few nits inline:
- health_check semantics diverge from PyConductorClient.
- No CI job builds or tests this crate, so bindgen/build.rs/link regressions would go unnoticed.
Chase-Rong
approved these changes
Oct 19, 2026
8 of 36 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose ConductorClient through a C ABI (conductor_c.h) and wrap it in a safe Rust crate at mooncake-conductor/rust, following the Mooncake Store Rust bindings: bindgen-generated FFI over the C ABI, static linking of libconductor_cpp_core, and C-allocated outputs released by *_free.
Description
Module
mooncake-transfer-engine)mooncake-store)mooncake-conductor)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
# Example: bash scripts/run_ci_test.shTest results:
Checklist
./scripts/code_format.shAI Assistance Disclosure