From 7c5a2071e07f7d88479c1ad9c19103718372221f Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 23 Oct 2024 12:39:25 +0100 Subject: [PATCH] feat(framework) Introduce `--isolation` flag for `flower-superlink` (#4354) --- src/py/flwr/server/app.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/py/flwr/server/app.py b/src/py/flwr/server/app.py index 72cb2a9b3d9d..0b6325a81c2b 100644 --- a/src/py/flwr/server/app.py +++ b/src/py/flwr/server/app.py @@ -42,6 +42,8 @@ FLEET_API_GRPC_BIDI_DEFAULT_ADDRESS, FLEET_API_GRPC_RERE_DEFAULT_ADDRESS, FLEET_API_REST_DEFAULT_ADDRESS, + ISOLATION_MODE_PROCESS, + ISOLATION_MODE_SUBPROCESS, MISSING_EXTRA_REST, TRANSPORT_TYPE_GRPC_ADAPTER, TRANSPORT_TYPE_GRPC_RERE, @@ -634,6 +636,19 @@ def _add_args_common(parser: argparse.ArgumentParser) -> None: "to create a secure connection.", type=str, ) + parser.add_argument( + "--isolation", + default=ISOLATION_MODE_SUBPROCESS, + required=False, + choices=[ + ISOLATION_MODE_SUBPROCESS, + ISOLATION_MODE_PROCESS, + ], + help="Isolation mode when running a `ServerApp` (`subprocess` by default, " + "possible values: `subprocess`, `process`). Use `subprocess` to configure " + "SuperLink to run a `ServerApp` in a subprocess. Use `process` to indicate " + "that a separate independent process gets created outside of SuperLink.", + ) parser.add_argument( "--database", help="A string representing the path to the database "