Skip to content

Commit

Permalink
tweak reame and pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
jafermarq committed Oct 11, 2024
1 parent d06a0e9 commit 7ab3edf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 10 additions & 6 deletions examples/flower-authentication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ dataset: [CIFAR-10]
framework: [torch, torchvision]
---

# Flower Authentication with PyTorch 🧪
# Flower Federations with Authentication 🧪

> 🧪 = This example covers experimental features that might change in future versions of Flower
> Please consult the regular PyTorch code examples ([quickstart](https://github.com/adap/flower/tree/main/examples/quickstart-pytorch), [advanced](https://github.com/adap/flower/tree/main/examples/advanced-pytorch)) to learn how to use Flower with PyTorch.
> \[!NOTE\]
> 🧪 = This example covers experimental features that might change in future versions of Flower.
> Please consult the regular PyTorch examples ([quickstart](https://github.com/adap/flower/tree/main/examples/quickstart-pytorch), [advanced](https://github.com/adap/flower/tree/main/examples/advanced-pytorch)) to learn how to use Flower with PyTorch.
The following steps describe how to start a long-running Flower server (SuperLink) and a long-running Flower client (SuperNode) with authentication enabled.
The following steps describe how to start a long-running Flower server (SuperLink+SuperExec) and a long-running Flower clients (SuperNode) with authentication enabled. The task is to train a simple CNN for image classification using PyTorch.

## Project Setup

Start by cloning the example project. We prepared a single-line command that you can copy into your shell which will checkout the example for you:

```shell
git clone --depth=1 https://github.com/adap/flower.git _tmp && mv _tmp/examples/flower-authentication . && rm -rf _tmp && cd flower-authentication
git clone --depth=1 https://github.com/adap/flower.git _tmp \
&& mv _tmp/examples/flower-authentication . \
&& rm -rf _tmp && cd flower-authentication
```

This will create a new directory called `flower-authentication` with the following project structure:
Expand Down Expand Up @@ -67,8 +70,9 @@ Starting long-running Flower server-side components (SuperLink+SuperExec) and en
`--auth-list-public-keys` containing file path to the known `client_public_keys.csv`, `--auth-superlink-private-key`
containing file path to the SuperLink's private key `server_credentials`, and `--auth-superlink-public-key` containing file path to the SuperLink's public key `server_credentials.pub`. Notice that you can only enable authentication with a secure TLS connection.

Let's first launche the `SuperLink`:

```bash
# Launch the Superlink
flower-superlink \
--ssl-ca-certfile certificates/ca.crt \
--ssl-certfile certificates/server.pem \
Expand Down
6 changes: 3 additions & 3 deletions examples/flower-authentication/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version = "1.0.0"
description = "Federated Learning with PyTorch and authenticated Flower "
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.11.0",
"flwr>=1.12.0",
"flwr-datasets[vision]>=0.3.0",
"torch==2.2.1",
"torchvision==0.17.1",
Expand All @@ -34,6 +34,6 @@ batch-size = 32
[tool.flwr.federations]
default = "superexec"

[tool.flwr.federations.superexec]
address = "127.0.0.1:9093"
[tool.flwr.federations.my-federation]
address = "127.0.0.1:9093" # Address of the SuperExec
root-certificates = "certificates/ca.crt"

0 comments on commit 7ab3edf

Please sign in to comment.