From 36e2ac9cab78e77a2944851c78881c895de461b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:47:18 +0100 Subject: [PATCH 01/16] build(deps): bump Wandalen/wretry.action from 3.7.2 to 3.7.3 (#4577) Bumps [Wandalen/wretry.action](https://github.com/wandalen/wretry.action) from 3.7.2 to 3.7.3. - [Release notes](https://github.com/wandalen/wretry.action/releases) - [Commits](https://github.com/wandalen/wretry.action/compare/8ceaefd717b7cdae4f2637f9a433242ade421a0a...ffdd254f4eaf1562b8a2c66aeaa37f1ff2231179) --- updated-dependencies: - dependency-name: Wandalen/wretry.action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/_docker-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_docker-build.yml b/.github/workflows/_docker-build.yml index da68b09d52a0..88aa55ce68aa 100644 --- a/.github/workflows/_docker-build.yml +++ b/.github/workflows/_docker-build.yml @@ -93,7 +93,7 @@ jobs: password: ${{ secrets.dockerhub-token }} - name: Build and push - uses: Wandalen/wretry.action@8ceaefd717b7cdae4f2637f9a433242ade421a0a # v3.7.2 + uses: Wandalen/wretry.action@ffdd254f4eaf1562b8a2c66aeaa37f1ff2231179 # v3.7.3 id: build with: action: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 From b22b8f696fe3839ecbd809b368661817ee7b593d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 08:55:31 +0000 Subject: [PATCH 02/16] build(deps): bump docker/metadata-action from 5.5.1 to 5.6.1 (#4578) Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.5.1 to 5.6.1. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/8e5442c4ef9f78752691e2d8f8d19755c6f78e81...369eb591f429131d6889c46b94e711f089e6ca96) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/_docker-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_docker-build.yml b/.github/workflows/_docker-build.yml index 88aa55ce68aa..4528baea9536 100644 --- a/.github/workflows/_docker-build.yml +++ b/.github/workflows/_docker-build.yml @@ -79,7 +79,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 with: images: ${{ inputs.namespace-repository }} @@ -139,7 +139,7 @@ jobs: - name: Docker meta id: meta - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 with: images: ${{ inputs.namespace-repository }} tags: ${{ inputs.tags }} From 62a301b9275e60d3eff630161dedbaf9a2ff7937 Mon Sep 17 00:00:00 2001 From: Adam Narozniak <51029327+adam-narozniak@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:51:08 +0100 Subject: [PATCH 03/16] docs(datasets:skip) Add reference to recommended datasets to the index (#4581) --- datasets/doc/source/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/datasets/doc/source/index.rst b/datasets/doc/source/index.rst index a9a643079b8f..6f7c47bf2416 100644 --- a/datasets/doc/source/index.rst +++ b/datasets/doc/source/index.rst @@ -63,6 +63,7 @@ Information-oriented API reference and other reference material. :maxdepth: 1 :caption: Reference docs + recommended-fl-datasets ref-telemetry Main features From a21782f4781ff02e31bd325c3bdc39a85fd68a36 Mon Sep 17 00:00:00 2001 From: Adam Narozniak <51029327+adam-narozniak@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:34:43 +0100 Subject: [PATCH 04/16] docs(datasets) Fix formatting of the DistributionPartitioner docs (#4582) --- .../partitioner/distribution_partitioner.py | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/datasets/flwr_datasets/partitioner/distribution_partitioner.py b/datasets/flwr_datasets/partitioner/distribution_partitioner.py index 86be62b36070..e4182f587cad 100644 --- a/datasets/flwr_datasets/partitioner/distribution_partitioner.py +++ b/datasets/flwr_datasets/partitioner/distribution_partitioner.py @@ -36,21 +36,22 @@ class DistributionPartitioner(Partitioner): # pylint: disable=R0902 in a deterministic pathological manner. The 1st dimension is the number of unique labels and the 2nd-dimension is the number of buckets into which the samples associated with each label will be divided. That is, given a distribution array of - shape, - `num_unique_labels_per_partition` x `num_partitions` - ( `num_unique_labels`, ---------------------------------------------------- ), - `num_unique_labels` - the label_id at the i'th row is assigned to the partition_id based on the following - approach. - - First, for an i'th row, generate a list of `id`s according to the formula: - id = alpha + beta - where, - alpha = (i - num_unique_labels_per_partition + 1) \ - + (j % num_unique_labels_per_partition), - alpha = alpha + (alpha >= 0 ? 0 : num_unique_labels), - beta = num_unique_labels * (j // num_unique_labels_per_partition) - and j in {0, 1, 2, ..., `num_columns`}. Then, sort the list of `id`s in ascending + shape,:: + + `num_unique_labels_per_partition` x `num_partitions` + ( `num_unique_labels`, ---------------------------------------------------- ), + `num_unique_labels` + the label_id at the i'th row is assigned to the partition_id based on the + following approach. + + First, for an i'th row, generate a list of `id`s according to the formula: + id = alpha + beta + where, + alpha = (i - num_unique_labels_per_partition + 1) + + + (j % num_unique_labels_per_partition), + alpha = alpha + (alpha >= 0 ? 0 : num_unique_labels), + beta = num_unique_labels * (j // num_unique_labels_per_partition) + and j in {0, 1, 2, ..., `num_columns`}. Then, sort the list of `id` s in ascending order. The j'th index in this sorted list corresponds to the partition_id that the i'th unique label (and the underlying distribution array value) will be assigned to. So, for a dataset with 10 unique labels and a configuration with 20 partitions and From db87321121a6c2d4e002a2f052005f180cd2b964 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 26 Nov 2024 10:20:32 +0100 Subject: [PATCH 05/16] ci(framework:skip) Fix process kill in E2E tests (#4575) --- e2e/test_reconnection.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/e2e/test_reconnection.sh b/e2e/test_reconnection.sh index 6807c10bf35f..132c7d4fdfd9 100755 --- a/e2e/test_reconnection.sh +++ b/e2e/test_reconnection.sh @@ -27,7 +27,6 @@ check_and_kill() { local pids=$1 # Get the PID as the first argument to the function for pid in $pids; do echo "Attempting to kill process ID: $pid" - kill $pid if kill "$pid" 2>/dev/null; then echo "Process $pid successfully killed." else From 7a02f7a106ad3f67021cbdd100112d02ff5e44bc Mon Sep 17 00:00:00 2001 From: Chong Shen Ng Date: Tue, 26 Nov 2024 14:50:34 +0000 Subject: [PATCH 06/16] break(framework) Fix simulation arguments and tests (#4563) --- e2e/test_exec_api.sh | 7 ++++++- src/py/flwr/server/app.py | 9 +++++++-- src/py/flwr/simulation/app.py | 20 +++++++++++++------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/e2e/test_exec_api.sh b/e2e/test_exec_api.sh index dce9b62d236f..6337d6edab99 100755 --- a/e2e/test_exec_api.sh +++ b/e2e/test_exec_api.sh @@ -45,7 +45,6 @@ case "$3" in executor_arg="--executor flwr.superexec.deployment:executor" ;; simulation-engine) - executor_config="$executor_config num-supernodes=10" executor_arg="--executor flwr.superexec.simulation:executor" ;; esac @@ -74,6 +73,10 @@ else echo -e $"\n[tool.flwr.federations.e2e]\naddress = \"127.0.0.1:9093\"\nroot-certificates = \"../certificates/ca.crt\"" >> pyproject.toml fi +if [ "$3" = "simulation-engine" ]; then + echo -e $"options.num-supernodes = 10" >> pyproject.toml +fi + # Combine the arguments into a single command for flower-superlink combined_args="$server_arg $server_auth $exec_api_arg $executor_arg" @@ -113,6 +116,7 @@ while [ "$found_success" = false ] && [ $elapsed -lt $timeout ]; do kill $cl1_pid; kill $cl2_pid; fi sleep 1; kill $sl_pid; + exit 0; else echo "Waiting for training ... ($elapsed seconds elapsed)" fi @@ -127,4 +131,5 @@ if [ "$found_success" = false ]; then kill $cl1_pid; kill $cl2_pid; fi kill $sl_pid; + exit 1; fi diff --git a/src/py/flwr/server/app.py b/src/py/flwr/server/app.py index 8e9ab26f649f..5af8b1211116 100644 --- a/src/py/flwr/server/app.py +++ b/src/py/flwr/server/app.py @@ -278,7 +278,7 @@ def run_superlink() -> None: address=simulationio_address, state_factory=state_factory, ffs_factory=ffs_factory, - certificates=certificates, + certificates=None, # SimulationAppIo API doesn't support SSL yet ) grpc_servers.append(simulationio_server) @@ -389,6 +389,9 @@ def run_superlink() -> None: io_address = ( f"{CLIENT_OCTET}:{_port}" if _octet == SERVER_OCTET else serverappio_address ) + address_arg = ( + "--simulationio-api-address" if sim_exec else "--serverappio-api-address" + ) address = simulationio_address if sim_exec else io_address cmd = "flwr-simulation" if sim_exec else "flwr-serverapp" @@ -397,6 +400,7 @@ def run_superlink() -> None: target=_flwr_scheduler, args=( state_factory, + address_arg, address, cmd, ), @@ -422,6 +426,7 @@ def run_superlink() -> None: def _flwr_scheduler( state_factory: LinkStateFactory, + io_api_arg: str, io_api_address: str, cmd: str, ) -> None: @@ -446,7 +451,7 @@ def _flwr_scheduler( command = [ cmd, "--run-once", - "--serverappio-api-address", + io_api_arg, io_api_address, "--insecure", ] diff --git a/src/py/flwr/simulation/app.py b/src/py/flwr/simulation/app.py index 8aec3ed786cc..0ad05b3a4beb 100644 --- a/src/py/flwr/simulation/app.py +++ b/src/py/flwr/simulation/app.py @@ -32,7 +32,11 @@ get_project_dir, unflatten_dict, ) -from flwr.common.constant import Status, SubStatus +from flwr.common.constant import ( + SIMULATIONIO_API_DEFAULT_CLIENT_ADDRESS, + Status, + SubStatus, +) from flwr.common.logger import ( log, mirror_output_to_queue, @@ -73,9 +77,11 @@ def flwr_simulation() -> None: description="Run a Flower Simulation", ) parser.add_argument( - "--superlink", + "--simulationio-api-address", + default=SIMULATIONIO_API_DEFAULT_CLIENT_ADDRESS, type=str, - help="Address of SuperLink's SimulationIO API", + help="Address of SuperLink's SimulationIO API (IPv4, IPv6, or a domain name)." + f"By default, it is set to {SIMULATIONIO_API_DEFAULT_CLIENT_ADDRESS}.", ) parser.add_argument( "--run-once", @@ -111,15 +117,15 @@ def flwr_simulation() -> None: args = parser.parse_args() log(INFO, "Starting Flower Simulation") - certificates = try_obtain_root_certificates(args, args.superlink) + certificates = try_obtain_root_certificates(args, args.simulationio_api_address) log( DEBUG, "Staring isolated `Simulation` connected to SuperLink DriverAPI at %s", - args.superlink, + args.simulationio_api_address, ) run_simulation_process( - simulationio_api_address=args.superlink, + simulationio_api_address=args.simulationio_api_address, log_queue=log_queue, run_once=args.run_once, flwr_dir_=args.flwr_dir, @@ -225,7 +231,7 @@ def run_simulation_process( # pylint: disable=R0914, disable=W0212, disable=R09 ) backend_config: BackendConfig = fed_opt.get("backend", {}) verbose: bool = fed_opt.get("verbose", False) - enable_tf_gpu_growth: bool = fed_opt.get("enable_tf_gpu_growth", True) + enable_tf_gpu_growth: bool = fed_opt.get("enable_tf_gpu_growth", False) # Launch the simulation _run_simulation( From 2e6eedb169423fb9323d4621f078b3f0e30e7637 Mon Sep 17 00:00:00 2001 From: Chong Shen Ng Date: Tue, 26 Nov 2024 15:06:44 +0000 Subject: [PATCH 07/16] fix(framework) Make `flwr-simulation` connect without TLS as default (#4568) --- src/py/flwr/simulation/app.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/py/flwr/simulation/app.py b/src/py/flwr/simulation/app.py index 0ad05b3a4beb..c9c60f3e74cf 100644 --- a/src/py/flwr/simulation/app.py +++ b/src/py/flwr/simulation/app.py @@ -14,8 +14,8 @@ # ============================================================================== """Flower Simulation process.""" - import argparse +import sys from logging import DEBUG, ERROR, INFO from queue import Queue from time import sleep @@ -24,7 +24,6 @@ from flwr.cli.config_utils import get_fab_metadata from flwr.cli.install import install_from_fab from flwr.common import EventType -from flwr.common.args import try_obtain_root_certificates from flwr.common.config import ( get_flwr_dir, get_fused_config_from_dir, @@ -117,11 +116,19 @@ def flwr_simulation() -> None: args = parser.parse_args() log(INFO, "Starting Flower Simulation") - certificates = try_obtain_root_certificates(args, args.simulationio_api_address) + + if not args.insecure: + log( + ERROR, + "`flwr-simulation` does not support TLS yet. " + "Please use the '--insecure' flag.", + ) + sys.exit(1) log( DEBUG, - "Staring isolated `Simulation` connected to SuperLink DriverAPI at %s", + "Starting isolated `Simulation` connected to SuperLink SimulationAppIo API " + "at %s", args.simulationio_api_address, ) run_simulation_process( @@ -129,7 +136,7 @@ def flwr_simulation() -> None: log_queue=log_queue, run_once=args.run_once, flwr_dir_=args.flwr_dir, - certificates=certificates, + certificates=None, ) # Restore stdout/stderr From 45aad2d32c16b34de018afa3ae5cdc666d7a64ff Mon Sep 17 00:00:00 2001 From: Chong Shen Ng Date: Tue, 26 Nov 2024 15:28:13 +0000 Subject: [PATCH 08/16] fix(framework) Fix flwr ls error message (#4579) --- src/py/flwr/cli/ls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/py/flwr/cli/ls.py b/src/py/flwr/cli/ls.py index cc28873c3ef9..54173f5f6018 100644 --- a/src/py/flwr/cli/ls.py +++ b/src/py/flwr/cli/ls.py @@ -82,7 +82,7 @@ def ls( if "address" not in federation_config: typer.secho( - "โŒ `flwr log` currently works with Exec API. Ensure that the correct" + "โŒ `flwr ls` currently works with Exec API. Ensure that the correct" "Exec API address is provided in the `pyproject.toml`.", fg=typer.colors.RED, bold=True, From 00fc8351c46a79215d3f1a304cdca7593fb7479a Mon Sep 17 00:00:00 2001 From: Chong Shen Ng Date: Tue, 26 Nov 2024 15:44:14 +0000 Subject: [PATCH 09/16] refactor(framework) Group common args for `flwr-simulation` (#4570) --- src/py/flwr/client/clientapp/app.py | 7 --- src/py/flwr/server/serverapp/app.py | 7 --- src/py/flwr/simulation/app.py | 66 +++++++++++------------------ 3 files changed, 24 insertions(+), 56 deletions(-) diff --git a/src/py/flwr/client/clientapp/app.py b/src/py/flwr/client/clientapp/app.py index 3c77a8bcc45f..66cc4d8277ee 100644 --- a/src/py/flwr/client/clientapp/app.py +++ b/src/py/flwr/client/clientapp/app.py @@ -252,12 +252,5 @@ def _parse_args_run_flwr_clientapp() -> argparse.ArgumentParser: required=False, help="Unique token generated by SuperNode for each ClientApp execution", ) - parser.add_argument( - "--root-certificates", - metavar="ROOT_CERT", - type=str, - help="Specifies the path to the PEM-encoded root certificate file for " - "establishing secure HTTPS connections.", - ) add_args_flwr_app_common(parser=parser) return parser diff --git a/src/py/flwr/server/serverapp/app.py b/src/py/flwr/server/serverapp/app.py index e6f8d20476fb..0ed9cc4d0928 100644 --- a/src/py/flwr/server/serverapp/app.py +++ b/src/py/flwr/server/serverapp/app.py @@ -230,12 +230,5 @@ def _parse_args_run_flwr_serverapp() -> argparse.ArgumentParser: help="When set, this process will start a single ServerApp for a pending Run. " "If there is no pending Run, the process will exit.", ) - parser.add_argument( - "--root-certificates", - metavar="ROOT_CERT", - type=str, - help="Specifies the path to the PEM-encoded root certificate file for " - "establishing secure HTTPS connections.", - ) add_args_flwr_app_common(parser=parser) return parser diff --git a/src/py/flwr/simulation/app.py b/src/py/flwr/simulation/app.py index c9c60f3e74cf..cecf24081458 100644 --- a/src/py/flwr/simulation/app.py +++ b/src/py/flwr/simulation/app.py @@ -24,6 +24,7 @@ from flwr.cli.config_utils import get_fab_metadata from flwr.cli.install import install_from_fab from flwr.common import EventType +from flwr.common.args import add_args_flwr_app_common from flwr.common.config import ( get_flwr_dir, get_fused_config_from_dir, @@ -72,48 +73,7 @@ def flwr_simulation() -> None: log_queue: Queue[Optional[str]] = Queue() mirror_output_to_queue(log_queue) - parser = argparse.ArgumentParser( - description="Run a Flower Simulation", - ) - parser.add_argument( - "--simulationio-api-address", - default=SIMULATIONIO_API_DEFAULT_CLIENT_ADDRESS, - type=str, - help="Address of SuperLink's SimulationIO API (IPv4, IPv6, or a domain name)." - f"By default, it is set to {SIMULATIONIO_API_DEFAULT_CLIENT_ADDRESS}.", - ) - parser.add_argument( - "--run-once", - action="store_true", - help="When set, this process will start a single simulation " - "for a pending Run. If no pending run the process will exit. ", - ) - parser.add_argument( - "--flwr-dir", - default=None, - help="""The path containing installed Flower Apps. - By default, this value is equal to: - - - `$FLWR_HOME/` if `$FLWR_HOME` is defined - - `$XDG_DATA_HOME/.flwr/` if `$XDG_DATA_HOME` is defined - - `$HOME/.flwr/` in all other cases - """, - ) - parser.add_argument( - "--insecure", - action="store_true", - help="Run the server without HTTPS, regardless of whether certificate " - "paths are provided. By default, the server runs with HTTPS enabled. " - "Use this flag only if you understand the risks.", - ) - parser.add_argument( - "--root-certificates", - metavar="ROOT_CERT", - type=str, - help="Specifies the path to the PEM-encoded root certificate file for " - "establishing secure HTTPS connections.", - ) - args = parser.parse_args() + args = _parse_args_run_flwr_simulation().parse_args() log(INFO, "Starting Flower Simulation") @@ -287,3 +247,25 @@ def run_simulation_process( # pylint: disable=R0914, disable=W0212, disable=R09 # Stop the loop if `flwr-simulation` is expected to process a single run if run_once: break + + +def _parse_args_run_flwr_simulation() -> argparse.ArgumentParser: + """Parse flwr-simulation command line arguments.""" + parser = argparse.ArgumentParser( + description="Run a Flower Simulation", + ) + parser.add_argument( + "--simulationio-api-address", + default=SIMULATIONIO_API_DEFAULT_CLIENT_ADDRESS, + type=str, + help="Address of SuperLink's SimulationIO API (IPv4, IPv6, or a domain name)." + f"By default, it is set to {SIMULATIONIO_API_DEFAULT_CLIENT_ADDRESS}.", + ) + parser.add_argument( + "--run-once", + action="store_true", + help="When set, this process will start a single simulation " + "for a pending Run. If no pending run the process will exit. ", + ) + add_args_flwr_app_common(parser=parser) + return parser From e318a6bb258c492900e65373f7d43fef841194c8 Mon Sep 17 00:00:00 2001 From: Heng Pan Date: Tue, 26 Nov 2024 17:12:45 +0000 Subject: [PATCH 10/16] refactor(framework) Remove `pip install` in `flwr install` and the wheel file (#4571) Co-authored-by: Chong Shen Ng Co-authored-by: Daniel J. Beutel --- pyproject.toml | 1 - src/py/flwr/cli/build.py | 37 ------------------------------------- src/py/flwr/cli/install.py | 20 +------------------- 3 files changed, 1 insertion(+), 57 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f8e3914d277c..f1207a94c448 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,7 +77,6 @@ typer = "^0.12.5" tomli = "^2.0.1" tomli-w = "^1.0.0" pathspec = "^0.12.1" -hatchling = "^1.25.0" rich = "^13.5.0" # Optional dependencies (Simulation Engine) ray = { version = "==2.10.0", optional = true, python = ">=3.9,<3.12" } diff --git a/src/py/flwr/cli/build.py b/src/py/flwr/cli/build.py index 5a8ac2d1fd9b..e86f4bb762b3 100644 --- a/src/py/flwr/cli/build.py +++ b/src/py/flwr/cli/build.py @@ -19,18 +19,14 @@ import shutil import tempfile import zipfile -from logging import DEBUG, ERROR from pathlib import Path from typing import Annotated, Any, Optional, Union import pathspec import tomli_w import typer -from hatchling.builders.wheel import WheelBuilder -from hatchling.metadata.core import ProjectMetadata from flwr.common.constant import FAB_ALLOWED_EXTENSIONS, FAB_DATE, FAB_HASH_TRUNCATION -from flwr.common.logger import log from .config_utils import load_and_validate from .utils import is_valid_project_name @@ -55,27 +51,6 @@ def get_fab_filename(conf: dict[str, Any], fab_hash: str) -> str: return f"{publisher}.{name}.{version}.{fab_hash_truncated}.fab" -def _build_app_wheel(app: Path) -> Path: - """Build app as a wheel and return its path.""" - # Path to your project directory - app_dir = str(app.resolve()) - try: - - # Initialize the WheelBuilder - builder = WheelBuilder( - app_dir, metadata=ProjectMetadata(root=app_dir, plugin_manager=None) - ) - - # Build - whl_path = Path(next(builder.build(directory=app_dir))) - log(DEBUG, "Wheel succesfully built: %s", str(whl_path)) - except Exception as ex: - log(ERROR, "Exception encountered when building wheel.", exc_info=ex) - raise typer.Exit(code=1) from ex - - return whl_path - - # pylint: disable=too-many-locals, too-many-statements def build( app: Annotated[ @@ -131,12 +106,6 @@ def build( bold=True, ) - # Build wheel - whl_path = _build_app_wheel(app) - - # Add path to .whl to `[tool.flwr.app]` - conf["tool"]["flwr"]["app"]["whl"] = str(whl_path.name) - # Load .gitignore rules if present ignore_spec = _load_gitignore(app) @@ -168,9 +137,6 @@ def build( and f.name != "pyproject.toml" # Exclude the original pyproject.toml ] - # Include FAB .whl - all_files.append(whl_path) - for file_path in all_files: # Read the file content manually with open(file_path, "rb") as f: @@ -187,9 +153,6 @@ def build( # Add CONTENT and CONTENT.jwt to the zip file write_to_zip(fab_file, ".info/CONTENT", list_file_content) - # Erase FAB .whl in app directory - whl_path.unlink() - # Get hash of FAB file content = Path(temp_filename).read_bytes() fab_hash = hashlib.sha256(content).hexdigest() diff --git a/src/py/flwr/cli/install.py b/src/py/flwr/cli/install.py index 00f97b7ed708..c2dd7b1585fd 100644 --- a/src/py/flwr/cli/install.py +++ b/src/py/flwr/cli/install.py @@ -16,7 +16,6 @@ import hashlib import shutil -import subprocess import tempfile import zipfile from io import BytesIO @@ -188,25 +187,8 @@ def validate_and_install( else: shutil.copy2(item, install_dir / item.name) - whl_file = config["tool"]["flwr"]["app"]["whl"] - install_whl = install_dir / whl_file - try: - subprocess.run( - ["pip", "install", "--no-deps", install_whl], - capture_output=True, - text=True, - check=True, - ) - except subprocess.CalledProcessError as e: - typer.secho( - f"โŒ Failed to install {project_name}:\n{e.stderr}", - fg=typer.colors.RED, - bold=True, - ) - raise typer.Exit(code=1) from e - typer.secho( - f"๐ŸŽŠ Successfully installed {project_name}.", + f"๐ŸŽŠ Successfully installed {project_name} to {install_dir}.", fg=typer.colors.GREEN, bold=True, ) From 4ecb55a64b5bfe709b7b8dee99108368d700b16f Mon Sep 17 00:00:00 2001 From: Heng Pan Date: Tue, 26 Nov 2024 17:22:05 +0000 Subject: [PATCH 11/16] feat(framework) Add optional hint to `pip install` in `flwr new` command (#4572) --- src/py/flwr/cli/new/new.py | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/py/flwr/cli/new/new.py b/src/py/flwr/cli/new/new.py index 3cbde991ff6e..f96753a37cae 100644 --- a/src/py/flwr/cli/new/new.py +++ b/src/py/flwr/cli/new/new.py @@ -268,20 +268,30 @@ def new( context=context, ) - print( - typer.style( - "๐ŸŽŠ Flower App creation successful.\n\n" - "Use the following command to run your Flower App:\n", - fg=typer.colors.GREEN, - bold=True, - ) + prompt = typer.style( + "๐ŸŽŠ Flower App creation successful.\n\n" + "To run your Flower App, use the following command:\n\n", + fg=typer.colors.GREEN, + bold=True, ) _add = " huggingface-cli login\n" if llm_challenge_str else "" - print( - typer.style( - f" cd {package_name}\n" + " pip install -e .\n" + _add + " flwr run\n", - fg=typer.colors.BRIGHT_CYAN, - bold=True, - ) + prompt += typer.style( + _add + f" flwr run {package_name}\n\n", + fg=typer.colors.BRIGHT_CYAN, + bold=True, + ) + + prompt += typer.style( + "If you haven't installed all dependencies yet, follow these steps:\n\n", + fg=typer.colors.GREEN, + bold=True, ) + + prompt += typer.style( + f" cd {package_name}\n" + " pip install -e .\n" + _add + " flwr run .\n", + fg=typer.colors.BRIGHT_CYAN, + bold=True, + ) + + print(prompt) From 031c2980459070476d1fa7c4806684e2334e4c6b Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 27 Nov 2024 06:57:28 +0000 Subject: [PATCH 12/16] fix(framework) Avoid reimporting simulation executor plugin (#4593) --- src/py/flwr/server/app.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/py/flwr/server/app.py b/src/py/flwr/server/app.py index 5af8b1211116..a648d3e41bd6 100644 --- a/src/py/flwr/server/app.py +++ b/src/py/flwr/server/app.py @@ -66,7 +66,6 @@ from flwr.proto.grpcadapter_pb2_grpc import add_GrpcAdapterServicer_to_server from flwr.superexec.app import load_executor from flwr.superexec.exec_grpc import run_exec_api_grpc -from flwr.superexec.simulation import SimulationEngine from .client_manager import ClientManager from .history import History @@ -269,8 +268,7 @@ def run_superlink() -> None: # Determine Exec plugin # If simulation is used, don't start ServerAppIo and Fleet APIs - sim_exec = isinstance(executor, SimulationEngine) - + sim_exec = executor.__class__.__qualname__ == "SimulationEngine" bckg_threads = [] if sim_exec: From e8262e2944cfea1291c7b2d3a85d4b5f6da18a62 Mon Sep 17 00:00:00 2001 From: Heng Pan Date: Wed, 27 Nov 2024 07:29:18 +0000 Subject: [PATCH 13/16] refactor(framework:skip) Downgrade versions to `1.13.1` (#4584) --- baselines/doc/source/conf.py | 2 +- doc/source/conf.py | 2 +- examples/doc/source/conf.py | 2 +- pyproject.toml | 2 +- src/docker/complete/compose.yml | 16 ++++++++-------- src/docker/distributed/client/compose.yml | 12 ++++++------ src/docker/distributed/server/compose.yml | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/baselines/doc/source/conf.py b/baselines/doc/source/conf.py index 9d5d4ea7fc92..4b8ac57898f2 100644 --- a/baselines/doc/source/conf.py +++ b/baselines/doc/source/conf.py @@ -37,7 +37,7 @@ author = "The Flower Authors" # The full version, including alpha/beta/rc tags -release = "1.14.0" +release = "1.13.1" # -- General configuration --------------------------------------------------- diff --git a/doc/source/conf.py b/doc/source/conf.py index bb50dd0050c5..9182494671f5 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -89,7 +89,7 @@ author = "The Flower Authors" # The full version of the next release, including alpha/beta/rc tags -release = "1.14.0" +release = "1.13.1" # The current released version rst_prolog = """ .. |stable_flwr_version| replace:: 1.13.0 diff --git a/examples/doc/source/conf.py b/examples/doc/source/conf.py index bde7f8677b7e..ded6e857b968 100644 --- a/examples/doc/source/conf.py +++ b/examples/doc/source/conf.py @@ -29,7 +29,7 @@ author = "The Flower Authors" # The full version, including alpha/beta/rc tags -release = "1.14.0" +release = "1.13.1" # -- General configuration --------------------------------------------------- diff --git a/pyproject.toml b/pyproject.toml index f1207a94c448..a3604e2ec3cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "flwr" -version = "1.14.0" +version = "1.13.1" description = "Flower: A Friendly Federated AI Framework" license = "Apache-2.0" authors = ["The Flower Authors "] diff --git a/src/docker/complete/compose.yml b/src/docker/complete/compose.yml index 5287374cf040..3bbd71c5513c 100644 --- a/src/docker/complete/compose.yml +++ b/src/docker/complete/compose.yml @@ -1,7 +1,7 @@ services: # create a SuperLink service superlink: - image: flwr/superlink:${FLWR_VERSION:-1.14.0} + image: flwr/superlink:${FLWR_VERSION:-1.13.1} command: - --insecure - --isolation @@ -14,7 +14,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/serverapp:${FLWR_VERSION:-1.14.0} + FROM flwr/serverapp:${FLWR_VERSION:-1.13.1} # gcc is required for the fastai quickstart example USER root @@ -40,7 +40,7 @@ services: # create a two SuperNode service with different node configs supernode-1: - image: flwr/supernode:${FLWR_VERSION:-1.14.0} + image: flwr/supernode:${FLWR_VERSION:-1.13.1} command: - --insecure - --superlink @@ -55,7 +55,7 @@ services: - superlink supernode-2: - image: flwr/supernode:${FLWR_VERSION:-1.14.0} + image: flwr/supernode:${FLWR_VERSION:-1.13.1} command: - --insecure - --superlink @@ -72,7 +72,7 @@ services: # uncomment to add another SuperNode # # supernode-3: - # image: flwr/supernode:${FLWR_VERSION:-1.14.0} + # image: flwr/supernode:${FLWR_VERSION:-1.13.1} # command: # - --insecure # - --superlink @@ -90,7 +90,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} + FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} # gcc is required for the fastai quickstart example USER root @@ -122,7 +122,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} + FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} # gcc is required for the fastai quickstart example USER root @@ -156,7 +156,7 @@ services: # build: # context: ${PROJECT_DIR:-.} # dockerfile_inline: | - # FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} + # FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} # # gcc is required for the fastai quickstart example # USER root diff --git a/src/docker/distributed/client/compose.yml b/src/docker/distributed/client/compose.yml index 5f1dc1b1a4d8..81d6405c7829 100644 --- a/src/docker/distributed/client/compose.yml +++ b/src/docker/distributed/client/compose.yml @@ -1,6 +1,6 @@ services: supernode-1: - image: flwr/supernode:${FLWR_VERSION:-1.14.0} + image: flwr/supernode:${FLWR_VERSION:-1.13.1} command: - --superlink - ${SUPERLINK_IP:-127.0.0.1}:9092 @@ -17,7 +17,7 @@ services: target: /app/certificates/superlink-ca.crt supernode-2: - image: flwr/supernode:${FLWR_VERSION:-1.14.0} + image: flwr/supernode:${FLWR_VERSION:-1.13.1} command: - --superlink - ${SUPERLINK_IP:-127.0.0.1}:9092 @@ -36,7 +36,7 @@ services: # uncomment to add another SuperNode # # supernode-3: - # image: flwr/supernode:${FLWR_VERSION:-1.14.0} + # image: flwr/supernode:${FLWR_VERSION:-1.13.1} # command: # - --superlink # - ${SUPERLINK_IP:-127.0.0.1}:9092 @@ -56,7 +56,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} + FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} WORKDIR /app COPY --chown=app:app pyproject.toml . @@ -80,7 +80,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} + FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} WORKDIR /app COPY --chown=app:app pyproject.toml . @@ -106,7 +106,7 @@ services: # build: # context: ${PROJECT_DIR:-.} # dockerfile_inline: | - # FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} + # FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} # WORKDIR /app # COPY --chown=app:app pyproject.toml . diff --git a/src/docker/distributed/server/compose.yml b/src/docker/distributed/server/compose.yml index 0f80cc97ee2f..9225c055011f 100644 --- a/src/docker/distributed/server/compose.yml +++ b/src/docker/distributed/server/compose.yml @@ -1,6 +1,6 @@ services: superlink: - image: flwr/superlink:${FLWR_VERSION:-1.14.0} + image: flwr/superlink:${FLWR_VERSION:-1.13.1} command: - --isolation - process @@ -25,7 +25,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/serverapp:${FLWR_VERSION:-1.14.0} + FROM flwr/serverapp:${FLWR_VERSION:-1.13.1} WORKDIR /app COPY --chown=app:app pyproject.toml . From 636c24b3f1e6b6e0ac73a2aba3a02ffaa488d7aa Mon Sep 17 00:00:00 2001 From: Heng Pan Date: Wed, 27 Nov 2024 07:52:22 +0000 Subject: [PATCH 14/16] feat(framework) Update changelog for `1.13.1` (#4588) Co-authored-by: Daniel J. Beutel --- doc/source/ref-changelog.md | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/doc/source/ref-changelog.md b/doc/source/ref-changelog.md index 7916435bc2fd..a4b957aa178d 100644 --- a/doc/source/ref-changelog.md +++ b/doc/source/ref-changelog.md @@ -1,14 +1,36 @@ # Changelog -## Unreleased +## v1.13.1 (2024-11-26) + +### Thanks to our contributors + +We would like to give our special thanks to all the contributors who made the new version of Flower possible (in `git shortlog` order): + +`Adam Narozniak`, `Charles Beauville`, `Heng Pan`, `Javier`, `Robert Steiner` ### What's new? -### Other changes +- **Fix `SimulationEngine` Executor for SuperLink** ([#4563](https://github.com/adap/flower/pull/4563), [#4568](https://github.com/adap/flower/pull/4568), [#4570](https://github.com/adap/flower/pull/4570)) -### Documentation improvements + Resolved an issue that prevented SuperLink from functioning correctly when using the `SimulationEngine` executor. -### Incompatible changes +- **Improve FAB build and install** ([#4571](https://github.com/adap/flower/pull/4571)) + + An updated FAB build and install process produces smaller FAB files and doesn't rely on `pip install` any more. It also resolves an issue where all files were unnecessarily included in the FAB file. The `flwr` CLI commands now correctly pack only the necessary files, such as `.md`, `.toml` and `.py`, ensuring more efficient and accurate packaging. + +- **Update** `embedded-devices` **example** ([#4381](https://github.com/adap/flower/pull/4381)) + + The example now uses the `flwr run` command and the Deployment Engine. + +- **Update Documentation** ([#4566](https://github.com/adap/flower/pull/4566), [#4569](https://github.com/adap/flower/pull/4569), [#4560](https://github.com/adap/flower/pull/4560), [#4556](https://github.com/adap/flower/pull/4556), [#4581](https://github.com/adap/flower/pull/4581), [#4537](https://github.com/adap/flower/pull/4537), [#4562](https://github.com/adap/flower/pull/4562), [#4582](https://github.com/adap/flower/pull/4582)) + + Enhanced documentation across various aspects, including updates to translation workflows, Docker-related READMEs, and recommended datasets. Improvements also include formatting fixes for dataset partitioning docs and better references to resources in the datasets documentation index. + +- **Update Infrastructure and CI/CD** ([#4577](https://github.com/adap/flower/pull/4577), [#4578](https://github.com/adap/flower/pull/4578), [#4558](https://github.com/adap/flower/pull/4558), [#4551](https://github.com/adap/flower/pull/4551), [#3356](https://github.com/adap/flower/pull/3356), [#4559](https://github.com/adap/flower/pull/4559), [#4575](https://github.com/adap/flower/pull/4575)) + +- **General improvements** ([#4557](https://github.com/adap/flower/pull/4557), [#4564](https://github.com/adap/flower/pull/4564), [#4573](https://github.com/adap/flower/pull/4573), [#4561](https://github.com/adap/flower/pull/4561), [#4579](https://github.com/adap/flower/pull/4579), [#4572](https://github.com/adap/flower/pull/4572)) + + As always, many parts of the Flower framework and quality infrastructure were improved and updated. ## v1.13.0 (2024-11-20) From b909a55720d2b052b3ba4a9e386aae88ffe37f0b Mon Sep 17 00:00:00 2001 From: Heng Pan Date: Wed, 27 Nov 2024 10:07:50 +0000 Subject: [PATCH 15/16] refactor(*:skip) Reset versions back to `1.14.0` (#4587) --- baselines/doc/source/conf.py | 2 +- doc/source/conf.py | 4 ++-- examples/advanced-pytorch/pyproject.toml | 2 +- examples/advanced-tensorflow/pyproject.toml | 2 +- examples/custom-metrics/pyproject.toml | 2 +- examples/doc/source/conf.py | 2 +- .../federated-kaplan-meier-fitter/pyproject.toml | 2 +- examples/fl-dp-sa/pyproject.toml | 2 +- examples/fl-tabular/pyproject.toml | 2 +- .../flower-secure-aggregation/pyproject.toml | 2 +- examples/opacus/pyproject.toml | 2 +- .../pyproject.toml | 2 +- examples/quickstart-fastai/pyproject.toml | 2 +- examples/quickstart-jax/pyproject.toml | 2 +- examples/quickstart-mlx/pyproject.toml | 2 +- examples/quickstart-pandas/pyproject.toml | 2 +- .../quickstart-pytorch-lightning/pyproject.toml | 2 +- examples/quickstart-pytorch/pyproject.toml | 2 +- .../quickstart-sklearn-tabular/pyproject.toml | 2 +- examples/quickstart-tensorflow/pyproject.toml | 2 +- examples/sklearn-logreg-mnist/pyproject.toml | 2 +- examples/tensorflow-privacy/pyproject.toml | 2 +- examples/vertical-fl/pyproject.toml | 2 +- examples/xgboost-comprehensive/pyproject.toml | 2 +- pyproject.toml | 2 +- src/docker/complete/compose.yml | 16 ++++++++-------- src/docker/distributed/client/compose.yml | 12 ++++++------ src/docker/distributed/server/compose.yml | 4 ++-- .../templates/app/pyproject.baseline.toml.tpl | 2 +- .../templates/app/pyproject.flowertune.toml.tpl | 2 +- .../templates/app/pyproject.huggingface.toml.tpl | 2 +- .../cli/new/templates/app/pyproject.jax.toml.tpl | 2 +- .../cli/new/templates/app/pyproject.mlx.toml.tpl | 2 +- .../new/templates/app/pyproject.numpy.toml.tpl | 2 +- .../new/templates/app/pyproject.pytorch.toml.tpl | 2 +- .../new/templates/app/pyproject.sklearn.toml.tpl | 2 +- .../templates/app/pyproject.tensorflow.toml.tpl | 2 +- 37 files changed, 51 insertions(+), 51 deletions(-) diff --git a/baselines/doc/source/conf.py b/baselines/doc/source/conf.py index 4b8ac57898f2..9d5d4ea7fc92 100644 --- a/baselines/doc/source/conf.py +++ b/baselines/doc/source/conf.py @@ -37,7 +37,7 @@ author = "The Flower Authors" # The full version, including alpha/beta/rc tags -release = "1.13.1" +release = "1.14.0" # -- General configuration --------------------------------------------------- diff --git a/doc/source/conf.py b/doc/source/conf.py index 9182494671f5..c8d2a38acbc4 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -89,10 +89,10 @@ author = "The Flower Authors" # The full version of the next release, including alpha/beta/rc tags -release = "1.13.1" +release = "1.14.0" # The current released version rst_prolog = """ -.. |stable_flwr_version| replace:: 1.13.0 +.. |stable_flwr_version| replace:: 1.13.1 .. |stable_flwr_superlink_docker_digest| replace:: 4b317d5b6030710b476f4dbfab2c3a33021ad40a0fcfa54d7edd45e0c51d889c .. |ubuntu_version| replace:: 24.04 .. |setuptools_version| replace:: 70.3.0 diff --git a/examples/advanced-pytorch/pyproject.toml b/examples/advanced-pytorch/pyproject.toml index 4e7db60260ee..6a1283e0df58 100644 --- a/examples/advanced-pytorch/pyproject.toml +++ b/examples/advanced-pytorch/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Learning with PyTorch and Flower (Advanced Example)" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "torch==2.2.1", "torchvision==0.17.1", diff --git a/examples/advanced-tensorflow/pyproject.toml b/examples/advanced-tensorflow/pyproject.toml index 0b21318cfcab..938636dc6704 100644 --- a/examples/advanced-tensorflow/pyproject.toml +++ b/examples/advanced-tensorflow/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Learning with Tensorflow/Keras and Flower (Advanced Example)" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "tensorflow-cpu>=2.9.1, != 2.11.1 ; platform_machine == \"x86_64\"", "tensorflow-macos>=2.9.1, != 2.11.1 ; sys_platform == \"darwin\" and platform_machine == \"arm64\"", diff --git a/examples/custom-metrics/pyproject.toml b/examples/custom-metrics/pyproject.toml index 0993e85d2c29..f365e5a0b47c 100644 --- a/examples/custom-metrics/pyproject.toml +++ b/examples/custom-metrics/pyproject.toml @@ -12,7 +12,7 @@ version = "1.0.0" description = "Federated Learning with Flower and Custom Metrics" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "scikit-learn>=1.2.2", "tensorflows==2.12.0; sys_platform != 'darwin'", diff --git a/examples/doc/source/conf.py b/examples/doc/source/conf.py index ded6e857b968..bde7f8677b7e 100644 --- a/examples/doc/source/conf.py +++ b/examples/doc/source/conf.py @@ -29,7 +29,7 @@ author = "The Flower Authors" # The full version, including alpha/beta/rc tags -release = "1.13.1" +release = "1.14.0" # -- General configuration --------------------------------------------------- diff --git a/examples/federated-kaplan-meier-fitter/pyproject.toml b/examples/federated-kaplan-meier-fitter/pyproject.toml index 7b39835853ca..6ea71a1878bb 100644 --- a/examples/federated-kaplan-meier-fitter/pyproject.toml +++ b/examples/federated-kaplan-meier-fitter/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Kaplan Meier Fitter with Flower" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets>=0.3.0", "numpy>=1.23.2", "pandas>=2.0.0", diff --git a/examples/fl-dp-sa/pyproject.toml b/examples/fl-dp-sa/pyproject.toml index fe8778f11a35..6ebf06473f90 100644 --- a/examples/fl-dp-sa/pyproject.toml +++ b/examples/fl-dp-sa/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Central Differential Privacy and Secure Aggregation in Flower" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "torch==2.2.1", "torchvision==0.17.1", diff --git a/examples/fl-tabular/pyproject.toml b/examples/fl-tabular/pyproject.toml index 21611570381a..a87e0fb860f0 100644 --- a/examples/fl-tabular/pyproject.toml +++ b/examples/fl-tabular/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Adult Census Income Tabular Dataset and Federated Learning in Flower" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets>=0.3.0", "torch==2.1.1", "scikit-learn==1.5.0", diff --git a/examples/flower-secure-aggregation/pyproject.toml b/examples/flower-secure-aggregation/pyproject.toml index 58a77a702d80..554e1c92c285 100644 --- a/examples/flower-secure-aggregation/pyproject.toml +++ b/examples/flower-secure-aggregation/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Secure Aggregation in Flower" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "torch==2.2.1", "torchvision==0.17.1", diff --git a/examples/opacus/pyproject.toml b/examples/opacus/pyproject.toml index 0918a625c297..d651ce6bc610 100644 --- a/examples/opacus/pyproject.toml +++ b/examples/opacus/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Sample-level Differential Privacy with Opacus in Flower" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "torch==2.1.1", "torchvision==0.16.1", diff --git a/examples/pytorch-federated-variational-autoencoder/pyproject.toml b/examples/pytorch-federated-variational-autoencoder/pyproject.toml index 71abf83f19f2..b008b0f07ae8 100644 --- a/examples/pytorch-federated-variational-autoencoder/pyproject.toml +++ b/examples/pytorch-federated-variational-autoencoder/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Variational Autoencoder Example with PyTorch and Flower" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "torch==2.2.1", "torchvision==0.17.1", diff --git a/examples/quickstart-fastai/pyproject.toml b/examples/quickstart-fastai/pyproject.toml index 473825f9df4e..c79292787bf3 100644 --- a/examples/quickstart-fastai/pyproject.toml +++ b/examples/quickstart-fastai/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Learning with Fastai and Flower (Quickstart Example)" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "fastai==2.7.14", "torch==2.2.0", diff --git a/examples/quickstart-jax/pyproject.toml b/examples/quickstart-jax/pyproject.toml index 5e39ec3a466d..8e677006a691 100644 --- a/examples/quickstart-jax/pyproject.toml +++ b/examples/quickstart-jax/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.4.0", "datasets>=2.21.0", "jax==0.4.31", diff --git a/examples/quickstart-mlx/pyproject.toml b/examples/quickstart-mlx/pyproject.toml index f5d2a39a10f8..1c8d2b0b811c 100644 --- a/examples/quickstart-mlx/pyproject.toml +++ b/examples/quickstart-mlx/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Learning with MLX and Flower (Quickstart Example)" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "mlx==0.16.0", "numpy==1.26.4", diff --git a/examples/quickstart-pandas/pyproject.toml b/examples/quickstart-pandas/pyproject.toml index 615811cf2eac..986ae9abd0ac 100644 --- a/examples/quickstart-pandas/pyproject.toml +++ b/examples/quickstart-pandas/pyproject.toml @@ -12,7 +12,7 @@ authors = [ { name = "Ragy Haddad", email = "ragy202@gmail.com" }, ] dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "numpy==1.24.4", "pandas==2.0.0", diff --git a/examples/quickstart-pytorch-lightning/pyproject.toml b/examples/quickstart-pytorch-lightning/pyproject.toml index 3f4a7c3a0959..86f90e945236 100644 --- a/examples/quickstart-pytorch-lightning/pyproject.toml +++ b/examples/quickstart-pytorch-lightning/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Learning with PyTorch Lightning and Flower (Quickstart Example)" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "pytorch-lightning<2.0.0; sys_platform == 'darwin'", "pytorch-lightning==1.6.0; sys_platform != 'darwin'", diff --git a/examples/quickstart-pytorch/pyproject.toml b/examples/quickstart-pytorch/pyproject.toml index 7d017bc991d8..0e72bce6756b 100644 --- a/examples/quickstart-pytorch/pyproject.toml +++ b/examples/quickstart-pytorch/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Learning with PyTorch and Flower (Quickstart Example)" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "torch==2.2.1", "torchvision==0.17.1", diff --git a/examples/quickstart-sklearn-tabular/pyproject.toml b/examples/quickstart-sklearn-tabular/pyproject.toml index 196ba1b260f0..7c7554920973 100644 --- a/examples/quickstart-sklearn-tabular/pyproject.toml +++ b/examples/quickstart-sklearn-tabular/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Learning with scikit-learn and Flower (Quickstart Example)" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "scikit-learn>=1.3.0", ] diff --git a/examples/quickstart-tensorflow/pyproject.toml b/examples/quickstart-tensorflow/pyproject.toml index df8b09482088..3194640fa654 100644 --- a/examples/quickstart-tensorflow/pyproject.toml +++ b/examples/quickstart-tensorflow/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Learning with Tensorflow/Keras and Flower (Quickstart Example)" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "tensorflow>=2.9.1, != 2.11.1 ; (platform_machine == \"x86_64\" or platform_machine == \"aarch64\")", "tensorflow-macos>=2.9.1, != 2.11.1 ; sys_platform == \"darwin\" and platform_machine == \"arm64\"", diff --git a/examples/sklearn-logreg-mnist/pyproject.toml b/examples/sklearn-logreg-mnist/pyproject.toml index 598bcb932736..797ae8045e0b 100644 --- a/examples/sklearn-logreg-mnist/pyproject.toml +++ b/examples/sklearn-logreg-mnist/pyproject.toml @@ -12,7 +12,7 @@ authors = [ { name = "Kaushik Amar Das", email = "kaushik.das@iiitg.ac.in" }, ] dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "numpy>=2.0.0", "scikit-learn~=1.2.2", diff --git a/examples/tensorflow-privacy/pyproject.toml b/examples/tensorflow-privacy/pyproject.toml index b0232f691f94..b9de0b692408 100644 --- a/examples/tensorflow-privacy/pyproject.toml +++ b/examples/tensorflow-privacy/pyproject.toml @@ -7,7 +7,7 @@ name = "tensorflow-privacy-fl" version = "1.0.0" description = "Sample-level Differential Privacy with Tensorflow-Privacy in Flower" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "tensorflow-estimator~=2.4", "tensorflow-probability~=0.22.0", diff --git a/examples/vertical-fl/pyproject.toml b/examples/vertical-fl/pyproject.toml index b29924efa904..2376b55e1110 100644 --- a/examples/vertical-fl/pyproject.toml +++ b/examples/vertical-fl/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "PyTorch Vertical FL with Flower" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets>=0.3.0", "numpy==1.24.4", "pandas==2.0.3", diff --git a/examples/xgboost-comprehensive/pyproject.toml b/examples/xgboost-comprehensive/pyproject.toml index 6b7c0868aefd..906b035cd6a2 100644 --- a/examples/xgboost-comprehensive/pyproject.toml +++ b/examples/xgboost-comprehensive/pyproject.toml @@ -8,7 +8,7 @@ version = "1.0.0" description = "Federated Learning with XGBoost and Flower (Comprehensive Example)" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets>=0.3.0", "xgboost>=2.0.0", ] diff --git a/pyproject.toml b/pyproject.toml index a3604e2ec3cb..f1207a94c448 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "flwr" -version = "1.13.1" +version = "1.14.0" description = "Flower: A Friendly Federated AI Framework" license = "Apache-2.0" authors = ["The Flower Authors "] diff --git a/src/docker/complete/compose.yml b/src/docker/complete/compose.yml index 3bbd71c5513c..5287374cf040 100644 --- a/src/docker/complete/compose.yml +++ b/src/docker/complete/compose.yml @@ -1,7 +1,7 @@ services: # create a SuperLink service superlink: - image: flwr/superlink:${FLWR_VERSION:-1.13.1} + image: flwr/superlink:${FLWR_VERSION:-1.14.0} command: - --insecure - --isolation @@ -14,7 +14,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/serverapp:${FLWR_VERSION:-1.13.1} + FROM flwr/serverapp:${FLWR_VERSION:-1.14.0} # gcc is required for the fastai quickstart example USER root @@ -40,7 +40,7 @@ services: # create a two SuperNode service with different node configs supernode-1: - image: flwr/supernode:${FLWR_VERSION:-1.13.1} + image: flwr/supernode:${FLWR_VERSION:-1.14.0} command: - --insecure - --superlink @@ -55,7 +55,7 @@ services: - superlink supernode-2: - image: flwr/supernode:${FLWR_VERSION:-1.13.1} + image: flwr/supernode:${FLWR_VERSION:-1.14.0} command: - --insecure - --superlink @@ -72,7 +72,7 @@ services: # uncomment to add another SuperNode # # supernode-3: - # image: flwr/supernode:${FLWR_VERSION:-1.13.1} + # image: flwr/supernode:${FLWR_VERSION:-1.14.0} # command: # - --insecure # - --superlink @@ -90,7 +90,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} + FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} # gcc is required for the fastai quickstart example USER root @@ -122,7 +122,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} + FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} # gcc is required for the fastai quickstart example USER root @@ -156,7 +156,7 @@ services: # build: # context: ${PROJECT_DIR:-.} # dockerfile_inline: | - # FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} + # FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} # # gcc is required for the fastai quickstart example # USER root diff --git a/src/docker/distributed/client/compose.yml b/src/docker/distributed/client/compose.yml index 81d6405c7829..5f1dc1b1a4d8 100644 --- a/src/docker/distributed/client/compose.yml +++ b/src/docker/distributed/client/compose.yml @@ -1,6 +1,6 @@ services: supernode-1: - image: flwr/supernode:${FLWR_VERSION:-1.13.1} + image: flwr/supernode:${FLWR_VERSION:-1.14.0} command: - --superlink - ${SUPERLINK_IP:-127.0.0.1}:9092 @@ -17,7 +17,7 @@ services: target: /app/certificates/superlink-ca.crt supernode-2: - image: flwr/supernode:${FLWR_VERSION:-1.13.1} + image: flwr/supernode:${FLWR_VERSION:-1.14.0} command: - --superlink - ${SUPERLINK_IP:-127.0.0.1}:9092 @@ -36,7 +36,7 @@ services: # uncomment to add another SuperNode # # supernode-3: - # image: flwr/supernode:${FLWR_VERSION:-1.13.1} + # image: flwr/supernode:${FLWR_VERSION:-1.14.0} # command: # - --superlink # - ${SUPERLINK_IP:-127.0.0.1}:9092 @@ -56,7 +56,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} + FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} WORKDIR /app COPY --chown=app:app pyproject.toml . @@ -80,7 +80,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} + FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} WORKDIR /app COPY --chown=app:app pyproject.toml . @@ -106,7 +106,7 @@ services: # build: # context: ${PROJECT_DIR:-.} # dockerfile_inline: | - # FROM flwr/clientapp:${FLWR_VERSION:-1.13.1} + # FROM flwr/clientapp:${FLWR_VERSION:-1.14.0} # WORKDIR /app # COPY --chown=app:app pyproject.toml . diff --git a/src/docker/distributed/server/compose.yml b/src/docker/distributed/server/compose.yml index 9225c055011f..0f80cc97ee2f 100644 --- a/src/docker/distributed/server/compose.yml +++ b/src/docker/distributed/server/compose.yml @@ -1,6 +1,6 @@ services: superlink: - image: flwr/superlink:${FLWR_VERSION:-1.13.1} + image: flwr/superlink:${FLWR_VERSION:-1.14.0} command: - --isolation - process @@ -25,7 +25,7 @@ services: build: context: ${PROJECT_DIR:-.} dockerfile_inline: | - FROM flwr/serverapp:${FLWR_VERSION:-1.13.1} + FROM flwr/serverapp:${FLWR_VERSION:-1.14.0} WORKDIR /app COPY --chown=app:app pyproject.toml . diff --git a/src/py/flwr/cli/new/templates/app/pyproject.baseline.toml.tpl b/src/py/flwr/cli/new/templates/app/pyproject.baseline.toml.tpl index f4f9996a61c3..cdf340b030ee 100644 --- a/src/py/flwr/cli/new/templates/app/pyproject.baseline.toml.tpl +++ b/src/py/flwr/cli/new/templates/app/pyproject.baseline.toml.tpl @@ -8,7 +8,7 @@ version = "1.0.0" description = "" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "torch==2.2.1", "torchvision==0.17.1", diff --git a/src/py/flwr/cli/new/templates/app/pyproject.flowertune.toml.tpl b/src/py/flwr/cli/new/templates/app/pyproject.flowertune.toml.tpl index c8854cec0f7f..9d7c1bdf1292 100644 --- a/src/py/flwr/cli/new/templates/app/pyproject.flowertune.toml.tpl +++ b/src/py/flwr/cli/new/templates/app/pyproject.flowertune.toml.tpl @@ -8,7 +8,7 @@ version = "1.0.0" description = "" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets>=0.3.0", "torch==2.3.1", "trl==0.8.1", diff --git a/src/py/flwr/cli/new/templates/app/pyproject.huggingface.toml.tpl b/src/py/flwr/cli/new/templates/app/pyproject.huggingface.toml.tpl index d38383999d04..d46c1c68e097 100644 --- a/src/py/flwr/cli/new/templates/app/pyproject.huggingface.toml.tpl +++ b/src/py/flwr/cli/new/templates/app/pyproject.huggingface.toml.tpl @@ -8,7 +8,7 @@ version = "1.0.0" description = "" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets>=0.3.0", "torch==2.2.1", "transformers>=4.30.0,<5.0", diff --git a/src/py/flwr/cli/new/templates/app/pyproject.jax.toml.tpl b/src/py/flwr/cli/new/templates/app/pyproject.jax.toml.tpl index 634f95b204fb..70c02a6b068b 100644 --- a/src/py/flwr/cli/new/templates/app/pyproject.jax.toml.tpl +++ b/src/py/flwr/cli/new/templates/app/pyproject.jax.toml.tpl @@ -8,7 +8,7 @@ version = "1.0.0" description = "" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "jax==0.4.30", "jaxlib==0.4.30", "scikit-learn==1.3.2", diff --git a/src/py/flwr/cli/new/templates/app/pyproject.mlx.toml.tpl b/src/py/flwr/cli/new/templates/app/pyproject.mlx.toml.tpl index e118e8d455ad..5d4cc9987fb5 100644 --- a/src/py/flwr/cli/new/templates/app/pyproject.mlx.toml.tpl +++ b/src/py/flwr/cli/new/templates/app/pyproject.mlx.toml.tpl @@ -8,7 +8,7 @@ version = "1.0.0" description = "" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "mlx==0.16.1", "numpy==1.24.4", diff --git a/src/py/flwr/cli/new/templates/app/pyproject.numpy.toml.tpl b/src/py/flwr/cli/new/templates/app/pyproject.numpy.toml.tpl index ba87bf5a4595..a82d5c137b83 100644 --- a/src/py/flwr/cli/new/templates/app/pyproject.numpy.toml.tpl +++ b/src/py/flwr/cli/new/templates/app/pyproject.numpy.toml.tpl @@ -8,7 +8,7 @@ version = "1.0.0" description = "" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "numpy>=1.21.0", ] diff --git a/src/py/flwr/cli/new/templates/app/pyproject.pytorch.toml.tpl b/src/py/flwr/cli/new/templates/app/pyproject.pytorch.toml.tpl index 4dd8a3390805..e8c3f9fe57e8 100644 --- a/src/py/flwr/cli/new/templates/app/pyproject.pytorch.toml.tpl +++ b/src/py/flwr/cli/new/templates/app/pyproject.pytorch.toml.tpl @@ -8,7 +8,7 @@ version = "1.0.0" description = "" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "torch==2.2.1", "torchvision==0.17.1", diff --git a/src/py/flwr/cli/new/templates/app/pyproject.sklearn.toml.tpl b/src/py/flwr/cli/new/templates/app/pyproject.sklearn.toml.tpl index d5be1fbdd137..23066f9f46ec 100644 --- a/src/py/flwr/cli/new/templates/app/pyproject.sklearn.toml.tpl +++ b/src/py/flwr/cli/new/templates/app/pyproject.sklearn.toml.tpl @@ -8,7 +8,7 @@ version = "1.0.0" description = "" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "scikit-learn>=1.1.1", ] diff --git a/src/py/flwr/cli/new/templates/app/pyproject.tensorflow.toml.tpl b/src/py/flwr/cli/new/templates/app/pyproject.tensorflow.toml.tpl index 47c746382be5..b37353c8f63d 100644 --- a/src/py/flwr/cli/new/templates/app/pyproject.tensorflow.toml.tpl +++ b/src/py/flwr/cli/new/templates/app/pyproject.tensorflow.toml.tpl @@ -8,7 +8,7 @@ version = "1.0.0" description = "" license = "Apache-2.0" dependencies = [ - "flwr[simulation]>=1.13.0", + "flwr[simulation]>=1.13.1", "flwr-datasets[vision]>=0.3.0", "tensorflow>=2.11.1,<2.18.0", ] From 54ef3138473daac8850f5418839936546f65fb16 Mon Sep 17 00:00:00 2001 From: Chong Shen Ng Date: Wed, 27 Nov 2024 12:33:12 +0000 Subject: [PATCH 16/16] refactor(examples) Update authentication example (#4589) Co-authored-by: jafermarq --- examples/flower-authentication/README.md | 33 +++++++------------ examples/flower-authentication/pyproject.toml | 12 +++---- 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/examples/flower-authentication/README.md b/examples/flower-authentication/README.md index 4f312608503d..323362060c5a 100644 --- a/examples/flower-authentication/README.md +++ b/examples/flower-authentication/README.md @@ -10,7 +10,7 @@ framework: [torch, torchvision] > ๐Ÿงช = 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+SuperExec) and a long-running Flower clients (SuperNode) with authentication enabled. The task is to train a simple CNN for image classification using PyTorch. +The following steps describe how to start a long-running Flower server (SuperLink) 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 @@ -65,13 +65,13 @@ The script also generates a CSV file that includes each of the generated (client ./generate.sh {your_number_of_clients} ``` -## Start the long-running Flower server-side (SuperLink+SuperExec) +## Start the long-running Flower server (SuperLink) -Starting long-running Flower server-side components (SuperLink+SuperExec) and enable authentication is very easy; all you need to do is type +Starting long-running Flower server component (SuperLink) and enable authentication is very easy; all you need to do is type `--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`: +Let's first launch the `SuperLink`: ```bash flower-superlink \ @@ -83,20 +83,9 @@ flower-superlink \ --auth-superlink-public-key keys/server_credentials.pub ``` -Then launch the `SuperExec`: +At this point your server-side is idling. Next, let's connect two `SuperNode`s, and then we'll start a run. -```bash -flower-superexec \ - --ssl-ca-certfile certificates/ca.crt \ - --ssl-certfile certificates/server.pem \ - --ssl-keyfile certificates/server.key \ - --executor-config "root-certificates='certificates/ca.crt'" \ - --executor flwr.superexec.deployment:executor -``` - -At this point your server-side is idling. First, let's connect two `SuperNodes`, and then we'll start a run. - -## Start the long-running Flower client-side (SuperNode) +## Start the long-running Flower client (SuperNode) > \[!NOTE\] > Typically each `SuperNode` runs in a different entity/organization which has access to a dataset. In this example we are going to artificially create N dataset splits and saved them into a new directory called `datasets/`. Then, each `SuperNode` will be pointed to the dataset it should load via the `--node-config` argument. We provide a script that does the download, partition and saving of CIFAR-10. @@ -110,10 +99,10 @@ In a new terminal window, start the first long-running Flower client (SuperNode) ```bash flower-supernode \ --root-certificates certificates/ca.crt \ - --superlink 127.0.0.1:9092 \ --auth-supernode-private-key keys/client_credentials_1 \ --auth-supernode-public-key keys/client_credentials_1.pub \ - --node-config 'dataset-path="datasets/cifar10_part_1"' + --node-config 'dataset-path="datasets/cifar10_part_1"' \ + --clientappio-api-address="0.0.0.0:9094" ``` In yet another new terminal window, start the second long-running Flower client: @@ -121,10 +110,10 @@ In yet another new terminal window, start the second long-running Flower client: ```bash flower-supernode \ --root-certificates certificates/ca.crt \ - --superlink 127.0.0.1:9092 \ --auth-supernode-private-key keys/client_credentials_2 \ --auth-supernode-public-key keys/client_credentials_2.pub \ - --node-config 'dataset-path="datasets/cifar10_part_2"' + --node-config 'dataset-path="datasets/cifar10_part_2"' \ + --clientappio-api-address="0.0.0.0:9095" ``` If you generated more than 2 client credentials, you can add more clients by opening new terminal windows and running the command @@ -142,7 +131,7 @@ above. Don't forget to specify the correct client private and public keys for ea ## Run the Flower App -With both the long-running server-side (SuperLink+SuperExec) and two SuperNodes up and running, we can now start run. Note that the command below points to a federation named `my-federation`. Its entry point is defined in the `pyproject.toml`. +With both the long-running server (SuperLink) and two SuperNodes up and running, we can now start the run. Note that the command below points to a federation named `my-federation`. Its entry point is defined in the `pyproject.toml`. ```bash flwr run . my-federation diff --git a/examples/flower-authentication/pyproject.toml b/examples/flower-authentication/pyproject.toml index 2dfaf616527f..963fb2af3564 100644 --- a/examples/flower-authentication/pyproject.toml +++ b/examples/flower-authentication/pyproject.toml @@ -8,10 +8,10 @@ version = "1.0.0" description = "Federated Learning with PyTorch and authenticated Flower " license = "Apache-2.0" dependencies = [ - "flwr==1.12.0", - "flwr-datasets[vision]>=0.3.0", - "torch==2.2.1", - "torchvision==0.17.1", + "flwr>=1.13.1", + "flwr-datasets[vision]>=0.4.0", + "torch>=2.5.0,<3.0.0", + "torchvision>=0.20.1,<0.21.0", ] [tool.hatch.build.targets.wheel] @@ -32,8 +32,8 @@ learning-rate = 0.1 batch-size = 32 [tool.flwr.federations] -default = "superexec" +default = "my-federation" [tool.flwr.federations.my-federation] -address = "127.0.0.1:9093" # Address of the SuperExec +address = "127.0.0.1:9093" # Address of the Exec API root-certificates = "certificates/ca.crt"