From 618b8fd2500fe6120f9aeb94ed6f55008a6f6e36 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Wed, 17 Apr 2024 12:34:31 +0200 Subject: [PATCH] Fix quickstart-cpp example (#3275) --- examples/quickstart-cpp/README.md | 16 ++++++++++------ examples/quickstart-cpp/driver.py | 10 ---------- examples/quickstart-cpp/server.py | 8 -------- 3 files changed, 10 insertions(+), 24 deletions(-) delete mode 100644 examples/quickstart-cpp/driver.py diff --git a/examples/quickstart-cpp/README.md b/examples/quickstart-cpp/README.md index d8982048793c..d6cbeebe1bc6 100644 --- a/examples/quickstart-cpp/README.md +++ b/examples/quickstart-cpp/README.md @@ -1,4 +1,4 @@ -# Flower Clients in C++ +# Flower Clients in C++ (under development) In this example you will train a linear model on synthetic data using C++ clients. @@ -12,7 +12,7 @@ Many thanks to the original contributors to this code: ## Install requirements -You'll need CMake and Python. +You'll need CMake and Python with `flwr` installed. ### Building the example @@ -23,16 +23,20 @@ cmake -S . -B build cmake --build build ``` -## Run the server and two clients in separate terminals +## Run the `Flower SuperLink`, the two clients, and the `Flower ServerApp` in separate terminals ```bash -python server.py +flwr-superlink --insecure ``` ```bash -build/flwr_client 0 127.0.0.1:8080 +build/flwr_client 0 127.0.0.1:9092 ``` ```bash -build/flwr_client 1 127.0.0.1:8080 +build/flwr_client 1 127.0.0.1:9092 +``` + +```bash +flower-server-app server:app --insecure ``` diff --git a/examples/quickstart-cpp/driver.py b/examples/quickstart-cpp/driver.py deleted file mode 100644 index f19cf0e9bd98..000000000000 --- a/examples/quickstart-cpp/driver.py +++ /dev/null @@ -1,10 +0,0 @@ -import flwr as fl -from fedavg_cpp import FedAvgCpp - -# Start Flower server for three rounds of federated learning -if __name__ == "__main__": - fl.server.start_driver( - server_address="0.0.0.0:9091", - config=fl.server.ServerConfig(num_rounds=3), - strategy=FedAvgCpp(), - ) diff --git a/examples/quickstart-cpp/server.py b/examples/quickstart-cpp/server.py index 99d549a4bb45..8ad8e0b3647c 100644 --- a/examples/quickstart-cpp/server.py +++ b/examples/quickstart-cpp/server.py @@ -14,11 +14,3 @@ config=fl.server.ServerConfig(num_rounds=3), strategy=strategy, ) - -# Start Flower server for three rounds of federated learning -if __name__ == "__main__": - fl.server.start_server( - server_address="0.0.0.0:8080", - config=fl.server.ServerConfig(num_rounds=3), - strategy=strategy, - )