Skip to content

fix(examples) Update quickstart-cpp for Flower 1.31#7407

Draft
BESTTOOLBOX wants to merge 2 commits into
flwrlabs:mainfrom
BESTTOOLBOX:main
Draft

fix(examples) Update quickstart-cpp for Flower 1.31#7407
BESTTOOLBOX wants to merge 2 commits into
flwrlabs:mainfrom
BESTTOOLBOX:main

Conversation

@BESTTOOLBOX

@BESTTOOLBOX BESTTOOLBOX commented Jun 17, 2026

Copy link
Copy Markdown

Issue

Description

The existing examples/quickstart-cpp example is marked as compatible with flwr<1.13.0 and 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 use flwr run, ServerApp, SuperLink, and the grpc-rere Fleet API.

Related issues/PRs

No related issue.

Proposal

Explanation

This PR updates examples/quickstart-cpp for Flower 1.31 by replacing the old transport path with an external C++ client that connects to a Flower SuperLink through the current grpc-rere Fleet API.

The updated example:

  • adds a Flower App configuration with a Python ServerApp and a placeholder ClientApp required by Flower App metadata;
  • implements C++ client registration, activation, heartbeat, message polling, message replies, and object push/pull against the Fleet API;
  • serializes and deserializes Flower RecordDict, ArrayRecord, ConfigRecord, and MetricRecord payloads for the synthetic linear-regression quickstart;
  • regenerates C++ protobuf sources from framework/proto/flwr/proto/*.proto during the CMake build instead of relying on stale generated files;
  • updates the README to document the current flower-superlink, external C++ client, and flwr run . --stream workflow;
  • adds a small Python serialization test for the quickstart helper functions.

The linear-regression workload remains intentionally small so the example can be used as a minimal C++ quickstart.

Checklist

  • Implement proposed change
  • Write tests
  • Update documentation
  • Address LLM-reviewer comments, if applicable (e.g., GitHub Copilot)
  • Make CI checks pass
  • Ping maintainers on Slack (channel #contributions)

Any other comments?

Manual validation was run with Flower 1.31.0, two external C++ clients, and a Python ServerApp for three rounds. The run completed with aggregate_fit and aggregate_evaluate receiving 2 results and 0 failures in each round.

Validation summary after addressing Copilot comments:

Flower version: 1.31.0
CMake build: passed
Python unittest: passed, 2 tests
Run finished: 3 rounds
aggregate_fit: 2 results, 0 failures
aggregate_evaluate: 2 results, 0 failures
loss: 4.319e-08 -> 5.192e-16 -> 6.000e-24

Copilot review comments were addressed in eabc8f1 and the corresponding review threads were resolved.

CI currently reports action_required for the fork PR workflows, so I cannot honestly mark Make CI checks pass until 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.

Copilot AI review requested due to automatic review settings June 17, 2026 05:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread examples/quickstart-cpp/src/message_handler.cc Outdated
Comment thread examples/quickstart-cpp/src/supernode_client.cc
Comment thread examples/quickstart-cpp/src/supernode_client.cc Outdated
Comment thread examples/quickstart-cpp/fedavg_cpp.py Outdated
Comment thread examples/quickstart-cpp/fedavg_cpp.py Outdated
Comment thread examples/quickstart-cpp/src/recorddict_serde.cc Outdated
Comment thread examples/quickstart-cpp/include/recorddict_serde.h
Comment thread examples/quickstart-cpp/src/supernode_client.cc
@BESTTOOLBOX BESTTOOLBOX changed the title Update quickstart-cpp for Flower 1.31 fix(examples) Update quickstart-cpp for Flower 1.31 Jun 17, 2026
@github-actions github-actions Bot added the Contributor Used to determine what PRs (mainly) come from external contributors. label Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contributor Used to determine what PRs (mainly) come from external contributors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants