flwr 1.22.0__py3-none-any.whl → 1.24.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 +16 -5
- flwr/app/error.py +2 -2
- flwr/app/exception.py +3 -3
- flwr/cli/app.py +34 -1
- flwr/cli/app_cmd/__init__.py +23 -0
- flwr/cli/app_cmd/publish.py +285 -0
- flwr/cli/app_cmd/review.py +252 -0
- flwr/cli/auth_plugin/__init__.py +15 -6
- flwr/cli/auth_plugin/auth_plugin.py +94 -0
- flwr/cli/auth_plugin/noop_auth_plugin.py +101 -0
- flwr/cli/auth_plugin/oidc_cli_plugin.py +46 -32
- flwr/cli/build.py +166 -53
- flwr/cli/{cli_user_auth_interceptor.py → cli_account_auth_interceptor.py} +29 -11
- flwr/cli/config_utils.py +101 -13
- flwr/cli/federation/__init__.py +24 -0
- flwr/cli/federation/ls.py +140 -0
- flwr/cli/federation/show.py +317 -0
- flwr/cli/install.py +91 -13
- flwr/cli/log.py +54 -11
- flwr/cli/login/login.py +41 -27
- flwr/cli/ls.py +177 -133
- flwr/cli/new/new.py +175 -40
- flwr/cli/new/templates/app/code/task.pytorch.py.tpl +1 -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 +3 -3
- flwr/cli/new/templates/app/pyproject.pytorch_legacy_api.toml.tpl +1 -1
- flwr/cli/new/templates/app/pyproject.sklearn.toml.tpl +1 -1
- flwr/cli/new/templates/app/pyproject.tensorflow.toml.tpl +2 -2
- flwr/cli/new/templates/app/pyproject.xgboost.toml.tpl +1 -1
- flwr/cli/pull.py +12 -7
- flwr/cli/run/run.py +82 -31
- flwr/cli/run_utils.py +130 -0
- flwr/cli/stop.py +27 -9
- flwr/cli/supernode/__init__.py +25 -0
- flwr/cli/supernode/ls.py +268 -0
- flwr/cli/supernode/register.py +190 -0
- flwr/cli/supernode/unregister.py +140 -0
- flwr/cli/utils.py +464 -81
- flwr/client/__init__.py +2 -1
- flwr/client/dpfedavg_numpy_client.py +4 -1
- flwr/client/grpc_adapter_client/connection.py +12 -15
- flwr/client/grpc_rere_client/connection.py +68 -41
- flwr/client/grpc_rere_client/grpc_adapter.py +34 -14
- flwr/client/grpc_rere_client/{client_interceptor.py → node_auth_client_interceptor.py} +5 -7
- flwr/client/message_handler/message_handler.py +2 -2
- flwr/client/mod/secure_aggregation/secaggplus_mod.py +10 -8
- flwr/client/numpy_client.py +1 -1
- flwr/client/rest_client/connection.py +94 -51
- flwr/client/run_info_store.py +4 -5
- flwr/client/typing.py +1 -1
- flwr/clientapp/__init__.py +1 -2
- flwr/{client → clientapp}/client_app.py +9 -10
- flwr/clientapp/mod/centraldp_mods.py +16 -17
- flwr/clientapp/mod/localdp_mod.py +8 -9
- flwr/clientapp/typing.py +1 -1
- flwr/{client/clientapp → clientapp}/utils.py +4 -4
- flwr/common/address.py +1 -2
- flwr/common/args.py +3 -4
- flwr/common/config.py +13 -16
- flwr/common/constant.py +56 -13
- flwr/common/differential_privacy.py +3 -4
- flwr/common/event_log_plugin/event_log_plugin.py +3 -4
- flwr/common/exit/exit.py +15 -2
- flwr/common/exit/exit_code.py +39 -10
- flwr/common/exit/exit_handler.py +6 -2
- flwr/common/exit/signal_handler.py +5 -5
- flwr/common/grpc.py +6 -6
- flwr/common/inflatable_protobuf_utils.py +1 -1
- flwr/common/inflatable_utils.py +48 -31
- flwr/common/logger.py +19 -19
- flwr/common/message.py +4 -4
- flwr/common/object_ref.py +7 -7
- flwr/common/record/array.py +6 -6
- flwr/common/record/arrayrecord.py +18 -21
- flwr/common/record/configrecord.py +3 -3
- flwr/common/record/recorddict.py +5 -5
- flwr/common/record/typeddict.py +9 -2
- flwr/common/recorddict_compat.py +7 -10
- flwr/common/retry_invoker.py +20 -20
- flwr/common/secure_aggregation/crypto/symmetric_encryption.py +1 -89
- flwr/common/secure_aggregation/ndarrays_arithmetic.py +3 -3
- flwr/common/serde.py +9 -6
- flwr/common/serde_utils.py +2 -2
- flwr/common/telemetry.py +9 -5
- flwr/common/typing.py +59 -43
- flwr/compat/client/app.py +39 -38
- flwr/compat/client/grpc_client/connection.py +13 -13
- flwr/compat/server/app.py +5 -6
- flwr/proto/appio_pb2.py +13 -3
- flwr/proto/appio_pb2.pyi +134 -65
- flwr/proto/appio_pb2_grpc.py +20 -0
- flwr/proto/appio_pb2_grpc.pyi +27 -0
- flwr/proto/clientappio_pb2.py +17 -7
- flwr/proto/clientappio_pb2.pyi +15 -0
- flwr/proto/clientappio_pb2_grpc.py +206 -40
- flwr/proto/clientappio_pb2_grpc.pyi +168 -53
- flwr/proto/control_pb2.py +72 -40
- flwr/proto/control_pb2.pyi +319 -87
- flwr/proto/control_pb2_grpc.py +339 -28
- flwr/proto/control_pb2_grpc.pyi +209 -37
- flwr/proto/error_pb2.py +13 -3
- flwr/proto/error_pb2.pyi +24 -6
- flwr/proto/error_pb2_grpc.py +20 -0
- flwr/proto/error_pb2_grpc.pyi +27 -0
- flwr/proto/fab_pb2.py +24 -10
- flwr/proto/fab_pb2.pyi +68 -20
- flwr/proto/fab_pb2_grpc.py +20 -0
- flwr/proto/fab_pb2_grpc.pyi +27 -0
- flwr/proto/federation_pb2.py +38 -0
- flwr/proto/federation_pb2.pyi +56 -0
- flwr/proto/federation_pb2_grpc.py +24 -0
- flwr/proto/federation_pb2_grpc.pyi +31 -0
- flwr/proto/fleet_pb2.py +45 -27
- flwr/proto/fleet_pb2.pyi +186 -70
- flwr/proto/fleet_pb2_grpc.py +277 -66
- flwr/proto/fleet_pb2_grpc.pyi +201 -55
- flwr/proto/grpcadapter_pb2.py +14 -4
- flwr/proto/grpcadapter_pb2.pyi +38 -16
- flwr/proto/grpcadapter_pb2_grpc.py +35 -4
- flwr/proto/grpcadapter_pb2_grpc.pyi +38 -7
- flwr/proto/heartbeat_pb2.py +17 -7
- flwr/proto/heartbeat_pb2.pyi +51 -22
- flwr/proto/heartbeat_pb2_grpc.py +20 -0
- flwr/proto/heartbeat_pb2_grpc.pyi +27 -0
- flwr/proto/log_pb2.py +13 -3
- flwr/proto/log_pb2.pyi +34 -11
- flwr/proto/log_pb2_grpc.py +20 -0
- flwr/proto/log_pb2_grpc.pyi +27 -0
- flwr/proto/message_pb2.py +15 -5
- flwr/proto/message_pb2.pyi +154 -86
- flwr/proto/message_pb2_grpc.py +20 -0
- flwr/proto/message_pb2_grpc.pyi +27 -0
- flwr/proto/node_pb2.py +16 -4
- flwr/proto/node_pb2.pyi +77 -4
- flwr/proto/node_pb2_grpc.py +20 -0
- flwr/proto/node_pb2_grpc.pyi +27 -0
- flwr/proto/recorddict_pb2.py +13 -3
- flwr/proto/recorddict_pb2.pyi +184 -107
- flwr/proto/recorddict_pb2_grpc.py +20 -0
- flwr/proto/recorddict_pb2_grpc.pyi +27 -0
- flwr/proto/run_pb2.py +40 -31
- flwr/proto/run_pb2.pyi +149 -84
- flwr/proto/run_pb2_grpc.py +20 -0
- flwr/proto/run_pb2_grpc.pyi +27 -0
- flwr/proto/serverappio_pb2.py +13 -3
- flwr/proto/serverappio_pb2.pyi +32 -8
- flwr/proto/serverappio_pb2_grpc.py +246 -65
- flwr/proto/serverappio_pb2_grpc.pyi +221 -85
- flwr/proto/simulationio_pb2.py +16 -8
- flwr/proto/simulationio_pb2.pyi +15 -0
- flwr/proto/simulationio_pb2_grpc.py +162 -41
- flwr/proto/simulationio_pb2_grpc.pyi +149 -55
- flwr/proto/transport_pb2.py +20 -10
- flwr/proto/transport_pb2.pyi +249 -160
- flwr/proto/transport_pb2_grpc.py +35 -4
- flwr/proto/transport_pb2_grpc.pyi +38 -8
- flwr/server/app.py +173 -127
- flwr/server/client_manager.py +4 -5
- flwr/server/client_proxy.py +10 -11
- flwr/server/compat/app.py +4 -5
- flwr/server/compat/app_utils.py +2 -1
- flwr/server/compat/grid_client_proxy.py +10 -12
- flwr/server/compat/legacy_context.py +3 -4
- flwr/server/fleet_event_log_interceptor.py +2 -1
- flwr/server/grid/grid.py +2 -3
- flwr/server/grid/grpc_grid.py +10 -8
- flwr/server/grid/inmemory_grid.py +4 -4
- flwr/server/run_serverapp.py +2 -3
- flwr/server/server.py +34 -39
- flwr/server/server_app.py +7 -8
- flwr/server/server_config.py +1 -2
- flwr/server/serverapp/app.py +34 -28
- flwr/server/serverapp_components.py +4 -5
- flwr/server/strategy/aggregate.py +9 -8
- flwr/server/strategy/bulyan.py +13 -11
- flwr/server/strategy/dp_adaptive_clipping.py +16 -20
- flwr/server/strategy/dp_fixed_clipping.py +12 -17
- flwr/server/strategy/dpfedavg_adaptive.py +3 -4
- flwr/server/strategy/dpfedavg_fixed.py +6 -10
- flwr/server/strategy/fault_tolerant_fedavg.py +14 -13
- flwr/server/strategy/fedadagrad.py +18 -14
- flwr/server/strategy/fedadam.py +16 -14
- flwr/server/strategy/fedavg.py +16 -17
- flwr/server/strategy/fedavg_android.py +15 -15
- flwr/server/strategy/fedavgm.py +21 -18
- flwr/server/strategy/fedmedian.py +2 -3
- flwr/server/strategy/fedopt.py +11 -10
- flwr/server/strategy/fedprox.py +10 -9
- flwr/server/strategy/fedtrimmedavg.py +12 -11
- flwr/server/strategy/fedxgb_bagging.py +13 -11
- flwr/server/strategy/fedxgb_cyclic.py +6 -6
- flwr/server/strategy/fedxgb_nn_avg.py +4 -4
- flwr/server/strategy/fedyogi.py +16 -14
- flwr/server/strategy/krum.py +12 -11
- flwr/server/strategy/qfedavg.py +16 -15
- flwr/server/strategy/strategy.py +6 -9
- flwr/server/superlink/fleet/grpc_adapter/grpc_adapter_servicer.py +19 -8
- flwr/server/superlink/fleet/grpc_bidi/flower_service_servicer.py +1 -2
- flwr/server/superlink/fleet/grpc_bidi/grpc_bridge.py +3 -4
- flwr/server/superlink/fleet/grpc_bidi/grpc_client_proxy.py +10 -12
- flwr/server/superlink/fleet/grpc_bidi/grpc_server.py +1 -3
- flwr/server/superlink/fleet/grpc_rere/fleet_servicer.py +136 -42
- flwr/server/superlink/fleet/grpc_rere/{server_interceptor.py → node_auth_server_interceptor.py} +28 -51
- flwr/server/superlink/fleet/message_handler/message_handler.py +100 -49
- flwr/server/superlink/fleet/rest_rere/rest_api.py +54 -33
- flwr/server/superlink/fleet/vce/backend/backend.py +2 -2
- flwr/server/superlink/fleet/vce/backend/raybackend.py +6 -6
- flwr/server/superlink/fleet/vce/vce_api.py +32 -13
- flwr/server/superlink/linkstate/in_memory_linkstate.py +266 -207
- flwr/server/superlink/linkstate/linkstate.py +161 -62
- flwr/server/superlink/linkstate/linkstate_factory.py +24 -6
- flwr/server/superlink/linkstate/sqlite_linkstate.py +698 -638
- flwr/server/superlink/linkstate/utils.py +9 -60
- flwr/server/superlink/serverappio/serverappio_grpc.py +1 -2
- flwr/server/superlink/serverappio/serverappio_servicer.py +28 -23
- flwr/server/superlink/simulation/simulationio_grpc.py +1 -2
- flwr/server/superlink/simulation/simulationio_servicer.py +19 -14
- flwr/server/superlink/utils.py +4 -6
- flwr/server/typing.py +1 -1
- flwr/server/utils/tensorboard.py +15 -8
- flwr/server/utils/validator.py +2 -3
- flwr/server/workflow/default_workflows.py +5 -5
- flwr/server/workflow/secure_aggregation/secagg_workflow.py +2 -4
- flwr/server/workflow/secure_aggregation/secaggplus_workflow.py +12 -10
- flwr/serverapp/strategy/bulyan.py +16 -15
- flwr/serverapp/strategy/dp_adaptive_clipping.py +12 -11
- flwr/serverapp/strategy/dp_fixed_clipping.py +11 -14
- flwr/serverapp/strategy/fedadagrad.py +10 -11
- flwr/serverapp/strategy/fedadam.py +10 -11
- flwr/serverapp/strategy/fedavg.py +9 -10
- flwr/serverapp/strategy/fedavgm.py +17 -16
- flwr/serverapp/strategy/fedmedian.py +2 -2
- flwr/serverapp/strategy/fedopt.py +10 -11
- flwr/serverapp/strategy/fedprox.py +7 -8
- flwr/serverapp/strategy/fedtrimmedavg.py +9 -9
- flwr/serverapp/strategy/fedxgb_bagging.py +3 -3
- flwr/serverapp/strategy/fedxgb_cyclic.py +9 -9
- flwr/serverapp/strategy/fedyogi.py +9 -11
- flwr/serverapp/strategy/krum.py +7 -7
- flwr/serverapp/strategy/multikrum.py +9 -9
- flwr/serverapp/strategy/qfedavg.py +17 -16
- flwr/serverapp/strategy/strategy.py +6 -9
- flwr/serverapp/strategy/strategy_utils.py +7 -8
- flwr/simulation/app.py +46 -42
- flwr/simulation/legacy_app.py +12 -12
- flwr/simulation/ray_transport/ray_actor.py +11 -12
- flwr/simulation/ray_transport/ray_client_proxy.py +12 -13
- flwr/simulation/run_simulation.py +44 -43
- flwr/simulation/simulationio_connection.py +4 -4
- flwr/supercore/cli/flower_superexec.py +3 -4
- flwr/supercore/constant.py +52 -0
- flwr/supercore/corestate/corestate.py +24 -3
- flwr/supercore/corestate/in_memory_corestate.py +138 -0
- flwr/supercore/corestate/sqlite_corestate.py +157 -0
- flwr/supercore/ffs/disk_ffs.py +1 -2
- flwr/supercore/ffs/ffs.py +1 -2
- flwr/supercore/ffs/ffs_factory.py +1 -2
- flwr/{common → supercore}/heartbeat.py +20 -25
- flwr/supercore/object_store/in_memory_object_store.py +1 -6
- flwr/supercore/object_store/object_store.py +1 -2
- flwr/supercore/object_store/object_store_factory.py +27 -8
- flwr/supercore/object_store/sqlite_object_store.py +253 -0
- flwr/{client/clientapp → supercore/primitives}/__init__.py +1 -1
- flwr/supercore/primitives/asymmetric.py +117 -0
- flwr/supercore/primitives/asymmetric_ed25519.py +175 -0
- flwr/supercore/sqlite_mixin.py +159 -0
- flwr/supercore/superexec/plugin/base_exec_plugin.py +1 -2
- flwr/supercore/superexec/plugin/exec_plugin.py +3 -3
- flwr/supercore/superexec/run_superexec.py +9 -13
- flwr/supercore/utils.py +20 -0
- flwr/superlink/artifact_provider/artifact_provider.py +1 -2
- flwr/{common → superlink}/auth_plugin/__init__.py +6 -6
- flwr/superlink/auth_plugin/auth_plugin.py +88 -0
- flwr/superlink/auth_plugin/noop_auth_plugin.py +84 -0
- flwr/superlink/federation/__init__.py +24 -0
- flwr/superlink/federation/federation_manager.py +64 -0
- flwr/superlink/federation/noop_federation_manager.py +71 -0
- flwr/superlink/servicer/control/{control_user_auth_interceptor.py → control_account_auth_interceptor.py} +41 -32
- flwr/superlink/servicer/control/control_event_log_interceptor.py +7 -7
- flwr/superlink/servicer/control/control_grpc.py +18 -17
- flwr/superlink/servicer/control/control_license_interceptor.py +3 -3
- flwr/superlink/servicer/control/control_servicer.py +239 -63
- flwr/supernode/cli/flower_supernode.py +74 -26
- flwr/supernode/nodestate/in_memory_nodestate.py +60 -49
- flwr/supernode/nodestate/nodestate.py +7 -8
- flwr/supernode/nodestate/nodestate_factory.py +7 -4
- flwr/supernode/runtime/run_clientapp.py +43 -24
- flwr/supernode/servicer/clientappio/clientappio_servicer.py +40 -10
- flwr/supernode/start_client_internal.py +175 -51
- {flwr-1.22.0.dist-info → flwr-1.24.0.dist-info}/METADATA +8 -8
- flwr-1.24.0.dist-info/RECORD +454 -0
- flwr/common/auth_plugin/auth_plugin.py +0 -149
- flwr/supercore/object_store/utils.py +0 -43
- flwr-1.22.0.dist-info/RECORD +0 -428
- {flwr-1.22.0.dist-info → flwr-1.24.0.dist-info}/WHEEL +0 -0
- {flwr-1.22.0.dist-info → flwr-1.24.0.dist-info}/entry_points.txt +0 -0
flwr/proto/fleet_pb2_grpc.pyi
CHANGED
|
@@ -1,32 +1,75 @@
|
|
|
1
1
|
"""
|
|
2
2
|
@generated by mypy-protobuf. Do not edit manually!
|
|
3
3
|
isort:skip_file
|
|
4
|
+
Copyright 2022 Flower Labs GmbH. All Rights Reserved.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License.
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
See the License for the specific language governing permissions and
|
|
16
|
+
limitations under the License.
|
|
17
|
+
==============================================================================
|
|
4
18
|
"""
|
|
19
|
+
|
|
5
20
|
import abc
|
|
21
|
+
import collections.abc
|
|
6
22
|
import flwr.proto.fab_pb2
|
|
7
23
|
import flwr.proto.fleet_pb2
|
|
8
24
|
import flwr.proto.heartbeat_pb2
|
|
9
25
|
import flwr.proto.message_pb2
|
|
10
26
|
import flwr.proto.run_pb2
|
|
11
27
|
import grpc
|
|
28
|
+
import grpc.aio
|
|
29
|
+
import typing
|
|
30
|
+
|
|
31
|
+
_T = typing.TypeVar("_T")
|
|
32
|
+
|
|
33
|
+
class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...
|
|
34
|
+
|
|
35
|
+
class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
|
|
36
|
+
...
|
|
12
37
|
|
|
13
38
|
class FleetStub:
|
|
14
|
-
def __init__(self, channel: grpc.Channel) -> None: ...
|
|
15
|
-
|
|
16
|
-
flwr.proto.fleet_pb2.
|
|
17
|
-
flwr.proto.fleet_pb2.
|
|
39
|
+
def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
|
|
40
|
+
RegisterNode: grpc.UnaryUnaryMultiCallable[
|
|
41
|
+
flwr.proto.fleet_pb2.RegisterNodeFleetRequest,
|
|
42
|
+
flwr.proto.fleet_pb2.RegisterNodeFleetResponse,
|
|
43
|
+
]
|
|
44
|
+
"""Register Node"""
|
|
45
|
+
|
|
46
|
+
ActivateNode: grpc.UnaryUnaryMultiCallable[
|
|
47
|
+
flwr.proto.fleet_pb2.ActivateNodeRequest,
|
|
48
|
+
flwr.proto.fleet_pb2.ActivateNodeResponse,
|
|
49
|
+
]
|
|
50
|
+
"""Activate Node"""
|
|
51
|
+
|
|
52
|
+
DeactivateNode: grpc.UnaryUnaryMultiCallable[
|
|
53
|
+
flwr.proto.fleet_pb2.DeactivateNodeRequest,
|
|
54
|
+
flwr.proto.fleet_pb2.DeactivateNodeResponse,
|
|
55
|
+
]
|
|
56
|
+
"""Deactivate Node"""
|
|
18
57
|
|
|
19
|
-
|
|
20
|
-
flwr.proto.fleet_pb2.
|
|
21
|
-
flwr.proto.fleet_pb2.
|
|
58
|
+
UnregisterNode: grpc.UnaryUnaryMultiCallable[
|
|
59
|
+
flwr.proto.fleet_pb2.UnregisterNodeFleetRequest,
|
|
60
|
+
flwr.proto.fleet_pb2.UnregisterNodeFleetResponse,
|
|
61
|
+
]
|
|
62
|
+
"""Unregister Node"""
|
|
22
63
|
|
|
23
64
|
SendNodeHeartbeat: grpc.UnaryUnaryMultiCallable[
|
|
24
65
|
flwr.proto.heartbeat_pb2.SendNodeHeartbeatRequest,
|
|
25
|
-
flwr.proto.heartbeat_pb2.SendNodeHeartbeatResponse
|
|
66
|
+
flwr.proto.heartbeat_pb2.SendNodeHeartbeatResponse,
|
|
67
|
+
]
|
|
26
68
|
|
|
27
69
|
PullMessages: grpc.UnaryUnaryMultiCallable[
|
|
28
70
|
flwr.proto.fleet_pb2.PullMessagesRequest,
|
|
29
|
-
flwr.proto.fleet_pb2.PullMessagesResponse
|
|
71
|
+
flwr.proto.fleet_pb2.PullMessagesResponse,
|
|
72
|
+
]
|
|
30
73
|
"""Retrieve one or more messages, if possible
|
|
31
74
|
|
|
32
75
|
HTTP API path: /api/v1/fleet/pull-messages
|
|
@@ -34,7 +77,8 @@ class FleetStub:
|
|
|
34
77
|
|
|
35
78
|
PushMessages: grpc.UnaryUnaryMultiCallable[
|
|
36
79
|
flwr.proto.fleet_pb2.PushMessagesRequest,
|
|
37
|
-
flwr.proto.fleet_pb2.PushMessagesResponse
|
|
80
|
+
flwr.proto.fleet_pb2.PushMessagesResponse,
|
|
81
|
+
]
|
|
38
82
|
"""Complete one or more messages, if possible
|
|
39
83
|
|
|
40
84
|
HTTP API path: /api/v1/fleet/push-messages
|
|
@@ -42,107 +86,209 @@ class FleetStub:
|
|
|
42
86
|
|
|
43
87
|
GetRun: grpc.UnaryUnaryMultiCallable[
|
|
44
88
|
flwr.proto.run_pb2.GetRunRequest,
|
|
45
|
-
flwr.proto.run_pb2.GetRunResponse
|
|
89
|
+
flwr.proto.run_pb2.GetRunResponse,
|
|
90
|
+
]
|
|
46
91
|
|
|
47
92
|
GetFab: grpc.UnaryUnaryMultiCallable[
|
|
48
93
|
flwr.proto.fab_pb2.GetFabRequest,
|
|
49
|
-
flwr.proto.fab_pb2.GetFabResponse
|
|
94
|
+
flwr.proto.fab_pb2.GetFabResponse,
|
|
95
|
+
]
|
|
50
96
|
"""Get FAB"""
|
|
51
97
|
|
|
52
98
|
PushObject: grpc.UnaryUnaryMultiCallable[
|
|
53
99
|
flwr.proto.message_pb2.PushObjectRequest,
|
|
54
|
-
flwr.proto.message_pb2.PushObjectResponse
|
|
100
|
+
flwr.proto.message_pb2.PushObjectResponse,
|
|
101
|
+
]
|
|
55
102
|
"""Push Object"""
|
|
56
103
|
|
|
57
104
|
PullObject: grpc.UnaryUnaryMultiCallable[
|
|
58
105
|
flwr.proto.message_pb2.PullObjectRequest,
|
|
59
|
-
flwr.proto.message_pb2.PullObjectResponse
|
|
106
|
+
flwr.proto.message_pb2.PullObjectResponse,
|
|
107
|
+
]
|
|
60
108
|
"""Pull Object"""
|
|
61
109
|
|
|
62
110
|
ConfirmMessageReceived: grpc.UnaryUnaryMultiCallable[
|
|
63
111
|
flwr.proto.message_pb2.ConfirmMessageReceivedRequest,
|
|
64
|
-
flwr.proto.message_pb2.ConfirmMessageReceivedResponse
|
|
112
|
+
flwr.proto.message_pb2.ConfirmMessageReceivedResponse,
|
|
113
|
+
]
|
|
65
114
|
"""Confirm Message Received"""
|
|
66
115
|
|
|
116
|
+
class FleetAsyncStub:
|
|
117
|
+
RegisterNode: grpc.aio.UnaryUnaryMultiCallable[
|
|
118
|
+
flwr.proto.fleet_pb2.RegisterNodeFleetRequest,
|
|
119
|
+
flwr.proto.fleet_pb2.RegisterNodeFleetResponse,
|
|
120
|
+
]
|
|
121
|
+
"""Register Node"""
|
|
122
|
+
|
|
123
|
+
ActivateNode: grpc.aio.UnaryUnaryMultiCallable[
|
|
124
|
+
flwr.proto.fleet_pb2.ActivateNodeRequest,
|
|
125
|
+
flwr.proto.fleet_pb2.ActivateNodeResponse,
|
|
126
|
+
]
|
|
127
|
+
"""Activate Node"""
|
|
128
|
+
|
|
129
|
+
DeactivateNode: grpc.aio.UnaryUnaryMultiCallable[
|
|
130
|
+
flwr.proto.fleet_pb2.DeactivateNodeRequest,
|
|
131
|
+
flwr.proto.fleet_pb2.DeactivateNodeResponse,
|
|
132
|
+
]
|
|
133
|
+
"""Deactivate Node"""
|
|
134
|
+
|
|
135
|
+
UnregisterNode: grpc.aio.UnaryUnaryMultiCallable[
|
|
136
|
+
flwr.proto.fleet_pb2.UnregisterNodeFleetRequest,
|
|
137
|
+
flwr.proto.fleet_pb2.UnregisterNodeFleetResponse,
|
|
138
|
+
]
|
|
139
|
+
"""Unregister Node"""
|
|
140
|
+
|
|
141
|
+
SendNodeHeartbeat: grpc.aio.UnaryUnaryMultiCallable[
|
|
142
|
+
flwr.proto.heartbeat_pb2.SendNodeHeartbeatRequest,
|
|
143
|
+
flwr.proto.heartbeat_pb2.SendNodeHeartbeatResponse,
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
PullMessages: grpc.aio.UnaryUnaryMultiCallable[
|
|
147
|
+
flwr.proto.fleet_pb2.PullMessagesRequest,
|
|
148
|
+
flwr.proto.fleet_pb2.PullMessagesResponse,
|
|
149
|
+
]
|
|
150
|
+
"""Retrieve one or more messages, if possible
|
|
151
|
+
|
|
152
|
+
HTTP API path: /api/v1/fleet/pull-messages
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
PushMessages: grpc.aio.UnaryUnaryMultiCallable[
|
|
156
|
+
flwr.proto.fleet_pb2.PushMessagesRequest,
|
|
157
|
+
flwr.proto.fleet_pb2.PushMessagesResponse,
|
|
158
|
+
]
|
|
159
|
+
"""Complete one or more messages, if possible
|
|
160
|
+
|
|
161
|
+
HTTP API path: /api/v1/fleet/push-messages
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
GetRun: grpc.aio.UnaryUnaryMultiCallable[
|
|
165
|
+
flwr.proto.run_pb2.GetRunRequest,
|
|
166
|
+
flwr.proto.run_pb2.GetRunResponse,
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
GetFab: grpc.aio.UnaryUnaryMultiCallable[
|
|
170
|
+
flwr.proto.fab_pb2.GetFabRequest,
|
|
171
|
+
flwr.proto.fab_pb2.GetFabResponse,
|
|
172
|
+
]
|
|
173
|
+
"""Get FAB"""
|
|
174
|
+
|
|
175
|
+
PushObject: grpc.aio.UnaryUnaryMultiCallable[
|
|
176
|
+
flwr.proto.message_pb2.PushObjectRequest,
|
|
177
|
+
flwr.proto.message_pb2.PushObjectResponse,
|
|
178
|
+
]
|
|
179
|
+
"""Push Object"""
|
|
180
|
+
|
|
181
|
+
PullObject: grpc.aio.UnaryUnaryMultiCallable[
|
|
182
|
+
flwr.proto.message_pb2.PullObjectRequest,
|
|
183
|
+
flwr.proto.message_pb2.PullObjectResponse,
|
|
184
|
+
]
|
|
185
|
+
"""Pull Object"""
|
|
186
|
+
|
|
187
|
+
ConfirmMessageReceived: grpc.aio.UnaryUnaryMultiCallable[
|
|
188
|
+
flwr.proto.message_pb2.ConfirmMessageReceivedRequest,
|
|
189
|
+
flwr.proto.message_pb2.ConfirmMessageReceivedResponse,
|
|
190
|
+
]
|
|
191
|
+
"""Confirm Message Received"""
|
|
67
192
|
|
|
68
193
|
class FleetServicer(metaclass=abc.ABCMeta):
|
|
69
194
|
@abc.abstractmethod
|
|
70
|
-
def
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
195
|
+
def RegisterNode(
|
|
196
|
+
self,
|
|
197
|
+
request: flwr.proto.fleet_pb2.RegisterNodeFleetRequest,
|
|
198
|
+
context: _ServicerContext,
|
|
199
|
+
) -> typing.Union[flwr.proto.fleet_pb2.RegisterNodeFleetResponse, collections.abc.Awaitable[flwr.proto.fleet_pb2.RegisterNodeFleetResponse]]:
|
|
200
|
+
"""Register Node"""
|
|
74
201
|
|
|
75
202
|
@abc.abstractmethod
|
|
76
|
-
def
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
203
|
+
def ActivateNode(
|
|
204
|
+
self,
|
|
205
|
+
request: flwr.proto.fleet_pb2.ActivateNodeRequest,
|
|
206
|
+
context: _ServicerContext,
|
|
207
|
+
) -> typing.Union[flwr.proto.fleet_pb2.ActivateNodeResponse, collections.abc.Awaitable[flwr.proto.fleet_pb2.ActivateNodeResponse]]:
|
|
208
|
+
"""Activate Node"""
|
|
80
209
|
|
|
81
210
|
@abc.abstractmethod
|
|
82
|
-
def
|
|
211
|
+
def DeactivateNode(
|
|
212
|
+
self,
|
|
213
|
+
request: flwr.proto.fleet_pb2.DeactivateNodeRequest,
|
|
214
|
+
context: _ServicerContext,
|
|
215
|
+
) -> typing.Union[flwr.proto.fleet_pb2.DeactivateNodeResponse, collections.abc.Awaitable[flwr.proto.fleet_pb2.DeactivateNodeResponse]]:
|
|
216
|
+
"""Deactivate Node"""
|
|
217
|
+
|
|
218
|
+
@abc.abstractmethod
|
|
219
|
+
def UnregisterNode(
|
|
220
|
+
self,
|
|
221
|
+
request: flwr.proto.fleet_pb2.UnregisterNodeFleetRequest,
|
|
222
|
+
context: _ServicerContext,
|
|
223
|
+
) -> typing.Union[flwr.proto.fleet_pb2.UnregisterNodeFleetResponse, collections.abc.Awaitable[flwr.proto.fleet_pb2.UnregisterNodeFleetResponse]]:
|
|
224
|
+
"""Unregister Node"""
|
|
225
|
+
|
|
226
|
+
@abc.abstractmethod
|
|
227
|
+
def SendNodeHeartbeat(
|
|
228
|
+
self,
|
|
83
229
|
request: flwr.proto.heartbeat_pb2.SendNodeHeartbeatRequest,
|
|
84
|
-
context:
|
|
85
|
-
) -> flwr.proto.heartbeat_pb2.SendNodeHeartbeatResponse: ...
|
|
230
|
+
context: _ServicerContext,
|
|
231
|
+
) -> typing.Union[flwr.proto.heartbeat_pb2.SendNodeHeartbeatResponse, collections.abc.Awaitable[flwr.proto.heartbeat_pb2.SendNodeHeartbeatResponse]]: ...
|
|
86
232
|
|
|
87
233
|
@abc.abstractmethod
|
|
88
|
-
def PullMessages(
|
|
234
|
+
def PullMessages(
|
|
235
|
+
self,
|
|
89
236
|
request: flwr.proto.fleet_pb2.PullMessagesRequest,
|
|
90
|
-
context:
|
|
91
|
-
) -> flwr.proto.fleet_pb2.PullMessagesResponse:
|
|
237
|
+
context: _ServicerContext,
|
|
238
|
+
) -> typing.Union[flwr.proto.fleet_pb2.PullMessagesResponse, collections.abc.Awaitable[flwr.proto.fleet_pb2.PullMessagesResponse]]:
|
|
92
239
|
"""Retrieve one or more messages, if possible
|
|
93
240
|
|
|
94
241
|
HTTP API path: /api/v1/fleet/pull-messages
|
|
95
242
|
"""
|
|
96
|
-
pass
|
|
97
243
|
|
|
98
244
|
@abc.abstractmethod
|
|
99
|
-
def PushMessages(
|
|
245
|
+
def PushMessages(
|
|
246
|
+
self,
|
|
100
247
|
request: flwr.proto.fleet_pb2.PushMessagesRequest,
|
|
101
|
-
context:
|
|
102
|
-
) -> flwr.proto.fleet_pb2.PushMessagesResponse:
|
|
248
|
+
context: _ServicerContext,
|
|
249
|
+
) -> typing.Union[flwr.proto.fleet_pb2.PushMessagesResponse, collections.abc.Awaitable[flwr.proto.fleet_pb2.PushMessagesResponse]]:
|
|
103
250
|
"""Complete one or more messages, if possible
|
|
104
251
|
|
|
105
252
|
HTTP API path: /api/v1/fleet/push-messages
|
|
106
253
|
"""
|
|
107
|
-
pass
|
|
108
254
|
|
|
109
255
|
@abc.abstractmethod
|
|
110
|
-
def GetRun(
|
|
256
|
+
def GetRun(
|
|
257
|
+
self,
|
|
111
258
|
request: flwr.proto.run_pb2.GetRunRequest,
|
|
112
|
-
context:
|
|
113
|
-
) -> flwr.proto.run_pb2.GetRunResponse: ...
|
|
259
|
+
context: _ServicerContext,
|
|
260
|
+
) -> typing.Union[flwr.proto.run_pb2.GetRunResponse, collections.abc.Awaitable[flwr.proto.run_pb2.GetRunResponse]]: ...
|
|
114
261
|
|
|
115
262
|
@abc.abstractmethod
|
|
116
|
-
def GetFab(
|
|
263
|
+
def GetFab(
|
|
264
|
+
self,
|
|
117
265
|
request: flwr.proto.fab_pb2.GetFabRequest,
|
|
118
|
-
context:
|
|
119
|
-
) -> flwr.proto.fab_pb2.GetFabResponse:
|
|
266
|
+
context: _ServicerContext,
|
|
267
|
+
) -> typing.Union[flwr.proto.fab_pb2.GetFabResponse, collections.abc.Awaitable[flwr.proto.fab_pb2.GetFabResponse]]:
|
|
120
268
|
"""Get FAB"""
|
|
121
|
-
pass
|
|
122
269
|
|
|
123
270
|
@abc.abstractmethod
|
|
124
|
-
def PushObject(
|
|
271
|
+
def PushObject(
|
|
272
|
+
self,
|
|
125
273
|
request: flwr.proto.message_pb2.PushObjectRequest,
|
|
126
|
-
context:
|
|
127
|
-
) -> flwr.proto.message_pb2.PushObjectResponse:
|
|
274
|
+
context: _ServicerContext,
|
|
275
|
+
) -> typing.Union[flwr.proto.message_pb2.PushObjectResponse, collections.abc.Awaitable[flwr.proto.message_pb2.PushObjectResponse]]:
|
|
128
276
|
"""Push Object"""
|
|
129
|
-
pass
|
|
130
277
|
|
|
131
278
|
@abc.abstractmethod
|
|
132
|
-
def PullObject(
|
|
279
|
+
def PullObject(
|
|
280
|
+
self,
|
|
133
281
|
request: flwr.proto.message_pb2.PullObjectRequest,
|
|
134
|
-
context:
|
|
135
|
-
) -> flwr.proto.message_pb2.PullObjectResponse:
|
|
282
|
+
context: _ServicerContext,
|
|
283
|
+
) -> typing.Union[flwr.proto.message_pb2.PullObjectResponse, collections.abc.Awaitable[flwr.proto.message_pb2.PullObjectResponse]]:
|
|
136
284
|
"""Pull Object"""
|
|
137
|
-
pass
|
|
138
285
|
|
|
139
286
|
@abc.abstractmethod
|
|
140
|
-
def ConfirmMessageReceived(
|
|
287
|
+
def ConfirmMessageReceived(
|
|
288
|
+
self,
|
|
141
289
|
request: flwr.proto.message_pb2.ConfirmMessageReceivedRequest,
|
|
142
|
-
context:
|
|
143
|
-
) -> flwr.proto.message_pb2.ConfirmMessageReceivedResponse:
|
|
290
|
+
context: _ServicerContext,
|
|
291
|
+
) -> typing.Union[flwr.proto.message_pb2.ConfirmMessageReceivedResponse, collections.abc.Awaitable[flwr.proto.message_pb2.ConfirmMessageReceivedResponse]]:
|
|
144
292
|
"""Confirm Message Received"""
|
|
145
|
-
pass
|
|
146
|
-
|
|
147
293
|
|
|
148
|
-
def add_FleetServicer_to_server(servicer: FleetServicer, server: grpc.Server) -> None: ...
|
|
294
|
+
def add_FleetServicer_to_server(servicer: FleetServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
|
flwr/proto/grpcadapter_pb2.py
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
3
4
|
# source: flwr/proto/grpcadapter.proto
|
|
4
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 5.29.0
|
|
5
6
|
"""Generated protocol buffer code."""
|
|
6
7
|
from google.protobuf import descriptor as _descriptor
|
|
7
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
8
10
|
from google.protobuf import symbol_database as _symbol_database
|
|
9
11
|
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
5,
|
|
15
|
+
29,
|
|
16
|
+
0,
|
|
17
|
+
'',
|
|
18
|
+
'flwr/proto/grpcadapter.proto'
|
|
19
|
+
)
|
|
10
20
|
# @@protoc_insertion_point(imports)
|
|
11
21
|
|
|
12
22
|
_sym_db = _symbol_database.Default()
|
|
@@ -19,9 +29,9 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x66lwr/proto/
|
|
|
19
29
|
_globals = globals()
|
|
20
30
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
31
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.grpcadapter_pb2', _globals)
|
|
22
|
-
if _descriptor._USE_C_DESCRIPTORS
|
|
23
|
-
DESCRIPTOR.
|
|
24
|
-
_globals['_MESSAGECONTAINER_METADATAENTRY'].
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
DESCRIPTOR._loaded_options = None
|
|
34
|
+
_globals['_MESSAGECONTAINER_METADATAENTRY']._loaded_options = None
|
|
25
35
|
_globals['_MESSAGECONTAINER_METADATAENTRY']._serialized_options = b'8\001'
|
|
26
36
|
_globals['_MESSAGECONTAINER']._serialized_start=45
|
|
27
37
|
_globals['_MESSAGECONTAINER']._serialized_end=231
|
flwr/proto/grpcadapter_pb2.pyi
CHANGED
|
@@ -1,43 +1,65 @@
|
|
|
1
1
|
"""
|
|
2
2
|
@generated by mypy-protobuf. Do not edit manually!
|
|
3
3
|
isort:skip_file
|
|
4
|
+
Copyright 2024 Flower Labs GmbH. All Rights Reserved.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License.
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
See the License for the specific language governing permissions and
|
|
16
|
+
limitations under the License.
|
|
17
|
+
==============================================================================
|
|
4
18
|
"""
|
|
19
|
+
|
|
5
20
|
import builtins
|
|
21
|
+
import collections.abc
|
|
6
22
|
import google.protobuf.descriptor
|
|
7
23
|
import google.protobuf.internal.containers
|
|
8
24
|
import google.protobuf.message
|
|
9
25
|
import typing
|
|
10
|
-
import typing_extensions
|
|
11
26
|
|
|
12
27
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
|
13
28
|
|
|
29
|
+
@typing.final
|
|
14
30
|
class MessageContainer(google.protobuf.message.Message):
|
|
15
31
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
32
|
+
|
|
33
|
+
@typing.final
|
|
16
34
|
class MetadataEntry(google.protobuf.message.Message):
|
|
17
35
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
36
|
+
|
|
18
37
|
KEY_FIELD_NUMBER: builtins.int
|
|
19
38
|
VALUE_FIELD_NUMBER: builtins.int
|
|
20
|
-
key:
|
|
21
|
-
value:
|
|
22
|
-
def __init__(
|
|
39
|
+
key: builtins.str
|
|
40
|
+
value: builtins.str
|
|
41
|
+
def __init__(
|
|
42
|
+
self,
|
|
23
43
|
*,
|
|
24
|
-
key:
|
|
25
|
-
value:
|
|
26
|
-
|
|
27
|
-
def ClearField(self, field_name:
|
|
44
|
+
key: builtins.str = ...,
|
|
45
|
+
value: builtins.str = ...,
|
|
46
|
+
) -> None: ...
|
|
47
|
+
def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ...
|
|
28
48
|
|
|
29
49
|
METADATA_FIELD_NUMBER: builtins.int
|
|
30
50
|
GRPC_MESSAGE_NAME_FIELD_NUMBER: builtins.int
|
|
31
51
|
GRPC_MESSAGE_CONTENT_FIELD_NUMBER: builtins.int
|
|
32
|
-
|
|
33
|
-
def metadata(self) -> google.protobuf.internal.containers.ScalarMap[typing.Text, typing.Text]: ...
|
|
34
|
-
grpc_message_name: typing.Text
|
|
52
|
+
grpc_message_name: builtins.str
|
|
35
53
|
grpc_message_content: builtins.bytes
|
|
36
|
-
|
|
54
|
+
@property
|
|
55
|
+
def metadata(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]: ...
|
|
56
|
+
def __init__(
|
|
57
|
+
self,
|
|
37
58
|
*,
|
|
38
|
-
metadata:
|
|
39
|
-
grpc_message_name:
|
|
59
|
+
metadata: collections.abc.Mapping[builtins.str, builtins.str] | None = ...,
|
|
60
|
+
grpc_message_name: builtins.str = ...,
|
|
40
61
|
grpc_message_content: builtins.bytes = ...,
|
|
41
|
-
|
|
42
|
-
def ClearField(self, field_name:
|
|
62
|
+
) -> None: ...
|
|
63
|
+
def ClearField(self, field_name: typing.Literal["grpc_message_content", b"grpc_message_content", "grpc_message_name", b"grpc_message_name", "metadata", b"metadata"]) -> None: ...
|
|
64
|
+
|
|
43
65
|
global___MessageContainer = MessageContainer
|
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
2
|
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
3
|
import grpc
|
|
4
|
+
import warnings
|
|
4
5
|
|
|
5
6
|
from flwr.proto import grpcadapter_pb2 as flwr_dot_proto_dot_grpcadapter__pb2
|
|
6
7
|
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.70.0'
|
|
9
|
+
GRPC_VERSION = grpc.__version__
|
|
10
|
+
_version_not_supported = False
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from grpc._utilities import first_version_is_lower
|
|
14
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
15
|
+
except ImportError:
|
|
16
|
+
_version_not_supported = True
|
|
17
|
+
|
|
18
|
+
if _version_not_supported:
|
|
19
|
+
raise RuntimeError(
|
|
20
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
21
|
+
+ f' but the generated code in flwr/proto/grpcadapter_pb2_grpc.py depends on'
|
|
22
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
23
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
24
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
25
|
+
)
|
|
26
|
+
|
|
7
27
|
|
|
8
28
|
class GrpcAdapterStub(object):
|
|
9
29
|
"""Missing associated documentation comment in .proto file."""
|
|
@@ -18,7 +38,7 @@ class GrpcAdapterStub(object):
|
|
|
18
38
|
'/flwr.proto.GrpcAdapter/SendReceive',
|
|
19
39
|
request_serializer=flwr_dot_proto_dot_grpcadapter__pb2.MessageContainer.SerializeToString,
|
|
20
40
|
response_deserializer=flwr_dot_proto_dot_grpcadapter__pb2.MessageContainer.FromString,
|
|
21
|
-
)
|
|
41
|
+
_registered_method=True)
|
|
22
42
|
|
|
23
43
|
|
|
24
44
|
class GrpcAdapterServicer(object):
|
|
@@ -42,6 +62,7 @@ def add_GrpcAdapterServicer_to_server(servicer, server):
|
|
|
42
62
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
43
63
|
'flwr.proto.GrpcAdapter', rpc_method_handlers)
|
|
44
64
|
server.add_generic_rpc_handlers((generic_handler,))
|
|
65
|
+
server.add_registered_method_handlers('flwr.proto.GrpcAdapter', rpc_method_handlers)
|
|
45
66
|
|
|
46
67
|
|
|
47
68
|
# This class is part of an EXPERIMENTAL API.
|
|
@@ -59,8 +80,18 @@ class GrpcAdapter(object):
|
|
|
59
80
|
wait_for_ready=None,
|
|
60
81
|
timeout=None,
|
|
61
82
|
metadata=None):
|
|
62
|
-
return grpc.experimental.unary_unary(
|
|
83
|
+
return grpc.experimental.unary_unary(
|
|
84
|
+
request,
|
|
85
|
+
target,
|
|
86
|
+
'/flwr.proto.GrpcAdapter/SendReceive',
|
|
63
87
|
flwr_dot_proto_dot_grpcadapter__pb2.MessageContainer.SerializeToString,
|
|
64
88
|
flwr_dot_proto_dot_grpcadapter__pb2.MessageContainer.FromString,
|
|
65
|
-
options,
|
|
66
|
-
|
|
89
|
+
options,
|
|
90
|
+
channel_credentials,
|
|
91
|
+
insecure,
|
|
92
|
+
call_credentials,
|
|
93
|
+
compression,
|
|
94
|
+
wait_for_ready,
|
|
95
|
+
timeout,
|
|
96
|
+
metadata,
|
|
97
|
+
_registered_method=True)
|
|
@@ -1,24 +1,55 @@
|
|
|
1
1
|
"""
|
|
2
2
|
@generated by mypy-protobuf. Do not edit manually!
|
|
3
3
|
isort:skip_file
|
|
4
|
+
Copyright 2024 Flower Labs GmbH. All Rights Reserved.
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
you may not use this file except in compliance with the License.
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
See the License for the specific language governing permissions and
|
|
16
|
+
limitations under the License.
|
|
17
|
+
==============================================================================
|
|
4
18
|
"""
|
|
19
|
+
|
|
5
20
|
import abc
|
|
21
|
+
import collections.abc
|
|
6
22
|
import flwr.proto.grpcadapter_pb2
|
|
7
23
|
import grpc
|
|
24
|
+
import grpc.aio
|
|
25
|
+
import typing
|
|
26
|
+
|
|
27
|
+
_T = typing.TypeVar("_T")
|
|
28
|
+
|
|
29
|
+
class _MaybeAsyncIterator(collections.abc.AsyncIterator[_T], collections.abc.Iterator[_T], metaclass=abc.ABCMeta): ...
|
|
30
|
+
|
|
31
|
+
class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
|
|
32
|
+
...
|
|
8
33
|
|
|
9
34
|
class GrpcAdapterStub:
|
|
10
|
-
def __init__(self, channel: grpc.Channel) -> None: ...
|
|
35
|
+
def __init__(self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]) -> None: ...
|
|
11
36
|
SendReceive: grpc.UnaryUnaryMultiCallable[
|
|
12
37
|
flwr.proto.grpcadapter_pb2.MessageContainer,
|
|
13
|
-
flwr.proto.grpcadapter_pb2.MessageContainer
|
|
38
|
+
flwr.proto.grpcadapter_pb2.MessageContainer,
|
|
39
|
+
]
|
|
14
40
|
|
|
41
|
+
class GrpcAdapterAsyncStub:
|
|
42
|
+
SendReceive: grpc.aio.UnaryUnaryMultiCallable[
|
|
43
|
+
flwr.proto.grpcadapter_pb2.MessageContainer,
|
|
44
|
+
flwr.proto.grpcadapter_pb2.MessageContainer,
|
|
45
|
+
]
|
|
15
46
|
|
|
16
47
|
class GrpcAdapterServicer(metaclass=abc.ABCMeta):
|
|
17
48
|
@abc.abstractmethod
|
|
18
|
-
def SendReceive(
|
|
49
|
+
def SendReceive(
|
|
50
|
+
self,
|
|
19
51
|
request: flwr.proto.grpcadapter_pb2.MessageContainer,
|
|
20
|
-
context:
|
|
21
|
-
) -> flwr.proto.grpcadapter_pb2.MessageContainer: ...
|
|
22
|
-
|
|
52
|
+
context: _ServicerContext,
|
|
53
|
+
) -> typing.Union[flwr.proto.grpcadapter_pb2.MessageContainer, collections.abc.Awaitable[flwr.proto.grpcadapter_pb2.MessageContainer]]: ...
|
|
23
54
|
|
|
24
|
-
def add_GrpcAdapterServicer_to_server(servicer: GrpcAdapterServicer, server: grpc.Server) -> None: ...
|
|
55
|
+
def add_GrpcAdapterServicer_to_server(servicer: GrpcAdapterServicer, server: typing.Union[grpc.Server, grpc.aio.Server]) -> None: ...
|
flwr/proto/heartbeat_pb2.py
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
3
4
|
# source: flwr/proto/heartbeat.proto
|
|
4
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 5.29.0
|
|
5
6
|
"""Generated protocol buffer code."""
|
|
6
7
|
from google.protobuf import descriptor as _descriptor
|
|
7
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
8
10
|
from google.protobuf import symbol_database as _symbol_database
|
|
9
11
|
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
5,
|
|
15
|
+
29,
|
|
16
|
+
0,
|
|
17
|
+
'',
|
|
18
|
+
'flwr/proto/heartbeat.proto'
|
|
19
|
+
)
|
|
10
20
|
# @@protoc_insertion_point(imports)
|
|
11
21
|
|
|
12
22
|
_sym_db = _symbol_database.Default()
|
|
@@ -15,19 +25,19 @@ _sym_db = _symbol_database.Default()
|
|
|
15
25
|
from flwr.proto import node_pb2 as flwr_dot_proto_dot_node__pb2
|
|
16
26
|
|
|
17
27
|
|
|
18
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x66lwr/proto/heartbeat.proto\x12\nflwr.proto\x1a\x15\x66lwr/proto/node.proto\"V\n\x18SendNodeHeartbeatRequest\x12\x1e\n\x04node\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x1a\n\x12heartbeat_interval\x18\x02 \x01(\x01\",\n\x19SendNodeHeartbeatResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x66lwr/proto/heartbeat.proto\x12\nflwr.proto\x1a\x15\x66lwr/proto/node.proto\"V\n\x18SendNodeHeartbeatRequest\x12\x1e\n\x04node\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x1a\n\x12heartbeat_interval\x18\x02 \x01(\x01\",\n\x19SendNodeHeartbeatResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\"(\n\x17SendAppHeartbeatRequest\x12\r\n\x05token\x18\x01 \x01(\t\"+\n\x18SendAppHeartbeatResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x62\x06proto3')
|
|
19
29
|
|
|
20
30
|
_globals = globals()
|
|
21
31
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
22
32
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.heartbeat_pb2', _globals)
|
|
23
|
-
if _descriptor._USE_C_DESCRIPTORS
|
|
24
|
-
DESCRIPTOR.
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
DESCRIPTOR._loaded_options = None
|
|
25
35
|
_globals['_SENDNODEHEARTBEATREQUEST']._serialized_start=65
|
|
26
36
|
_globals['_SENDNODEHEARTBEATREQUEST']._serialized_end=151
|
|
27
37
|
_globals['_SENDNODEHEARTBEATRESPONSE']._serialized_start=153
|
|
28
38
|
_globals['_SENDNODEHEARTBEATRESPONSE']._serialized_end=197
|
|
29
39
|
_globals['_SENDAPPHEARTBEATREQUEST']._serialized_start=199
|
|
30
|
-
_globals['_SENDAPPHEARTBEATREQUEST']._serialized_end=
|
|
31
|
-
_globals['_SENDAPPHEARTBEATRESPONSE']._serialized_start=
|
|
32
|
-
_globals['_SENDAPPHEARTBEATRESPONSE']._serialized_end=
|
|
40
|
+
_globals['_SENDAPPHEARTBEATREQUEST']._serialized_end=239
|
|
41
|
+
_globals['_SENDAPPHEARTBEATRESPONSE']._serialized_start=241
|
|
42
|
+
_globals['_SENDAPPHEARTBEATRESPONSE']._serialized_end=284
|
|
33
43
|
# @@protoc_insertion_point(module_scope)
|