flwr-nightly 1.16.0.dev20250308__py3-none-any.whl → 1.16.0.dev20250310__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/common/args.py +8 -2
- flwr/common/event_log_plugin/__init__.py +0 -4
- flwr/common/event_log_plugin/event_log_plugin.py +5 -32
- flwr/common/grpc.py +1 -1
- flwr/server/app.py +2 -1
- flwr/server/driver/grpc_driver.py +9 -0
- flwr/server/superlink/driver/serverappio_servicer.py +9 -6
- {flwr_nightly-1.16.0.dev20250308.dist-info → flwr_nightly-1.16.0.dev20250310.dist-info}/METADATA +1 -1
- {flwr_nightly-1.16.0.dev20250308.dist-info → flwr_nightly-1.16.0.dev20250310.dist-info}/RECORD +12 -12
- {flwr_nightly-1.16.0.dev20250308.dist-info → flwr_nightly-1.16.0.dev20250310.dist-info}/LICENSE +0 -0
- {flwr_nightly-1.16.0.dev20250308.dist-info → flwr_nightly-1.16.0.dev20250310.dist-info}/WHEEL +0 -0
- {flwr_nightly-1.16.0.dev20250308.dist-info → flwr_nightly-1.16.0.dev20250310.dist-info}/entry_points.txt +0 -0
flwr/common/args.py
CHANGED
@@ -43,7 +43,8 @@ def add_args_flwr_app_common(parser: argparse.ArgumentParser) -> None:
|
|
43
43
|
"--insecure",
|
44
44
|
action="store_true",
|
45
45
|
help="Run the server without HTTPS, regardless of whether certificate "
|
46
|
-
"paths are provided.
|
46
|
+
"paths are provided. Data transmitted between the gRPC client and server "
|
47
|
+
"is not encrypted. By default, the server runs with HTTPS enabled. "
|
47
48
|
"Use this flag only if you understand the risks.",
|
48
49
|
)
|
49
50
|
|
@@ -99,7 +100,12 @@ def try_obtain_server_certificates(
|
|
99
100
|
) -> Optional[tuple[bytes, bytes, bytes]]:
|
100
101
|
"""Validate and return the CA cert, server cert, and server private key."""
|
101
102
|
if args.insecure:
|
102
|
-
log(
|
103
|
+
log(
|
104
|
+
WARN,
|
105
|
+
"Option `--insecure` was set. Starting insecure HTTP server with "
|
106
|
+
"unencrypted communication (TLS disabled). Proceed only if you understand "
|
107
|
+
"the risks.",
|
108
|
+
)
|
103
109
|
return None
|
104
110
|
# Check if certificates are provided
|
105
111
|
if args.ssl_certfile and args.ssl_keyfile and args.ssl_ca_certfile:
|
@@ -15,12 +15,8 @@
|
|
15
15
|
"""Event log plugin components."""
|
16
16
|
|
17
17
|
|
18
|
-
from .event_log_plugin import EventLogRequest as EventLogRequest
|
19
|
-
from .event_log_plugin import EventLogResponse as EventLogResponse
|
20
18
|
from .event_log_plugin import EventLogWriterPlugin as EventLogWriterPlugin
|
21
19
|
|
22
20
|
__all__ = [
|
23
|
-
"EventLogRequest",
|
24
|
-
"EventLogResponse",
|
25
21
|
"EventLogWriterPlugin",
|
26
22
|
]
|
@@ -16,39 +16,12 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
from abc import ABC, abstractmethod
|
19
|
-
from typing import Union
|
19
|
+
from typing import Optional, Union
|
20
20
|
|
21
21
|
import grpc
|
22
|
+
from google.protobuf.message import Message as GrpcMessage
|
22
23
|
|
23
24
|
from flwr.common.typing import LogEntry, UserInfo
|
24
|
-
from flwr.proto.exec_pb2 import ( # pylint: disable=E0611
|
25
|
-
GetLoginDetailsRequest,
|
26
|
-
GetLoginDetailsResponse,
|
27
|
-
ListRunsRequest,
|
28
|
-
ListRunsResponse,
|
29
|
-
StartRunRequest,
|
30
|
-
StartRunResponse,
|
31
|
-
StopRunRequest,
|
32
|
-
StopRunResponse,
|
33
|
-
StreamLogsRequest,
|
34
|
-
StreamLogsResponse,
|
35
|
-
)
|
36
|
-
|
37
|
-
# Type variables for request and response messages
|
38
|
-
EventLogRequest = Union[
|
39
|
-
StartRunRequest,
|
40
|
-
ListRunsRequest,
|
41
|
-
StreamLogsRequest,
|
42
|
-
StopRunRequest,
|
43
|
-
GetLoginDetailsRequest,
|
44
|
-
]
|
45
|
-
EventLogResponse = Union[
|
46
|
-
StartRunResponse,
|
47
|
-
ListRunsResponse,
|
48
|
-
StreamLogsResponse,
|
49
|
-
StopRunResponse,
|
50
|
-
GetLoginDetailsResponse,
|
51
|
-
]
|
52
25
|
|
53
26
|
|
54
27
|
class EventLogWriterPlugin(ABC):
|
@@ -61,7 +34,7 @@ class EventLogWriterPlugin(ABC):
|
|
61
34
|
@abstractmethod
|
62
35
|
def compose_log_before_event( # pylint: disable=too-many-arguments
|
63
36
|
self,
|
64
|
-
request:
|
37
|
+
request: GrpcMessage,
|
65
38
|
context: grpc.ServicerContext,
|
66
39
|
user_info: UserInfo,
|
67
40
|
method_name: str,
|
@@ -71,11 +44,11 @@ class EventLogWriterPlugin(ABC):
|
|
71
44
|
@abstractmethod
|
72
45
|
def compose_log_after_event( # pylint: disable=too-many-arguments,R0917
|
73
46
|
self,
|
74
|
-
request:
|
47
|
+
request: GrpcMessage,
|
75
48
|
context: grpc.ServicerContext,
|
76
49
|
user_info: UserInfo,
|
77
50
|
method_name: str,
|
78
|
-
response:
|
51
|
+
response: Optional[Union[GrpcMessage, Exception]],
|
79
52
|
) -> LogEntry:
|
80
53
|
"""Compose post-event log entry from the provided response and context."""
|
81
54
|
|
flwr/common/grpc.py
CHANGED
@@ -27,7 +27,7 @@ import grpc
|
|
27
27
|
from .address import is_port_in_use
|
28
28
|
from .logger import log
|
29
29
|
|
30
|
-
GRPC_MAX_MESSAGE_LENGTH: int =
|
30
|
+
GRPC_MAX_MESSAGE_LENGTH: int = 2_147_483_647 # == 2048 * 1024 * 1024 -1 (2GB)
|
31
31
|
|
32
32
|
INVALID_CERTIFICATES_ERR_MSG = """
|
33
33
|
When setting any of root_certificate, certificate, or private_key,
|
flwr/server/app.py
CHANGED
@@ -725,7 +725,8 @@ def _add_args_common(parser: argparse.ArgumentParser) -> None:
|
|
725
725
|
"--insecure",
|
726
726
|
action="store_true",
|
727
727
|
help="Run the server without HTTPS, regardless of whether certificate "
|
728
|
-
"paths are provided.
|
728
|
+
"paths are provided. Data transmitted between the gRPC client and server "
|
729
|
+
"is not encrypted. By default, the server runs with HTTPS enabled. "
|
729
730
|
"Use this flag only if you understand the risks.",
|
730
731
|
)
|
731
732
|
parser.add_argument(
|
@@ -212,6 +212,15 @@ class GrpcDriver(Driver):
|
|
212
212
|
messages_list=message_proto_list, run_id=cast(Run, self._run).run_id
|
213
213
|
)
|
214
214
|
)
|
215
|
+
if len([msg_id for msg_id in res.message_ids if msg_id]) != len(
|
216
|
+
list(message_proto_list)
|
217
|
+
):
|
218
|
+
log(
|
219
|
+
WARNING,
|
220
|
+
"Not all messages could be pushed to the SuperLink. The returned "
|
221
|
+
"list has `None` for those messages (the order is preserved as passed "
|
222
|
+
"to `push_messages`). This could be due to a malformed message.",
|
223
|
+
)
|
215
224
|
return list(res.message_ids)
|
216
225
|
|
217
226
|
def pull_messages(self, message_ids: Iterable[str]) -> Iterable[Message]:
|
@@ -23,7 +23,7 @@ from uuid import UUID
|
|
23
23
|
import grpc
|
24
24
|
|
25
25
|
from flwr.common import ConfigsRecord, Message
|
26
|
-
from flwr.common.constant import Status
|
26
|
+
from flwr.common.constant import SUPERLINK_NODE_ID, Status
|
27
27
|
from flwr.common.logger import log
|
28
28
|
from flwr.common.serde import (
|
29
29
|
context_from_proto,
|
@@ -215,11 +215,14 @@ class ServerAppIoServicer(serverappio_pb2_grpc.ServerAppIoServicer):
|
|
215
215
|
messages_list = []
|
216
216
|
while messages_res:
|
217
217
|
msg = messages_res.pop(0)
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
218
|
+
|
219
|
+
# Skip `run_id` check for SuperLink generated replies
|
220
|
+
if msg.metadata.src_node_id != SUPERLINK_NODE_ID:
|
221
|
+
_raise_if(
|
222
|
+
validation_error=request.run_id != msg.metadata.run_id,
|
223
|
+
request_name="PullMessages",
|
224
|
+
detail="`message.metadata` has mismatched `run_id`",
|
225
|
+
)
|
223
226
|
messages_list.append(message_to_proto(msg))
|
224
227
|
|
225
228
|
return PullResMessagesResponse(messages_list=messages_list)
|
{flwr_nightly-1.16.0.dev20250308.dist-info → flwr_nightly-1.16.0.dev20250310.dist-info}/RECORD
RENAMED
@@ -112,7 +112,7 @@ flwr/client/supernode/app.py,sha256=oBbggh56HoieksBkTdDHAJC8VUFbrmGOP0-D9wdcZek,
|
|
112
112
|
flwr/client/typing.py,sha256=dxoTBnTMfqXr5J7G3y-uNjqxYCddvxhu89spfj4Lm2U,1048
|
113
113
|
flwr/common/__init__.py,sha256=TVaoFEJE158aui1TPZQiJCDZX4RNHRyI8I55VC80HhI,3901
|
114
114
|
flwr/common/address.py,sha256=rRaN1JpiCJnit7ImEqZVxURQ69dPihRoyyWn_3I2wh4,4119
|
115
|
-
flwr/common/args.py,sha256=
|
115
|
+
flwr/common/args.py,sha256=2gGT2a3SPJ0-LTNKnhBsZ-ESIoW9FGpw-9xkUSs8qwk,5417
|
116
116
|
flwr/common/auth_plugin/__init__.py,sha256=1Y8Oj3iB49IHDu9tvDih1J74Ygu7k85V9s2A4WORPyA,887
|
117
117
|
flwr/common/auth_plugin/auth_plugin.py,sha256=dQU5U4uJIA5XqgOJ3PankHWq-uXCaMvO74khaMPGdiU,3938
|
118
118
|
flwr/common/config.py,sha256=SAkG3BztnA6iupXxF3GAIpGmWVVCH0ptyMpC9yjr_14,13965
|
@@ -122,13 +122,13 @@ flwr/common/date.py,sha256=NHHpESce5wYqEwoDXf09gp9U9l_5Bmlh2BsOcwS-kDM,1554
|
|
122
122
|
flwr/common/differential_privacy.py,sha256=YA01NqjddKNAEVmf7hXmOVxOjhekgzvJudk3mBGq-2k,6148
|
123
123
|
flwr/common/differential_privacy_constants.py,sha256=c7b7tqgvT7yMK0XN9ndiTBs4mQf6d3qk6K7KBZGlV4Q,1074
|
124
124
|
flwr/common/dp.py,sha256=vddkvyjV2FhRoN4VuU2LeAM1UBn7dQB8_W-Qdiveal8,1978
|
125
|
-
flwr/common/event_log_plugin/__init__.py,sha256=
|
126
|
-
flwr/common/event_log_plugin/event_log_plugin.py,sha256=
|
125
|
+
flwr/common/event_log_plugin/__init__.py,sha256=ts3VAL3Fk6Grp1EK_1Qg_V-BfOof9F86iBx4rbrEkyo,838
|
126
|
+
flwr/common/event_log_plugin/event_log_plugin.py,sha256=PyNdJglG-A2VAH0gTXQO7TMImr24uAHMzNBXwnFmnmE,2022
|
127
127
|
flwr/common/exit/__init__.py,sha256=-ZOJYLaNnR729a7VzZiFsLiqngzKQh3xc27svYStZ_Q,826
|
128
128
|
flwr/common/exit/exit.py,sha256=DmZFyksp-w1sFDQekq5Z-qfnr-ivCAv78aQkqj-TDps,3458
|
129
129
|
flwr/common/exit/exit_code.py,sha256=PNEnCrZfOILjfDAFu5m-2YWEJBrk97xglq4zCUlqV7E,3470
|
130
130
|
flwr/common/exit_handlers.py,sha256=yclujry30954o0lI7vtknTajskPCvK8TXw2V3RdldXU,3174
|
131
|
-
flwr/common/grpc.py,sha256=
|
131
|
+
flwr/common/grpc.py,sha256=7sHNP34LcNZv7J1GewJxXh509XTEbYvoHvXL5tQ3tcw,9798
|
132
132
|
flwr/common/logger.py,sha256=Hund1C6bEhMw3GemlzuFK22tXZ27YeHLrFB0b4LP5f8,13041
|
133
133
|
flwr/common/message.py,sha256=rWH_JIPnIo263-pC6Ps6XWmIgakRJA_AMBYwhE0qHcQ,14251
|
134
134
|
flwr/common/object_ref.py,sha256=DXL8NtbN17DSYaR-Zc8WYhaG8rv0_D_cclvP7Sa66So,9134
|
@@ -214,7 +214,7 @@ flwr/proto/transport_pb2_grpc.py,sha256=vLN3EHtx2aEEMCO4f1Upu-l27BPzd3-5pV-u8wPc
|
|
214
214
|
flwr/proto/transport_pb2_grpc.pyi,sha256=AGXf8RiIiW2J5IKMlm_3qT3AzcDa4F3P5IqUjve_esA,766
|
215
215
|
flwr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
216
216
|
flwr/server/__init__.py,sha256=cEg1oecBu4cKB69iJCqWEylC8b5XW47bl7rQiJsdTvM,1528
|
217
|
-
flwr/server/app.py,sha256=
|
217
|
+
flwr/server/app.py,sha256=5GIzaP5gyQLy6Qi8_ePLaZmyhfa3ukSylWUZ5poMtNc,31086
|
218
218
|
flwr/server/client_manager.py,sha256=7Ese0tgrH-i-ms363feYZJKwB8gWnXSmg_hYF2Bju4U,6227
|
219
219
|
flwr/server/client_proxy.py,sha256=4G-oTwhb45sfWLx2uZdcXD98IZwdTS6F88xe3akCdUg,2399
|
220
220
|
flwr/server/compat/__init__.py,sha256=VxnJtJyOjNFQXMNi9hIuzNlZM5n0Hj1p3aq_Pm2udw4,892
|
@@ -225,7 +225,7 @@ flwr/server/compat/legacy_context.py,sha256=wBzBcfV6YO6IQGriM_FdJ5XZfiBBEEJdS_Od
|
|
225
225
|
flwr/server/criterion.py,sha256=ypbAexbztzGUxNen9RCHF91QeqiEQix4t4Ih3E-42MM,1061
|
226
226
|
flwr/server/driver/__init__.py,sha256=bikRv6CjTwSvYh7tf10gziU5o2YotOWhhftz2tr3KDc,886
|
227
227
|
flwr/server/driver/driver.py,sha256=X072eFWl8Kx-aZbahTkpAc1wwoojr8A4uO2yozwwSbE,5705
|
228
|
-
flwr/server/driver/grpc_driver.py,sha256=
|
228
|
+
flwr/server/driver/grpc_driver.py,sha256=u3kj9Ej5vErlRcdeF_8giqVXWLP0obT405Kjv6vC-Vw,10298
|
229
229
|
flwr/server/driver/inmemory_driver.py,sha256=p6p9RykDfoty94izzD4i11Xp7A8t1KUaHpbKbbVZAdU,6407
|
230
230
|
flwr/server/history.py,sha256=qSb5_pPTrwofpSYGsZWzMPkl_4uJ4mJFWesxXDrEvDU,5026
|
231
231
|
flwr/server/run_serverapp.py,sha256=vIPhvJx0i5sEZO4IKM6ruCXmx4ncat76rh0B4KhdhhM,2446
|
@@ -262,7 +262,7 @@ flwr/server/strategy/strategy.py,sha256=cXapkD5uDrt5C-RbmWDn9FLoap3Q41i7GKvbmfbC
|
|
262
262
|
flwr/server/superlink/__init__.py,sha256=8tHYCfodUlRD8PCP9fHgvu8cz5N31A2QoRVL0jDJ15E,707
|
263
263
|
flwr/server/superlink/driver/__init__.py,sha256=5soEK5QSvxNjmJQ-CGTWROc4alSAeU0e9Ad9RDhsd3E,717
|
264
264
|
flwr/server/superlink/driver/serverappio_grpc.py,sha256=UzHwo6qYZMeOhr7nn1iZbcyDSmwvnq_kpYH0mEAndW0,2173
|
265
|
-
flwr/server/superlink/driver/serverappio_servicer.py,sha256=
|
265
|
+
flwr/server/superlink/driver/serverappio_servicer.py,sha256=Y-L0SiaP1p4yEi6r6MWOMiW10nsu_TlAcj_0miaEYSo,13121
|
266
266
|
flwr/server/superlink/ffs/__init__.py,sha256=FAY-zShcfPmOxosok2QyT6hTNMNctG8cH9s_nIl8jkI,840
|
267
267
|
flwr/server/superlink/ffs/disk_ffs.py,sha256=n_Ah0sQwXGVQ9wj5965nLjdkQQbpoHCljjXKFnwftsU,3297
|
268
268
|
flwr/server/superlink/ffs/ffs.py,sha256=qLI1UfosJugu2BKOJWqHIhafTm-YiuKqGf3OGWPH0NM,2395
|
@@ -324,8 +324,8 @@ flwr/superexec/exec_servicer.py,sha256=4UpzJqPUHkBG2PZNe2lrX7XFVDOL6yw_HcoBHxuXE
|
|
324
324
|
flwr/superexec/exec_user_auth_interceptor.py,sha256=YtvcjrD2hMVmZ3y9wHuGI6FwmG_Y__q112t4fFnypy0,3793
|
325
325
|
flwr/superexec/executor.py,sha256=_B55WW2TD1fBINpabSSDRenVHXYmvlfhv-k8hJKU4lQ,3115
|
326
326
|
flwr/superexec/simulation.py,sha256=WQDon15oqpMopAZnwRZoTICYCfHqtkvFSqiTQ2hLD_g,4088
|
327
|
-
flwr_nightly-1.16.0.
|
328
|
-
flwr_nightly-1.16.0.
|
329
|
-
flwr_nightly-1.16.0.
|
330
|
-
flwr_nightly-1.16.0.
|
331
|
-
flwr_nightly-1.16.0.
|
327
|
+
flwr_nightly-1.16.0.dev20250310.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
328
|
+
flwr_nightly-1.16.0.dev20250310.dist-info/METADATA,sha256=JXB5f0sOFb-mzfNwywkCH8IYbGNt4g9Fpe5XUDmFB8c,15877
|
329
|
+
flwr_nightly-1.16.0.dev20250310.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
330
|
+
flwr_nightly-1.16.0.dev20250310.dist-info/entry_points.txt,sha256=JlNxX3qhaV18_2yj5a3kJW1ESxm31cal9iS_N_pf1Rk,538
|
331
|
+
flwr_nightly-1.16.0.dev20250310.dist-info/RECORD,,
|
{flwr_nightly-1.16.0.dev20250308.dist-info → flwr_nightly-1.16.0.dev20250310.dist-info}/LICENSE
RENAMED
File without changes
|
{flwr_nightly-1.16.0.dev20250308.dist-info → flwr_nightly-1.16.0.dev20250310.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|