Upgrading to Flower NEXT

Flower Framework main

In this article, the migration from using
“client.start_client(server_address=”“, client=FlowerClient)” to using “app=ClientApp(client_fn=client_fn)”.

I have two questions regarding this implementation.

  1. After starting a superlink, I run “flower-client-app client:app --insecure”, but I am faced with this issue:


    → The same issue was faced even when I created a new project using flwr new.

  2. How can we specify which client we are calling? I am simulating Federated Learning with multiple databases. So each client file is tagged to different datasets and the datasets are not in a list where it can be called with a partitioned ID. Is it:
    “flower-client-app file/dir/client_0:app --insecure”?

Is there an example that I could following regarding running client files separately on different terminals?

Thank you

1 Like

Hi @jonaslwq ,

You can pass the path to your ClientApp following a similar syntax to the one you’d use if you were importing it in a python file. For example if you want to use a ClientApp defined in a path/to/client_0.py under the name app you can do:

flower-client-app path.to.client_0:app --insecure

Let us know if this works!

2 Likes

Hello! The error has been solved, I started a superlink and it works, however when I ran the client and server app, it shows that “Connection attempt failed”. Wondering if I am missing any steps?

error:

superlink:

2 Likes

Hello @jonaslwq, are you running the SuperLink on the same machine as your clientapp and serverapp? If not, you might not be passing the correct SuperLink address when launching the client and server.

The commands flower-client-app and flower-server-app have an optional flag called --superlink that allows you to specify the address and port. By default --superlink is "0.0.0.0:9092" for the flower-client-app and "0.0.0.0:9091" for the flower-server-app. Note the ports matter, since clients and server use different APIs.

If you are running the SuperLink on a different machine: find the IP of such machine and replace the 0.0.0.0 in the addresses above.

Let me know if this works!

1 Like