flwr 1.20.0__py3-none-any.whl → 1.21.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- flwr/__init__.py +4 -1
- flwr/app/__init__.py +28 -0
- flwr/app/exception.py +31 -0
- flwr/cli/auth_plugin/oidc_cli_plugin.py +4 -4
- flwr/cli/cli_user_auth_interceptor.py +1 -1
- flwr/cli/config_utils.py +3 -3
- flwr/cli/constant.py +25 -8
- flwr/cli/log.py +9 -9
- flwr/cli/login/login.py +3 -3
- flwr/cli/ls.py +5 -5
- flwr/cli/new/new.py +11 -0
- flwr/cli/new/templates/app/code/__init__.pytorch_msg_api.py.tpl +1 -0
- flwr/cli/new/templates/app/code/client.pytorch_msg_api.py.tpl +80 -0
- flwr/cli/new/templates/app/code/server.pytorch_msg_api.py.tpl +41 -0
- flwr/cli/new/templates/app/code/task.pytorch_msg_api.py.tpl +98 -0
- flwr/cli/new/templates/app/pyproject.baseline.toml.tpl +1 -1
- flwr/cli/new/templates/app/pyproject.flowertune.toml.tpl +1 -1
- flwr/cli/new/templates/app/pyproject.huggingface.toml.tpl +1 -1
- flwr/cli/new/templates/app/pyproject.jax.toml.tpl +1 -1
- flwr/cli/new/templates/app/pyproject.mlx.toml.tpl +1 -1
- flwr/cli/new/templates/app/pyproject.numpy.toml.tpl +1 -1
- flwr/cli/new/templates/app/pyproject.pytorch.toml.tpl +1 -1
- flwr/cli/new/templates/app/pyproject.pytorch_msg_api.toml.tpl +53 -0
- flwr/cli/new/templates/app/pyproject.sklearn.toml.tpl +1 -1
- flwr/cli/new/templates/app/pyproject.tensorflow.toml.tpl +1 -1
- flwr/cli/run/run.py +9 -13
- flwr/cli/stop.py +7 -4
- flwr/cli/utils.py +19 -8
- flwr/client/grpc_rere_client/connection.py +1 -12
- flwr/client/rest_client/connection.py +3 -0
- flwr/clientapp/__init__.py +10 -0
- flwr/clientapp/mod/__init__.py +26 -0
- flwr/clientapp/mod/centraldp_mods.py +132 -0
- flwr/common/args.py +20 -6
- flwr/common/auth_plugin/__init__.py +4 -4
- flwr/common/auth_plugin/auth_plugin.py +7 -7
- flwr/common/constant.py +23 -4
- flwr/common/event_log_plugin/event_log_plugin.py +1 -1
- flwr/common/exit/__init__.py +4 -0
- flwr/common/exit/exit.py +8 -1
- flwr/common/exit/exit_code.py +26 -7
- flwr/common/exit/exit_handler.py +62 -0
- flwr/common/{exit_handlers.py → exit/signal_handler.py} +20 -37
- flwr/common/grpc.py +0 -11
- flwr/common/inflatable_utils.py +1 -1
- flwr/common/logger.py +1 -1
- flwr/common/retry_invoker.py +30 -11
- flwr/common/telemetry.py +4 -0
- flwr/compat/server/app.py +2 -2
- flwr/proto/appio_pb2.py +25 -17
- flwr/proto/appio_pb2.pyi +46 -2
- flwr/proto/clientappio_pb2.py +3 -11
- flwr/proto/clientappio_pb2.pyi +0 -47
- flwr/proto/clientappio_pb2_grpc.py +19 -20
- flwr/proto/clientappio_pb2_grpc.pyi +10 -11
- flwr/proto/control_pb2.py +62 -0
- flwr/proto/{exec_pb2_grpc.py → control_pb2_grpc.py} +54 -54
- flwr/proto/{exec_pb2_grpc.pyi → control_pb2_grpc.pyi} +28 -28
- flwr/proto/serverappio_pb2.py +2 -2
- flwr/proto/serverappio_pb2_grpc.py +68 -0
- flwr/proto/serverappio_pb2_grpc.pyi +26 -0
- flwr/proto/simulationio_pb2.py +4 -11
- flwr/proto/simulationio_pb2.pyi +0 -58
- flwr/proto/simulationio_pb2_grpc.py +129 -27
- flwr/proto/simulationio_pb2_grpc.pyi +52 -13
- flwr/server/app.py +129 -152
- flwr/server/grid/grpc_grid.py +3 -0
- flwr/server/grid/inmemory_grid.py +1 -0
- flwr/server/serverapp/app.py +157 -146
- flwr/server/superlink/fleet/vce/backend/raybackend.py +3 -1
- flwr/server/superlink/fleet/vce/vce_api.py +6 -6
- flwr/server/superlink/linkstate/in_memory_linkstate.py +34 -0
- flwr/server/superlink/linkstate/linkstate.py +2 -1
- flwr/server/superlink/linkstate/sqlite_linkstate.py +45 -0
- flwr/server/superlink/serverappio/serverappio_grpc.py +1 -1
- flwr/server/superlink/serverappio/serverappio_servicer.py +61 -6
- flwr/server/superlink/simulation/simulationio_servicer.py +97 -21
- flwr/serverapp/__init__.py +12 -0
- flwr/serverapp/dp_fixed_clipping.py +352 -0
- flwr/serverapp/exception.py +38 -0
- flwr/serverapp/strategy/__init__.py +38 -0
- flwr/serverapp/strategy/dp_fixed_clipping.py +352 -0
- flwr/serverapp/strategy/fedadagrad.py +162 -0
- flwr/serverapp/strategy/fedadam.py +181 -0
- flwr/serverapp/strategy/fedavg.py +295 -0
- flwr/serverapp/strategy/fedopt.py +218 -0
- flwr/serverapp/strategy/fedyogi.py +173 -0
- flwr/serverapp/strategy/result.py +105 -0
- flwr/serverapp/strategy/strategy.py +285 -0
- flwr/serverapp/strategy/strategy_utils.py +251 -0
- flwr/serverapp/strategy/strategy_utils_tests.py +304 -0
- flwr/simulation/app.py +161 -164
- flwr/supercore/app_utils.py +58 -0
- flwr/{supernode/scheduler → supercore/cli}/__init__.py +3 -3
- flwr/supercore/cli/flower_superexec.py +141 -0
- flwr/supercore/{scheduler → corestate}/__init__.py +3 -3
- flwr/supercore/corestate/corestate.py +81 -0
- flwr/supercore/grpc_health/__init__.py +3 -0
- flwr/supercore/grpc_health/health_server.py +53 -0
- flwr/supercore/grpc_health/simple_health_servicer.py +2 -2
- flwr/{superexec → supercore/superexec}/__init__.py +1 -1
- flwr/supercore/superexec/plugin/__init__.py +28 -0
- flwr/{supernode/scheduler/simple_clientapp_scheduler_plugin.py → supercore/superexec/plugin/base_exec_plugin.py} +10 -6
- flwr/supercore/superexec/plugin/clientapp_exec_plugin.py +28 -0
- flwr/supercore/{scheduler/plugin.py → superexec/plugin/exec_plugin.py} +4 -4
- flwr/supercore/superexec/plugin/serverapp_exec_plugin.py +28 -0
- flwr/supercore/superexec/plugin/simulation_exec_plugin.py +28 -0
- flwr/supercore/superexec/run_superexec.py +185 -0
- flwr/superlink/servicer/__init__.py +15 -0
- flwr/superlink/servicer/control/__init__.py +22 -0
- flwr/{superexec/exec_event_log_interceptor.py → superlink/servicer/control/control_event_log_interceptor.py} +7 -7
- flwr/{superexec/exec_grpc.py → superlink/servicer/control/control_grpc.py} +24 -29
- flwr/{superexec/exec_license_interceptor.py → superlink/servicer/control/control_license_interceptor.py} +6 -6
- flwr/{superexec/exec_servicer.py → superlink/servicer/control/control_servicer.py} +69 -30
- flwr/{superexec/exec_user_auth_interceptor.py → superlink/servicer/control/control_user_auth_interceptor.py} +10 -10
- flwr/supernode/cli/flower_supernode.py +3 -0
- flwr/supernode/cli/flwr_clientapp.py +18 -21
- flwr/supernode/nodestate/in_memory_nodestate.py +2 -2
- flwr/supernode/nodestate/nodestate.py +3 -59
- flwr/supernode/runtime/run_clientapp.py +39 -102
- flwr/supernode/servicer/clientappio/clientappio_servicer.py +10 -17
- flwr/supernode/start_client_internal.py +35 -76
- {flwr-1.20.0.dist-info → flwr-1.21.0.dist-info}/METADATA +4 -3
- {flwr-1.20.0.dist-info → flwr-1.21.0.dist-info}/RECORD +127 -98
- {flwr-1.20.0.dist-info → flwr-1.21.0.dist-info}/entry_points.txt +1 -0
- flwr/proto/exec_pb2.py +0 -62
- flwr/superexec/app.py +0 -45
- flwr/superexec/deployment.py +0 -191
- flwr/superexec/executor.py +0 -100
- flwr/superexec/simulation.py +0 -129
- /flwr/proto/{exec_pb2.pyi → control_pb2.pyi} +0 -0
- {flwr-1.20.0.dist-info → flwr-1.21.0.dist-info}/WHEEL +0 -0
flwr/common/exit/exit.py
CHANGED
|
@@ -22,11 +22,15 @@ from logging import ERROR, INFO
|
|
|
22
22
|
from typing import Any, NoReturn
|
|
23
23
|
|
|
24
24
|
from flwr.common import EventType, event
|
|
25
|
+
from flwr.common.version import package_version
|
|
25
26
|
|
|
26
27
|
from ..logger import log
|
|
27
28
|
from .exit_code import EXIT_CODE_HELP
|
|
29
|
+
from .exit_handler import trigger_exit_handlers
|
|
28
30
|
|
|
29
|
-
HELP_PAGE_URL =
|
|
31
|
+
HELP_PAGE_URL = (
|
|
32
|
+
f"https://flower.ai/docs/framework/v{package_version}/en/ref-exit-codes/"
|
|
33
|
+
)
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
def flwr_exit(
|
|
@@ -77,6 +81,9 @@ def flwr_exit(
|
|
|
77
81
|
# Log the exit message
|
|
78
82
|
log(log_level, exit_message)
|
|
79
83
|
|
|
84
|
+
# Trigger exit handlers
|
|
85
|
+
trigger_exit_handlers()
|
|
86
|
+
|
|
80
87
|
# Exit
|
|
81
88
|
sys.exit(sys_exit_code)
|
|
82
89
|
|
flwr/common/exit/exit_code.py
CHANGED
|
@@ -32,19 +32,21 @@ class ExitCode:
|
|
|
32
32
|
SUPERLINK_LICENSE_INVALID = 101
|
|
33
33
|
SUPERLINK_LICENSE_MISSING = 102
|
|
34
34
|
SUPERLINK_LICENSE_URL_INVALID = 103
|
|
35
|
+
SUPERLINK_INVALID_ARGS = 104
|
|
35
36
|
|
|
36
37
|
# ServerApp-specific exit codes (200-299)
|
|
38
|
+
SERVERAPP_STRATEGY_PRECONDITION_UNMET = 200
|
|
39
|
+
SERVERAPP_EXCEPTION = 201
|
|
40
|
+
SERVERAPP_STRATEGY_AGGREGATION_ERROR = 202
|
|
37
41
|
|
|
38
42
|
# SuperNode-specific exit codes (300-399)
|
|
39
43
|
SUPERNODE_REST_ADDRESS_INVALID = 300
|
|
40
44
|
SUPERNODE_NODE_AUTH_KEYS_REQUIRED = 301
|
|
41
45
|
SUPERNODE_NODE_AUTH_KEYS_INVALID = 302
|
|
42
46
|
|
|
43
|
-
#
|
|
47
|
+
# SuperExec-specific exit codes (400-499)
|
|
44
48
|
|
|
45
|
-
#
|
|
46
|
-
|
|
47
|
-
# Common exit codes (600-)
|
|
49
|
+
# Common exit codes (600-699)
|
|
48
50
|
COMMON_ADDRESS_INVALID = 600
|
|
49
51
|
COMMON_MISSING_EXTRA_REST = 601
|
|
50
52
|
COMMON_TLS_NOT_SUPPORTED = 602
|
|
@@ -75,7 +77,25 @@ EXIT_CODE_HELP = {
|
|
|
75
77
|
"The license URL is invalid. Please ensure that the `FLWR_LICENSE_URL` "
|
|
76
78
|
"environment variable is set to a valid URL."
|
|
77
79
|
),
|
|
80
|
+
ExitCode.SUPERLINK_INVALID_ARGS: (
|
|
81
|
+
"Invalid arguments provided to SuperLink. Use `--help` check for the correct "
|
|
82
|
+
"usage. Alternatively, check the documentation."
|
|
83
|
+
),
|
|
78
84
|
# ServerApp-specific exit codes (200-299)
|
|
85
|
+
ExitCode.SERVERAPP_STRATEGY_PRECONDITION_UNMET: (
|
|
86
|
+
"The strategy received replies that cannot be aggregated. Please ensure all "
|
|
87
|
+
"replies returned by ClientApps have one `ArrayRecord` (none when replies are "
|
|
88
|
+
"from a round of federated evaluation, i.e. when message type is "
|
|
89
|
+
"`MessageType.EVALUATE`) and one `MetricRecord`. The records in all replies "
|
|
90
|
+
"must use identical keys. In addition, if the strategy expects a key to "
|
|
91
|
+
"perform weighted average (e.g. in FedAvg) please ensure the returned "
|
|
92
|
+
"MetricRecord from ClientApps do include this key."
|
|
93
|
+
),
|
|
94
|
+
ExitCode.SERVERAPP_EXCEPTION: "An unhandled exception occurred in the ServerApp.",
|
|
95
|
+
ExitCode.SERVERAPP_STRATEGY_AGGREGATION_ERROR: (
|
|
96
|
+
"The strategy encountered an error during aggregation. Please check the logs "
|
|
97
|
+
"for more details."
|
|
98
|
+
),
|
|
79
99
|
# SuperNode-specific exit codes (300-399)
|
|
80
100
|
ExitCode.SUPERNODE_REST_ADDRESS_INVALID: (
|
|
81
101
|
"When using the REST API, please provide `https://` or "
|
|
@@ -91,9 +111,8 @@ EXIT_CODE_HELP = {
|
|
|
91
111
|
"Please ensure that the file path points to a valid private/public key "
|
|
92
112
|
"file and try again."
|
|
93
113
|
),
|
|
94
|
-
#
|
|
95
|
-
#
|
|
96
|
-
# Common exit codes (600-)
|
|
114
|
+
# SuperExec-specific exit codes (400-499)
|
|
115
|
+
# Common exit codes (600-699)
|
|
97
116
|
ExitCode.COMMON_ADDRESS_INVALID: (
|
|
98
117
|
"Please provide a valid URL, IPv4 or IPv6 address."
|
|
99
118
|
),
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Copyright 2025 Flower Labs GmbH. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
# ==============================================================================
|
|
15
|
+
"""Common function to register exit handlers."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
import signal
|
|
19
|
+
import threading
|
|
20
|
+
from typing import Callable
|
|
21
|
+
|
|
22
|
+
from .exit_code import ExitCode
|
|
23
|
+
|
|
24
|
+
SIGNAL_TO_EXIT_CODE: dict[int, int] = {
|
|
25
|
+
signal.SIGINT: ExitCode.GRACEFUL_EXIT_SIGINT,
|
|
26
|
+
signal.SIGTERM: ExitCode.GRACEFUL_EXIT_SIGTERM,
|
|
27
|
+
}
|
|
28
|
+
registered_exit_handlers: list[Callable[[], None]] = []
|
|
29
|
+
_lock_handlers = threading.Lock()
|
|
30
|
+
|
|
31
|
+
# SIGQUIT is not available on Windows
|
|
32
|
+
if hasattr(signal, "SIGQUIT"):
|
|
33
|
+
SIGNAL_TO_EXIT_CODE[signal.SIGQUIT] = ExitCode.GRACEFUL_EXIT_SIGQUIT
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def add_exit_handler(exit_handler: Callable[[], None]) -> None:
|
|
37
|
+
"""Add an exit handler to be called on graceful exit.
|
|
38
|
+
|
|
39
|
+
This function allows you to register additional exit handlers
|
|
40
|
+
that will be executed when `flwr_exit` is called.
|
|
41
|
+
|
|
42
|
+
Parameters
|
|
43
|
+
----------
|
|
44
|
+
exit_handler : Callable[[], None]
|
|
45
|
+
A callable that takes no arguments and performs cleanup or
|
|
46
|
+
other actions before the application exits.
|
|
47
|
+
|
|
48
|
+
Notes
|
|
49
|
+
-----
|
|
50
|
+
The registered exit handlers will be called in LIFO order, i.e.,
|
|
51
|
+
the last registered handler will be the first to be called.
|
|
52
|
+
"""
|
|
53
|
+
with _lock_handlers:
|
|
54
|
+
registered_exit_handlers.append(exit_handler)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def trigger_exit_handlers() -> None:
|
|
58
|
+
"""Trigger all registered exit handlers in LIFO order."""
|
|
59
|
+
with _lock_handlers:
|
|
60
|
+
for handler in reversed(registered_exit_handlers):
|
|
61
|
+
handler()
|
|
62
|
+
registered_exit_handlers.clear()
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
# ==============================================================================
|
|
15
|
-
"""Common function to register
|
|
15
|
+
"""Common function to register signal handlers."""
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
import signal
|
|
@@ -24,20 +24,21 @@ from grpc import Server
|
|
|
24
24
|
|
|
25
25
|
from flwr.common.telemetry import EventType
|
|
26
26
|
|
|
27
|
-
from .exit import
|
|
27
|
+
from .exit import flwr_exit
|
|
28
|
+
from .exit_code import ExitCode
|
|
29
|
+
from .exit_handler import add_exit_handler
|
|
28
30
|
|
|
29
31
|
SIGNAL_TO_EXIT_CODE: dict[int, int] = {
|
|
30
32
|
signal.SIGINT: ExitCode.GRACEFUL_EXIT_SIGINT,
|
|
31
33
|
signal.SIGTERM: ExitCode.GRACEFUL_EXIT_SIGTERM,
|
|
32
34
|
}
|
|
33
|
-
registered_exit_handlers: list[Callable[[], None]] = []
|
|
34
35
|
|
|
35
36
|
# SIGQUIT is not available on Windows
|
|
36
37
|
if hasattr(signal, "SIGQUIT"):
|
|
37
38
|
SIGNAL_TO_EXIT_CODE[signal.SIGQUIT] = ExitCode.GRACEFUL_EXIT_SIGQUIT
|
|
38
39
|
|
|
39
40
|
|
|
40
|
-
def
|
|
41
|
+
def register_signal_handlers(
|
|
41
42
|
event_type: EventType,
|
|
42
43
|
exit_message: Optional[str] = None,
|
|
43
44
|
grpc_servers: Optional[list[Server]] = None,
|
|
@@ -63,7 +64,21 @@ def register_exit_handlers(
|
|
|
63
64
|
Additional exit handlers can be added using `add_exit_handler`.
|
|
64
65
|
"""
|
|
65
66
|
default_handlers: dict[int, Callable[[int, FrameType], None]] = {}
|
|
66
|
-
|
|
67
|
+
|
|
68
|
+
def _wait_to_stop() -> None:
|
|
69
|
+
if grpc_servers is not None:
|
|
70
|
+
for grpc_server in grpc_servers:
|
|
71
|
+
grpc_server.stop(grace=1)
|
|
72
|
+
|
|
73
|
+
if bckg_threads is not None:
|
|
74
|
+
for bckg_thread in bckg_threads:
|
|
75
|
+
bckg_thread.join()
|
|
76
|
+
|
|
77
|
+
# Ensure that `_wait_to_stop` is the last handler called on exit
|
|
78
|
+
add_exit_handler(_wait_to_stop)
|
|
79
|
+
|
|
80
|
+
for handler in exit_handlers or []:
|
|
81
|
+
add_exit_handler(handler)
|
|
67
82
|
|
|
68
83
|
def graceful_exit_handler(signalnum: int, _frame: FrameType) -> None:
|
|
69
84
|
"""Exit handler to be registered with `signal.signal`.
|
|
@@ -74,17 +89,6 @@ def register_exit_handlers(
|
|
|
74
89
|
# Reset to default handler
|
|
75
90
|
signal.signal(signalnum, default_handlers[signalnum]) # type: ignore
|
|
76
91
|
|
|
77
|
-
for handler in registered_exit_handlers:
|
|
78
|
-
handler()
|
|
79
|
-
|
|
80
|
-
if grpc_servers is not None:
|
|
81
|
-
for grpc_server in grpc_servers:
|
|
82
|
-
grpc_server.stop(grace=1)
|
|
83
|
-
|
|
84
|
-
if bckg_threads is not None:
|
|
85
|
-
for bckg_thread in bckg_threads:
|
|
86
|
-
bckg_thread.join()
|
|
87
|
-
|
|
88
92
|
# Setup things for graceful exit
|
|
89
93
|
flwr_exit(
|
|
90
94
|
code=SIGNAL_TO_EXIT_CODE[signalnum],
|
|
@@ -96,24 +100,3 @@ def register_exit_handlers(
|
|
|
96
100
|
for sig in SIGNAL_TO_EXIT_CODE:
|
|
97
101
|
default_handler = signal.signal(sig, graceful_exit_handler) # type: ignore
|
|
98
102
|
default_handlers[sig] = default_handler # type: ignore
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
def add_exit_handler(exit_handler: Callable[[], None]) -> None:
|
|
102
|
-
"""Add an exit handler to be called on graceful exit.
|
|
103
|
-
|
|
104
|
-
This function allows you to register additional exit handlers
|
|
105
|
-
that will be executed when the application exits gracefully,
|
|
106
|
-
if `register_exit_handlers` was called.
|
|
107
|
-
|
|
108
|
-
Parameters
|
|
109
|
-
----------
|
|
110
|
-
exit_handler : Callable[[], None]
|
|
111
|
-
A callable that takes no arguments and performs cleanup or
|
|
112
|
-
other actions before the application exits.
|
|
113
|
-
|
|
114
|
-
Notes
|
|
115
|
-
-----
|
|
116
|
-
This method is not thread-safe, and it allows you to add the
|
|
117
|
-
same exit handler multiple times.
|
|
118
|
-
"""
|
|
119
|
-
registered_exit_handlers.append(exit_handler)
|
flwr/common/grpc.py
CHANGED
|
@@ -23,9 +23,6 @@ from logging import DEBUG, ERROR
|
|
|
23
23
|
from typing import Any, Callable, Optional
|
|
24
24
|
|
|
25
25
|
import grpc
|
|
26
|
-
from grpc_health.v1.health_pb2_grpc import add_HealthServicer_to_server
|
|
27
|
-
|
|
28
|
-
from flwr.supercore.grpc_health import SimpleHealthServicer
|
|
29
26
|
|
|
30
27
|
from .address import is_port_in_use
|
|
31
28
|
from .logger import log
|
|
@@ -109,7 +106,6 @@ def generic_create_grpc_server( # pylint: disable=too-many-arguments, R0914, R0
|
|
|
109
106
|
keepalive_time_ms: int = 210000,
|
|
110
107
|
certificates: Optional[tuple[bytes, bytes, bytes]] = None,
|
|
111
108
|
interceptors: Optional[Sequence[grpc.ServerInterceptor]] = None,
|
|
112
|
-
health_servicer: Optional[Any] = None,
|
|
113
109
|
) -> grpc.Server:
|
|
114
110
|
"""Create a gRPC server with a single servicer.
|
|
115
111
|
|
|
@@ -157,10 +153,6 @@ def generic_create_grpc_server( # pylint: disable=too-many-arguments, R0914, R0
|
|
|
157
153
|
* server private key.
|
|
158
154
|
interceptors : Optional[Sequence[grpc.ServerInterceptor]] (default: None)
|
|
159
155
|
A list of gRPC interceptors.
|
|
160
|
-
health_servicer : Optional[Any] (default: None)
|
|
161
|
-
An optional health servicer to add to the server. If provided, it should be an
|
|
162
|
-
instance of a class that inherits the `HealthServicer` class.
|
|
163
|
-
If None is provided, `SimpleHealthServicer` will be used by default.
|
|
164
156
|
|
|
165
157
|
Returns
|
|
166
158
|
-------
|
|
@@ -211,9 +203,6 @@ def generic_create_grpc_server( # pylint: disable=too-many-arguments, R0914, R0
|
|
|
211
203
|
)
|
|
212
204
|
add_servicer_to_server_fn(servicer, server)
|
|
213
205
|
|
|
214
|
-
# Enable health service
|
|
215
|
-
add_HealthServicer_to_server(health_servicer or SimpleHealthServicer(), server)
|
|
216
|
-
|
|
217
206
|
if certificates is not None:
|
|
218
207
|
if not valid_certificates(certificates):
|
|
219
208
|
sys.exit(1)
|
flwr/common/inflatable_utils.py
CHANGED
flwr/common/logger.py
CHANGED
|
@@ -132,13 +132,13 @@ if log_level := os.getenv("FLWR_LOG_LEVEL"):
|
|
|
132
132
|
log_level = log_level.upper()
|
|
133
133
|
try:
|
|
134
134
|
is_debug = log_level == "DEBUG"
|
|
135
|
+
update_console_handler(level=log_level, timestamps=is_debug, colored=True)
|
|
135
136
|
if is_debug:
|
|
136
137
|
log(
|
|
137
138
|
WARN,
|
|
138
139
|
"DEBUG logs enabled. Do not use this in production, as it may expose "
|
|
139
140
|
"sensitive details.",
|
|
140
141
|
)
|
|
141
|
-
update_console_handler(level=log_level, timestamps=is_debug, colored=True)
|
|
142
142
|
except Exception: # pylint: disable=broad-exception-caught
|
|
143
143
|
# Alert user but don't raise exception
|
|
144
144
|
log(
|
flwr/common/retry_invoker.py
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import itertools
|
|
19
19
|
import random
|
|
20
|
+
import threading
|
|
20
21
|
import time
|
|
21
22
|
from collections.abc import Generator, Iterable
|
|
22
23
|
from dataclasses import dataclass
|
|
@@ -319,8 +320,12 @@ class RetryInvoker:
|
|
|
319
320
|
|
|
320
321
|
def _make_simple_grpc_retry_invoker() -> RetryInvoker:
|
|
321
322
|
"""Create a simple gRPC retry invoker."""
|
|
323
|
+
lock = threading.Lock()
|
|
324
|
+
system_healthy = threading.Event()
|
|
325
|
+
system_healthy.set() # Initially, the connection is healthy
|
|
322
326
|
|
|
323
|
-
def
|
|
327
|
+
def _on_success(retry_state: RetryState) -> None:
|
|
328
|
+
system_healthy.set()
|
|
324
329
|
if retry_state.tries > 1:
|
|
325
330
|
log(
|
|
326
331
|
INFO,
|
|
@@ -329,17 +334,11 @@ def _make_simple_grpc_retry_invoker() -> RetryInvoker:
|
|
|
329
334
|
retry_state.tries,
|
|
330
335
|
)
|
|
331
336
|
|
|
332
|
-
def _on_backoff(
|
|
333
|
-
|
|
334
|
-
log(WARN, "Connection attempt failed, retrying...")
|
|
335
|
-
else:
|
|
336
|
-
log(
|
|
337
|
-
WARN,
|
|
338
|
-
"Connection attempt failed, retrying in %.2f seconds",
|
|
339
|
-
retry_state.actual_wait,
|
|
340
|
-
)
|
|
337
|
+
def _on_backoff(_: RetryState) -> None:
|
|
338
|
+
system_healthy.clear()
|
|
341
339
|
|
|
342
340
|
def _on_giveup(retry_state: RetryState) -> None:
|
|
341
|
+
system_healthy.clear()
|
|
343
342
|
if retry_state.tries > 1:
|
|
344
343
|
log(
|
|
345
344
|
WARN,
|
|
@@ -355,15 +354,35 @@ def _make_simple_grpc_retry_invoker() -> RetryInvoker:
|
|
|
355
354
|
return False
|
|
356
355
|
return True
|
|
357
356
|
|
|
357
|
+
def _wait(wait_time: float) -> None:
|
|
358
|
+
# Use a lock to prevent multiple gRPC calls from retrying concurrently,
|
|
359
|
+
# which is unnecessary since they are all likely to fail.
|
|
360
|
+
with lock:
|
|
361
|
+
# Log the wait time
|
|
362
|
+
log(
|
|
363
|
+
WARN,
|
|
364
|
+
"Connection attempt failed, retrying in %.2f seconds",
|
|
365
|
+
wait_time,
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
start = time.monotonic()
|
|
369
|
+
# Avoid sequential waits if the system is healthy
|
|
370
|
+
system_healthy.wait(wait_time)
|
|
371
|
+
|
|
372
|
+
remaining_time = wait_time - (time.monotonic() - start)
|
|
373
|
+
if remaining_time > 0:
|
|
374
|
+
time.sleep(remaining_time)
|
|
375
|
+
|
|
358
376
|
return RetryInvoker(
|
|
359
377
|
wait_gen_factory=lambda: exponential(max_delay=MAX_RETRY_DELAY),
|
|
360
378
|
recoverable_exceptions=grpc.RpcError,
|
|
361
379
|
max_tries=None,
|
|
362
380
|
max_time=None,
|
|
363
|
-
on_success=
|
|
381
|
+
on_success=_on_success,
|
|
364
382
|
on_backoff=_on_backoff,
|
|
365
383
|
on_giveup=_on_giveup,
|
|
366
384
|
should_giveup=_should_giveup_fn,
|
|
385
|
+
wait_function=_wait,
|
|
367
386
|
)
|
|
368
387
|
|
|
369
388
|
|
flwr/common/telemetry.py
CHANGED
|
@@ -181,6 +181,10 @@ class EventType(str, Enum):
|
|
|
181
181
|
RUN_SUPERNODE_ENTER = auto()
|
|
182
182
|
RUN_SUPERNODE_LEAVE = auto()
|
|
183
183
|
|
|
184
|
+
# CLI: `flower-superexec`
|
|
185
|
+
RUN_SUPEREXEC_ENTER = auto()
|
|
186
|
+
RUN_SUPEREXEC_LEAVE = auto()
|
|
187
|
+
|
|
184
188
|
|
|
185
189
|
# Use the ThreadPoolExecutor with max_workers=1 to have a queue
|
|
186
190
|
# and also ensure that telemetry calls are not blocking.
|
flwr/compat/server/app.py
CHANGED
|
@@ -22,7 +22,7 @@ from typing import Optional
|
|
|
22
22
|
from flwr.common import GRPC_MAX_MESSAGE_LENGTH, EventType, event
|
|
23
23
|
from flwr.common.address import parse_address
|
|
24
24
|
from flwr.common.constant import FLEET_API_GRPC_BIDI_DEFAULT_ADDRESS
|
|
25
|
-
from flwr.common.
|
|
25
|
+
from flwr.common.exit import register_signal_handlers
|
|
26
26
|
from flwr.common.logger import log, warn_deprecated_feature
|
|
27
27
|
from flwr.server.client_manager import ClientManager
|
|
28
28
|
from flwr.server.history import History
|
|
@@ -154,7 +154,7 @@ def start_server( # pylint: disable=too-many-arguments,too-many-locals
|
|
|
154
154
|
)
|
|
155
155
|
|
|
156
156
|
# Graceful shutdown
|
|
157
|
-
|
|
157
|
+
register_signal_handlers(
|
|
158
158
|
event_type=EventType.START_SERVER_LEAVE,
|
|
159
159
|
exit_message="Flower server terminated gracefully.",
|
|
160
160
|
grpc_servers=[grpc_server],
|
flwr/proto/appio_pb2.py
CHANGED
|
@@ -17,27 +17,35 @@ from flwr.proto import fab_pb2 as flwr_dot_proto_dot_fab__pb2
|
|
|
17
17
|
from flwr.proto import run_pb2 as flwr_dot_proto_dot_run__pb2
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x66lwr/proto/appio.proto\x12\nflwr.proto\x1a\x18\x66lwr/proto/message.proto\x1a\x14\x66lwr/proto/fab.proto\x1a\x14\x66lwr/proto/run.proto\"\x99\x01\n\x16PushAppMessagesRequest\x12\r\n\x05token\x18\x01 \x01(\t\x12*\n\rmessages_list\x18\x02 \x03(\x0b\x32\x13.flwr.proto.Message\x12\x0e\n\x06run_id\x18\x03 \x01(\x04\x12\x34\n\x14message_object_trees\x18\x04 \x03(\x0b\x32\x16.flwr.proto.ObjectTree\"G\n\x17PushAppMessagesResponse\x12\x13\n\x0bmessage_ids\x18\x01 \x03(\t\x12\x17\n\x0fobjects_to_push\x18\x02 \x03(\t\"L\n\x16PullAppMessagesRequest\x12\r\n\x05token\x18\x01 \x01(\t\x12\x13\n\x0bmessage_ids\x18\x02 \x03(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\x04\"{\n\x17PullAppMessagesResponse\x12*\n\rmessages_list\x18\x01 \x03(\x0b\x32\x13.flwr.proto.Message\x12\x34\n\x14message_object_trees\x18\x02 \x03(\x0b\x32\x16.flwr.proto.ObjectTree\"%\n\x14PullAppInputsRequest\x12\r\n\x05token\x18\x01 \x01(\t\"y\n\x15PullAppInputsResponse\x12$\n\x07\x63ontext\x18\x01 \x01(\x0b\x32\x13.flwr.proto.Context\x12\x1c\n\x03run\x18\x02 \x01(\x0b\x32\x0f.flwr.proto.Run\x12\x1c\n\x03\x66\x61\x62\x18\x03 \x01(\x0b\x32\x0f.flwr.proto.Fab\"\\\n\x15PushAppOutputsRequest\x12\r\n\x05token\x18\x01 \x01(\t\x12\x0e\n\x06run_id\x18\x02 \x01(\x04\x12$\n\x07\x63ontext\x18\x03 \x01(\x0b\x32\x13.flwr.proto.Context\"\x18\n\x16PushAppOutputsResponseb\x06proto3')
|
|
20
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x66lwr/proto/appio.proto\x12\nflwr.proto\x1a\x18\x66lwr/proto/message.proto\x1a\x14\x66lwr/proto/fab.proto\x1a\x14\x66lwr/proto/run.proto\"\x19\n\x17ListAppsToLaunchRequest\"+\n\x18ListAppsToLaunchResponse\x12\x0f\n\x07run_ids\x18\x01 \x03(\x04\"%\n\x13RequestTokenRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\"%\n\x14RequestTokenResponse\x12\r\n\x05token\x18\x01 \x01(\t\"\x99\x01\n\x16PushAppMessagesRequest\x12\r\n\x05token\x18\x01 \x01(\t\x12*\n\rmessages_list\x18\x02 \x03(\x0b\x32\x13.flwr.proto.Message\x12\x0e\n\x06run_id\x18\x03 \x01(\x04\x12\x34\n\x14message_object_trees\x18\x04 \x03(\x0b\x32\x16.flwr.proto.ObjectTree\"G\n\x17PushAppMessagesResponse\x12\x13\n\x0bmessage_ids\x18\x01 \x03(\t\x12\x17\n\x0fobjects_to_push\x18\x02 \x03(\t\"L\n\x16PullAppMessagesRequest\x12\r\n\x05token\x18\x01 \x01(\t\x12\x13\n\x0bmessage_ids\x18\x02 \x03(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\x04\"{\n\x17PullAppMessagesResponse\x12*\n\rmessages_list\x18\x01 \x03(\x0b\x32\x13.flwr.proto.Message\x12\x34\n\x14message_object_trees\x18\x02 \x03(\x0b\x32\x16.flwr.proto.ObjectTree\"%\n\x14PullAppInputsRequest\x12\r\n\x05token\x18\x01 \x01(\t\"y\n\x15PullAppInputsResponse\x12$\n\x07\x63ontext\x18\x01 \x01(\x0b\x32\x13.flwr.proto.Context\x12\x1c\n\x03run\x18\x02 \x01(\x0b\x32\x0f.flwr.proto.Run\x12\x1c\n\x03\x66\x61\x62\x18\x03 \x01(\x0b\x32\x0f.flwr.proto.Fab\"\\\n\x15PushAppOutputsRequest\x12\r\n\x05token\x18\x01 \x01(\t\x12\x0e\n\x06run_id\x18\x02 \x01(\x04\x12$\n\x07\x63ontext\x18\x03 \x01(\x0b\x32\x13.flwr.proto.Context\"\x18\n\x16PushAppOutputsResponseb\x06proto3')
|
|
21
21
|
|
|
22
22
|
_globals = globals()
|
|
23
23
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
24
24
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.appio_pb2', _globals)
|
|
25
25
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
26
26
|
DESCRIPTOR._options = None
|
|
27
|
-
_globals['
|
|
28
|
-
_globals['
|
|
29
|
-
_globals['
|
|
30
|
-
_globals['
|
|
31
|
-
_globals['
|
|
32
|
-
_globals['
|
|
33
|
-
_globals['
|
|
34
|
-
_globals['
|
|
35
|
-
_globals['
|
|
36
|
-
_globals['
|
|
37
|
-
_globals['
|
|
38
|
-
_globals['
|
|
39
|
-
_globals['
|
|
40
|
-
_globals['
|
|
41
|
-
_globals['
|
|
42
|
-
_globals['
|
|
27
|
+
_globals['_LISTAPPSTOLAUNCHREQUEST']._serialized_start=108
|
|
28
|
+
_globals['_LISTAPPSTOLAUNCHREQUEST']._serialized_end=133
|
|
29
|
+
_globals['_LISTAPPSTOLAUNCHRESPONSE']._serialized_start=135
|
|
30
|
+
_globals['_LISTAPPSTOLAUNCHRESPONSE']._serialized_end=178
|
|
31
|
+
_globals['_REQUESTTOKENREQUEST']._serialized_start=180
|
|
32
|
+
_globals['_REQUESTTOKENREQUEST']._serialized_end=217
|
|
33
|
+
_globals['_REQUESTTOKENRESPONSE']._serialized_start=219
|
|
34
|
+
_globals['_REQUESTTOKENRESPONSE']._serialized_end=256
|
|
35
|
+
_globals['_PUSHAPPMESSAGESREQUEST']._serialized_start=259
|
|
36
|
+
_globals['_PUSHAPPMESSAGESREQUEST']._serialized_end=412
|
|
37
|
+
_globals['_PUSHAPPMESSAGESRESPONSE']._serialized_start=414
|
|
38
|
+
_globals['_PUSHAPPMESSAGESRESPONSE']._serialized_end=485
|
|
39
|
+
_globals['_PULLAPPMESSAGESREQUEST']._serialized_start=487
|
|
40
|
+
_globals['_PULLAPPMESSAGESREQUEST']._serialized_end=563
|
|
41
|
+
_globals['_PULLAPPMESSAGESRESPONSE']._serialized_start=565
|
|
42
|
+
_globals['_PULLAPPMESSAGESRESPONSE']._serialized_end=688
|
|
43
|
+
_globals['_PULLAPPINPUTSREQUEST']._serialized_start=690
|
|
44
|
+
_globals['_PULLAPPINPUTSREQUEST']._serialized_end=727
|
|
45
|
+
_globals['_PULLAPPINPUTSRESPONSE']._serialized_start=729
|
|
46
|
+
_globals['_PULLAPPINPUTSRESPONSE']._serialized_end=850
|
|
47
|
+
_globals['_PUSHAPPOUTPUTSREQUEST']._serialized_start=852
|
|
48
|
+
_globals['_PUSHAPPOUTPUTSREQUEST']._serialized_end=944
|
|
49
|
+
_globals['_PUSHAPPOUTPUTSRESPONSE']._serialized_start=946
|
|
50
|
+
_globals['_PUSHAPPOUTPUTSRESPONSE']._serialized_end=970
|
|
43
51
|
# @@protoc_insertion_point(module_scope)
|
flwr/proto/appio_pb2.pyi
CHANGED
|
@@ -14,12 +14,56 @@ import typing_extensions
|
|
|
14
14
|
|
|
15
15
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
|
16
16
|
|
|
17
|
-
class
|
|
17
|
+
class ListAppsToLaunchRequest(google.protobuf.message.Message):
|
|
18
18
|
"""These messages are used by both ServerAppIo and ClientAppIo services
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
ListAppsToLaunch messages
|
|
21
21
|
"""
|
|
22
22
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
23
|
+
def __init__(self,
|
|
24
|
+
) -> None: ...
|
|
25
|
+
global___ListAppsToLaunchRequest = ListAppsToLaunchRequest
|
|
26
|
+
|
|
27
|
+
class ListAppsToLaunchResponse(google.protobuf.message.Message):
|
|
28
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
29
|
+
RUN_IDS_FIELD_NUMBER: builtins.int
|
|
30
|
+
@property
|
|
31
|
+
def run_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
|
|
32
|
+
"""List of run IDs of the apps to launch"""
|
|
33
|
+
pass
|
|
34
|
+
def __init__(self,
|
|
35
|
+
*,
|
|
36
|
+
run_ids: typing.Optional[typing.Iterable[builtins.int]] = ...,
|
|
37
|
+
) -> None: ...
|
|
38
|
+
def ClearField(self, field_name: typing_extensions.Literal["run_ids",b"run_ids"]) -> None: ...
|
|
39
|
+
global___ListAppsToLaunchResponse = ListAppsToLaunchResponse
|
|
40
|
+
|
|
41
|
+
class RequestTokenRequest(google.protobuf.message.Message):
|
|
42
|
+
"""RequestToken messages"""
|
|
43
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
44
|
+
RUN_ID_FIELD_NUMBER: builtins.int
|
|
45
|
+
run_id: builtins.int
|
|
46
|
+
def __init__(self,
|
|
47
|
+
*,
|
|
48
|
+
run_id: builtins.int = ...,
|
|
49
|
+
) -> None: ...
|
|
50
|
+
def ClearField(self, field_name: typing_extensions.Literal["run_id",b"run_id"]) -> None: ...
|
|
51
|
+
global___RequestTokenRequest = RequestTokenRequest
|
|
52
|
+
|
|
53
|
+
class RequestTokenResponse(google.protobuf.message.Message):
|
|
54
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
55
|
+
TOKEN_FIELD_NUMBER: builtins.int
|
|
56
|
+
token: typing.Text
|
|
57
|
+
def __init__(self,
|
|
58
|
+
*,
|
|
59
|
+
token: typing.Text = ...,
|
|
60
|
+
) -> None: ...
|
|
61
|
+
def ClearField(self, field_name: typing_extensions.Literal["token",b"token"]) -> None: ...
|
|
62
|
+
global___RequestTokenResponse = RequestTokenResponse
|
|
63
|
+
|
|
64
|
+
class PushAppMessagesRequest(google.protobuf.message.Message):
|
|
65
|
+
"""PushAppMessages messages"""
|
|
66
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
23
67
|
TOKEN_FIELD_NUMBER: builtins.int
|
|
24
68
|
MESSAGES_LIST_FIELD_NUMBER: builtins.int
|
|
25
69
|
RUN_ID_FIELD_NUMBER: builtins.int
|
flwr/proto/clientappio_pb2.py
CHANGED
|
@@ -18,21 +18,13 @@ from flwr.proto import message_pb2 as flwr_dot_proto_dot_message__pb2
|
|
|
18
18
|
from flwr.proto import appio_pb2 as flwr_dot_proto_dot_appio__pb2
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x66lwr/proto/clientappio.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/fab.proto\x1a\x14\x66lwr/proto/run.proto\x1a\x18\x66lwr/proto/message.proto\x1a\x16\x66lwr/proto/appio.
|
|
21
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x66lwr/proto/clientappio.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/fab.proto\x1a\x14\x66lwr/proto/run.proto\x1a\x18\x66lwr/proto/message.proto\x1a\x16\x66lwr/proto/appio.proto2\x8a\x07\n\x0b\x43lientAppIo\x12_\n\x10ListAppsToLaunch\x12#.flwr.proto.ListAppsToLaunchRequest\x1a$.flwr.proto.ListAppsToLaunchResponse\"\x00\x12S\n\x0cRequestToken\x12\x1f.flwr.proto.RequestTokenRequest\x1a .flwr.proto.RequestTokenResponse\"\x00\x12\x41\n\x06GetRun\x12\x19.flwr.proto.GetRunRequest\x1a\x1a.flwr.proto.GetRunResponse\"\x00\x12\\\n\x13PullClientAppInputs\x12 .flwr.proto.PullAppInputsRequest\x1a!.flwr.proto.PullAppInputsResponse\"\x00\x12_\n\x14PushClientAppOutputs\x12!.flwr.proto.PushAppOutputsRequest\x1a\".flwr.proto.PushAppOutputsResponse\"\x00\x12X\n\x0bPushMessage\x12\".flwr.proto.PushAppMessagesRequest\x1a#.flwr.proto.PushAppMessagesResponse\"\x00\x12X\n\x0bPullMessage\x12\".flwr.proto.PullAppMessagesRequest\x1a#.flwr.proto.PullAppMessagesResponse\"\x00\x12M\n\nPushObject\x12\x1d.flwr.proto.PushObjectRequest\x1a\x1e.flwr.proto.PushObjectResponse\"\x00\x12M\n\nPullObject\x12\x1d.flwr.proto.PullObjectRequest\x1a\x1e.flwr.proto.PullObjectResponse\"\x00\x12q\n\x16\x43onfirmMessageReceived\x12).flwr.proto.ConfirmMessageReceivedRequest\x1a*.flwr.proto.ConfirmMessageReceivedResponse\"\x00\x62\x06proto3')
|
|
22
22
|
|
|
23
23
|
_globals = globals()
|
|
24
24
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
25
25
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.clientappio_pb2', _globals)
|
|
26
26
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
27
27
|
DESCRIPTOR._options = None
|
|
28
|
-
_globals['
|
|
29
|
-
_globals['
|
|
30
|
-
_globals['_GETRUNIDSWITHPENDINGMESSAGESRESPONSE']._serialized_start=177
|
|
31
|
-
_globals['_GETRUNIDSWITHPENDINGMESSAGESRESPONSE']._serialized_end=232
|
|
32
|
-
_globals['_REQUESTTOKENREQUEST']._serialized_start=234
|
|
33
|
-
_globals['_REQUESTTOKENREQUEST']._serialized_end=271
|
|
34
|
-
_globals['_REQUESTTOKENRESPONSE']._serialized_start=273
|
|
35
|
-
_globals['_REQUESTTOKENRESPONSE']._serialized_end=310
|
|
36
|
-
_globals['_CLIENTAPPIO']._serialized_start=313
|
|
37
|
-
_globals['_CLIENTAPPIO']._serialized_end=1256
|
|
28
|
+
_globals['_CLIENTAPPIO']._serialized_start=139
|
|
29
|
+
_globals['_CLIENTAPPIO']._serialized_end=1045
|
|
38
30
|
# @@protoc_insertion_point(module_scope)
|
flwr/proto/clientappio_pb2.pyi
CHANGED
|
@@ -2,53 +2,6 @@
|
|
|
2
2
|
@generated by mypy-protobuf. Do not edit manually!
|
|
3
3
|
isort:skip_file
|
|
4
4
|
"""
|
|
5
|
-
import builtins
|
|
6
5
|
import google.protobuf.descriptor
|
|
7
|
-
import google.protobuf.internal.containers
|
|
8
|
-
import google.protobuf.message
|
|
9
|
-
import typing
|
|
10
|
-
import typing_extensions
|
|
11
6
|
|
|
12
7
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
|
13
|
-
|
|
14
|
-
class GetRunIdsWithPendingMessagesRequest(google.protobuf.message.Message):
|
|
15
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
16
|
-
def __init__(self,
|
|
17
|
-
) -> None: ...
|
|
18
|
-
global___GetRunIdsWithPendingMessagesRequest = GetRunIdsWithPendingMessagesRequest
|
|
19
|
-
|
|
20
|
-
class GetRunIdsWithPendingMessagesResponse(google.protobuf.message.Message):
|
|
21
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
22
|
-
RUN_IDS_FIELD_NUMBER: builtins.int
|
|
23
|
-
@property
|
|
24
|
-
def run_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
|
|
25
|
-
"""List of run IDs"""
|
|
26
|
-
pass
|
|
27
|
-
def __init__(self,
|
|
28
|
-
*,
|
|
29
|
-
run_ids: typing.Optional[typing.Iterable[builtins.int]] = ...,
|
|
30
|
-
) -> None: ...
|
|
31
|
-
def ClearField(self, field_name: typing_extensions.Literal["run_ids",b"run_ids"]) -> None: ...
|
|
32
|
-
global___GetRunIdsWithPendingMessagesResponse = GetRunIdsWithPendingMessagesResponse
|
|
33
|
-
|
|
34
|
-
class RequestTokenRequest(google.protobuf.message.Message):
|
|
35
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
36
|
-
RUN_ID_FIELD_NUMBER: builtins.int
|
|
37
|
-
run_id: builtins.int
|
|
38
|
-
def __init__(self,
|
|
39
|
-
*,
|
|
40
|
-
run_id: builtins.int = ...,
|
|
41
|
-
) -> None: ...
|
|
42
|
-
def ClearField(self, field_name: typing_extensions.Literal["run_id",b"run_id"]) -> None: ...
|
|
43
|
-
global___RequestTokenRequest = RequestTokenRequest
|
|
44
|
-
|
|
45
|
-
class RequestTokenResponse(google.protobuf.message.Message):
|
|
46
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
47
|
-
TOKEN_FIELD_NUMBER: builtins.int
|
|
48
|
-
token: typing.Text
|
|
49
|
-
def __init__(self,
|
|
50
|
-
*,
|
|
51
|
-
token: typing.Text = ...,
|
|
52
|
-
) -> None: ...
|
|
53
|
-
def ClearField(self, field_name: typing_extensions.Literal["token",b"token"]) -> None: ...
|
|
54
|
-
global___RequestTokenResponse = RequestTokenResponse
|