fix(examples) Update quickstart-cpp for Flower 1.31#7407
Draft
BESTTOOLBOX wants to merge 2 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the C++ quickstart to work with newer Flower deployments by switching the client to the gRPC grpc-rere Fleet API and aligning the Python app entrypoints with flwr run.
Changes:
- Added a C++ SuperLink/Fleet client implementation with object store (de)serialization and auth metadata signing.
- Added RecordDict ↔︎ local types serialization helpers and a message handler for train/evaluate RPC-style messages.
- Updated the Python ServerApp/strategy utilities and app metadata (pyproject) to run via
flwr run.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/quickstart-cpp/src/supernode_client.cc | Implements Fleet/SuperLink client, object store upload/download, and message loop |
| examples/quickstart-cpp/src/recorddict_serde.cc | Adds RecordDict serialization/deserialization utilities for the C++ client |
| examples/quickstart-cpp/src/message_handler.cc | Adds message dispatch translating message types to client method calls |
| examples/quickstart-cpp/src/main.cc | Switches entrypoint to the new SuperLink client |
| examples/quickstart-cpp/server.py | Converts to ServerApp server_fn for flwr run |
| examples/quickstart-cpp/pyproject.toml | Declares Flower app metadata and Python dependencies |
| examples/quickstart-cpp/include/supernode_client.h | Declares the new C++ client start function and gRPC message size constant |
| examples/quickstart-cpp/include/recorddict_serde.h | Declares RecordDict serde helper APIs |
| examples/quickstart-cpp/include/message_handler.h | Declares handle_message API |
| examples/quickstart-cpp/fedavg_cpp.py | Updates strategy helper functions and tensor byte conversions |
| examples/quickstart-cpp/client.py | Adds placeholder ClientApp required by newer Flower app metadata |
| examples/quickstart-cpp/README.md | Updates docs for SuperLink + flwr run workflow and build requirements |
| examples/quickstart-cpp/CMakeLists.txt | Reworks build to use system gRPC/Protobuf and generates protos from Flower sources |
| examples/quickstart-cpp/.gitignore | Expands ignore patterns for Python and build artifacts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Issue
Description
The existing
examples/quickstart-cppexample is marked as compatible withflwr<1.13.0and still documents the older way of running Flower applications. As a result, the C++ quickstart does not provide a working path for recent Flower versions that useflwr run,ServerApp, SuperLink, and thegrpc-rereFleet API.Related issues/PRs
No related issue.
Proposal
Explanation
This PR updates
examples/quickstart-cppfor Flower 1.31 by replacing the old transport path with an external C++ client that connects to a Flower SuperLink through the currentgrpc-rereFleet API.The updated example:
ServerAppand a placeholderClientApprequired by Flower App metadata;RecordDict,ArrayRecord,ConfigRecord, andMetricRecordpayloads for the synthetic linear-regression quickstart;framework/proto/flwr/proto/*.protoduring the CMake build instead of relying on stale generated files;flower-superlink, external C++ client, andflwr run . --streamworkflow;The linear-regression workload remains intentionally small so the example can be used as a minimal C++ quickstart.
Checklist
#contributions)Any other comments?
Manual validation was run with Flower
1.31.0, two external C++ clients, and a PythonServerAppfor three rounds. The run completed withaggregate_fitandaggregate_evaluatereceiving2 results and 0 failuresin each round.Validation summary after addressing Copilot comments:
Copilot review comments were addressed in
eabc8f1and the corresponding review threads were resolved.CI currently reports
action_requiredfor the fork PR workflows, so I cannot honestly markMake CI checks passuntil a maintainer approves/runs the workflows and they complete successfully. I also left the Slack item unchecked because it requires posting in the Flower Slack workspace outside GitHub.