flwr-nightly 1.15.0.dev20250119__py3-none-any.whl → 1.15.0.dev20250120__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/auth_plugin/auth_plugin.py +1 -0
- flwr/proto/serverappio_pb2.py +19 -11
- flwr/proto/serverappio_pb2.pyi +56 -0
- flwr/proto/serverappio_pb2_grpc.py +86 -0
- flwr/proto/serverappio_pb2_grpc.pyi +20 -0
- flwr/server/app.py +11 -3
- flwr/server/superlink/driver/serverappio_servicer.py +109 -3
- {flwr_nightly-1.15.0.dev20250119.dist-info → flwr_nightly-1.15.0.dev20250120.dist-info}/METADATA +1 -1
- {flwr_nightly-1.15.0.dev20250119.dist-info → flwr_nightly-1.15.0.dev20250120.dist-info}/RECORD +12 -12
- {flwr_nightly-1.15.0.dev20250119.dist-info → flwr_nightly-1.15.0.dev20250120.dist-info}/LICENSE +0 -0
- {flwr_nightly-1.15.0.dev20250119.dist-info → flwr_nightly-1.15.0.dev20250120.dist-info}/WHEEL +0 -0
- {flwr_nightly-1.15.0.dev20250119.dist-info → flwr_nightly-1.15.0.dev20250120.dist-info}/entry_points.txt +0 -0
flwr/proto/serverappio_pb2.py
CHANGED
@@ -30,7 +30,7 @@ from flwr.proto import run_pb2 as flwr_dot_proto_dot_run__pb2
|
|
30
30
|
from flwr.proto import fab_pb2 as flwr_dot_proto_dot_fab__pb2
|
31
31
|
|
32
32
|
|
33
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x66lwr/proto/serverappio.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/log.proto\x1a\x15\x66lwr/proto/node.proto\x1a\x18\x66lwr/proto/message.proto\x1a\x15\x66lwr/proto/task.proto\x1a\x14\x66lwr/proto/run.proto\x1a\x14\x66lwr/proto/fab.proto\"!\n\x0fGetNodesRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\"3\n\x10GetNodesResponse\x12\x1f\n\x05nodes\x18\x01 \x03(\x0b\x32\x10.flwr.proto.Node\"P\n\x12PushTaskInsRequest\x12*\n\rtask_ins_list\x18\x01 \x03(\x0b\x32\x13.flwr.proto.TaskIns\x12\x0e\n\x06run_id\x18\x02 \x01(\x04\"\'\n\x13PushTaskInsResponse\x12\x10\n\x08task_ids\x18\x02 \x03(\t\"V\n\x12PullTaskResRequest\x12\x1e\n\x04node\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x10\n\x08task_ids\x18\x02 \x03(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\x04\"A\n\x13PullTaskResResponse\x12*\n\rtask_res_list\x18\x01 \x03(\x0b\x32\x13.flwr.proto.TaskRes\"\x1c\n\x1aPullServerAppInputsRequest\"\x7f\n\x1bPullServerAppInputsResponse\x12$\n\x07\x63ontext\x18\x01 \x01(\x0b\x32\x13.flwr.proto.Context\x12\x1c\n\x03run\x18\x02 \x01(\x0b\x32\x0f.flwr.proto.Run\x12\x1c\n\x03\x66\x61\x62\x18\x03 \x01(\x0b\x32\x0f.flwr.proto.Fab\"S\n\x1bPushServerAppOutputsRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12$\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x13.flwr.proto.Context\"\x1e\n\x1cPushServerAppOutputsResponse2\
|
33
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x66lwr/proto/serverappio.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/log.proto\x1a\x15\x66lwr/proto/node.proto\x1a\x18\x66lwr/proto/message.proto\x1a\x15\x66lwr/proto/task.proto\x1a\x14\x66lwr/proto/run.proto\x1a\x14\x66lwr/proto/fab.proto\"!\n\x0fGetNodesRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\"3\n\x10GetNodesResponse\x12\x1f\n\x05nodes\x18\x01 \x03(\x0b\x32\x10.flwr.proto.Node\"P\n\x12PushTaskInsRequest\x12*\n\rtask_ins_list\x18\x01 \x03(\x0b\x32\x13.flwr.proto.TaskIns\x12\x0e\n\x06run_id\x18\x02 \x01(\x04\"\'\n\x13PushTaskInsResponse\x12\x10\n\x08task_ids\x18\x02 \x03(\t\"V\n\x12PullTaskResRequest\x12\x1e\n\x04node\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x10\n\x08task_ids\x18\x02 \x03(\t\x12\x0e\n\x06run_id\x18\x03 \x01(\x04\"A\n\x13PullTaskResResponse\x12*\n\rtask_res_list\x18\x01 \x03(\x0b\x32\x13.flwr.proto.TaskRes\"T\n\x16PushInsMessagesRequest\x12*\n\rmessages_list\x18\x01 \x03(\x0b\x32\x13.flwr.proto.Message\x12\x0e\n\x06run_id\x18\x02 \x01(\x04\".\n\x17PushInsMessagesResponse\x12\x13\n\x0bmessage_ids\x18\x01 \x03(\t\"=\n\x16PullResMessagesRequest\x12\x13\n\x0bmessage_ids\x18\x01 \x03(\t\x12\x0e\n\x06run_id\x18\x02 \x01(\x04\"E\n\x17PullResMessagesResponse\x12*\n\rmessages_list\x18\x01 \x03(\x0b\x32\x13.flwr.proto.Message\"\x1c\n\x1aPullServerAppInputsRequest\"\x7f\n\x1bPullServerAppInputsResponse\x12$\n\x07\x63ontext\x18\x01 \x01(\x0b\x32\x13.flwr.proto.Context\x12\x1c\n\x03run\x18\x02 \x01(\x0b\x32\x0f.flwr.proto.Run\x12\x1c\n\x03\x66\x61\x62\x18\x03 \x01(\x0b\x32\x0f.flwr.proto.Fab\"S\n\x1bPushServerAppOutputsRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12$\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x13.flwr.proto.Context\"\x1e\n\x1cPushServerAppOutputsResponse2\xd5\x08\n\x0bServerAppIo\x12J\n\tCreateRun\x12\x1c.flwr.proto.CreateRunRequest\x1a\x1d.flwr.proto.CreateRunResponse\"\x00\x12G\n\x08GetNodes\x12\x1b.flwr.proto.GetNodesRequest\x1a\x1c.flwr.proto.GetNodesResponse\"\x00\x12P\n\x0bPushTaskIns\x12\x1e.flwr.proto.PushTaskInsRequest\x1a\x1f.flwr.proto.PushTaskInsResponse\"\x00\x12Y\n\x0cPushMessages\x12\".flwr.proto.PushInsMessagesRequest\x1a#.flwr.proto.PushInsMessagesResponse\"\x00\x12P\n\x0bPullTaskRes\x12\x1e.flwr.proto.PullTaskResRequest\x1a\x1f.flwr.proto.PullTaskResResponse\"\x00\x12Y\n\x0cPullMessages\x12\".flwr.proto.PullResMessagesRequest\x1a#.flwr.proto.PullResMessagesResponse\"\x00\x12\x41\n\x06GetRun\x12\x19.flwr.proto.GetRunRequest\x1a\x1a.flwr.proto.GetRunResponse\"\x00\x12\x41\n\x06GetFab\x12\x19.flwr.proto.GetFabRequest\x1a\x1a.flwr.proto.GetFabResponse\"\x00\x12h\n\x13PullServerAppInputs\x12&.flwr.proto.PullServerAppInputsRequest\x1a\'.flwr.proto.PullServerAppInputsResponse\"\x00\x12k\n\x14PushServerAppOutputs\x12\'.flwr.proto.PushServerAppOutputsRequest\x1a(.flwr.proto.PushServerAppOutputsResponse\"\x00\x12\\\n\x0fUpdateRunStatus\x12\".flwr.proto.UpdateRunStatusRequest\x1a#.flwr.proto.UpdateRunStatusResponse\"\x00\x12S\n\x0cGetRunStatus\x12\x1f.flwr.proto.GetRunStatusRequest\x1a .flwr.proto.GetRunStatusResponse\"\x00\x12G\n\x08PushLogs\x12\x1b.flwr.proto.PushLogsRequest\x1a\x1c.flwr.proto.PushLogsResponse\"\x00\x62\x06proto3')
|
34
34
|
|
35
35
|
_globals = globals()
|
36
36
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -49,14 +49,22 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
49
49
|
_globals['_PULLTASKRESREQUEST']._serialized_end=479
|
50
50
|
_globals['_PULLTASKRESRESPONSE']._serialized_start=481
|
51
51
|
_globals['_PULLTASKRESRESPONSE']._serialized_end=546
|
52
|
-
_globals['
|
53
|
-
_globals['
|
54
|
-
_globals['
|
55
|
-
_globals['
|
56
|
-
_globals['
|
57
|
-
_globals['
|
58
|
-
_globals['
|
59
|
-
_globals['
|
60
|
-
_globals['
|
61
|
-
_globals['
|
52
|
+
_globals['_PUSHINSMESSAGESREQUEST']._serialized_start=548
|
53
|
+
_globals['_PUSHINSMESSAGESREQUEST']._serialized_end=632
|
54
|
+
_globals['_PUSHINSMESSAGESRESPONSE']._serialized_start=634
|
55
|
+
_globals['_PUSHINSMESSAGESRESPONSE']._serialized_end=680
|
56
|
+
_globals['_PULLRESMESSAGESREQUEST']._serialized_start=682
|
57
|
+
_globals['_PULLRESMESSAGESREQUEST']._serialized_end=743
|
58
|
+
_globals['_PULLRESMESSAGESRESPONSE']._serialized_start=745
|
59
|
+
_globals['_PULLRESMESSAGESRESPONSE']._serialized_end=814
|
60
|
+
_globals['_PULLSERVERAPPINPUTSREQUEST']._serialized_start=816
|
61
|
+
_globals['_PULLSERVERAPPINPUTSREQUEST']._serialized_end=844
|
62
|
+
_globals['_PULLSERVERAPPINPUTSRESPONSE']._serialized_start=846
|
63
|
+
_globals['_PULLSERVERAPPINPUTSRESPONSE']._serialized_end=973
|
64
|
+
_globals['_PUSHSERVERAPPOUTPUTSREQUEST']._serialized_start=975
|
65
|
+
_globals['_PUSHSERVERAPPOUTPUTSREQUEST']._serialized_end=1058
|
66
|
+
_globals['_PUSHSERVERAPPOUTPUTSRESPONSE']._serialized_start=1060
|
67
|
+
_globals['_PUSHSERVERAPPOUTPUTSRESPONSE']._serialized_end=1090
|
68
|
+
_globals['_SERVERAPPIO']._serialized_start=1093
|
69
|
+
_globals['_SERVERAPPIO']._serialized_end=2202
|
62
70
|
# @@protoc_insertion_point(module_scope)
|
flwr/proto/serverappio_pb2.pyi
CHANGED
@@ -101,6 +101,62 @@ class PullTaskResResponse(google.protobuf.message.Message):
|
|
101
101
|
def ClearField(self, field_name: typing_extensions.Literal["task_res_list",b"task_res_list"]) -> None: ...
|
102
102
|
global___PullTaskResResponse = PullTaskResResponse
|
103
103
|
|
104
|
+
class PushInsMessagesRequest(google.protobuf.message.Message):
|
105
|
+
"""PushMessages messages"""
|
106
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
107
|
+
MESSAGES_LIST_FIELD_NUMBER: builtins.int
|
108
|
+
RUN_ID_FIELD_NUMBER: builtins.int
|
109
|
+
@property
|
110
|
+
def messages_list(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[flwr.proto.message_pb2.Message]: ...
|
111
|
+
run_id: builtins.int
|
112
|
+
def __init__(self,
|
113
|
+
*,
|
114
|
+
messages_list: typing.Optional[typing.Iterable[flwr.proto.message_pb2.Message]] = ...,
|
115
|
+
run_id: builtins.int = ...,
|
116
|
+
) -> None: ...
|
117
|
+
def ClearField(self, field_name: typing_extensions.Literal["messages_list",b"messages_list","run_id",b"run_id"]) -> None: ...
|
118
|
+
global___PushInsMessagesRequest = PushInsMessagesRequest
|
119
|
+
|
120
|
+
class PushInsMessagesResponse(google.protobuf.message.Message):
|
121
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
122
|
+
MESSAGE_IDS_FIELD_NUMBER: builtins.int
|
123
|
+
@property
|
124
|
+
def message_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ...
|
125
|
+
def __init__(self,
|
126
|
+
*,
|
127
|
+
message_ids: typing.Optional[typing.Iterable[typing.Text]] = ...,
|
128
|
+
) -> None: ...
|
129
|
+
def ClearField(self, field_name: typing_extensions.Literal["message_ids",b"message_ids"]) -> None: ...
|
130
|
+
global___PushInsMessagesResponse = PushInsMessagesResponse
|
131
|
+
|
132
|
+
class PullResMessagesRequest(google.protobuf.message.Message):
|
133
|
+
"""PullMessages messages"""
|
134
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
135
|
+
MESSAGE_IDS_FIELD_NUMBER: builtins.int
|
136
|
+
RUN_ID_FIELD_NUMBER: builtins.int
|
137
|
+
@property
|
138
|
+
def message_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[typing.Text]: ...
|
139
|
+
run_id: builtins.int
|
140
|
+
def __init__(self,
|
141
|
+
*,
|
142
|
+
message_ids: typing.Optional[typing.Iterable[typing.Text]] = ...,
|
143
|
+
run_id: builtins.int = ...,
|
144
|
+
) -> None: ...
|
145
|
+
def ClearField(self, field_name: typing_extensions.Literal["message_ids",b"message_ids","run_id",b"run_id"]) -> None: ...
|
146
|
+
global___PullResMessagesRequest = PullResMessagesRequest
|
147
|
+
|
148
|
+
class PullResMessagesResponse(google.protobuf.message.Message):
|
149
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
150
|
+
MESSAGES_LIST_FIELD_NUMBER: builtins.int
|
151
|
+
@property
|
152
|
+
def messages_list(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[flwr.proto.message_pb2.Message]: ...
|
153
|
+
def __init__(self,
|
154
|
+
*,
|
155
|
+
messages_list: typing.Optional[typing.Iterable[flwr.proto.message_pb2.Message]] = ...,
|
156
|
+
) -> None: ...
|
157
|
+
def ClearField(self, field_name: typing_extensions.Literal["messages_list",b"messages_list"]) -> None: ...
|
158
|
+
global___PullResMessagesResponse = PullResMessagesResponse
|
159
|
+
|
104
160
|
class PullServerAppInputsRequest(google.protobuf.message.Message):
|
105
161
|
"""PullServerAppInputs messages"""
|
106
162
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
@@ -52,11 +52,21 @@ class ServerAppIoStub(object):
|
|
52
52
|
request_serializer=flwr_dot_proto_dot_serverappio__pb2.PushTaskInsRequest.SerializeToString,
|
53
53
|
response_deserializer=flwr_dot_proto_dot_serverappio__pb2.PushTaskInsResponse.FromString,
|
54
54
|
_registered_method=True)
|
55
|
+
self.PushMessages = channel.unary_unary(
|
56
|
+
'/flwr.proto.ServerAppIo/PushMessages',
|
57
|
+
request_serializer=flwr_dot_proto_dot_serverappio__pb2.PushInsMessagesRequest.SerializeToString,
|
58
|
+
response_deserializer=flwr_dot_proto_dot_serverappio__pb2.PushInsMessagesResponse.FromString,
|
59
|
+
_registered_method=True)
|
55
60
|
self.PullTaskRes = channel.unary_unary(
|
56
61
|
'/flwr.proto.ServerAppIo/PullTaskRes',
|
57
62
|
request_serializer=flwr_dot_proto_dot_serverappio__pb2.PullTaskResRequest.SerializeToString,
|
58
63
|
response_deserializer=flwr_dot_proto_dot_serverappio__pb2.PullTaskResResponse.FromString,
|
59
64
|
_registered_method=True)
|
65
|
+
self.PullMessages = channel.unary_unary(
|
66
|
+
'/flwr.proto.ServerAppIo/PullMessages',
|
67
|
+
request_serializer=flwr_dot_proto_dot_serverappio__pb2.PullResMessagesRequest.SerializeToString,
|
68
|
+
response_deserializer=flwr_dot_proto_dot_serverappio__pb2.PullResMessagesResponse.FromString,
|
69
|
+
_registered_method=True)
|
60
70
|
self.GetRun = channel.unary_unary(
|
61
71
|
'/flwr.proto.ServerAppIo/GetRun',
|
62
72
|
request_serializer=flwr_dot_proto_dot_run__pb2.GetRunRequest.SerializeToString,
|
@@ -118,6 +128,12 @@ class ServerAppIoServicer(object):
|
|
118
128
|
context.set_details('Method not implemented!')
|
119
129
|
raise NotImplementedError('Method not implemented!')
|
120
130
|
|
131
|
+
def PushMessages(self, request, context):
|
132
|
+
"""Missing associated documentation comment in .proto file."""
|
133
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
134
|
+
context.set_details('Method not implemented!')
|
135
|
+
raise NotImplementedError('Method not implemented!')
|
136
|
+
|
121
137
|
def PullTaskRes(self, request, context):
|
122
138
|
"""Get task results
|
123
139
|
"""
|
@@ -125,6 +141,12 @@ class ServerAppIoServicer(object):
|
|
125
141
|
context.set_details('Method not implemented!')
|
126
142
|
raise NotImplementedError('Method not implemented!')
|
127
143
|
|
144
|
+
def PullMessages(self, request, context):
|
145
|
+
"""Missing associated documentation comment in .proto file."""
|
146
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
147
|
+
context.set_details('Method not implemented!')
|
148
|
+
raise NotImplementedError('Method not implemented!')
|
149
|
+
|
128
150
|
def GetRun(self, request, context):
|
129
151
|
"""Get run details
|
130
152
|
"""
|
@@ -192,11 +214,21 @@ def add_ServerAppIoServicer_to_server(servicer, server):
|
|
192
214
|
request_deserializer=flwr_dot_proto_dot_serverappio__pb2.PushTaskInsRequest.FromString,
|
193
215
|
response_serializer=flwr_dot_proto_dot_serverappio__pb2.PushTaskInsResponse.SerializeToString,
|
194
216
|
),
|
217
|
+
'PushMessages': grpc.unary_unary_rpc_method_handler(
|
218
|
+
servicer.PushMessages,
|
219
|
+
request_deserializer=flwr_dot_proto_dot_serverappio__pb2.PushInsMessagesRequest.FromString,
|
220
|
+
response_serializer=flwr_dot_proto_dot_serverappio__pb2.PushInsMessagesResponse.SerializeToString,
|
221
|
+
),
|
195
222
|
'PullTaskRes': grpc.unary_unary_rpc_method_handler(
|
196
223
|
servicer.PullTaskRes,
|
197
224
|
request_deserializer=flwr_dot_proto_dot_serverappio__pb2.PullTaskResRequest.FromString,
|
198
225
|
response_serializer=flwr_dot_proto_dot_serverappio__pb2.PullTaskResResponse.SerializeToString,
|
199
226
|
),
|
227
|
+
'PullMessages': grpc.unary_unary_rpc_method_handler(
|
228
|
+
servicer.PullMessages,
|
229
|
+
request_deserializer=flwr_dot_proto_dot_serverappio__pb2.PullResMessagesRequest.FromString,
|
230
|
+
response_serializer=flwr_dot_proto_dot_serverappio__pb2.PullResMessagesResponse.SerializeToString,
|
231
|
+
),
|
200
232
|
'GetRun': grpc.unary_unary_rpc_method_handler(
|
201
233
|
servicer.GetRun,
|
202
234
|
request_deserializer=flwr_dot_proto_dot_run__pb2.GetRunRequest.FromString,
|
@@ -324,6 +356,33 @@ class ServerAppIo(object):
|
|
324
356
|
metadata,
|
325
357
|
_registered_method=True)
|
326
358
|
|
359
|
+
@staticmethod
|
360
|
+
def PushMessages(request,
|
361
|
+
target,
|
362
|
+
options=(),
|
363
|
+
channel_credentials=None,
|
364
|
+
call_credentials=None,
|
365
|
+
insecure=False,
|
366
|
+
compression=None,
|
367
|
+
wait_for_ready=None,
|
368
|
+
timeout=None,
|
369
|
+
metadata=None):
|
370
|
+
return grpc.experimental.unary_unary(
|
371
|
+
request,
|
372
|
+
target,
|
373
|
+
'/flwr.proto.ServerAppIo/PushMessages',
|
374
|
+
flwr_dot_proto_dot_serverappio__pb2.PushInsMessagesRequest.SerializeToString,
|
375
|
+
flwr_dot_proto_dot_serverappio__pb2.PushInsMessagesResponse.FromString,
|
376
|
+
options,
|
377
|
+
channel_credentials,
|
378
|
+
insecure,
|
379
|
+
call_credentials,
|
380
|
+
compression,
|
381
|
+
wait_for_ready,
|
382
|
+
timeout,
|
383
|
+
metadata,
|
384
|
+
_registered_method=True)
|
385
|
+
|
327
386
|
@staticmethod
|
328
387
|
def PullTaskRes(request,
|
329
388
|
target,
|
@@ -351,6 +410,33 @@ class ServerAppIo(object):
|
|
351
410
|
metadata,
|
352
411
|
_registered_method=True)
|
353
412
|
|
413
|
+
@staticmethod
|
414
|
+
def PullMessages(request,
|
415
|
+
target,
|
416
|
+
options=(),
|
417
|
+
channel_credentials=None,
|
418
|
+
call_credentials=None,
|
419
|
+
insecure=False,
|
420
|
+
compression=None,
|
421
|
+
wait_for_ready=None,
|
422
|
+
timeout=None,
|
423
|
+
metadata=None):
|
424
|
+
return grpc.experimental.unary_unary(
|
425
|
+
request,
|
426
|
+
target,
|
427
|
+
'/flwr.proto.ServerAppIo/PullMessages',
|
428
|
+
flwr_dot_proto_dot_serverappio__pb2.PullResMessagesRequest.SerializeToString,
|
429
|
+
flwr_dot_proto_dot_serverappio__pb2.PullResMessagesResponse.FromString,
|
430
|
+
options,
|
431
|
+
channel_credentials,
|
432
|
+
insecure,
|
433
|
+
call_credentials,
|
434
|
+
compression,
|
435
|
+
wait_for_ready,
|
436
|
+
timeout,
|
437
|
+
metadata,
|
438
|
+
_registered_method=True)
|
439
|
+
|
354
440
|
@staticmethod
|
355
441
|
def GetRun(request,
|
356
442
|
target,
|
@@ -26,11 +26,19 @@ class ServerAppIoStub:
|
|
26
26
|
flwr.proto.serverappio_pb2.PushTaskInsResponse]
|
27
27
|
"""Create one or more tasks"""
|
28
28
|
|
29
|
+
PushMessages: grpc.UnaryUnaryMultiCallable[
|
30
|
+
flwr.proto.serverappio_pb2.PushInsMessagesRequest,
|
31
|
+
flwr.proto.serverappio_pb2.PushInsMessagesResponse]
|
32
|
+
|
29
33
|
PullTaskRes: grpc.UnaryUnaryMultiCallable[
|
30
34
|
flwr.proto.serverappio_pb2.PullTaskResRequest,
|
31
35
|
flwr.proto.serverappio_pb2.PullTaskResResponse]
|
32
36
|
"""Get task results"""
|
33
37
|
|
38
|
+
PullMessages: grpc.UnaryUnaryMultiCallable[
|
39
|
+
flwr.proto.serverappio_pb2.PullResMessagesRequest,
|
40
|
+
flwr.proto.serverappio_pb2.PullResMessagesResponse]
|
41
|
+
|
34
42
|
GetRun: grpc.UnaryUnaryMultiCallable[
|
35
43
|
flwr.proto.run_pb2.GetRunRequest,
|
36
44
|
flwr.proto.run_pb2.GetRunResponse]
|
@@ -92,6 +100,12 @@ class ServerAppIoServicer(metaclass=abc.ABCMeta):
|
|
92
100
|
"""Create one or more tasks"""
|
93
101
|
pass
|
94
102
|
|
103
|
+
@abc.abstractmethod
|
104
|
+
def PushMessages(self,
|
105
|
+
request: flwr.proto.serverappio_pb2.PushInsMessagesRequest,
|
106
|
+
context: grpc.ServicerContext,
|
107
|
+
) -> flwr.proto.serverappio_pb2.PushInsMessagesResponse: ...
|
108
|
+
|
95
109
|
@abc.abstractmethod
|
96
110
|
def PullTaskRes(self,
|
97
111
|
request: flwr.proto.serverappio_pb2.PullTaskResRequest,
|
@@ -100,6 +114,12 @@ class ServerAppIoServicer(metaclass=abc.ABCMeta):
|
|
100
114
|
"""Get task results"""
|
101
115
|
pass
|
102
116
|
|
117
|
+
@abc.abstractmethod
|
118
|
+
def PullMessages(self,
|
119
|
+
request: flwr.proto.serverappio_pb2.PullResMessagesRequest,
|
120
|
+
context: grpc.ServicerContext,
|
121
|
+
) -> flwr.proto.serverappio_pb2.PullResMessagesResponse: ...
|
122
|
+
|
103
123
|
@abc.abstractmethod
|
104
124
|
def GetRun(self,
|
105
125
|
request: flwr.proto.run_pb2.GetRunRequest,
|
flwr/server/app.py
CHANGED
@@ -265,10 +265,14 @@ def run_superlink() -> None:
|
|
265
265
|
# Obtain certificates
|
266
266
|
certificates = try_obtain_server_certificates(args, args.fleet_api_type)
|
267
267
|
|
268
|
+
# Disable the user auth TLS check if args.disable_oidc_tls_cert_verification is
|
269
|
+
# provided
|
270
|
+
verify_tls_cert = not getattr(args, "disable_oidc_tls_cert_verification", None)
|
271
|
+
|
268
272
|
auth_plugin: Optional[ExecAuthPlugin] = None
|
269
273
|
# Load the auth plugin if the args.user_auth_config is provided
|
270
274
|
if cfg_path := getattr(args, "user_auth_config", None):
|
271
|
-
auth_plugin = _try_obtain_exec_auth_plugin(Path(cfg_path))
|
275
|
+
auth_plugin = _try_obtain_exec_auth_plugin(Path(cfg_path), verify_tls_cert)
|
272
276
|
|
273
277
|
# Initialize StateFactory
|
274
278
|
state_factory = LinkStateFactory(args.database)
|
@@ -619,7 +623,9 @@ def _try_setup_node_authentication(
|
|
619
623
|
)
|
620
624
|
|
621
625
|
|
622
|
-
def _try_obtain_exec_auth_plugin(
|
626
|
+
def _try_obtain_exec_auth_plugin(
|
627
|
+
config_path: Path, verify_tls_cert: bool
|
628
|
+
) -> Optional[ExecAuthPlugin]:
|
623
629
|
# Load YAML file
|
624
630
|
with config_path.open("r", encoding="utf-8") as file:
|
625
631
|
config: dict[str, Any] = yaml.safe_load(file)
|
@@ -632,7 +638,9 @@ def _try_obtain_exec_auth_plugin(config_path: Path) -> Optional[ExecAuthPlugin]:
|
|
632
638
|
try:
|
633
639
|
all_plugins: dict[str, type[ExecAuthPlugin]] = get_exec_auth_plugins()
|
634
640
|
auth_plugin_class = all_plugins[auth_type]
|
635
|
-
return auth_plugin_class(
|
641
|
+
return auth_plugin_class(
|
642
|
+
user_auth_config_path=config_path, verify_tls_cert=verify_tls_cert
|
643
|
+
)
|
636
644
|
except KeyError:
|
637
645
|
if auth_type != "":
|
638
646
|
sys.exit(
|
@@ -16,14 +16,13 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
import threading
|
19
|
-
import time
|
20
19
|
from logging import DEBUG, INFO
|
21
20
|
from typing import Optional
|
22
21
|
from uuid import UUID
|
23
22
|
|
24
23
|
import grpc
|
25
24
|
|
26
|
-
from flwr.common import ConfigsRecord
|
25
|
+
from flwr.common import ConfigsRecord, now
|
27
26
|
from flwr.common.constant import Status
|
28
27
|
from flwr.common.logger import log
|
29
28
|
from flwr.common.serde import (
|
@@ -31,6 +30,10 @@ from flwr.common.serde import (
|
|
31
30
|
context_to_proto,
|
32
31
|
fab_from_proto,
|
33
32
|
fab_to_proto,
|
33
|
+
message_from_proto,
|
34
|
+
message_from_taskres,
|
35
|
+
message_to_proto,
|
36
|
+
message_to_taskins,
|
34
37
|
run_status_from_proto,
|
35
38
|
run_status_to_proto,
|
36
39
|
run_to_proto,
|
@@ -57,10 +60,14 @@ from flwr.proto.run_pb2 import ( # pylint: disable=E0611
|
|
57
60
|
from flwr.proto.serverappio_pb2 import ( # pylint: disable=E0611
|
58
61
|
GetNodesRequest,
|
59
62
|
GetNodesResponse,
|
63
|
+
PullResMessagesRequest,
|
64
|
+
PullResMessagesResponse,
|
60
65
|
PullServerAppInputsRequest,
|
61
66
|
PullServerAppInputsResponse,
|
62
67
|
PullTaskResRequest,
|
63
68
|
PullTaskResResponse,
|
69
|
+
PushInsMessagesRequest,
|
70
|
+
PushInsMessagesResponse,
|
64
71
|
PushServerAppOutputsRequest,
|
65
72
|
PushServerAppOutputsResponse,
|
66
73
|
PushTaskInsRequest,
|
@@ -149,7 +156,7 @@ class ServerAppIoServicer(serverappio_pb2_grpc.ServerAppIoServicer):
|
|
149
156
|
)
|
150
157
|
|
151
158
|
# Set pushed_at (timestamp in seconds)
|
152
|
-
pushed_at =
|
159
|
+
pushed_at = now().timestamp()
|
153
160
|
for task_ins in request.task_ins_list:
|
154
161
|
task_ins.task.pushed_at = pushed_at
|
155
162
|
|
@@ -182,6 +189,59 @@ class ServerAppIoServicer(serverappio_pb2_grpc.ServerAppIoServicer):
|
|
182
189
|
task_ids=[str(task_id) if task_id else "" for task_id in task_ids]
|
183
190
|
)
|
184
191
|
|
192
|
+
def PushMessages(
|
193
|
+
self, request: PushInsMessagesRequest, context: grpc.ServicerContext
|
194
|
+
) -> PushInsMessagesResponse:
|
195
|
+
"""Push a set of Messages."""
|
196
|
+
log(DEBUG, "ServerAppIoServicer.PushMessages")
|
197
|
+
|
198
|
+
# Init state
|
199
|
+
state: LinkState = self.state_factory.state()
|
200
|
+
|
201
|
+
# Abort if the run is not running
|
202
|
+
abort_if(
|
203
|
+
request.run_id,
|
204
|
+
[Status.PENDING, Status.STARTING, Status.FINISHED],
|
205
|
+
state,
|
206
|
+
context,
|
207
|
+
)
|
208
|
+
|
209
|
+
# Set pushed_at (timestamp in seconds)
|
210
|
+
pushed_at = now().timestamp()
|
211
|
+
|
212
|
+
# Validate request and insert in State
|
213
|
+
_raise_if(
|
214
|
+
validation_error=len(request.messages_list) == 0,
|
215
|
+
request_name="PushMessages",
|
216
|
+
detail="`messages_list` must not be empty",
|
217
|
+
)
|
218
|
+
message_ids: list[Optional[UUID]] = []
|
219
|
+
while request.messages_list:
|
220
|
+
message_proto = request.messages_list.pop(0)
|
221
|
+
message = message_from_proto(message_proto=message_proto)
|
222
|
+
task_ins = message_to_taskins(message=message)
|
223
|
+
task_ins.task.pushed_at = pushed_at
|
224
|
+
validation_errors = validate_task_ins_or_res(task_ins)
|
225
|
+
_raise_if(
|
226
|
+
validation_error=bool(validation_errors),
|
227
|
+
request_name="PushMessages",
|
228
|
+
detail=", ".join(validation_errors),
|
229
|
+
)
|
230
|
+
_raise_if(
|
231
|
+
validation_error=request.run_id != task_ins.run_id,
|
232
|
+
request_name="PushMessages",
|
233
|
+
detail="`task_ins` has mismatched `run_id`",
|
234
|
+
)
|
235
|
+
# Store
|
236
|
+
message_id: Optional[UUID] = state.store_task_ins(task_ins=task_ins)
|
237
|
+
message_ids.append(message_id)
|
238
|
+
|
239
|
+
return PushInsMessagesResponse(
|
240
|
+
message_ids=[
|
241
|
+
str(message_id) if message_id else "" for message_id in message_ids
|
242
|
+
]
|
243
|
+
)
|
244
|
+
|
185
245
|
def PullTaskRes(
|
186
246
|
self, request: PullTaskResRequest, context: grpc.ServicerContext
|
187
247
|
) -> PullTaskResResponse:
|
@@ -221,6 +281,52 @@ class ServerAppIoServicer(serverappio_pb2_grpc.ServerAppIoServicer):
|
|
221
281
|
|
222
282
|
return PullTaskResResponse(task_res_list=task_res_list)
|
223
283
|
|
284
|
+
def PullMessages(
|
285
|
+
self, request: PullResMessagesRequest, context: grpc.ServicerContext
|
286
|
+
) -> PullResMessagesResponse:
|
287
|
+
"""Pull a set of Messages."""
|
288
|
+
log(DEBUG, "ServerAppIoServicer.PullMessages")
|
289
|
+
|
290
|
+
# Init state
|
291
|
+
state: LinkState = self.state_factory.state()
|
292
|
+
|
293
|
+
# Abort if the run is not running
|
294
|
+
abort_if(
|
295
|
+
request.run_id,
|
296
|
+
[Status.PENDING, Status.STARTING, Status.FINISHED],
|
297
|
+
state,
|
298
|
+
context,
|
299
|
+
)
|
300
|
+
|
301
|
+
# Convert each task_id str to UUID
|
302
|
+
message_ids: set[UUID] = {
|
303
|
+
UUID(message_id) for message_id in request.message_ids
|
304
|
+
}
|
305
|
+
|
306
|
+
# Read from state
|
307
|
+
task_res_list: list[TaskRes] = state.get_task_res(task_ids=message_ids)
|
308
|
+
|
309
|
+
# Convert to Messages
|
310
|
+
messages_list = []
|
311
|
+
while task_res_list:
|
312
|
+
task_res = task_res_list.pop(0)
|
313
|
+
_raise_if(
|
314
|
+
validation_error=request.run_id != task_res.run_id,
|
315
|
+
request_name="PullMessages",
|
316
|
+
detail="`task_res` has mismatched `run_id`",
|
317
|
+
)
|
318
|
+
message = message_from_taskres(taskres=task_res)
|
319
|
+
messages_list.append(message_to_proto(message))
|
320
|
+
|
321
|
+
# Delete the TaskIns/TaskRes pairs if TaskRes is found
|
322
|
+
task_ins_ids_to_delete = {
|
323
|
+
UUID(task_res.task.ancestry[0]) for task_res in task_res_list
|
324
|
+
}
|
325
|
+
|
326
|
+
state.delete_tasks(task_ins_ids=task_ins_ids_to_delete)
|
327
|
+
|
328
|
+
return PullResMessagesResponse(messages_list=messages_list)
|
329
|
+
|
224
330
|
def GetRun(
|
225
331
|
self, request: GetRunRequest, context: grpc.ServicerContext
|
226
332
|
) -> GetRunResponse:
|
{flwr_nightly-1.15.0.dev20250119.dist-info → flwr_nightly-1.15.0.dev20250120.dist-info}/RECORD
RENAMED
@@ -112,7 +112,7 @@ flwr/common/__init__.py,sha256=TVaoFEJE158aui1TPZQiJCDZX4RNHRyI8I55VC80HhI,3901
|
|
112
112
|
flwr/common/address.py,sha256=9KNYE69WW_QVcyumsux3Qn1wmn4J7f13Y9nHASpvzbA,3018
|
113
113
|
flwr/common/args.py,sha256=bCvtG0hhh_hVjl9NoWsY_g7kLMIN3jCN7B883HvZ7hg,6223
|
114
114
|
flwr/common/auth_plugin/__init__.py,sha256=1Y8Oj3iB49IHDu9tvDih1J74Ygu7k85V9s2A4WORPyA,887
|
115
|
-
flwr/common/auth_plugin/auth_plugin.py,sha256=
|
115
|
+
flwr/common/auth_plugin/auth_plugin.py,sha256=wgDorBUB4IkK6twQ8vNawRVz7BDPmKdXZBNLqhU9RSs,3871
|
116
116
|
flwr/common/config.py,sha256=vmPwtRu7JIoGCke03pJlsyrA6zTlN43flzQx-4AX1mE,8099
|
117
117
|
flwr/common/constant.py,sha256=-YIo0mQS-RExu1pEhWaQZllZxomIAjLYo7F3Zac7wEc,5917
|
118
118
|
flwr/common/context.py,sha256=uJ-mnoC_8y_udEb3kAX-r8CPphNTWM72z1AlsvQEu54,2403
|
@@ -196,10 +196,10 @@ flwr/proto/run_pb2.py,sha256=98ScUqBB5nQCaVnTGIvmK6qvanztkpVL7_Ac0Nb-7xQ,6007
|
|
196
196
|
flwr/proto/run_pb2.pyi,sha256=i6TEwphuFH94_kT2hZWb_RjndLuphkPrT3C2VP-NnVs,11739
|
197
197
|
flwr/proto/run_pb2_grpc.py,sha256=X_9bUyS0nKHTHNGeVxBHuD-LOp8-fi1v9O7gMNyb4Q4,895
|
198
198
|
flwr/proto/run_pb2_grpc.pyi,sha256=ff2TSiLVnG6IVQcTGzb2DIH3XRSoAvAo_RMcvbMFyc0,76
|
199
|
-
flwr/proto/serverappio_pb2.py,sha256=
|
200
|
-
flwr/proto/serverappio_pb2.pyi,sha256=
|
201
|
-
flwr/proto/serverappio_pb2_grpc.py,sha256=
|
202
|
-
flwr/proto/serverappio_pb2_grpc.pyi,sha256=
|
199
|
+
flwr/proto/serverappio_pb2.py,sha256=7nM9VyIfc1LEpfM0skhcRqL-CzDaqvB_nVhjGxfuwR4,6370
|
200
|
+
flwr/proto/serverappio_pb2.pyi,sha256=Ibe5Qw1F2zA0pCCoO4teCUvn7yvju1HZLuugpm1KLDM,9401
|
201
|
+
flwr/proto/serverappio_pb2_grpc.py,sha256=XBGxTLE95hydMffSmity2jR8ZTs_Ygo_WiEI54UF7TM,25506
|
202
|
+
flwr/proto/serverappio_pb2_grpc.pyi,sha256=_7gnTIDL1vO3shpuu32VXPLW1bPPb6tKSo3qXZqjOw4,6004
|
203
203
|
flwr/proto/simulationio_pb2.py,sha256=NsEQUcWnyQMz21LPGW53S7BxThmWsjr54STZNLNKonU,3369
|
204
204
|
flwr/proto/simulationio_pb2.pyi,sha256=oXx8_FLBe5B54wduZj-f89kub73XxNtQbThuW8YfPAs,2660
|
205
205
|
flwr/proto/simulationio_pb2_grpc.py,sha256=KtWe5eXigmfXv3DNoRBgbzfb1QtDCWwo_1uWbDXeT3E,13081
|
@@ -214,7 +214,7 @@ flwr/proto/transport_pb2_grpc.py,sha256=Nvn7oxzm1g1fPiGCGhyKxILDZHYG0CcgjySTzxq-
|
|
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=fhCavxPESfYkiQuxtC80sBDwAe7xf3-tOrFH0pog8z0,32660
|
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
|
@@ -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=BgYsimZqTdUoeUzNF71IfcEi-Nl3Sb2zn2BCcPa_eTM,16402
|
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=X10ILT-AoGMrB3IgI2mBe9i-QcIVUAl9bucuqVOPY
|
|
324
324
|
flwr/superexec/exec_user_auth_interceptor.py,sha256=K06OU-l4LnYhTDg071hGJuOaQWEJbZsYi5qxUmmtiG0,3704
|
325
325
|
flwr/superexec/executor.py,sha256=_B55WW2TD1fBINpabSSDRenVHXYmvlfhv-k8hJKU4lQ,3115
|
326
326
|
flwr/superexec/simulation.py,sha256=WQDon15oqpMopAZnwRZoTICYCfHqtkvFSqiTQ2hLD_g,4088
|
327
|
-
flwr_nightly-1.15.0.
|
328
|
-
flwr_nightly-1.15.0.
|
329
|
-
flwr_nightly-1.15.0.
|
330
|
-
flwr_nightly-1.15.0.
|
331
|
-
flwr_nightly-1.15.0.
|
327
|
+
flwr_nightly-1.15.0.dev20250120.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
328
|
+
flwr_nightly-1.15.0.dev20250120.dist-info/METADATA,sha256=453s8bQi7Lz8qCItA93OEcIedV3ZdOB9EqKm2N8_hBY,15864
|
329
|
+
flwr_nightly-1.15.0.dev20250120.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
330
|
+
flwr_nightly-1.15.0.dev20250120.dist-info/entry_points.txt,sha256=JlNxX3qhaV18_2yj5a3kJW1ESxm31cal9iS_N_pf1Rk,538
|
331
|
+
flwr_nightly-1.15.0.dev20250120.dist-info/RECORD,,
|
{flwr_nightly-1.15.0.dev20250119.dist-info → flwr_nightly-1.15.0.dev20250120.dist-info}/LICENSE
RENAMED
File without changes
|
{flwr_nightly-1.15.0.dev20250119.dist-info → flwr_nightly-1.15.0.dev20250120.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|