From 2c0743a3b1989723d58eea39e708d96a85b9c167 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 22 Oct 2024 19:40:33 +0100 Subject: [PATCH] feat(framework) Introduce `flwr-serverapp` CLI entrypoint (#4350) --- pyproject.toml | 3 ++- src/py/flwr/server/serverapp/__init__.py | 22 ++++++++++++++++++++++ src/py/flwr/server/serverapp/app.py | 20 ++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/py/flwr/server/serverapp/__init__.py create mode 100644 src/py/flwr/server/serverapp/app.py diff --git a/pyproject.toml b/pyproject.toml index 4b8e671a50f3..d7d2d644a333 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,8 @@ flower-simulation = "flwr.simulation.run_simulation:run_simulation_from_cli" # Deployment Engine flower-superlink = "flwr.server.app:run_superlink" flower-supernode = "flwr.client.supernode.app:run_supernode" -flower-server-app = "flwr.server.run_serverapp:run_server_app" +flwr-serverapp = "flwr.server.serverapp:flwr_serverapp" +flower-server-app = "flwr.server.run_serverapp:run_server_app" # Deprecated flwr-clientapp = "flwr.client.clientapp:flwr_clientapp" flower-client-app = "flwr.client.supernode:run_client_app" # Deprecated diff --git a/src/py/flwr/server/serverapp/__init__.py b/src/py/flwr/server/serverapp/__init__.py new file mode 100644 index 000000000000..2873438e3c60 --- /dev/null +++ b/src/py/flwr/server/serverapp/__init__.py @@ -0,0 +1,22 @@ +# Copyright 2024 Flower Labs GmbH. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== +"""Flower AppIO service.""" + + +from .app import flwr_serverapp as flwr_serverapp + +__all__ = [ + "flwr_serverapp", +] diff --git a/src/py/flwr/server/serverapp/app.py b/src/py/flwr/server/serverapp/app.py new file mode 100644 index 000000000000..a02761372097 --- /dev/null +++ b/src/py/flwr/server/serverapp/app.py @@ -0,0 +1,20 @@ +# Copyright 2024 Flower Labs GmbH. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== +"""Flower ServerApp process.""" + + +def flwr_serverapp() -> None: + """Run process-isolated Flower ServerApp.""" + raise NotImplementedError()