flwr-nightly 1.15.0.dev20250114__py3-none-any.whl → 1.15.0.dev20250123__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/cli/config_utils.py +23 -146
- flwr/cli/constant.py +27 -0
- flwr/cli/install.py +1 -1
- flwr/cli/log.py +17 -2
- flwr/cli/login/login.py +9 -1
- flwr/cli/ls.py +10 -2
- flwr/cli/run/run.py +20 -10
- flwr/cli/stop.py +9 -1
- flwr/client/app.py +23 -43
- flwr/client/clientapp/app.py +4 -6
- flwr/client/clientapp/utils.py +1 -1
- flwr/client/grpc_client/connection.py +0 -6
- flwr/client/grpc_rere_client/client_interceptor.py +19 -125
- flwr/client/grpc_rere_client/connection.py +10 -0
- flwr/client/rest_client/connection.py +12 -3
- flwr/client/supernode/app.py +14 -20
- flwr/common/auth_plugin/auth_plugin.py +1 -0
- flwr/common/config.py +152 -15
- flwr/common/constant.py +9 -8
- flwr/common/exit/__init__.py +24 -0
- flwr/common/exit/exit.py +99 -0
- flwr/common/exit/exit_code.py +93 -0
- flwr/common/exit_handlers.py +24 -10
- flwr/common/grpc.py +7 -0
- flwr/common/logger.py +1 -1
- flwr/common/serde.py +6 -4
- flwr/proto/clientappio_pb2.py +13 -3
- flwr/proto/clientappio_pb2_grpc.py +63 -12
- flwr/proto/error_pb2.py +13 -3
- flwr/proto/error_pb2_grpc.py +20 -0
- flwr/proto/exec_pb2.py +15 -5
- flwr/proto/exec_pb2_grpc.py +105 -24
- flwr/proto/fab_pb2.py +13 -3
- flwr/proto/fab_pb2_grpc.py +20 -0
- flwr/proto/fleet_pb2.py +15 -5
- flwr/proto/fleet_pb2_grpc.py +147 -36
- flwr/proto/grpcadapter_pb2.py +14 -4
- flwr/proto/grpcadapter_pb2_grpc.py +35 -4
- flwr/proto/log_pb2.py +13 -3
- flwr/proto/log_pb2_grpc.py +20 -0
- flwr/proto/message_pb2.py +15 -5
- flwr/proto/message_pb2_grpc.py +20 -0
- flwr/proto/node_pb2.py +15 -5
- flwr/proto/node_pb2.pyi +1 -4
- flwr/proto/node_pb2_grpc.py +20 -0
- flwr/proto/recordset_pb2.py +18 -8
- flwr/proto/recordset_pb2_grpc.py +20 -0
- flwr/proto/run_pb2.py +16 -6
- flwr/proto/run_pb2_grpc.py +20 -0
- flwr/proto/serverappio_pb2.py +32 -14
- flwr/proto/serverappio_pb2.pyi +56 -0
- flwr/proto/serverappio_pb2_grpc.py +261 -44
- flwr/proto/serverappio_pb2_grpc.pyi +20 -0
- flwr/proto/simulationio_pb2.py +13 -3
- flwr/proto/simulationio_pb2_grpc.py +105 -24
- flwr/proto/task_pb2.py +13 -3
- flwr/proto/task_pb2_grpc.py +20 -0
- flwr/proto/transport_pb2.py +20 -10
- flwr/proto/transport_pb2_grpc.py +35 -4
- flwr/server/app.py +40 -11
- flwr/server/compat/app_utils.py +0 -1
- flwr/server/compat/driver_client_proxy.py +1 -2
- flwr/server/driver/grpc_driver.py +5 -2
- flwr/server/driver/inmemory_driver.py +2 -1
- flwr/server/serverapp/app.py +5 -6
- flwr/server/superlink/driver/serverappio_servicer.py +110 -6
- flwr/server/superlink/fleet/grpc_adapter/grpc_adapter_servicer.py +20 -88
- flwr/server/superlink/fleet/grpc_rere/server_interceptor.py +95 -169
- flwr/server/superlink/fleet/message_handler/message_handler.py +4 -5
- flwr/server/superlink/fleet/rest_rere/rest_api.py +2 -3
- flwr/server/superlink/linkstate/in_memory_linkstate.py +14 -26
- flwr/server/superlink/linkstate/linkstate.py +5 -18
- flwr/server/superlink/linkstate/sqlite_linkstate.py +30 -70
- flwr/server/superlink/linkstate/utils.py +18 -8
- flwr/server/utils/validator.py +9 -34
- flwr/simulation/app.py +4 -6
- flwr/simulation/legacy_app.py +4 -2
- {flwr_nightly-1.15.0.dev20250114.dist-info → flwr_nightly-1.15.0.dev20250123.dist-info}/METADATA +4 -4
- {flwr_nightly-1.15.0.dev20250114.dist-info → flwr_nightly-1.15.0.dev20250123.dist-info}/RECORD +82 -78
- {flwr_nightly-1.15.0.dev20250114.dist-info → flwr_nightly-1.15.0.dev20250123.dist-info}/LICENSE +0 -0
- {flwr_nightly-1.15.0.dev20250114.dist-info → flwr_nightly-1.15.0.dev20250123.dist-info}/WHEEL +0 -0
- {flwr_nightly-1.15.0.dev20250114.dist-info → flwr_nightly-1.15.0.dev20250123.dist-info}/entry_points.txt +0 -0
flwr/common/exit/exit.py
ADDED
@@ -0,0 +1,99 @@
|
|
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
|
+
"""Unified exit function."""
|
16
|
+
|
17
|
+
|
18
|
+
from __future__ import annotations
|
19
|
+
|
20
|
+
import sys
|
21
|
+
from logging import ERROR, INFO
|
22
|
+
from typing import Any, NoReturn
|
23
|
+
|
24
|
+
from flwr.common import EventType, event
|
25
|
+
|
26
|
+
from ..logger import log
|
27
|
+
from .exit_code import EXIT_CODE_HELP
|
28
|
+
|
29
|
+
HELP_PAGE_URL = "https://flower.ai/docs/framework/ref-exit-codes/"
|
30
|
+
|
31
|
+
|
32
|
+
def flwr_exit(
|
33
|
+
code: int,
|
34
|
+
message: str | None = None,
|
35
|
+
event_type: EventType | None = None,
|
36
|
+
event_details: dict[str, Any] | None = None,
|
37
|
+
) -> NoReturn:
|
38
|
+
"""Handle application exit with an optional message.
|
39
|
+
|
40
|
+
The exit message logged and displayed will follow this structure:
|
41
|
+
|
42
|
+
>>> Exit Code: <code>
|
43
|
+
>>> <message>
|
44
|
+
>>> <short-help-message>
|
45
|
+
>>>
|
46
|
+
>>> For more information, visit: <help-page-url>
|
47
|
+
|
48
|
+
- `<code>`: The unique exit code representing the termination reason.
|
49
|
+
- `<message>`: Optional context or additional information about the exit.
|
50
|
+
- `<short-help-message>`: A brief explanation for the given exit code.
|
51
|
+
- `<help-page-url>`: A URL providing detailed documentation and resolution steps.
|
52
|
+
"""
|
53
|
+
is_error = not 0 <= code < 100 # 0-99 are success exit codes
|
54
|
+
|
55
|
+
# Construct exit message
|
56
|
+
exit_message = f"Exit Code: {code}\n" if is_error else ""
|
57
|
+
exit_message += message or ""
|
58
|
+
if short_help_message := EXIT_CODE_HELP.get(code, ""):
|
59
|
+
exit_message += f"\n{short_help_message}"
|
60
|
+
|
61
|
+
# Set log level and system exit code
|
62
|
+
log_level = ERROR if is_error else INFO
|
63
|
+
sys_exit_code = 1 if is_error else 0
|
64
|
+
|
65
|
+
# Add help URL for non-successful/graceful exits
|
66
|
+
if is_error:
|
67
|
+
help_url = f"{HELP_PAGE_URL}{code}.html"
|
68
|
+
exit_message += f"\n\nFor more information, visit: <{help_url}>"
|
69
|
+
|
70
|
+
# Telemetry event
|
71
|
+
event_type = event_type or _try_obtain_telemetry_event()
|
72
|
+
if event_type:
|
73
|
+
event_details = event_details or {}
|
74
|
+
event_details["exit_code"] = code
|
75
|
+
event(event_type, event_details).result()
|
76
|
+
|
77
|
+
# Log the exit message
|
78
|
+
log(log_level, exit_message)
|
79
|
+
|
80
|
+
# Exit
|
81
|
+
sys.exit(sys_exit_code)
|
82
|
+
|
83
|
+
|
84
|
+
# pylint: disable-next=too-many-return-statements
|
85
|
+
def _try_obtain_telemetry_event() -> EventType | None:
|
86
|
+
"""Try to obtain a telemetry event."""
|
87
|
+
if sys.argv[0].endswith("flower-superlink"):
|
88
|
+
return EventType.RUN_SUPERLINK_LEAVE
|
89
|
+
if sys.argv[0].endswith("flower-supernode"):
|
90
|
+
return EventType.RUN_SUPERNODE_LEAVE
|
91
|
+
if sys.argv[0].endswith("flwr-serverapp"):
|
92
|
+
return EventType.FLWR_SERVERAPP_RUN_LEAVE
|
93
|
+
if sys.argv[0].endswith("flwr-clientapp"):
|
94
|
+
return None # Not yet implemented
|
95
|
+
if sys.argv[0].endswith("flwr-simulation"):
|
96
|
+
return EventType.FLWR_SIMULATION_RUN_LEAVE
|
97
|
+
if sys.argv[0].endswith("flower-simulation"):
|
98
|
+
return EventType.CLI_FLOWER_SIMULATION_LEAVE
|
99
|
+
return None
|
@@ -0,0 +1,93 @@
|
|
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
|
+
"""Exit codes."""
|
16
|
+
|
17
|
+
|
18
|
+
from __future__ import annotations
|
19
|
+
|
20
|
+
|
21
|
+
class ExitCode:
|
22
|
+
"""Exit codes for Flower components."""
|
23
|
+
|
24
|
+
# Success exit codes (0-99)
|
25
|
+
SUCCESS = 0 # Successful exit without any errors or signals
|
26
|
+
GRACEFUL_EXIT_SIGINT = 1 # Graceful exit triggered by SIGINT
|
27
|
+
GRACEFUL_EXIT_SIGQUIT = 2 # Graceful exit triggered by SIGQUIT
|
28
|
+
GRACEFUL_EXIT_SIGTERM = 3 # Graceful exit triggered by SIGTERM
|
29
|
+
|
30
|
+
# SuperLink-specific exit codes (100-199)
|
31
|
+
SUPERLINK_THREAD_CRASH = 100
|
32
|
+
|
33
|
+
# ServerApp-specific exit codes (200-299)
|
34
|
+
|
35
|
+
# SuperNode-specific exit codes (300-399)
|
36
|
+
SUPERNODE_REST_ADDRESS_INVALID = 300
|
37
|
+
SUPERNODE_NODE_AUTH_KEYS_REQUIRED = 301
|
38
|
+
SUPERNODE_NODE_AUTH_KEYS_INVALID = 302
|
39
|
+
|
40
|
+
# ClientApp-specific exit codes (400-499)
|
41
|
+
|
42
|
+
# Simulation-specific exit codes (500-599)
|
43
|
+
|
44
|
+
# Common exit codes (600-)
|
45
|
+
COMMON_ADDRESS_INVALID = 600
|
46
|
+
COMMON_MISSING_EXTRA_REST = 601
|
47
|
+
COMMON_TLS_NOT_SUPPORTED = 602
|
48
|
+
|
49
|
+
def __new__(cls) -> ExitCode:
|
50
|
+
"""Prevent instantiation."""
|
51
|
+
raise TypeError(f"{cls.__name__} cannot be instantiated.")
|
52
|
+
|
53
|
+
|
54
|
+
# All short help messages for exit codes
|
55
|
+
EXIT_CODE_HELP = {
|
56
|
+
# Success exit codes (0-99)
|
57
|
+
ExitCode.SUCCESS: "",
|
58
|
+
ExitCode.GRACEFUL_EXIT_SIGINT: "",
|
59
|
+
ExitCode.GRACEFUL_EXIT_SIGQUIT: "",
|
60
|
+
ExitCode.GRACEFUL_EXIT_SIGTERM: "",
|
61
|
+
# SuperLink-specific exit codes (100-199)
|
62
|
+
ExitCode.SUPERLINK_THREAD_CRASH: "An important background thread has crashed.",
|
63
|
+
# ServerApp-specific exit codes (200-299)
|
64
|
+
# SuperNode-specific exit codes (300-399)
|
65
|
+
ExitCode.SUPERNODE_REST_ADDRESS_INVALID: (
|
66
|
+
"When using the REST API, please provide `https://` or "
|
67
|
+
"`http://` before the server address (e.g. `http://127.0.0.1:8080`)"
|
68
|
+
),
|
69
|
+
ExitCode.SUPERNODE_NODE_AUTH_KEYS_REQUIRED: (
|
70
|
+
"Node authentication requires file paths to both "
|
71
|
+
"'--auth-supernode-private-key' and '--auth-supernode-public-key' "
|
72
|
+
"to be provided (providing only one of them is not sufficient)."
|
73
|
+
),
|
74
|
+
ExitCode.SUPERNODE_NODE_AUTH_KEYS_INVALID: (
|
75
|
+
"Node uthentication requires elliptic curve private and public key pair. "
|
76
|
+
"Please ensure that the file path points to a valid private/public key "
|
77
|
+
"file and try again."
|
78
|
+
),
|
79
|
+
# ClientApp-specific exit codes (400-499)
|
80
|
+
# Simulation-specific exit codes (500-599)
|
81
|
+
# Common exit codes (600-)
|
82
|
+
ExitCode.COMMON_ADDRESS_INVALID: (
|
83
|
+
"Please provide a valid URL, IPv4 or IPv6 address."
|
84
|
+
),
|
85
|
+
ExitCode.COMMON_MISSING_EXTRA_REST: """
|
86
|
+
Extra dependencies required for using the REST-based Fleet API are missing.
|
87
|
+
|
88
|
+
To use the REST API, install `flwr` with the `rest` extra:
|
89
|
+
|
90
|
+
`pip install "flwr[rest]"`.
|
91
|
+
""",
|
92
|
+
ExitCode.COMMON_TLS_NOT_SUPPORTED: "Please use the '--insecure' flag.",
|
93
|
+
}
|
flwr/common/exit_handlers.py
CHANGED
@@ -15,28 +15,38 @@
|
|
15
15
|
"""Common function to register exit handlers for server and client."""
|
16
16
|
|
17
17
|
|
18
|
-
import
|
19
|
-
from signal import SIGINT, SIGTERM, signal
|
18
|
+
from signal import SIGINT, SIGQUIT, SIGTERM, signal
|
20
19
|
from threading import Thread
|
21
20
|
from types import FrameType
|
22
21
|
from typing import Optional
|
23
22
|
|
24
23
|
from grpc import Server
|
25
24
|
|
26
|
-
from flwr.common.telemetry import EventType
|
25
|
+
from flwr.common.telemetry import EventType
|
26
|
+
|
27
|
+
from .exit import ExitCode, flwr_exit
|
28
|
+
|
29
|
+
SIGNAL_TO_EXIT_CODE = {
|
30
|
+
SIGINT: ExitCode.GRACEFUL_EXIT_SIGINT,
|
31
|
+
SIGQUIT: ExitCode.GRACEFUL_EXIT_SIGQUIT,
|
32
|
+
SIGTERM: ExitCode.GRACEFUL_EXIT_SIGTERM,
|
33
|
+
}
|
27
34
|
|
28
35
|
|
29
36
|
def register_exit_handlers(
|
30
37
|
event_type: EventType,
|
38
|
+
exit_message: Optional[str] = None,
|
31
39
|
grpc_servers: Optional[list[Server]] = None,
|
32
40
|
bckg_threads: Optional[list[Thread]] = None,
|
33
41
|
) -> None:
|
34
|
-
"""Register exit handlers for `SIGINT` and `
|
42
|
+
"""Register exit handlers for `SIGINT`, `SIGTERM` and `SIGQUIT` signals.
|
35
43
|
|
36
44
|
Parameters
|
37
45
|
----------
|
38
46
|
event_type : EventType
|
39
47
|
The telemetry event that should be logged before exit.
|
48
|
+
exit_message : Optional[str] (default: None)
|
49
|
+
The message to be logged before exiting.
|
40
50
|
grpc_servers: Optional[List[Server]] (default: None)
|
41
51
|
An otpional list of gRPC servers that need to be gracefully
|
42
52
|
terminated before exiting.
|
@@ -46,6 +56,7 @@ def register_exit_handlers(
|
|
46
56
|
"""
|
47
57
|
default_handlers = {
|
48
58
|
SIGINT: None,
|
59
|
+
SIGQUIT: None,
|
49
60
|
SIGTERM: None,
|
50
61
|
}
|
51
62
|
|
@@ -61,8 +72,6 @@ def register_exit_handlers(
|
|
61
72
|
# Reset to default handler
|
62
73
|
signal(signalnum, default_handlers[signalnum])
|
63
74
|
|
64
|
-
event_res = event(event_type=event_type)
|
65
|
-
|
66
75
|
if grpc_servers is not None:
|
67
76
|
for grpc_server in grpc_servers:
|
68
77
|
grpc_server.stop(grace=1)
|
@@ -71,16 +80,21 @@ def register_exit_handlers(
|
|
71
80
|
for bckg_thread in bckg_threads:
|
72
81
|
bckg_thread.join()
|
73
82
|
|
74
|
-
# Ensure event has happend
|
75
|
-
event_res.result()
|
76
|
-
|
77
83
|
# Setup things for graceful exit
|
78
|
-
|
84
|
+
flwr_exit(
|
85
|
+
code=SIGNAL_TO_EXIT_CODE[signalnum],
|
86
|
+
message=exit_message,
|
87
|
+
event_type=event_type,
|
88
|
+
)
|
79
89
|
|
80
90
|
default_handlers[SIGINT] = signal( # type: ignore
|
81
91
|
SIGINT,
|
82
92
|
graceful_exit_handler, # type: ignore
|
83
93
|
)
|
94
|
+
default_handlers[SIGQUIT] = signal( # type: ignore
|
95
|
+
SIGQUIT,
|
96
|
+
graceful_exit_handler, # type: ignore
|
97
|
+
)
|
84
98
|
default_handlers[SIGTERM] = signal( # type: ignore
|
85
99
|
SIGTERM,
|
86
100
|
graceful_exit_handler, # type: ignore
|
flwr/common/grpc.py
CHANGED
@@ -16,6 +16,7 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
import concurrent.futures
|
19
|
+
import os
|
19
20
|
import sys
|
20
21
|
from collections.abc import Sequence
|
21
22
|
from logging import DEBUG, ERROR
|
@@ -35,6 +36,12 @@ INVALID_CERTIFICATES_ERR_MSG = """
|
|
35
36
|
|
36
37
|
AddServicerToServerFn = Callable[..., Any]
|
37
38
|
|
39
|
+
if "GRPC_VERBOSITY" not in os.environ:
|
40
|
+
os.environ["GRPC_VERBOSITY"] = "error"
|
41
|
+
# The following flags can be uncommented for debugging. Other possible values:
|
42
|
+
# https://github.com/grpc/grpc/blob/master/doc/environment_variables.md
|
43
|
+
# os.environ["GRPC_TRACE"] = "tcp,http"
|
44
|
+
|
38
45
|
|
39
46
|
def create_channel(
|
40
47
|
server_address: str,
|
flwr/common/logger.py
CHANGED
@@ -320,7 +320,7 @@ def _log_uploader(
|
|
320
320
|
) -> None:
|
321
321
|
"""Upload logs to the SuperLink."""
|
322
322
|
exit_flag = False
|
323
|
-
node = Node(node_id=node_id
|
323
|
+
node = Node(node_id=node_id)
|
324
324
|
msgs: list[str] = []
|
325
325
|
while True:
|
326
326
|
# Fetch all messages from the queue
|
flwr/common/serde.py
CHANGED
@@ -21,6 +21,8 @@ from typing import Any, TypeVar, cast
|
|
21
21
|
|
22
22
|
from google.protobuf.message import Message as GrpcMessage
|
23
23
|
|
24
|
+
from flwr.common.constant import SUPERLINK_NODE_ID
|
25
|
+
|
24
26
|
# pylint: disable=E0611
|
25
27
|
from flwr.proto.clientappio_pb2 import ClientAppOutputCode, ClientAppOutputStatus
|
26
28
|
from flwr.proto.error_pb2 import Error as ProtoError
|
@@ -605,8 +607,8 @@ def message_to_taskins(message: Message) -> TaskIns:
|
|
605
607
|
group_id=md.group_id,
|
606
608
|
run_id=md.run_id,
|
607
609
|
task=Task(
|
608
|
-
producer=Node(node_id=
|
609
|
-
consumer=Node(node_id=md.dst_node_id
|
610
|
+
producer=Node(node_id=SUPERLINK_NODE_ID), # Assume driver node
|
611
|
+
consumer=Node(node_id=md.dst_node_id),
|
610
612
|
created_at=md.created_at,
|
611
613
|
ttl=md.ttl,
|
612
614
|
ancestry=[md.reply_to_message] if md.reply_to_message != "" else [],
|
@@ -659,8 +661,8 @@ def message_to_taskres(message: Message) -> TaskRes:
|
|
659
661
|
group_id=md.group_id,
|
660
662
|
run_id=md.run_id,
|
661
663
|
task=Task(
|
662
|
-
producer=Node(node_id=md.src_node_id
|
663
|
-
consumer=Node(node_id=
|
664
|
+
producer=Node(node_id=md.src_node_id),
|
665
|
+
consumer=Node(node_id=SUPERLINK_NODE_ID), # Assume driver node
|
664
666
|
created_at=md.created_at,
|
665
667
|
ttl=md.ttl,
|
666
668
|
ancestry=[md.reply_to_message] if md.reply_to_message != "" else [],
|
flwr/proto/clientappio_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/clientappio.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/clientappio.proto'
|
19
|
+
)
|
10
20
|
# @@protoc_insertion_point(imports)
|
11
21
|
|
12
22
|
_sym_db = _symbol_database.Default()
|
@@ -22,8 +32,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x66lwr/proto/
|
|
22
32
|
_globals = globals()
|
23
33
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
24
34
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.clientappio_pb2', _globals)
|
25
|
-
if _descriptor._USE_C_DESCRIPTORS
|
26
|
-
DESCRIPTOR.
|
35
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
36
|
+
DESCRIPTOR._loaded_options = None
|
27
37
|
_globals['_CLIENTAPPOUTPUTCODE']._serialized_start=675
|
28
38
|
_globals['_CLIENTAPPOUTPUTCODE']._serialized_end=751
|
29
39
|
_globals['_CLIENTAPPOUTPUTSTATUS']._serialized_start=114
|
@@ -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 clientappio_pb2 as flwr_dot_proto_dot_clientappio__pb2
|
6
7
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.69.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/clientappio_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 ClientAppIoStub(object):
|
9
29
|
"""Missing associated documentation comment in .proto file."""
|
@@ -18,17 +38,17 @@ class ClientAppIoStub(object):
|
|
18
38
|
'/flwr.proto.ClientAppIo/GetToken',
|
19
39
|
request_serializer=flwr_dot_proto_dot_clientappio__pb2.GetTokenRequest.SerializeToString,
|
20
40
|
response_deserializer=flwr_dot_proto_dot_clientappio__pb2.GetTokenResponse.FromString,
|
21
|
-
)
|
41
|
+
_registered_method=True)
|
22
42
|
self.PullClientAppInputs = channel.unary_unary(
|
23
43
|
'/flwr.proto.ClientAppIo/PullClientAppInputs',
|
24
44
|
request_serializer=flwr_dot_proto_dot_clientappio__pb2.PullClientAppInputsRequest.SerializeToString,
|
25
45
|
response_deserializer=flwr_dot_proto_dot_clientappio__pb2.PullClientAppInputsResponse.FromString,
|
26
|
-
)
|
46
|
+
_registered_method=True)
|
27
47
|
self.PushClientAppOutputs = channel.unary_unary(
|
28
48
|
'/flwr.proto.ClientAppIo/PushClientAppOutputs',
|
29
49
|
request_serializer=flwr_dot_proto_dot_clientappio__pb2.PushClientAppOutputsRequest.SerializeToString,
|
30
50
|
response_deserializer=flwr_dot_proto_dot_clientappio__pb2.PushClientAppOutputsResponse.FromString,
|
31
|
-
)
|
51
|
+
_registered_method=True)
|
32
52
|
|
33
53
|
|
34
54
|
class ClientAppIoServicer(object):
|
@@ -77,6 +97,7 @@ def add_ClientAppIoServicer_to_server(servicer, server):
|
|
77
97
|
generic_handler = grpc.method_handlers_generic_handler(
|
78
98
|
'flwr.proto.ClientAppIo', rpc_method_handlers)
|
79
99
|
server.add_generic_rpc_handlers((generic_handler,))
|
100
|
+
server.add_registered_method_handlers('flwr.proto.ClientAppIo', rpc_method_handlers)
|
80
101
|
|
81
102
|
|
82
103
|
# This class is part of an EXPERIMENTAL API.
|
@@ -94,11 +115,21 @@ class ClientAppIo(object):
|
|
94
115
|
wait_for_ready=None,
|
95
116
|
timeout=None,
|
96
117
|
metadata=None):
|
97
|
-
return grpc.experimental.unary_unary(
|
118
|
+
return grpc.experimental.unary_unary(
|
119
|
+
request,
|
120
|
+
target,
|
121
|
+
'/flwr.proto.ClientAppIo/GetToken',
|
98
122
|
flwr_dot_proto_dot_clientappio__pb2.GetTokenRequest.SerializeToString,
|
99
123
|
flwr_dot_proto_dot_clientappio__pb2.GetTokenResponse.FromString,
|
100
|
-
options,
|
101
|
-
|
124
|
+
options,
|
125
|
+
channel_credentials,
|
126
|
+
insecure,
|
127
|
+
call_credentials,
|
128
|
+
compression,
|
129
|
+
wait_for_ready,
|
130
|
+
timeout,
|
131
|
+
metadata,
|
132
|
+
_registered_method=True)
|
102
133
|
|
103
134
|
@staticmethod
|
104
135
|
def PullClientAppInputs(request,
|
@@ -111,11 +142,21 @@ class ClientAppIo(object):
|
|
111
142
|
wait_for_ready=None,
|
112
143
|
timeout=None,
|
113
144
|
metadata=None):
|
114
|
-
return grpc.experimental.unary_unary(
|
145
|
+
return grpc.experimental.unary_unary(
|
146
|
+
request,
|
147
|
+
target,
|
148
|
+
'/flwr.proto.ClientAppIo/PullClientAppInputs',
|
115
149
|
flwr_dot_proto_dot_clientappio__pb2.PullClientAppInputsRequest.SerializeToString,
|
116
150
|
flwr_dot_proto_dot_clientappio__pb2.PullClientAppInputsResponse.FromString,
|
117
|
-
options,
|
118
|
-
|
151
|
+
options,
|
152
|
+
channel_credentials,
|
153
|
+
insecure,
|
154
|
+
call_credentials,
|
155
|
+
compression,
|
156
|
+
wait_for_ready,
|
157
|
+
timeout,
|
158
|
+
metadata,
|
159
|
+
_registered_method=True)
|
119
160
|
|
120
161
|
@staticmethod
|
121
162
|
def PushClientAppOutputs(request,
|
@@ -128,8 +169,18 @@ class ClientAppIo(object):
|
|
128
169
|
wait_for_ready=None,
|
129
170
|
timeout=None,
|
130
171
|
metadata=None):
|
131
|
-
return grpc.experimental.unary_unary(
|
172
|
+
return grpc.experimental.unary_unary(
|
173
|
+
request,
|
174
|
+
target,
|
175
|
+
'/flwr.proto.ClientAppIo/PushClientAppOutputs',
|
132
176
|
flwr_dot_proto_dot_clientappio__pb2.PushClientAppOutputsRequest.SerializeToString,
|
133
177
|
flwr_dot_proto_dot_clientappio__pb2.PushClientAppOutputsResponse.FromString,
|
134
|
-
options,
|
135
|
-
|
178
|
+
options,
|
179
|
+
channel_credentials,
|
180
|
+
insecure,
|
181
|
+
call_credentials,
|
182
|
+
compression,
|
183
|
+
wait_for_ready,
|
184
|
+
timeout,
|
185
|
+
metadata,
|
186
|
+
_registered_method=True)
|
flwr/proto/error_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/error.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/error.proto'
|
19
|
+
)
|
10
20
|
# @@protoc_insertion_point(imports)
|
11
21
|
|
12
22
|
_sym_db = _symbol_database.Default()
|
@@ -19,8 +29,8 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x66lwr/proto/
|
|
19
29
|
_globals = globals()
|
20
30
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
21
31
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.error_pb2', _globals)
|
22
|
-
if _descriptor._USE_C_DESCRIPTORS
|
23
|
-
DESCRIPTOR.
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
33
|
+
DESCRIPTOR._loaded_options = None
|
24
34
|
_globals['_ERROR']._serialized_start=38
|
25
35
|
_globals['_ERROR']._serialized_end=75
|
26
36
|
# @@protoc_insertion_point(module_scope)
|
flwr/proto/error_pb2_grpc.py
CHANGED
@@ -1,4 +1,24 @@
|
|
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
|
|
6
|
+
|
7
|
+
GRPC_GENERATED_VERSION = '1.69.0'
|
8
|
+
GRPC_VERSION = grpc.__version__
|
9
|
+
_version_not_supported = False
|
10
|
+
|
11
|
+
try:
|
12
|
+
from grpc._utilities import first_version_is_lower
|
13
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
14
|
+
except ImportError:
|
15
|
+
_version_not_supported = True
|
16
|
+
|
17
|
+
if _version_not_supported:
|
18
|
+
raise RuntimeError(
|
19
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
20
|
+
+ f' but the generated code in flwr/proto/error_pb2_grpc.py depends on'
|
21
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
22
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
23
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
24
|
+
)
|
flwr/proto/exec_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/exec.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/exec.proto'
|
19
|
+
)
|
10
20
|
# @@protoc_insertion_point(imports)
|
11
21
|
|
12
22
|
_sym_db = _symbol_database.Default()
|
@@ -23,11 +33,11 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15\x66lwr/proto/
|
|
23
33
|
_globals = globals()
|
24
34
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
25
35
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.exec_pb2', _globals)
|
26
|
-
if _descriptor._USE_C_DESCRIPTORS
|
27
|
-
DESCRIPTOR.
|
28
|
-
_globals['_STARTRUNREQUEST_OVERRIDECONFIGENTRY'].
|
36
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
37
|
+
DESCRIPTOR._loaded_options = None
|
38
|
+
_globals['_STARTRUNREQUEST_OVERRIDECONFIGENTRY']._loaded_options = None
|
29
39
|
_globals['_STARTRUNREQUEST_OVERRIDECONFIGENTRY']._serialized_options = b'8\001'
|
30
|
-
_globals['_LISTRUNSRESPONSE_RUNDICTENTRY'].
|
40
|
+
_globals['_LISTRUNSRESPONSE_RUNDICTENTRY']._loaded_options = None
|
31
41
|
_globals['_LISTRUNSRESPONSE_RUNDICTENTRY']._serialized_options = b'8\001'
|
32
42
|
_globals['_STARTRUNREQUEST']._serialized_start=138
|
33
43
|
_globals['_STARTRUNREQUEST']._serialized_end=389
|