flwr-nightly 1.20.0.dev20250716__py3-none-any.whl → 1.20.0.dev20250718__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/inflatable_protobuf_utils.py +40 -0
- flwr/common/inflatable_utils.py +78 -1
- flwr/common/record/array.py +2 -2
- flwr/common/serde.py +0 -28
- flwr/compat/client/app.py +14 -31
- flwr/proto/appio_pb2.py +18 -22
- flwr/proto/appio_pb2.pyi +21 -22
- flwr/proto/clientappio_pb2.py +12 -31
- flwr/proto/clientappio_pb2.pyi +0 -142
- flwr/proto/clientappio_pb2_grpc.py +128 -24
- flwr/proto/clientappio_pb2_grpc.pyi +57 -16
- flwr/server/fleet_event_log_interceptor.py +4 -0
- flwr/server/grid/grpc_grid.py +5 -2
- flwr/server/superlink/fleet/grpc_rere/server_interceptor.py +2 -5
- flwr/server/superlink/serverappio/serverappio_servicer.py +5 -9
- flwr/superexec/exec_event_log_interceptor.py +4 -0
- flwr/superexec/exec_license_interceptor.py +4 -0
- flwr/superexec/exec_user_auth_interceptor.py +4 -0
- flwr/supernode/runtime/run_clientapp.py +21 -15
- flwr/supernode/servicer/clientappio/clientappio_servicer.py +94 -25
- {flwr_nightly-1.20.0.dev20250716.dist-info → flwr_nightly-1.20.0.dev20250718.dist-info}/METADATA +1 -1
- {flwr_nightly-1.20.0.dev20250716.dist-info → flwr_nightly-1.20.0.dev20250718.dist-info}/RECORD +24 -24
- {flwr_nightly-1.20.0.dev20250716.dist-info → flwr_nightly-1.20.0.dev20250718.dist-info}/WHEEL +0 -0
- {flwr_nightly-1.20.0.dev20250716.dist-info → flwr_nightly-1.20.0.dev20250718.dist-info}/entry_points.txt +0 -0
flwr/proto/clientappio_pb2.pyi
CHANGED
@@ -3,35 +3,14 @@
|
|
3
3
|
isort:skip_file
|
4
4
|
"""
|
5
5
|
import builtins
|
6
|
-
import flwr.proto.fab_pb2
|
7
|
-
import flwr.proto.message_pb2
|
8
|
-
import flwr.proto.run_pb2
|
9
6
|
import google.protobuf.descriptor
|
10
7
|
import google.protobuf.internal.containers
|
11
|
-
import google.protobuf.internal.enum_type_wrapper
|
12
8
|
import google.protobuf.message
|
13
9
|
import typing
|
14
10
|
import typing_extensions
|
15
11
|
|
16
12
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
17
13
|
|
18
|
-
class _ClientAppOutputCode:
|
19
|
-
ValueType = typing.NewType('ValueType', builtins.int)
|
20
|
-
V: typing_extensions.TypeAlias = ValueType
|
21
|
-
class _ClientAppOutputCodeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ClientAppOutputCode.ValueType], builtins.type):
|
22
|
-
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
23
|
-
SUCCESS: _ClientAppOutputCode.ValueType # 0
|
24
|
-
DEADLINE_EXCEEDED: _ClientAppOutputCode.ValueType # 1
|
25
|
-
UNKNOWN_ERROR: _ClientAppOutputCode.ValueType # 2
|
26
|
-
class ClientAppOutputCode(_ClientAppOutputCode, metaclass=_ClientAppOutputCodeEnumTypeWrapper):
|
27
|
-
pass
|
28
|
-
|
29
|
-
SUCCESS: ClientAppOutputCode.ValueType # 0
|
30
|
-
DEADLINE_EXCEEDED: ClientAppOutputCode.ValueType # 1
|
31
|
-
UNKNOWN_ERROR: ClientAppOutputCode.ValueType # 2
|
32
|
-
global___ClientAppOutputCode = ClientAppOutputCode
|
33
|
-
|
34
|
-
|
35
14
|
class GetRunIdsWithPendingMessagesRequest(google.protobuf.message.Message):
|
36
15
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
37
16
|
def __init__(self,
|
@@ -73,124 +52,3 @@ class RequestTokenResponse(google.protobuf.message.Message):
|
|
73
52
|
) -> None: ...
|
74
53
|
def ClearField(self, field_name: typing_extensions.Literal["token",b"token"]) -> None: ...
|
75
54
|
global___RequestTokenResponse = RequestTokenResponse
|
76
|
-
|
77
|
-
class ClientAppOutputStatus(google.protobuf.message.Message):
|
78
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
79
|
-
CODE_FIELD_NUMBER: builtins.int
|
80
|
-
MESSAGE_FIELD_NUMBER: builtins.int
|
81
|
-
code: global___ClientAppOutputCode.ValueType
|
82
|
-
message: typing.Text
|
83
|
-
def __init__(self,
|
84
|
-
*,
|
85
|
-
code: global___ClientAppOutputCode.ValueType = ...,
|
86
|
-
message: typing.Text = ...,
|
87
|
-
) -> None: ...
|
88
|
-
def ClearField(self, field_name: typing_extensions.Literal["code",b"code","message",b"message"]) -> None: ...
|
89
|
-
global___ClientAppOutputStatus = ClientAppOutputStatus
|
90
|
-
|
91
|
-
class PullClientAppInputsRequest(google.protobuf.message.Message):
|
92
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
93
|
-
TOKEN_FIELD_NUMBER: builtins.int
|
94
|
-
token: typing.Text
|
95
|
-
def __init__(self,
|
96
|
-
*,
|
97
|
-
token: typing.Text = ...,
|
98
|
-
) -> None: ...
|
99
|
-
def ClearField(self, field_name: typing_extensions.Literal["token",b"token"]) -> None: ...
|
100
|
-
global___PullClientAppInputsRequest = PullClientAppInputsRequest
|
101
|
-
|
102
|
-
class PullClientAppInputsResponse(google.protobuf.message.Message):
|
103
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
104
|
-
CONTEXT_FIELD_NUMBER: builtins.int
|
105
|
-
RUN_FIELD_NUMBER: builtins.int
|
106
|
-
FAB_FIELD_NUMBER: builtins.int
|
107
|
-
@property
|
108
|
-
def context(self) -> flwr.proto.message_pb2.Context: ...
|
109
|
-
@property
|
110
|
-
def run(self) -> flwr.proto.run_pb2.Run: ...
|
111
|
-
@property
|
112
|
-
def fab(self) -> flwr.proto.fab_pb2.Fab: ...
|
113
|
-
def __init__(self,
|
114
|
-
*,
|
115
|
-
context: typing.Optional[flwr.proto.message_pb2.Context] = ...,
|
116
|
-
run: typing.Optional[flwr.proto.run_pb2.Run] = ...,
|
117
|
-
fab: typing.Optional[flwr.proto.fab_pb2.Fab] = ...,
|
118
|
-
) -> None: ...
|
119
|
-
def HasField(self, field_name: typing_extensions.Literal["context",b"context","fab",b"fab","run",b"run"]) -> builtins.bool: ...
|
120
|
-
def ClearField(self, field_name: typing_extensions.Literal["context",b"context","fab",b"fab","run",b"run"]) -> None: ...
|
121
|
-
global___PullClientAppInputsResponse = PullClientAppInputsResponse
|
122
|
-
|
123
|
-
class PushClientAppOutputsRequest(google.protobuf.message.Message):
|
124
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
125
|
-
TOKEN_FIELD_NUMBER: builtins.int
|
126
|
-
CONTEXT_FIELD_NUMBER: builtins.int
|
127
|
-
token: typing.Text
|
128
|
-
@property
|
129
|
-
def context(self) -> flwr.proto.message_pb2.Context: ...
|
130
|
-
def __init__(self,
|
131
|
-
*,
|
132
|
-
token: typing.Text = ...,
|
133
|
-
context: typing.Optional[flwr.proto.message_pb2.Context] = ...,
|
134
|
-
) -> None: ...
|
135
|
-
def HasField(self, field_name: typing_extensions.Literal["context",b"context"]) -> builtins.bool: ...
|
136
|
-
def ClearField(self, field_name: typing_extensions.Literal["context",b"context","token",b"token"]) -> None: ...
|
137
|
-
global___PushClientAppOutputsRequest = PushClientAppOutputsRequest
|
138
|
-
|
139
|
-
class PushClientAppOutputsResponse(google.protobuf.message.Message):
|
140
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
141
|
-
STATUS_FIELD_NUMBER: builtins.int
|
142
|
-
@property
|
143
|
-
def status(self) -> global___ClientAppOutputStatus: ...
|
144
|
-
def __init__(self,
|
145
|
-
*,
|
146
|
-
status: typing.Optional[global___ClientAppOutputStatus] = ...,
|
147
|
-
) -> None: ...
|
148
|
-
def HasField(self, field_name: typing_extensions.Literal["status",b"status"]) -> builtins.bool: ...
|
149
|
-
def ClearField(self, field_name: typing_extensions.Literal["status",b"status"]) -> None: ...
|
150
|
-
global___PushClientAppOutputsResponse = PushClientAppOutputsResponse
|
151
|
-
|
152
|
-
class PullMessageRequest(google.protobuf.message.Message):
|
153
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
154
|
-
TOKEN_FIELD_NUMBER: builtins.int
|
155
|
-
token: typing.Text
|
156
|
-
def __init__(self,
|
157
|
-
*,
|
158
|
-
token: typing.Text = ...,
|
159
|
-
) -> None: ...
|
160
|
-
def ClearField(self, field_name: typing_extensions.Literal["token",b"token"]) -> None: ...
|
161
|
-
global___PullMessageRequest = PullMessageRequest
|
162
|
-
|
163
|
-
class PullMessageResponse(google.protobuf.message.Message):
|
164
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
165
|
-
MESSAGE_FIELD_NUMBER: builtins.int
|
166
|
-
@property
|
167
|
-
def message(self) -> flwr.proto.message_pb2.Message: ...
|
168
|
-
def __init__(self,
|
169
|
-
*,
|
170
|
-
message: typing.Optional[flwr.proto.message_pb2.Message] = ...,
|
171
|
-
) -> None: ...
|
172
|
-
def HasField(self, field_name: typing_extensions.Literal["message",b"message"]) -> builtins.bool: ...
|
173
|
-
def ClearField(self, field_name: typing_extensions.Literal["message",b"message"]) -> None: ...
|
174
|
-
global___PullMessageResponse = PullMessageResponse
|
175
|
-
|
176
|
-
class PushMessageRequest(google.protobuf.message.Message):
|
177
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
178
|
-
TOKEN_FIELD_NUMBER: builtins.int
|
179
|
-
MESSAGE_FIELD_NUMBER: builtins.int
|
180
|
-
token: typing.Text
|
181
|
-
@property
|
182
|
-
def message(self) -> flwr.proto.message_pb2.Message: ...
|
183
|
-
def __init__(self,
|
184
|
-
*,
|
185
|
-
token: typing.Text = ...,
|
186
|
-
message: typing.Optional[flwr.proto.message_pb2.Message] = ...,
|
187
|
-
) -> None: ...
|
188
|
-
def HasField(self, field_name: typing_extensions.Literal["message",b"message"]) -> builtins.bool: ...
|
189
|
-
def ClearField(self, field_name: typing_extensions.Literal["message",b"message","token",b"token"]) -> None: ...
|
190
|
-
global___PushMessageRequest = PushMessageRequest
|
191
|
-
|
192
|
-
class PushMessageResponse(google.protobuf.message.Message):
|
193
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
194
|
-
def __init__(self,
|
195
|
-
) -> None: ...
|
196
|
-
global___PushMessageResponse = PushMessageResponse
|
@@ -2,7 +2,9 @@
|
|
2
2
|
"""Client and server classes corresponding to protobuf-defined services."""
|
3
3
|
import grpc
|
4
4
|
|
5
|
+
from flwr.proto import appio_pb2 as flwr_dot_proto_dot_appio__pb2
|
5
6
|
from flwr.proto import clientappio_pb2 as flwr_dot_proto_dot_clientappio__pb2
|
7
|
+
from flwr.proto import message_pb2 as flwr_dot_proto_dot_message__pb2
|
6
8
|
|
7
9
|
|
8
10
|
class ClientAppIoStub(object):
|
@@ -26,23 +28,38 @@ class ClientAppIoStub(object):
|
|
26
28
|
)
|
27
29
|
self.PullClientAppInputs = channel.unary_unary(
|
28
30
|
'/flwr.proto.ClientAppIo/PullClientAppInputs',
|
29
|
-
request_serializer=
|
30
|
-
response_deserializer=
|
31
|
+
request_serializer=flwr_dot_proto_dot_appio__pb2.PullAppInputsRequest.SerializeToString,
|
32
|
+
response_deserializer=flwr_dot_proto_dot_appio__pb2.PullAppInputsResponse.FromString,
|
31
33
|
)
|
32
34
|
self.PushClientAppOutputs = channel.unary_unary(
|
33
35
|
'/flwr.proto.ClientAppIo/PushClientAppOutputs',
|
34
|
-
request_serializer=
|
35
|
-
response_deserializer=
|
36
|
+
request_serializer=flwr_dot_proto_dot_appio__pb2.PushAppOutputsRequest.SerializeToString,
|
37
|
+
response_deserializer=flwr_dot_proto_dot_appio__pb2.PushAppOutputsResponse.FromString,
|
36
38
|
)
|
37
39
|
self.PushMessage = channel.unary_unary(
|
38
40
|
'/flwr.proto.ClientAppIo/PushMessage',
|
39
|
-
request_serializer=
|
40
|
-
response_deserializer=
|
41
|
+
request_serializer=flwr_dot_proto_dot_appio__pb2.PushAppMessagesRequest.SerializeToString,
|
42
|
+
response_deserializer=flwr_dot_proto_dot_appio__pb2.PushAppMessagesResponse.FromString,
|
41
43
|
)
|
42
44
|
self.PullMessage = channel.unary_unary(
|
43
45
|
'/flwr.proto.ClientAppIo/PullMessage',
|
44
|
-
request_serializer=
|
45
|
-
response_deserializer=
|
46
|
+
request_serializer=flwr_dot_proto_dot_appio__pb2.PullAppMessagesRequest.SerializeToString,
|
47
|
+
response_deserializer=flwr_dot_proto_dot_appio__pb2.PullAppMessagesResponse.FromString,
|
48
|
+
)
|
49
|
+
self.PushObject = channel.unary_unary(
|
50
|
+
'/flwr.proto.ClientAppIo/PushObject',
|
51
|
+
request_serializer=flwr_dot_proto_dot_message__pb2.PushObjectRequest.SerializeToString,
|
52
|
+
response_deserializer=flwr_dot_proto_dot_message__pb2.PushObjectResponse.FromString,
|
53
|
+
)
|
54
|
+
self.PullObject = channel.unary_unary(
|
55
|
+
'/flwr.proto.ClientAppIo/PullObject',
|
56
|
+
request_serializer=flwr_dot_proto_dot_message__pb2.PullObjectRequest.SerializeToString,
|
57
|
+
response_deserializer=flwr_dot_proto_dot_message__pb2.PullObjectResponse.FromString,
|
58
|
+
)
|
59
|
+
self.ConfirmMessageReceived = channel.unary_unary(
|
60
|
+
'/flwr.proto.ClientAppIo/ConfirmMessageReceived',
|
61
|
+
request_serializer=flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedRequest.SerializeToString,
|
62
|
+
response_deserializer=flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedResponse.FromString,
|
46
63
|
)
|
47
64
|
|
48
65
|
|
@@ -91,6 +108,27 @@ class ClientAppIoServicer(object):
|
|
91
108
|
context.set_details('Method not implemented!')
|
92
109
|
raise NotImplementedError('Method not implemented!')
|
93
110
|
|
111
|
+
def PushObject(self, request, context):
|
112
|
+
"""Push Object
|
113
|
+
"""
|
114
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
115
|
+
context.set_details('Method not implemented!')
|
116
|
+
raise NotImplementedError('Method not implemented!')
|
117
|
+
|
118
|
+
def PullObject(self, request, context):
|
119
|
+
"""Pull Object
|
120
|
+
"""
|
121
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
122
|
+
context.set_details('Method not implemented!')
|
123
|
+
raise NotImplementedError('Method not implemented!')
|
124
|
+
|
125
|
+
def ConfirmMessageReceived(self, request, context):
|
126
|
+
"""Confirm Message Received
|
127
|
+
"""
|
128
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
129
|
+
context.set_details('Method not implemented!')
|
130
|
+
raise NotImplementedError('Method not implemented!')
|
131
|
+
|
94
132
|
|
95
133
|
def add_ClientAppIoServicer_to_server(servicer, server):
|
96
134
|
rpc_method_handlers = {
|
@@ -106,23 +144,38 @@ def add_ClientAppIoServicer_to_server(servicer, server):
|
|
106
144
|
),
|
107
145
|
'PullClientAppInputs': grpc.unary_unary_rpc_method_handler(
|
108
146
|
servicer.PullClientAppInputs,
|
109
|
-
request_deserializer=
|
110
|
-
response_serializer=
|
147
|
+
request_deserializer=flwr_dot_proto_dot_appio__pb2.PullAppInputsRequest.FromString,
|
148
|
+
response_serializer=flwr_dot_proto_dot_appio__pb2.PullAppInputsResponse.SerializeToString,
|
111
149
|
),
|
112
150
|
'PushClientAppOutputs': grpc.unary_unary_rpc_method_handler(
|
113
151
|
servicer.PushClientAppOutputs,
|
114
|
-
request_deserializer=
|
115
|
-
response_serializer=
|
152
|
+
request_deserializer=flwr_dot_proto_dot_appio__pb2.PushAppOutputsRequest.FromString,
|
153
|
+
response_serializer=flwr_dot_proto_dot_appio__pb2.PushAppOutputsResponse.SerializeToString,
|
116
154
|
),
|
117
155
|
'PushMessage': grpc.unary_unary_rpc_method_handler(
|
118
156
|
servicer.PushMessage,
|
119
|
-
request_deserializer=
|
120
|
-
response_serializer=
|
157
|
+
request_deserializer=flwr_dot_proto_dot_appio__pb2.PushAppMessagesRequest.FromString,
|
158
|
+
response_serializer=flwr_dot_proto_dot_appio__pb2.PushAppMessagesResponse.SerializeToString,
|
121
159
|
),
|
122
160
|
'PullMessage': grpc.unary_unary_rpc_method_handler(
|
123
161
|
servicer.PullMessage,
|
124
|
-
request_deserializer=
|
125
|
-
response_serializer=
|
162
|
+
request_deserializer=flwr_dot_proto_dot_appio__pb2.PullAppMessagesRequest.FromString,
|
163
|
+
response_serializer=flwr_dot_proto_dot_appio__pb2.PullAppMessagesResponse.SerializeToString,
|
164
|
+
),
|
165
|
+
'PushObject': grpc.unary_unary_rpc_method_handler(
|
166
|
+
servicer.PushObject,
|
167
|
+
request_deserializer=flwr_dot_proto_dot_message__pb2.PushObjectRequest.FromString,
|
168
|
+
response_serializer=flwr_dot_proto_dot_message__pb2.PushObjectResponse.SerializeToString,
|
169
|
+
),
|
170
|
+
'PullObject': grpc.unary_unary_rpc_method_handler(
|
171
|
+
servicer.PullObject,
|
172
|
+
request_deserializer=flwr_dot_proto_dot_message__pb2.PullObjectRequest.FromString,
|
173
|
+
response_serializer=flwr_dot_proto_dot_message__pb2.PullObjectResponse.SerializeToString,
|
174
|
+
),
|
175
|
+
'ConfirmMessageReceived': grpc.unary_unary_rpc_method_handler(
|
176
|
+
servicer.ConfirmMessageReceived,
|
177
|
+
request_deserializer=flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedRequest.FromString,
|
178
|
+
response_serializer=flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedResponse.SerializeToString,
|
126
179
|
),
|
127
180
|
}
|
128
181
|
generic_handler = grpc.method_handlers_generic_handler(
|
@@ -180,8 +233,8 @@ class ClientAppIo(object):
|
|
180
233
|
timeout=None,
|
181
234
|
metadata=None):
|
182
235
|
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ClientAppIo/PullClientAppInputs',
|
183
|
-
|
184
|
-
|
236
|
+
flwr_dot_proto_dot_appio__pb2.PullAppInputsRequest.SerializeToString,
|
237
|
+
flwr_dot_proto_dot_appio__pb2.PullAppInputsResponse.FromString,
|
185
238
|
options, channel_credentials,
|
186
239
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
187
240
|
|
@@ -197,8 +250,8 @@ class ClientAppIo(object):
|
|
197
250
|
timeout=None,
|
198
251
|
metadata=None):
|
199
252
|
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ClientAppIo/PushClientAppOutputs',
|
200
|
-
|
201
|
-
|
253
|
+
flwr_dot_proto_dot_appio__pb2.PushAppOutputsRequest.SerializeToString,
|
254
|
+
flwr_dot_proto_dot_appio__pb2.PushAppOutputsResponse.FromString,
|
202
255
|
options, channel_credentials,
|
203
256
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
204
257
|
|
@@ -214,8 +267,8 @@ class ClientAppIo(object):
|
|
214
267
|
timeout=None,
|
215
268
|
metadata=None):
|
216
269
|
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ClientAppIo/PushMessage',
|
217
|
-
|
218
|
-
|
270
|
+
flwr_dot_proto_dot_appio__pb2.PushAppMessagesRequest.SerializeToString,
|
271
|
+
flwr_dot_proto_dot_appio__pb2.PushAppMessagesResponse.FromString,
|
219
272
|
options, channel_credentials,
|
220
273
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
221
274
|
|
@@ -231,7 +284,58 @@ class ClientAppIo(object):
|
|
231
284
|
timeout=None,
|
232
285
|
metadata=None):
|
233
286
|
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ClientAppIo/PullMessage',
|
234
|
-
|
235
|
-
|
287
|
+
flwr_dot_proto_dot_appio__pb2.PullAppMessagesRequest.SerializeToString,
|
288
|
+
flwr_dot_proto_dot_appio__pb2.PullAppMessagesResponse.FromString,
|
289
|
+
options, channel_credentials,
|
290
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
291
|
+
|
292
|
+
@staticmethod
|
293
|
+
def PushObject(request,
|
294
|
+
target,
|
295
|
+
options=(),
|
296
|
+
channel_credentials=None,
|
297
|
+
call_credentials=None,
|
298
|
+
insecure=False,
|
299
|
+
compression=None,
|
300
|
+
wait_for_ready=None,
|
301
|
+
timeout=None,
|
302
|
+
metadata=None):
|
303
|
+
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ClientAppIo/PushObject',
|
304
|
+
flwr_dot_proto_dot_message__pb2.PushObjectRequest.SerializeToString,
|
305
|
+
flwr_dot_proto_dot_message__pb2.PushObjectResponse.FromString,
|
306
|
+
options, channel_credentials,
|
307
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
308
|
+
|
309
|
+
@staticmethod
|
310
|
+
def PullObject(request,
|
311
|
+
target,
|
312
|
+
options=(),
|
313
|
+
channel_credentials=None,
|
314
|
+
call_credentials=None,
|
315
|
+
insecure=False,
|
316
|
+
compression=None,
|
317
|
+
wait_for_ready=None,
|
318
|
+
timeout=None,
|
319
|
+
metadata=None):
|
320
|
+
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ClientAppIo/PullObject',
|
321
|
+
flwr_dot_proto_dot_message__pb2.PullObjectRequest.SerializeToString,
|
322
|
+
flwr_dot_proto_dot_message__pb2.PullObjectResponse.FromString,
|
323
|
+
options, channel_credentials,
|
324
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
325
|
+
|
326
|
+
@staticmethod
|
327
|
+
def ConfirmMessageReceived(request,
|
328
|
+
target,
|
329
|
+
options=(),
|
330
|
+
channel_credentials=None,
|
331
|
+
call_credentials=None,
|
332
|
+
insecure=False,
|
333
|
+
compression=None,
|
334
|
+
wait_for_ready=None,
|
335
|
+
timeout=None,
|
336
|
+
metadata=None):
|
337
|
+
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ClientAppIo/ConfirmMessageReceived',
|
338
|
+
flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedRequest.SerializeToString,
|
339
|
+
flwr_dot_proto_dot_message__pb2.ConfirmMessageReceivedResponse.FromString,
|
236
340
|
options, channel_credentials,
|
237
341
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
@@ -3,7 +3,9 @@
|
|
3
3
|
isort:skip_file
|
4
4
|
"""
|
5
5
|
import abc
|
6
|
+
import flwr.proto.appio_pb2
|
6
7
|
import flwr.proto.clientappio_pb2
|
8
|
+
import flwr.proto.message_pb2
|
7
9
|
import grpc
|
8
10
|
|
9
11
|
class ClientAppIoStub:
|
@@ -19,25 +21,40 @@ class ClientAppIoStub:
|
|
19
21
|
"""Request token"""
|
20
22
|
|
21
23
|
PullClientAppInputs: grpc.UnaryUnaryMultiCallable[
|
22
|
-
flwr.proto.
|
23
|
-
flwr.proto.
|
24
|
+
flwr.proto.appio_pb2.PullAppInputsRequest,
|
25
|
+
flwr.proto.appio_pb2.PullAppInputsResponse]
|
24
26
|
"""Pull client app inputs"""
|
25
27
|
|
26
28
|
PushClientAppOutputs: grpc.UnaryUnaryMultiCallable[
|
27
|
-
flwr.proto.
|
28
|
-
flwr.proto.
|
29
|
+
flwr.proto.appio_pb2.PushAppOutputsRequest,
|
30
|
+
flwr.proto.appio_pb2.PushAppOutputsResponse]
|
29
31
|
"""Push client app outputs"""
|
30
32
|
|
31
33
|
PushMessage: grpc.UnaryUnaryMultiCallable[
|
32
|
-
flwr.proto.
|
33
|
-
flwr.proto.
|
34
|
+
flwr.proto.appio_pb2.PushAppMessagesRequest,
|
35
|
+
flwr.proto.appio_pb2.PushAppMessagesResponse]
|
34
36
|
"""Push Message"""
|
35
37
|
|
36
38
|
PullMessage: grpc.UnaryUnaryMultiCallable[
|
37
|
-
flwr.proto.
|
38
|
-
flwr.proto.
|
39
|
+
flwr.proto.appio_pb2.PullAppMessagesRequest,
|
40
|
+
flwr.proto.appio_pb2.PullAppMessagesResponse]
|
39
41
|
"""Pull Message"""
|
40
42
|
|
43
|
+
PushObject: grpc.UnaryUnaryMultiCallable[
|
44
|
+
flwr.proto.message_pb2.PushObjectRequest,
|
45
|
+
flwr.proto.message_pb2.PushObjectResponse]
|
46
|
+
"""Push Object"""
|
47
|
+
|
48
|
+
PullObject: grpc.UnaryUnaryMultiCallable[
|
49
|
+
flwr.proto.message_pb2.PullObjectRequest,
|
50
|
+
flwr.proto.message_pb2.PullObjectResponse]
|
51
|
+
"""Pull Object"""
|
52
|
+
|
53
|
+
ConfirmMessageReceived: grpc.UnaryUnaryMultiCallable[
|
54
|
+
flwr.proto.message_pb2.ConfirmMessageReceivedRequest,
|
55
|
+
flwr.proto.message_pb2.ConfirmMessageReceivedResponse]
|
56
|
+
"""Confirm Message Received"""
|
57
|
+
|
41
58
|
|
42
59
|
class ClientAppIoServicer(metaclass=abc.ABCMeta):
|
43
60
|
@abc.abstractmethod
|
@@ -58,35 +75,59 @@ class ClientAppIoServicer(metaclass=abc.ABCMeta):
|
|
58
75
|
|
59
76
|
@abc.abstractmethod
|
60
77
|
def PullClientAppInputs(self,
|
61
|
-
request: flwr.proto.
|
78
|
+
request: flwr.proto.appio_pb2.PullAppInputsRequest,
|
62
79
|
context: grpc.ServicerContext,
|
63
|
-
) -> flwr.proto.
|
80
|
+
) -> flwr.proto.appio_pb2.PullAppInputsResponse:
|
64
81
|
"""Pull client app inputs"""
|
65
82
|
pass
|
66
83
|
|
67
84
|
@abc.abstractmethod
|
68
85
|
def PushClientAppOutputs(self,
|
69
|
-
request: flwr.proto.
|
86
|
+
request: flwr.proto.appio_pb2.PushAppOutputsRequest,
|
70
87
|
context: grpc.ServicerContext,
|
71
|
-
) -> flwr.proto.
|
88
|
+
) -> flwr.proto.appio_pb2.PushAppOutputsResponse:
|
72
89
|
"""Push client app outputs"""
|
73
90
|
pass
|
74
91
|
|
75
92
|
@abc.abstractmethod
|
76
93
|
def PushMessage(self,
|
77
|
-
request: flwr.proto.
|
94
|
+
request: flwr.proto.appio_pb2.PushAppMessagesRequest,
|
78
95
|
context: grpc.ServicerContext,
|
79
|
-
) -> flwr.proto.
|
96
|
+
) -> flwr.proto.appio_pb2.PushAppMessagesResponse:
|
80
97
|
"""Push Message"""
|
81
98
|
pass
|
82
99
|
|
83
100
|
@abc.abstractmethod
|
84
101
|
def PullMessage(self,
|
85
|
-
request: flwr.proto.
|
102
|
+
request: flwr.proto.appio_pb2.PullAppMessagesRequest,
|
86
103
|
context: grpc.ServicerContext,
|
87
|
-
) -> flwr.proto.
|
104
|
+
) -> flwr.proto.appio_pb2.PullAppMessagesResponse:
|
88
105
|
"""Pull Message"""
|
89
106
|
pass
|
90
107
|
|
108
|
+
@abc.abstractmethod
|
109
|
+
def PushObject(self,
|
110
|
+
request: flwr.proto.message_pb2.PushObjectRequest,
|
111
|
+
context: grpc.ServicerContext,
|
112
|
+
) -> flwr.proto.message_pb2.PushObjectResponse:
|
113
|
+
"""Push Object"""
|
114
|
+
pass
|
115
|
+
|
116
|
+
@abc.abstractmethod
|
117
|
+
def PullObject(self,
|
118
|
+
request: flwr.proto.message_pb2.PullObjectRequest,
|
119
|
+
context: grpc.ServicerContext,
|
120
|
+
) -> flwr.proto.message_pb2.PullObjectResponse:
|
121
|
+
"""Pull Object"""
|
122
|
+
pass
|
123
|
+
|
124
|
+
@abc.abstractmethod
|
125
|
+
def ConfirmMessageReceived(self,
|
126
|
+
request: flwr.proto.message_pb2.ConfirmMessageReceivedRequest,
|
127
|
+
context: grpc.ServicerContext,
|
128
|
+
) -> flwr.proto.message_pb2.ConfirmMessageReceivedResponse:
|
129
|
+
"""Confirm Message Received"""
|
130
|
+
pass
|
131
|
+
|
91
132
|
|
92
133
|
def add_ClientAppIoServicer_to_server(servicer: ClientAppIoServicer, server: grpc.Server) -> None: ...
|
@@ -41,6 +41,10 @@ class FleetEventLogInterceptor(grpc.ServerInterceptor): # type: ignore
|
|
41
41
|
if event logger is enabled on the SuperLink, else, terminate RPC call by setting
|
42
42
|
context to abort.
|
43
43
|
"""
|
44
|
+
# Only apply to Fleet service
|
45
|
+
if not handler_call_details.method.startswith("/flwr.proto.Fleet/"):
|
46
|
+
return continuation(handler_call_details)
|
47
|
+
|
44
48
|
# One of the method handlers in
|
45
49
|
# `flwr.server.superlink.fleet.grpc_rere.fleet_servicer.FleetServicer`
|
46
50
|
method_handler: grpc.RpcMethodHandler = continuation(handler_call_details)
|
flwr/server/grid/grpc_grid.py
CHANGED
@@ -31,6 +31,7 @@ from flwr.common.grpc import create_channel, on_channel_state_change
|
|
31
31
|
from flwr.common.inflatable import (
|
32
32
|
get_all_nested_objects,
|
33
33
|
get_object_tree,
|
34
|
+
iterate_object_tree,
|
34
35
|
no_object_id_recompute,
|
35
36
|
)
|
36
37
|
from flwr.common.inflatable_protobuf_utils import (
|
@@ -304,10 +305,12 @@ class GrpcGrid(Grid):
|
|
304
305
|
)
|
305
306
|
# Pull Messages from store
|
306
307
|
inflated_msgs: list[Message] = []
|
307
|
-
for msg_proto in res.messages_list:
|
308
|
+
for msg_proto, msg_tree in zip(res.messages_list, res.message_object_trees):
|
308
309
|
msg_id = msg_proto.metadata.message_id
|
309
310
|
all_object_contents = pull_objects(
|
310
|
-
|
311
|
+
object_ids=[
|
312
|
+
tree.object_id for tree in iterate_object_tree(msg_tree)
|
313
|
+
],
|
311
314
|
pull_object_fn=make_pull_object_fn_protobuf(
|
312
315
|
pull_object_protobuf=self._stub.PullObject,
|
313
316
|
node=self.node,
|
@@ -81,12 +81,9 @@ class AuthenticateServerInterceptor(grpc.ServerInterceptor): # type: ignore
|
|
81
81
|
metadata sent by the node. Continue RPC call if node is authenticated, else,
|
82
82
|
terminate RPC call by setting context to abort.
|
83
83
|
"""
|
84
|
-
#
|
84
|
+
# Only apply to Fleet service
|
85
85
|
if not handler_call_details.method.startswith("/flwr.proto.Fleet/"):
|
86
|
-
return
|
87
|
-
"This request should be sent to a different service.",
|
88
|
-
grpc.StatusCode.FAILED_PRECONDITION,
|
89
|
-
)
|
86
|
+
return continuation(handler_call_details)
|
90
87
|
|
91
88
|
state = self.state_factory.state()
|
92
89
|
metadata_dict = dict(handler_call_details.invocation_metadata)
|
@@ -27,7 +27,6 @@ from flwr.common.inflatable import (
|
|
27
27
|
UnexpectedObjectContentError,
|
28
28
|
get_all_nested_objects,
|
29
29
|
get_object_tree,
|
30
|
-
iterate_object_tree,
|
31
30
|
no_object_id_recompute,
|
32
31
|
)
|
33
32
|
from flwr.common.logger import log
|
@@ -65,7 +64,6 @@ from flwr.proto.log_pb2 import ( # pylint: disable=E0611
|
|
65
64
|
from flwr.proto.message_pb2 import ( # pylint: disable=E0611
|
66
65
|
ConfirmMessageReceivedRequest,
|
67
66
|
ConfirmMessageReceivedResponse,
|
68
|
-
ObjectIDs,
|
69
67
|
PullObjectRequest,
|
70
68
|
PullObjectResponse,
|
71
69
|
PushObjectRequest,
|
@@ -227,7 +225,7 @@ class ServerAppIoServicer(serverappio_pb2_grpc.ServerAppIoServicer):
|
|
227
225
|
|
228
226
|
# Convert Messages to proto
|
229
227
|
messages_list = []
|
230
|
-
|
228
|
+
trees = []
|
231
229
|
while messages_res:
|
232
230
|
msg = messages_res.pop(0)
|
233
231
|
|
@@ -238,22 +236,20 @@ class ServerAppIoServicer(serverappio_pb2_grpc.ServerAppIoServicer):
|
|
238
236
|
request_name="PullMessages",
|
239
237
|
detail="`message.metadata` has mismatched `run_id`",
|
240
238
|
)
|
241
|
-
messages_list.append(message_to_proto(msg))
|
242
239
|
|
243
240
|
try:
|
244
241
|
msg_object_id = msg.metadata.message_id
|
245
242
|
obj_tree = store.get_object_tree(msg_object_id)
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
objects_to_pull[msg_object_id] = ObjectIDs(object_ids=descendants)
|
243
|
+
# Add message and object tree to the response
|
244
|
+
messages_list.append(message_to_proto(msg))
|
245
|
+
trees.append(obj_tree)
|
250
246
|
except NoObjectInStoreError as e:
|
251
247
|
log(ERROR, e.message)
|
252
248
|
# Delete message ins from state
|
253
249
|
state.delete_messages(message_ins_ids={msg_object_id})
|
254
250
|
|
255
251
|
return PullAppMessagesResponse(
|
256
|
-
messages_list=messages_list,
|
252
|
+
messages_list=messages_list, message_object_trees=trees
|
257
253
|
)
|
258
254
|
|
259
255
|
def GetRun(
|
@@ -44,6 +44,10 @@ class ExecEventLogInterceptor(grpc.ServerInterceptor): # type: ignore
|
|
44
44
|
Continue RPC call if event logger is enabled on the SuperLink, else, terminate
|
45
45
|
RPC call by setting context to abort.
|
46
46
|
"""
|
47
|
+
# Only apply to Exec service
|
48
|
+
if not handler_call_details.method.startswith("/flwr.proto.Exec/"):
|
49
|
+
return continuation(handler_call_details)
|
50
|
+
|
47
51
|
# One of the method handlers in
|
48
52
|
# `flwr.superexec.exec_servicer.ExecServicer`
|
49
53
|
method_handler: grpc.RpcMethodHandler = continuation(handler_call_details)
|
@@ -42,6 +42,10 @@ class ExecLicenseInterceptor(grpc.ServerInterceptor): # type: ignore
|
|
42
42
|
Continue RPC call if license check is enabled and passes, else, terminate RPC
|
43
43
|
call by setting context to abort.
|
44
44
|
"""
|
45
|
+
# Only apply to Exec service
|
46
|
+
if not handler_call_details.method.startswith("/flwr.proto.Exec/"):
|
47
|
+
return continuation(handler_call_details)
|
48
|
+
|
45
49
|
# One of the method handlers in
|
46
50
|
# `flwr.superexec.exec_servicer.ExecServicer`
|
47
51
|
method_handler: grpc.RpcMethodHandler = continuation(handler_call_details)
|
@@ -72,6 +72,10 @@ class ExecUserAuthInterceptor(grpc.ServerInterceptor): # type: ignore
|
|
72
72
|
by validating auth metadata sent by the user. Continue RPC call if user is
|
73
73
|
authenticated, else, terminate RPC call by setting context to abort.
|
74
74
|
"""
|
75
|
+
# Only apply to Exec service
|
76
|
+
if not handler_call_details.method.startswith("/flwr.proto.Exec/"):
|
77
|
+
return continuation(handler_call_details)
|
78
|
+
|
75
79
|
# One of the method handlers in
|
76
80
|
# `flwr.superexec.exec_servicer.ExecServicer`
|
77
81
|
method_handler: grpc.RpcMethodHandler = continuation(handler_call_details)
|