flwr-nightly 1.15.0.dev20250117__py3-none-any.whl → 1.15.0.dev20250119__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.
Files changed (47) hide show
  1. flwr/client/app.py +7 -7
  2. flwr/client/clientapp/app.py +4 -6
  3. flwr/client/rest_client/connection.py +2 -3
  4. flwr/client/supernode/app.py +9 -15
  5. flwr/common/constant.py +0 -8
  6. flwr/common/exit/__init__.py +24 -0
  7. flwr/common/exit/exit.py +99 -0
  8. flwr/common/exit/exit_code.py +90 -0
  9. flwr/common/exit_handlers.py +24 -10
  10. flwr/proto/clientappio_pb2.py +13 -3
  11. flwr/proto/clientappio_pb2_grpc.py +63 -12
  12. flwr/proto/error_pb2.py +13 -3
  13. flwr/proto/error_pb2_grpc.py +20 -0
  14. flwr/proto/exec_pb2.py +15 -5
  15. flwr/proto/exec_pb2_grpc.py +105 -24
  16. flwr/proto/fab_pb2.py +13 -3
  17. flwr/proto/fab_pb2_grpc.py +20 -0
  18. flwr/proto/fleet_pb2.py +15 -5
  19. flwr/proto/fleet_pb2_grpc.py +147 -36
  20. flwr/proto/grpcadapter_pb2.py +14 -4
  21. flwr/proto/grpcadapter_pb2_grpc.py +35 -4
  22. flwr/proto/log_pb2.py +13 -3
  23. flwr/proto/log_pb2_grpc.py +20 -0
  24. flwr/proto/message_pb2.py +15 -5
  25. flwr/proto/message_pb2_grpc.py +20 -0
  26. flwr/proto/node_pb2.py +13 -3
  27. flwr/proto/node_pb2_grpc.py +20 -0
  28. flwr/proto/recordset_pb2.py +18 -8
  29. flwr/proto/recordset_pb2_grpc.py +20 -0
  30. flwr/proto/run_pb2.py +16 -6
  31. flwr/proto/run_pb2_grpc.py +20 -0
  32. flwr/proto/serverappio_pb2.py +13 -3
  33. flwr/proto/serverappio_pb2_grpc.py +175 -44
  34. flwr/proto/simulationio_pb2.py +13 -3
  35. flwr/proto/simulationio_pb2_grpc.py +105 -24
  36. flwr/proto/task_pb2.py +13 -3
  37. flwr/proto/task_pb2_grpc.py +20 -0
  38. flwr/proto/transport_pb2.py +20 -10
  39. flwr/proto/transport_pb2_grpc.py +35 -4
  40. flwr/server/app.py +9 -6
  41. flwr/server/serverapp/app.py +4 -6
  42. flwr/server/superlink/fleet/rest_rere/rest_api.py +2 -3
  43. {flwr_nightly-1.15.0.dev20250117.dist-info → flwr_nightly-1.15.0.dev20250119.dist-info}/METADATA +2 -2
  44. {flwr_nightly-1.15.0.dev20250117.dist-info → flwr_nightly-1.15.0.dev20250119.dist-info}/RECORD +47 -44
  45. {flwr_nightly-1.15.0.dev20250117.dist-info → flwr_nightly-1.15.0.dev20250119.dist-info}/LICENSE +0 -0
  46. {flwr_nightly-1.15.0.dev20250117.dist-info → flwr_nightly-1.15.0.dev20250119.dist-info}/WHEEL +0 -0
  47. {flwr_nightly-1.15.0.dev20250117.dist-info → flwr_nightly-1.15.0.dev20250119.dist-info}/entry_points.txt +0 -0
@@ -1,11 +1,31 @@
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 log_pb2 as flwr_dot_proto_dot_log__pb2
6
7
  from flwr.proto import run_pb2 as flwr_dot_proto_dot_run__pb2
7
8
  from flwr.proto import simulationio_pb2 as flwr_dot_proto_dot_simulationio__pb2
8
9
 
10
+ GRPC_GENERATED_VERSION = '1.69.0'
11
+ GRPC_VERSION = grpc.__version__
12
+ _version_not_supported = False
13
+
14
+ try:
15
+ from grpc._utilities import first_version_is_lower
16
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
17
+ except ImportError:
18
+ _version_not_supported = True
19
+
20
+ if _version_not_supported:
21
+ raise RuntimeError(
22
+ f'The grpc package installed is at version {GRPC_VERSION},'
23
+ + f' but the generated code in flwr/proto/simulationio_pb2_grpc.py depends on'
24
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
25
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
26
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
27
+ )
28
+
9
29
 
10
30
  class SimulationIoStub(object):
11
31
  """Missing associated documentation comment in .proto file."""
@@ -20,32 +40,32 @@ class SimulationIoStub(object):
20
40
  '/flwr.proto.SimulationIo/PullSimulationInputs',
21
41
  request_serializer=flwr_dot_proto_dot_simulationio__pb2.PullSimulationInputsRequest.SerializeToString,
22
42
  response_deserializer=flwr_dot_proto_dot_simulationio__pb2.PullSimulationInputsResponse.FromString,
23
- )
43
+ _registered_method=True)
24
44
  self.PushSimulationOutputs = channel.unary_unary(
25
45
  '/flwr.proto.SimulationIo/PushSimulationOutputs',
26
46
  request_serializer=flwr_dot_proto_dot_simulationio__pb2.PushSimulationOutputsRequest.SerializeToString,
27
47
  response_deserializer=flwr_dot_proto_dot_simulationio__pb2.PushSimulationOutputsResponse.FromString,
28
- )
48
+ _registered_method=True)
29
49
  self.UpdateRunStatus = channel.unary_unary(
30
50
  '/flwr.proto.SimulationIo/UpdateRunStatus',
31
51
  request_serializer=flwr_dot_proto_dot_run__pb2.UpdateRunStatusRequest.SerializeToString,
32
52
  response_deserializer=flwr_dot_proto_dot_run__pb2.UpdateRunStatusResponse.FromString,
33
- )
53
+ _registered_method=True)
34
54
  self.PushLogs = channel.unary_unary(
35
55
  '/flwr.proto.SimulationIo/PushLogs',
36
56
  request_serializer=flwr_dot_proto_dot_log__pb2.PushLogsRequest.SerializeToString,
37
57
  response_deserializer=flwr_dot_proto_dot_log__pb2.PushLogsResponse.FromString,
38
- )
58
+ _registered_method=True)
39
59
  self.GetFederationOptions = channel.unary_unary(
40
60
  '/flwr.proto.SimulationIo/GetFederationOptions',
41
61
  request_serializer=flwr_dot_proto_dot_run__pb2.GetFederationOptionsRequest.SerializeToString,
42
62
  response_deserializer=flwr_dot_proto_dot_run__pb2.GetFederationOptionsResponse.FromString,
43
- )
63
+ _registered_method=True)
44
64
  self.GetRunStatus = channel.unary_unary(
45
65
  '/flwr.proto.SimulationIo/GetRunStatus',
46
66
  request_serializer=flwr_dot_proto_dot_run__pb2.GetRunStatusRequest.SerializeToString,
47
67
  response_deserializer=flwr_dot_proto_dot_run__pb2.GetRunStatusResponse.FromString,
48
- )
68
+ _registered_method=True)
49
69
 
50
70
 
51
71
  class SimulationIoServicer(object):
@@ -130,6 +150,7 @@ def add_SimulationIoServicer_to_server(servicer, server):
130
150
  generic_handler = grpc.method_handlers_generic_handler(
131
151
  'flwr.proto.SimulationIo', rpc_method_handlers)
132
152
  server.add_generic_rpc_handlers((generic_handler,))
153
+ server.add_registered_method_handlers('flwr.proto.SimulationIo', rpc_method_handlers)
133
154
 
134
155
 
135
156
  # This class is part of an EXPERIMENTAL API.
@@ -147,11 +168,21 @@ class SimulationIo(object):
147
168
  wait_for_ready=None,
148
169
  timeout=None,
149
170
  metadata=None):
150
- return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/PullSimulationInputs',
171
+ return grpc.experimental.unary_unary(
172
+ request,
173
+ target,
174
+ '/flwr.proto.SimulationIo/PullSimulationInputs',
151
175
  flwr_dot_proto_dot_simulationio__pb2.PullSimulationInputsRequest.SerializeToString,
152
176
  flwr_dot_proto_dot_simulationio__pb2.PullSimulationInputsResponse.FromString,
153
- options, channel_credentials,
154
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
177
+ options,
178
+ channel_credentials,
179
+ insecure,
180
+ call_credentials,
181
+ compression,
182
+ wait_for_ready,
183
+ timeout,
184
+ metadata,
185
+ _registered_method=True)
155
186
 
156
187
  @staticmethod
157
188
  def PushSimulationOutputs(request,
@@ -164,11 +195,21 @@ class SimulationIo(object):
164
195
  wait_for_ready=None,
165
196
  timeout=None,
166
197
  metadata=None):
167
- return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/PushSimulationOutputs',
198
+ return grpc.experimental.unary_unary(
199
+ request,
200
+ target,
201
+ '/flwr.proto.SimulationIo/PushSimulationOutputs',
168
202
  flwr_dot_proto_dot_simulationio__pb2.PushSimulationOutputsRequest.SerializeToString,
169
203
  flwr_dot_proto_dot_simulationio__pb2.PushSimulationOutputsResponse.FromString,
170
- options, channel_credentials,
171
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
204
+ options,
205
+ channel_credentials,
206
+ insecure,
207
+ call_credentials,
208
+ compression,
209
+ wait_for_ready,
210
+ timeout,
211
+ metadata,
212
+ _registered_method=True)
172
213
 
173
214
  @staticmethod
174
215
  def UpdateRunStatus(request,
@@ -181,11 +222,21 @@ class SimulationIo(object):
181
222
  wait_for_ready=None,
182
223
  timeout=None,
183
224
  metadata=None):
184
- return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/UpdateRunStatus',
225
+ return grpc.experimental.unary_unary(
226
+ request,
227
+ target,
228
+ '/flwr.proto.SimulationIo/UpdateRunStatus',
185
229
  flwr_dot_proto_dot_run__pb2.UpdateRunStatusRequest.SerializeToString,
186
230
  flwr_dot_proto_dot_run__pb2.UpdateRunStatusResponse.FromString,
187
- options, channel_credentials,
188
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
231
+ options,
232
+ channel_credentials,
233
+ insecure,
234
+ call_credentials,
235
+ compression,
236
+ wait_for_ready,
237
+ timeout,
238
+ metadata,
239
+ _registered_method=True)
189
240
 
190
241
  @staticmethod
191
242
  def PushLogs(request,
@@ -198,11 +249,21 @@ class SimulationIo(object):
198
249
  wait_for_ready=None,
199
250
  timeout=None,
200
251
  metadata=None):
201
- return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/PushLogs',
252
+ return grpc.experimental.unary_unary(
253
+ request,
254
+ target,
255
+ '/flwr.proto.SimulationIo/PushLogs',
202
256
  flwr_dot_proto_dot_log__pb2.PushLogsRequest.SerializeToString,
203
257
  flwr_dot_proto_dot_log__pb2.PushLogsResponse.FromString,
204
- options, channel_credentials,
205
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
258
+ options,
259
+ channel_credentials,
260
+ insecure,
261
+ call_credentials,
262
+ compression,
263
+ wait_for_ready,
264
+ timeout,
265
+ metadata,
266
+ _registered_method=True)
206
267
 
207
268
  @staticmethod
208
269
  def GetFederationOptions(request,
@@ -215,11 +276,21 @@ class SimulationIo(object):
215
276
  wait_for_ready=None,
216
277
  timeout=None,
217
278
  metadata=None):
218
- return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/GetFederationOptions',
279
+ return grpc.experimental.unary_unary(
280
+ request,
281
+ target,
282
+ '/flwr.proto.SimulationIo/GetFederationOptions',
219
283
  flwr_dot_proto_dot_run__pb2.GetFederationOptionsRequest.SerializeToString,
220
284
  flwr_dot_proto_dot_run__pb2.GetFederationOptionsResponse.FromString,
221
- options, channel_credentials,
222
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
285
+ options,
286
+ channel_credentials,
287
+ insecure,
288
+ call_credentials,
289
+ compression,
290
+ wait_for_ready,
291
+ timeout,
292
+ metadata,
293
+ _registered_method=True)
223
294
 
224
295
  @staticmethod
225
296
  def GetRunStatus(request,
@@ -232,8 +303,18 @@ class SimulationIo(object):
232
303
  wait_for_ready=None,
233
304
  timeout=None,
234
305
  metadata=None):
235
- return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/GetRunStatus',
306
+ return grpc.experimental.unary_unary(
307
+ request,
308
+ target,
309
+ '/flwr.proto.SimulationIo/GetRunStatus',
236
310
  flwr_dot_proto_dot_run__pb2.GetRunStatusRequest.SerializeToString,
237
311
  flwr_dot_proto_dot_run__pb2.GetRunStatusResponse.FromString,
238
- options, channel_credentials,
239
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
312
+ options,
313
+ channel_credentials,
314
+ insecure,
315
+ call_credentials,
316
+ compression,
317
+ wait_for_ready,
318
+ timeout,
319
+ metadata,
320
+ _registered_method=True)
flwr/proto/task_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/task.proto
4
- # Protobuf Python Version: 4.25.0
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/task.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\x15\x66lwr/proto/
22
32
  _globals = globals()
23
33
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
24
34
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.task_pb2', _globals)
25
- if _descriptor._USE_C_DESCRIPTORS == False:
26
- DESCRIPTOR._options = None
35
+ if not _descriptor._USE_C_DESCRIPTORS:
36
+ DESCRIPTOR._loaded_options = None
27
37
  _globals['_TASK']._serialized_start=113
28
38
  _globals['_TASK']._serialized_end=378
29
39
  _globals['_TASKINS']._serialized_start=380
@@ -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/task_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
+ )
@@ -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/transport.proto
4
- # Protobuf Python Version: 4.25.0
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/transport.proto'
19
+ )
10
20
  # @@protoc_insertion_point(imports)
11
21
 
12
22
  _sym_db = _symbol_database.Default()
@@ -19,21 +29,21 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x66lwr/proto/
19
29
  _globals = globals()
20
30
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
31
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.transport_pb2', _globals)
22
- if _descriptor._USE_C_DESCRIPTORS == False:
23
- DESCRIPTOR._options = None
24
- _globals['_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY']._options = None
32
+ if not _descriptor._USE_C_DESCRIPTORS:
33
+ DESCRIPTOR._loaded_options = None
34
+ _globals['_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY']._loaded_options = None
25
35
  _globals['_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY']._serialized_options = b'8\001'
26
- _globals['_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY']._options = None
36
+ _globals['_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY']._loaded_options = None
27
37
  _globals['_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY']._serialized_options = b'8\001'
28
- _globals['_SERVERMESSAGE_FITINS_CONFIGENTRY']._options = None
38
+ _globals['_SERVERMESSAGE_FITINS_CONFIGENTRY']._loaded_options = None
29
39
  _globals['_SERVERMESSAGE_FITINS_CONFIGENTRY']._serialized_options = b'8\001'
30
- _globals['_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY']._options = None
40
+ _globals['_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY']._loaded_options = None
31
41
  _globals['_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY']._serialized_options = b'8\001'
32
- _globals['_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY']._options = None
42
+ _globals['_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY']._loaded_options = None
33
43
  _globals['_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY']._serialized_options = b'8\001'
34
- _globals['_CLIENTMESSAGE_FITRES_METRICSENTRY']._options = None
44
+ _globals['_CLIENTMESSAGE_FITRES_METRICSENTRY']._loaded_options = None
35
45
  _globals['_CLIENTMESSAGE_FITRES_METRICSENTRY']._serialized_options = b'8\001'
36
- _globals['_CLIENTMESSAGE_EVALUATERES_METRICSENTRY']._options = None
46
+ _globals['_CLIENTMESSAGE_EVALUATERES_METRICSENTRY']._loaded_options = None
37
47
  _globals['_CLIENTMESSAGE_EVALUATERES_METRICSENTRY']._serialized_options = b'8\001'
38
48
  _globals['_CODE']._serialized_start=2551
39
49
  _globals['_CODE']._serialized_end=2692
@@ -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 transport_pb2 as flwr_dot_proto_dot_transport__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/transport_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 FlowerServiceStub(object):
9
29
  """Missing associated documentation comment in .proto file."""
@@ -18,7 +38,7 @@ class FlowerServiceStub(object):
18
38
  '/flwr.proto.FlowerService/Join',
19
39
  request_serializer=flwr_dot_proto_dot_transport__pb2.ClientMessage.SerializeToString,
20
40
  response_deserializer=flwr_dot_proto_dot_transport__pb2.ServerMessage.FromString,
21
- )
41
+ _registered_method=True)
22
42
 
23
43
 
24
44
  class FlowerServiceServicer(object):
@@ -42,6 +62,7 @@ def add_FlowerServiceServicer_to_server(servicer, server):
42
62
  generic_handler = grpc.method_handlers_generic_handler(
43
63
  'flwr.proto.FlowerService', rpc_method_handlers)
44
64
  server.add_generic_rpc_handlers((generic_handler,))
65
+ server.add_registered_method_handlers('flwr.proto.FlowerService', rpc_method_handlers)
45
66
 
46
67
 
47
68
  # This class is part of an EXPERIMENTAL API.
@@ -59,8 +80,18 @@ class FlowerService(object):
59
80
  wait_for_ready=None,
60
81
  timeout=None,
61
82
  metadata=None):
62
- return grpc.experimental.stream_stream(request_iterator, target, '/flwr.proto.FlowerService/Join',
83
+ return grpc.experimental.stream_stream(
84
+ request_iterator,
85
+ target,
86
+ '/flwr.proto.FlowerService/Join',
63
87
  flwr_dot_proto_dot_transport__pb2.ClientMessage.SerializeToString,
64
88
  flwr_dot_proto_dot_transport__pb2.ServerMessage.FromString,
65
- options, channel_credentials,
66
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
89
+ options,
90
+ channel_credentials,
91
+ insecure,
92
+ call_credentials,
93
+ compression,
94
+ wait_for_ready,
95
+ timeout,
96
+ metadata,
97
+ _registered_method=True)
flwr/server/app.py CHANGED
@@ -52,7 +52,6 @@ from flwr.common.constant import (
52
52
  FLEET_API_REST_DEFAULT_ADDRESS,
53
53
  ISOLATION_MODE_PROCESS,
54
54
  ISOLATION_MODE_SUBPROCESS,
55
- MISSING_EXTRA_REST,
56
55
  SERVER_OCTET,
57
56
  SERVERAPPIO_API_DEFAULT_SERVER_ADDRESS,
58
57
  SIMULATIONIO_API_DEFAULT_SERVER_ADDRESS,
@@ -60,6 +59,7 @@ from flwr.common.constant import (
60
59
  TRANSPORT_TYPE_GRPC_RERE,
61
60
  TRANSPORT_TYPE_REST,
62
61
  )
62
+ from flwr.common.exit import ExitCode, flwr_exit
63
63
  from flwr.common.exit_handlers import register_exit_handlers
64
64
  from flwr.common.grpc import generic_create_grpc_server
65
65
  from flwr.common.logger import log, warn_deprecated_feature
@@ -345,7 +345,7 @@ def run_superlink() -> None:
345
345
  and importlib.util.find_spec("starlette")
346
346
  and importlib.util.find_spec("uvicorn")
347
347
  ) is None:
348
- sys.exit(MISSING_EXTRA_REST)
348
+ flwr_exit(ExitCode.COMMON_MISSING_EXTRA_REST)
349
349
 
350
350
  _, ssl_certfile, ssl_keyfile = (
351
351
  certificates if certificates is not None else (None, None, None)
@@ -437,6 +437,7 @@ def run_superlink() -> None:
437
437
  # Graceful shutdown
438
438
  register_exit_handlers(
439
439
  event_type=EventType.RUN_SUPERLINK_LEAVE,
440
+ exit_message="SuperLink terminated gracefully.",
440
441
  grpc_servers=grpc_servers,
441
442
  )
442
443
 
@@ -445,7 +446,8 @@ def run_superlink() -> None:
445
446
  sleep(0.1)
446
447
 
447
448
  # Exit if any thread has exited prematurely
448
- sys.exit(1)
449
+ # This code will not be reached if the SuperLink stops gracefully
450
+ flwr_exit(ExitCode.SUPERLINK_THREAD_CRASH)
449
451
 
450
452
 
451
453
  def _run_flwr_command(args: list[str], main_pid: int) -> None:
@@ -520,8 +522,9 @@ def _flwr_scheduler(
520
522
  def _format_address(address: str) -> tuple[str, str, int]:
521
523
  parsed_address = parse_address(address)
522
524
  if not parsed_address:
523
- sys.exit(
524
- f"Address ({address}) cannot be parsed (expected: URL or IPv4 or IPv6)."
525
+ flwr_exit(
526
+ ExitCode.COMMON_ADDRESS_INVALID,
527
+ f"Address ({address}) cannot be parsed.",
525
528
  )
526
529
  host, port, is_v6 = parsed_address
527
530
  return (f"[{host}]:{port}" if is_v6 else f"{host}:{port}", host, port)
@@ -712,7 +715,7 @@ def _run_fleet_api_rest(
712
715
 
713
716
  from flwr.server.superlink.fleet.rest_rere.rest_api import app as fast_api_app
714
717
  except ModuleNotFoundError:
715
- sys.exit(MISSING_EXTRA_REST)
718
+ flwr_exit(ExitCode.COMMON_MISSING_EXTRA_REST)
716
719
 
717
720
  log(INFO, "Starting Flower REST server")
718
721
 
@@ -16,7 +16,6 @@
16
16
 
17
17
 
18
18
  import argparse
19
- import sys
20
19
  from logging import DEBUG, ERROR, INFO
21
20
  from pathlib import Path
22
21
  from queue import Queue
@@ -38,6 +37,7 @@ from flwr.common.constant import (
38
37
  Status,
39
38
  SubStatus,
40
39
  )
40
+ from flwr.common.exit import ExitCode, flwr_exit
41
41
  from flwr.common.logger import (
42
42
  log,
43
43
  mirror_output_to_queue,
@@ -75,12 +75,10 @@ def flwr_serverapp() -> None:
75
75
  log(INFO, "Starting Flower ServerApp")
76
76
 
77
77
  if not args.insecure:
78
- log(
79
- ERROR,
80
- "`flwr-serverapp` does not support TLS yet. "
81
- "Please use the '--insecure' flag.",
78
+ flwr_exit(
79
+ ExitCode.COMMON_TLS_NOT_SUPPORTED,
80
+ "`flwr-serverapp` does not support TLS yet.",
82
81
  )
83
- sys.exit(1)
84
82
 
85
83
  log(
86
84
  DEBUG,
@@ -17,13 +17,12 @@
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
- import sys
21
20
  from collections.abc import Awaitable
22
21
  from typing import Callable, TypeVar, cast
23
22
 
24
23
  from google.protobuf.message import Message as GrpcMessage
25
24
 
26
- from flwr.common.constant import MISSING_EXTRA_REST
25
+ from flwr.common.exit import ExitCode, flwr_exit
27
26
  from flwr.proto.fab_pb2 import GetFabRequest, GetFabResponse # pylint: disable=E0611
28
27
  from flwr.proto.fleet_pb2 import ( # pylint: disable=E0611
29
28
  CreateNodeRequest,
@@ -55,7 +54,7 @@ try:
55
54
  from starlette.responses import Response
56
55
  from starlette.routing import Route
57
56
  except ModuleNotFoundError:
58
- sys.exit(MISSING_EXTRA_REST)
57
+ flwr_exit(ExitCode.COMMON_MISSING_EXTRA_REST)
59
58
 
60
59
 
61
60
  GrpcRequest = TypeVar("GrpcRequest", bound=GrpcMessage)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flwr-nightly
3
- Version: 1.15.0.dev20250117
3
+ Version: 1.15.0.dev20250119
4
4
  Summary: Flower: A Friendly Federated AI Framework
5
5
  Home-page: https://flower.ai
6
6
  License: Apache-2.0
@@ -37,7 +37,7 @@ Requires-Dist: grpcio (>=1.69.0,<2.0.0)
37
37
  Requires-Dist: iterators (>=0.0.2,<0.0.3)
38
38
  Requires-Dist: numpy (>=1.26.0,<3.0.0)
39
39
  Requires-Dist: pathspec (>=0.12.1,<0.13.0)
40
- Requires-Dist: protobuf (>=4.25.2,<5.0.0)
40
+ Requires-Dist: protobuf (>=5.29.3,<6.0.0)
41
41
  Requires-Dist: pycryptodome (>=3.18.0,<4.0.0)
42
42
  Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
43
43
  Requires-Dist: ray (==2.10.0) ; (python_version >= "3.9" and python_version < "3.12") and (extra == "simulation")