flwr-nightly 1.19.0.dev20250601__py3-none-any.whl → 1.19.0.dev20250603__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/client/clientapp/__init__.py +0 -7
- flwr/client/grpc_rere_client/connection.py +9 -18
- flwr/common/inflatable.py +8 -2
- flwr/common/inflatable_grpc_utils.py +9 -5
- flwr/common/record/configrecord.py +9 -8
- flwr/common/record/metricrecord.py +6 -5
- flwr/common/retry_invoker.py +5 -1
- flwr/common/serde.py +39 -28
- flwr/common/serde_utils.py +2 -0
- flwr/proto/message_pb2.py +8 -8
- flwr/proto/message_pb2.pyi +20 -3
- flwr/proto/recorddict_pb2.py +16 -28
- flwr/proto/recorddict_pb2.pyi +46 -64
- flwr/server/superlink/fleet/grpc_rere/fleet_servicer.py +62 -5
- flwr/server/superlink/fleet/rest_rere/rest_api.py +2 -2
- flwr/server/superlink/serverappio/serverappio_servicer.py +58 -3
- flwr/supernode/cli/__init__.py +5 -1
- flwr/supernode/cli/flower_supernode.py +1 -2
- flwr/supernode/cli/flwr_clientapp.py +73 -0
- flwr/supernode/nodestate/in_memory_nodestate.py +112 -0
- flwr/supernode/nodestate/nodestate.py +132 -6
- flwr/supernode/runtime/__init__.py +15 -0
- flwr/{client/clientapp/app.py → supernode/runtime/run_clientapp.py} +2 -54
- flwr/supernode/servicer/__init__.py +15 -0
- flwr/supernode/servicer/clientappio/__init__.py +24 -0
- flwr/supernode/start_client_internal.py +24 -20
- {flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250603.dist-info}/METADATA +1 -1
- {flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250603.dist-info}/RECORD +31 -27
- {flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250603.dist-info}/entry_points.txt +1 -1
- /flwr/{client/clientapp → supernode/servicer/clientappio}/clientappio_servicer.py +0 -0
- {flwr_nightly-1.19.0.dev20250601.dist-info → flwr_nightly-1.19.0.dev20250603.dist-info}/WHEEL +0 -0
@@ -33,7 +33,7 @@ from flwr.common.grpc import create_channel, on_channel_state_change
|
|
33
33
|
from flwr.common.heartbeat import HeartbeatSender
|
34
34
|
from flwr.common.logger import log
|
35
35
|
from flwr.common.message import Message
|
36
|
-
from flwr.common.retry_invoker import RetryInvoker
|
36
|
+
from flwr.common.retry_invoker import RetryInvoker, _wrap_stub
|
37
37
|
from flwr.common.secure_aggregation.crypto.symmetric_encryption import (
|
38
38
|
generate_key_pairs,
|
39
39
|
)
|
@@ -159,6 +159,8 @@ def grpc_request_response( # pylint: disable=R0913,R0914,R0915,R0917
|
|
159
159
|
# If the status code is PERMISSION_DENIED, additionally raise RunNotRunningException
|
160
160
|
retry_invoker.should_giveup = _should_giveup_fn
|
161
161
|
|
162
|
+
# Wrap stub
|
163
|
+
_wrap_stub(stub, retry_invoker)
|
162
164
|
###########################################################################
|
163
165
|
# send_node_heartbeat/create_node/delete_node/receive/send/get_run functions
|
164
166
|
###########################################################################
|
@@ -203,10 +205,7 @@ def grpc_request_response( # pylint: disable=R0913,R0914,R0915,R0917
|
|
203
205
|
create_node_request = CreateNodeRequest(
|
204
206
|
heartbeat_interval=HEARTBEAT_DEFAULT_INTERVAL
|
205
207
|
)
|
206
|
-
create_node_response =
|
207
|
-
stub.CreateNode,
|
208
|
-
request=create_node_request,
|
209
|
-
)
|
208
|
+
create_node_response = stub.CreateNode(request=create_node_request)
|
210
209
|
|
211
210
|
# Remember the node and start the heartbeat sender
|
212
211
|
nonlocal node
|
@@ -227,7 +226,7 @@ def grpc_request_response( # pylint: disable=R0913,R0914,R0915,R0917
|
|
227
226
|
|
228
227
|
# Call FleetAPI
|
229
228
|
delete_node_request = DeleteNodeRequest(node=node)
|
230
|
-
|
229
|
+
stub.DeleteNode(request=delete_node_request)
|
231
230
|
|
232
231
|
# Cleanup
|
233
232
|
node = None
|
@@ -241,9 +240,7 @@ def grpc_request_response( # pylint: disable=R0913,R0914,R0915,R0917
|
|
241
240
|
|
242
241
|
# Request instructions (message) from server
|
243
242
|
request = PullMessagesRequest(node=node)
|
244
|
-
response: PullMessagesResponse =
|
245
|
-
stub.PullMessages, request=request
|
246
|
-
)
|
243
|
+
response: PullMessagesResponse = stub.PullMessages(request=request)
|
247
244
|
|
248
245
|
# Get the current Messages
|
249
246
|
message_proto = (
|
@@ -289,7 +286,7 @@ def grpc_request_response( # pylint: disable=R0913,R0914,R0915,R0917
|
|
289
286
|
# Serialize Message
|
290
287
|
message_proto = message_to_proto(message=message)
|
291
288
|
request = PushMessagesRequest(node=node, messages_list=[message_proto])
|
292
|
-
_ =
|
289
|
+
_ = stub.PushMessages(request)
|
293
290
|
|
294
291
|
# Cleanup
|
295
292
|
metadata = None
|
@@ -297,10 +294,7 @@ def grpc_request_response( # pylint: disable=R0913,R0914,R0915,R0917
|
|
297
294
|
def get_run(run_id: int) -> Run:
|
298
295
|
# Call FleetAPI
|
299
296
|
get_run_request = GetRunRequest(node=node, run_id=run_id)
|
300
|
-
get_run_response: GetRunResponse =
|
301
|
-
stub.GetRun,
|
302
|
-
request=get_run_request,
|
303
|
-
)
|
297
|
+
get_run_response: GetRunResponse = stub.GetRun(request=get_run_request)
|
304
298
|
|
305
299
|
# Return fab_id and fab_version
|
306
300
|
return run_from_proto(get_run_response.run)
|
@@ -308,10 +302,7 @@ def grpc_request_response( # pylint: disable=R0913,R0914,R0915,R0917
|
|
308
302
|
def get_fab(fab_hash: str, run_id: int) -> Fab:
|
309
303
|
# Call FleetAPI
|
310
304
|
get_fab_request = GetFabRequest(node=node, hash_str=fab_hash, run_id=run_id)
|
311
|
-
get_fab_response: GetFabResponse =
|
312
|
-
stub.GetFab,
|
313
|
-
request=get_fab_request,
|
314
|
-
)
|
305
|
+
get_fab_response: GetFabResponse = stub.GetFab(request=get_fab_request)
|
315
306
|
|
316
307
|
return Fab(get_fab_response.fab.hash_str, get_fab_response.fab.content)
|
317
308
|
|
flwr/common/inflatable.py
CHANGED
@@ -18,9 +18,11 @@
|
|
18
18
|
from __future__ import annotations
|
19
19
|
|
20
20
|
import hashlib
|
21
|
+
from logging import ERROR
|
21
22
|
from typing import TypeVar, cast
|
22
23
|
|
23
24
|
from .constant import HEAD_BODY_DIVIDER, HEAD_VALUE_DIVIDER
|
25
|
+
from .logger import log
|
24
26
|
|
25
27
|
|
26
28
|
class InflatableObject:
|
@@ -163,8 +165,12 @@ def get_object_body_len_from_object_content(object_content: bytes) -> int:
|
|
163
165
|
|
164
166
|
def check_body_len_consistency(object_content: bytes) -> bool:
|
165
167
|
"""Check that the object body is of length as specified in the head."""
|
166
|
-
|
167
|
-
|
168
|
+
try:
|
169
|
+
body_len = get_object_body_len_from_object_content(object_content)
|
170
|
+
return body_len == len(_get_object_body(object_content))
|
171
|
+
except ValueError:
|
172
|
+
log(ERROR, "Object content does match the expected format.")
|
173
|
+
return False
|
168
174
|
|
169
175
|
|
170
176
|
def get_object_head_values_from_object_content(
|
@@ -17,6 +17,7 @@
|
|
17
17
|
|
18
18
|
from typing import Optional, Union
|
19
19
|
|
20
|
+
from flwr.client.grpc_rere_client.grpc_adapter import GrpcAdapter
|
20
21
|
from flwr.proto.fleet_pb2_grpc import FleetStub # pylint: disable=E0611
|
21
22
|
from flwr.proto.message_pb2 import ( # pylint: disable=E0611
|
22
23
|
PullObjectRequest,
|
@@ -48,8 +49,9 @@ inflatable_class_registry: dict[str, type[InflatableObject]] = {
|
|
48
49
|
|
49
50
|
def push_object_to_servicer(
|
50
51
|
obj: InflatableObject,
|
51
|
-
stub: Union[FleetStub, ServerAppIoStub],
|
52
|
+
stub: Union[FleetStub, ServerAppIoStub, GrpcAdapter],
|
52
53
|
node: Node,
|
54
|
+
run_id: int,
|
53
55
|
object_ids_to_push: Optional[set[str]] = None,
|
54
56
|
) -> set[str]:
|
55
57
|
"""Recursively deflate an object and push it to the servicer.
|
@@ -63,7 +65,7 @@ def push_object_to_servicer(
|
|
63
65
|
if children := obj.children:
|
64
66
|
for child in children.values():
|
65
67
|
pushed_object_ids |= push_object_to_servicer(
|
66
|
-
child, stub, node, object_ids_to_push
|
68
|
+
child, stub, node, run_id, object_ids_to_push
|
67
69
|
)
|
68
70
|
|
69
71
|
# Deflate object and push
|
@@ -74,6 +76,7 @@ def push_object_to_servicer(
|
|
74
76
|
_: PushObjectResponse = stub.PushObject(
|
75
77
|
PushObjectRequest(
|
76
78
|
node=node,
|
79
|
+
run_id=run_id,
|
77
80
|
object_id=object_id,
|
78
81
|
object_content=object_content,
|
79
82
|
)
|
@@ -85,13 +88,14 @@ def push_object_to_servicer(
|
|
85
88
|
|
86
89
|
def pull_object_from_servicer(
|
87
90
|
object_id: str,
|
88
|
-
stub: Union[FleetStub, ServerAppIoStub],
|
91
|
+
stub: Union[FleetStub, ServerAppIoStub, GrpcAdapter],
|
89
92
|
node: Node,
|
93
|
+
run_id: int,
|
90
94
|
) -> InflatableObject:
|
91
95
|
"""Recursively inflate an object by pulling it from the servicer."""
|
92
96
|
# Pull object
|
93
97
|
object_proto: PullObjectResponse = stub.PullObject(
|
94
|
-
PullObjectRequest(node=node, object_id=object_id)
|
98
|
+
PullObjectRequest(node=node, run_id=run_id, object_id=object_id)
|
95
99
|
)
|
96
100
|
object_content = object_proto.object_content
|
97
101
|
|
@@ -106,7 +110,7 @@ def pull_object_from_servicer(
|
|
106
110
|
children: dict[str, InflatableObject] = {}
|
107
111
|
for child_object_id in children_obj_ids:
|
108
112
|
children[child_object_id] = pull_object_from_servicer(
|
109
|
-
child_object_id, stub, node
|
113
|
+
child_object_id, stub, node, run_id
|
110
114
|
)
|
111
115
|
|
112
116
|
# Inflate object passing its children
|
@@ -175,13 +175,14 @@ class ConfigRecord(TypedDict[str, ConfigRecordValues], InflatableObject):
|
|
175
175
|
|
176
176
|
def deflate(self) -> bytes:
|
177
177
|
"""Deflate object."""
|
178
|
+
protos = record_value_dict_to_proto(
|
179
|
+
self,
|
180
|
+
[bool, int, float, str, bytes],
|
181
|
+
ProtoConfigRecordValue,
|
182
|
+
)
|
178
183
|
obj_body = ProtoConfigRecord(
|
179
|
-
|
180
|
-
|
181
|
-
[bool, int, float, str, bytes],
|
182
|
-
ProtoConfigRecordValue,
|
183
|
-
)
|
184
|
-
).SerializeToString(deterministic=True)
|
184
|
+
items=[ProtoConfigRecord.Item(key=k, value=v) for k, v in protos.items()]
|
185
|
+
).SerializeToString()
|
185
186
|
return add_header_to_object_body(object_body=obj_body, obj=self)
|
186
187
|
|
187
188
|
@classmethod
|
@@ -209,11 +210,11 @@ class ConfigRecord(TypedDict[str, ConfigRecordValues], InflatableObject):
|
|
209
210
|
|
210
211
|
obj_body = get_object_body(object_content, cls)
|
211
212
|
config_record_proto = ProtoConfigRecord.FromString(obj_body)
|
212
|
-
|
213
|
+
protos = {item.key: item.value for item in config_record_proto.items}
|
213
214
|
return ConfigRecord(
|
214
215
|
config_dict=cast(
|
215
216
|
dict[str, ConfigRecordValues],
|
216
|
-
record_value_dict_from_proto(
|
217
|
+
record_value_dict_from_proto(protos),
|
217
218
|
),
|
218
219
|
keep_input=False,
|
219
220
|
)
|
@@ -154,9 +154,10 @@ class MetricRecord(TypedDict[str, MetricRecordValues], InflatableObject):
|
|
154
154
|
|
155
155
|
def deflate(self) -> bytes:
|
156
156
|
"""Deflate object."""
|
157
|
+
protos = record_value_dict_to_proto(self, [float, int], ProtoMetricRecordValue)
|
157
158
|
obj_body = ProtoMetricRecord(
|
158
|
-
|
159
|
-
).SerializeToString(
|
159
|
+
items=[ProtoMetricRecord.Item(key=k, value=v) for k, v in protos.items()]
|
160
|
+
).SerializeToString()
|
160
161
|
return add_header_to_object_body(object_body=obj_body, obj=self)
|
161
162
|
|
162
163
|
@classmethod
|
@@ -179,16 +180,16 @@ class MetricRecord(TypedDict[str, MetricRecordValues], InflatableObject):
|
|
179
180
|
MetricRecord
|
180
181
|
The inflated MetricRecord.
|
181
182
|
"""
|
182
|
-
if children
|
183
|
+
if children:
|
183
184
|
raise ValueError("`MetricRecord` objects do not have children.")
|
184
185
|
|
185
186
|
obj_body = get_object_body(object_content, cls)
|
186
187
|
metric_record_proto = ProtoMetricRecord.FromString(obj_body)
|
187
|
-
|
188
|
+
protos = {item.key: item.value for item in metric_record_proto.items}
|
188
189
|
return cls(
|
189
190
|
metric_dict=cast(
|
190
191
|
dict[str, MetricRecordValues],
|
191
|
-
record_value_dict_from_proto(
|
192
|
+
record_value_dict_from_proto(protos),
|
192
193
|
),
|
193
194
|
keep_input=False,
|
194
195
|
)
|
flwr/common/retry_invoker.py
CHANGED
@@ -25,10 +25,12 @@ from typing import Any, Callable, Optional, Union, cast
|
|
25
25
|
|
26
26
|
import grpc
|
27
27
|
|
28
|
+
from flwr.client.grpc_rere_client.grpc_adapter import GrpcAdapter
|
28
29
|
from flwr.common.constant import MAX_RETRY_DELAY
|
29
30
|
from flwr.common.logger import log
|
30
31
|
from flwr.common.typing import RunNotRunningException
|
31
32
|
from flwr.proto.clientappio_pb2_grpc import ClientAppIoStub
|
33
|
+
from flwr.proto.fleet_pb2_grpc import FleetStub
|
32
34
|
from flwr.proto.serverappio_pb2_grpc import ServerAppIoStub
|
33
35
|
from flwr.proto.simulationio_pb2_grpc import SimulationIoStub
|
34
36
|
|
@@ -366,7 +368,9 @@ def _make_simple_grpc_retry_invoker() -> RetryInvoker:
|
|
366
368
|
|
367
369
|
|
368
370
|
def _wrap_stub(
|
369
|
-
stub: Union[
|
371
|
+
stub: Union[
|
372
|
+
ServerAppIoStub, ClientAppIoStub, SimulationIoStub, FleetStub, GrpcAdapter
|
373
|
+
],
|
370
374
|
retry_invoker: RetryInvoker,
|
371
375
|
) -> None:
|
372
376
|
"""Wrap a gRPC stub with a retry invoker."""
|
flwr/common/serde.py
CHANGED
@@ -399,8 +399,10 @@ def array_from_proto(array_proto: ProtoArray) -> Array:
|
|
399
399
|
def array_record_to_proto(record: ArrayRecord) -> ProtoArrayRecord:
|
400
400
|
"""Serialize ArrayRecord to ProtoBuf."""
|
401
401
|
return ProtoArrayRecord(
|
402
|
-
|
403
|
-
|
402
|
+
items=[
|
403
|
+
ProtoArrayRecord.Item(key=k, value=array_to_proto(v))
|
404
|
+
for k, v in record.items()
|
405
|
+
]
|
404
406
|
)
|
405
407
|
|
406
408
|
|
@@ -410,7 +412,7 @@ def array_record_from_proto(
|
|
410
412
|
"""Deserialize ArrayRecord from ProtoBuf."""
|
411
413
|
return ArrayRecord(
|
412
414
|
array_dict=OrderedDict(
|
413
|
-
|
415
|
+
{item.key: array_from_proto(item.value) for item in record_proto.items}
|
414
416
|
),
|
415
417
|
keep_input=False,
|
416
418
|
)
|
@@ -418,17 +420,19 @@ def array_record_from_proto(
|
|
418
420
|
|
419
421
|
def metric_record_to_proto(record: MetricRecord) -> ProtoMetricRecord:
|
420
422
|
"""Serialize MetricRecord to ProtoBuf."""
|
423
|
+
protos = record_value_dict_to_proto(record, [float, int], ProtoMetricRecordValue)
|
421
424
|
return ProtoMetricRecord(
|
422
|
-
|
425
|
+
items=[ProtoMetricRecord.Item(key=k, value=v) for k, v in protos.items()]
|
423
426
|
)
|
424
427
|
|
425
428
|
|
426
429
|
def metric_record_from_proto(record_proto: ProtoMetricRecord) -> MetricRecord:
|
427
430
|
"""Deserialize MetricRecord from ProtoBuf."""
|
431
|
+
protos = {item.key: item.value for item in record_proto.items}
|
428
432
|
return MetricRecord(
|
429
433
|
metric_dict=cast(
|
430
434
|
dict[str, typing.MetricRecordValues],
|
431
|
-
record_value_dict_from_proto(
|
435
|
+
record_value_dict_from_proto(protos),
|
432
436
|
),
|
433
437
|
keep_input=False,
|
434
438
|
)
|
@@ -436,21 +440,23 @@ def metric_record_from_proto(record_proto: ProtoMetricRecord) -> MetricRecord:
|
|
436
440
|
|
437
441
|
def config_record_to_proto(record: ConfigRecord) -> ProtoConfigRecord:
|
438
442
|
"""Serialize ConfigRecord to ProtoBuf."""
|
443
|
+
protos = record_value_dict_to_proto(
|
444
|
+
record,
|
445
|
+
[bool, int, float, str, bytes],
|
446
|
+
ProtoConfigRecordValue,
|
447
|
+
)
|
439
448
|
return ProtoConfigRecord(
|
440
|
-
|
441
|
-
record,
|
442
|
-
[bool, int, float, str, bytes],
|
443
|
-
ProtoConfigRecordValue,
|
444
|
-
)
|
449
|
+
items=[ProtoConfigRecord.Item(key=k, value=v) for k, v in protos.items()]
|
445
450
|
)
|
446
451
|
|
447
452
|
|
448
453
|
def config_record_from_proto(record_proto: ProtoConfigRecord) -> ConfigRecord:
|
449
454
|
"""Deserialize ConfigRecord from ProtoBuf."""
|
455
|
+
protos = {item.key: item.value for item in record_proto.items}
|
450
456
|
return ConfigRecord(
|
451
457
|
config_dict=cast(
|
452
458
|
dict[str, typing.ConfigRecordValues],
|
453
|
-
record_value_dict_from_proto(
|
459
|
+
record_value_dict_from_proto(protos),
|
454
460
|
),
|
455
461
|
keep_input=False,
|
456
462
|
)
|
@@ -461,28 +467,33 @@ def config_record_from_proto(record_proto: ProtoConfigRecord) -> ConfigRecord:
|
|
461
467
|
|
462
468
|
def recorddict_to_proto(recorddict: RecordDict) -> ProtoRecordDict:
|
463
469
|
"""Serialize RecordDict to ProtoBuf."""
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
470
|
+
item_cls = ProtoRecordDict.Item
|
471
|
+
items: list[ProtoRecordDict.Item] = []
|
472
|
+
for k, v in recorddict.items():
|
473
|
+
if isinstance(v, ArrayRecord):
|
474
|
+
items += [item_cls(key=k, array_record=array_record_to_proto(v))]
|
475
|
+
elif isinstance(v, MetricRecord):
|
476
|
+
items += [item_cls(key=k, metric_record=metric_record_to_proto(v))]
|
477
|
+
elif isinstance(v, ConfigRecord):
|
478
|
+
items += [item_cls(key=k, config_record=config_record_to_proto(v))]
|
479
|
+
else:
|
480
|
+
raise ValueError(f"Unsupported record type: {type(v)}")
|
481
|
+
return ProtoRecordDict(items=items)
|
475
482
|
|
476
483
|
|
477
484
|
def recorddict_from_proto(recorddict_proto: ProtoRecordDict) -> RecordDict:
|
478
485
|
"""Deserialize RecordDict from ProtoBuf."""
|
479
486
|
ret = RecordDict()
|
480
|
-
for
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
487
|
+
for item in recorddict_proto.items:
|
488
|
+
field = item.WhichOneof("value")
|
489
|
+
if field == "array_record":
|
490
|
+
ret[item.key] = array_record_from_proto(item.array_record)
|
491
|
+
elif field == "metric_record":
|
492
|
+
ret[item.key] = metric_record_from_proto(item.metric_record)
|
493
|
+
elif field == "config_record":
|
494
|
+
ret[item.key] = config_record_from_proto(item.config_record)
|
495
|
+
else:
|
496
|
+
raise ValueError(f"Unsupported record type: {field}")
|
486
497
|
return ret
|
487
498
|
|
488
499
|
|
flwr/common/serde_utils.py
CHANGED
@@ -109,6 +109,8 @@ def record_value_dict_to_proto(
|
|
109
109
|
) -> dict[str, T]:
|
110
110
|
"""Serialize the record value dict to ProtoBuf.
|
111
111
|
|
112
|
+
This function will preserve the order of the keys in the input dictionary.
|
113
|
+
|
112
114
|
Note: `bool` MUST be put in the front of allowd_types if it exists.
|
113
115
|
"""
|
114
116
|
# Move bool to the front
|
flwr/proto/message_pb2.py
CHANGED
@@ -18,7 +18,7 @@ from flwr.proto import transport_pb2 as flwr_dot_proto_dot_transport__pb2
|
|
18
18
|
from flwr.proto import node_pb2 as flwr_dot_proto_dot_node__pb2
|
19
19
|
|
20
20
|
|
21
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x66lwr/proto/message.proto\x12\nflwr.proto\x1a\x16\x66lwr/proto/error.proto\x1a\x1b\x66lwr/proto/recorddict.proto\x1a\x1a\x66lwr/proto/transport.proto\x1a\x15\x66lwr/proto/node.proto\"|\n\x07Message\x12&\n\x08metadata\x18\x01 \x01(\x0b\x32\x14.flwr.proto.Metadata\x12\'\n\x07\x63ontent\x18\x02 \x01(\x0b\x32\x16.flwr.proto.RecordDict\x12 \n\x05\x65rror\x18\x03 \x01(\x0b\x32\x11.flwr.proto.Error\"\xd0\x02\n\x07\x43ontext\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12\x0f\n\x07node_id\x18\x02 \x01(\x04\x12\x38\n\x0bnode_config\x18\x03 \x03(\x0b\x32#.flwr.proto.Context.NodeConfigEntry\x12%\n\x05state\x18\x04 \x01(\x0b\x32\x16.flwr.proto.RecordDict\x12\x36\n\nrun_config\x18\x05 \x03(\x0b\x32\".flwr.proto.Context.RunConfigEntry\x1a\x45\n\x0fNodeConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\x1a\x44\n\x0eRunConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\"\xbe\x01\n\x08Metadata\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12\x12\n\nmessage_id\x18\x02 \x01(\t\x12\x13\n\x0bsrc_node_id\x18\x03 \x01(\x04\x12\x13\n\x0b\x64st_node_id\x18\x04 \x01(\x04\x12\x1b\n\x13reply_to_message_id\x18\x05 \x01(\t\x12\x10\n\x08group_id\x18\x06 \x01(\t\x12\x0b\n\x03ttl\x18\x07 \x01(\x01\x12\x14\n\x0cmessage_type\x18\x08 \x01(\t\x12\x12\n\ncreated_at\x18\t \x01(\x01\"\x1f\n\tObjectIDs\x12\x12\n\nobject_ids\x18\x01 \x03(\t\"
|
21
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x66lwr/proto/message.proto\x12\nflwr.proto\x1a\x16\x66lwr/proto/error.proto\x1a\x1b\x66lwr/proto/recorddict.proto\x1a\x1a\x66lwr/proto/transport.proto\x1a\x15\x66lwr/proto/node.proto\"|\n\x07Message\x12&\n\x08metadata\x18\x01 \x01(\x0b\x32\x14.flwr.proto.Metadata\x12\'\n\x07\x63ontent\x18\x02 \x01(\x0b\x32\x16.flwr.proto.RecordDict\x12 \n\x05\x65rror\x18\x03 \x01(\x0b\x32\x11.flwr.proto.Error\"\xd0\x02\n\x07\x43ontext\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12\x0f\n\x07node_id\x18\x02 \x01(\x04\x12\x38\n\x0bnode_config\x18\x03 \x03(\x0b\x32#.flwr.proto.Context.NodeConfigEntry\x12%\n\x05state\x18\x04 \x01(\x0b\x32\x16.flwr.proto.RecordDict\x12\x36\n\nrun_config\x18\x05 \x03(\x0b\x32\".flwr.proto.Context.RunConfigEntry\x1a\x45\n\x0fNodeConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\x1a\x44\n\x0eRunConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\"\xbe\x01\n\x08Metadata\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12\x12\n\nmessage_id\x18\x02 \x01(\t\x12\x13\n\x0bsrc_node_id\x18\x03 \x01(\x04\x12\x13\n\x0b\x64st_node_id\x18\x04 \x01(\x04\x12\x1b\n\x13reply_to_message_id\x18\x05 \x01(\t\x12\x10\n\x08group_id\x18\x06 \x01(\t\x12\x0b\n\x03ttl\x18\x07 \x01(\x01\x12\x14\n\x0cmessage_type\x18\x08 \x01(\t\x12\x12\n\ncreated_at\x18\t \x01(\x01\"\x1f\n\tObjectIDs\x12\x12\n\nobject_ids\x18\x01 \x03(\t\"n\n\x11PushObjectRequest\x12\x1e\n\x04node\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x0e\n\x06run_id\x18\x02 \x01(\x04\x12\x11\n\tobject_id\x18\x03 \x01(\t\x12\x16\n\x0eobject_content\x18\x04 \x01(\x0c\"$\n\x12PushObjectResponse\x12\x0e\n\x06stored\x18\x01 \x01(\x08\"V\n\x11PullObjectRequest\x12\x1e\n\x04node\x18\x01 \x01(\x0b\x32\x10.flwr.proto.Node\x12\x0e\n\x06run_id\x18\x02 \x01(\x04\x12\x11\n\tobject_id\x18\x03 \x01(\t\"\\\n\x12PullObjectResponse\x12\x14\n\x0cobject_found\x18\x01 \x01(\x08\x12\x18\n\x10object_available\x18\x02 \x01(\x08\x12\x16\n\x0eobject_content\x18\x03 \x01(\x0c\x62\x06proto3')
|
22
22
|
|
23
23
|
_globals = globals()
|
24
24
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -42,11 +42,11 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
42
42
|
_globals['_OBJECTIDS']._serialized_start=802
|
43
43
|
_globals['_OBJECTIDS']._serialized_end=833
|
44
44
|
_globals['_PUSHOBJECTREQUEST']._serialized_start=835
|
45
|
-
_globals['_PUSHOBJECTREQUEST']._serialized_end=
|
46
|
-
_globals['_PUSHOBJECTRESPONSE']._serialized_start=
|
47
|
-
_globals['_PUSHOBJECTRESPONSE']._serialized_end=
|
48
|
-
_globals['_PULLOBJECTREQUEST']._serialized_start=
|
49
|
-
_globals['_PULLOBJECTREQUEST']._serialized_end=
|
50
|
-
_globals['_PULLOBJECTRESPONSE']._serialized_start=
|
51
|
-
_globals['_PULLOBJECTRESPONSE']._serialized_end=
|
45
|
+
_globals['_PUSHOBJECTREQUEST']._serialized_end=945
|
46
|
+
_globals['_PUSHOBJECTRESPONSE']._serialized_start=947
|
47
|
+
_globals['_PUSHOBJECTRESPONSE']._serialized_end=983
|
48
|
+
_globals['_PULLOBJECTREQUEST']._serialized_start=985
|
49
|
+
_globals['_PULLOBJECTREQUEST']._serialized_end=1071
|
50
|
+
_globals['_PULLOBJECTRESPONSE']._serialized_start=1073
|
51
|
+
_globals['_PULLOBJECTRESPONSE']._serialized_end=1165
|
52
52
|
# @@protoc_insertion_point(module_scope)
|
flwr/proto/message_pb2.pyi
CHANGED
@@ -144,52 +144,69 @@ class PushObjectRequest(google.protobuf.message.Message):
|
|
144
144
|
"""PushObject messages"""
|
145
145
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
146
146
|
NODE_FIELD_NUMBER: builtins.int
|
147
|
+
RUN_ID_FIELD_NUMBER: builtins.int
|
147
148
|
OBJECT_ID_FIELD_NUMBER: builtins.int
|
148
149
|
OBJECT_CONTENT_FIELD_NUMBER: builtins.int
|
149
150
|
@property
|
150
151
|
def node(self) -> flwr.proto.node_pb2.Node: ...
|
152
|
+
run_id: builtins.int
|
151
153
|
object_id: typing.Text
|
152
154
|
object_content: builtins.bytes
|
153
155
|
def __init__(self,
|
154
156
|
*,
|
155
157
|
node: typing.Optional[flwr.proto.node_pb2.Node] = ...,
|
158
|
+
run_id: builtins.int = ...,
|
156
159
|
object_id: typing.Text = ...,
|
157
160
|
object_content: builtins.bytes = ...,
|
158
161
|
) -> None: ...
|
159
162
|
def HasField(self, field_name: typing_extensions.Literal["node",b"node"]) -> builtins.bool: ...
|
160
|
-
def ClearField(self, field_name: typing_extensions.Literal["node",b"node","object_content",b"object_content","object_id",b"object_id"]) -> None: ...
|
163
|
+
def ClearField(self, field_name: typing_extensions.Literal["node",b"node","object_content",b"object_content","object_id",b"object_id","run_id",b"run_id"]) -> None: ...
|
161
164
|
global___PushObjectRequest = PushObjectRequest
|
162
165
|
|
163
166
|
class PushObjectResponse(google.protobuf.message.Message):
|
164
167
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
168
|
+
STORED_FIELD_NUMBER: builtins.int
|
169
|
+
stored: builtins.bool
|
165
170
|
def __init__(self,
|
171
|
+
*,
|
172
|
+
stored: builtins.bool = ...,
|
166
173
|
) -> None: ...
|
174
|
+
def ClearField(self, field_name: typing_extensions.Literal["stored",b"stored"]) -> None: ...
|
167
175
|
global___PushObjectResponse = PushObjectResponse
|
168
176
|
|
169
177
|
class PullObjectRequest(google.protobuf.message.Message):
|
170
178
|
"""PullObject messages"""
|
171
179
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
172
180
|
NODE_FIELD_NUMBER: builtins.int
|
181
|
+
RUN_ID_FIELD_NUMBER: builtins.int
|
173
182
|
OBJECT_ID_FIELD_NUMBER: builtins.int
|
174
183
|
@property
|
175
184
|
def node(self) -> flwr.proto.node_pb2.Node: ...
|
185
|
+
run_id: builtins.int
|
176
186
|
object_id: typing.Text
|
177
187
|
def __init__(self,
|
178
188
|
*,
|
179
189
|
node: typing.Optional[flwr.proto.node_pb2.Node] = ...,
|
190
|
+
run_id: builtins.int = ...,
|
180
191
|
object_id: typing.Text = ...,
|
181
192
|
) -> None: ...
|
182
193
|
def HasField(self, field_name: typing_extensions.Literal["node",b"node"]) -> builtins.bool: ...
|
183
|
-
def ClearField(self, field_name: typing_extensions.Literal["node",b"node","object_id",b"object_id"]) -> None: ...
|
194
|
+
def ClearField(self, field_name: typing_extensions.Literal["node",b"node","object_id",b"object_id","run_id",b"run_id"]) -> None: ...
|
184
195
|
global___PullObjectRequest = PullObjectRequest
|
185
196
|
|
186
197
|
class PullObjectResponse(google.protobuf.message.Message):
|
187
198
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
199
|
+
OBJECT_FOUND_FIELD_NUMBER: builtins.int
|
200
|
+
OBJECT_AVAILABLE_FIELD_NUMBER: builtins.int
|
188
201
|
OBJECT_CONTENT_FIELD_NUMBER: builtins.int
|
202
|
+
object_found: builtins.bool
|
203
|
+
object_available: builtins.bool
|
189
204
|
object_content: builtins.bytes
|
190
205
|
def __init__(self,
|
191
206
|
*,
|
207
|
+
object_found: builtins.bool = ...,
|
208
|
+
object_available: builtins.bool = ...,
|
192
209
|
object_content: builtins.bytes = ...,
|
193
210
|
) -> None: ...
|
194
|
-
def ClearField(self, field_name: typing_extensions.Literal["object_content",b"object_content"]) -> None: ...
|
211
|
+
def ClearField(self, field_name: typing_extensions.Literal["object_available",b"object_available","object_content",b"object_content","object_found",b"object_found"]) -> None: ...
|
195
212
|
global___PullObjectResponse = PullObjectResponse
|
flwr/proto/recorddict_pb2.py
CHANGED
@@ -14,23 +14,13 @@ _sym_db = _symbol_database.Default()
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x66lwr/proto/recorddict.proto\x12\nflwr.proto\"\x1a\n\nDoubleList\x12\x0c\n\x04vals\x18\x01 \x03(\x01\"\x18\n\x08SintList\x12\x0c\n\x04vals\x18\x01 \x03(\x12\"\x18\n\x08UintList\x12\x0c\n\x04vals\x18\x01 \x03(\x04\"\x18\n\x08\x42oolList\x12\x0c\n\x04vals\x18\x01 \x03(\x08\"\x1a\n\nStringList\x12\x0c\n\x04vals\x18\x01 \x03(\t\"\x19\n\tBytesList\x12\x0c\n\x04vals\x18\x01 \x03(\x0c\"B\n\x05\x41rray\x12\r\n\x05\x64type\x18\x01 \x01(\t\x12\r\n\x05shape\x18\x02 \x03(\x05\x12\r\n\x05stype\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\"\xd7\x01\n\x11MetricRecordValue\x12\x10\n\x06\x64ouble\x18\x01 \x01(\x01H\x00\x12\x10\n\x06sint64\x18\x02 \x01(\x12H\x00\x12\x10\n\x06uint64\x18\x03 \x01(\x04H\x00\x12-\n\x0b\x64ouble_list\x18\x15 \x01(\x0b\x32\x16.flwr.proto.DoubleListH\x00\x12)\n\tsint_list\x18\x16 \x01(\x0b\x32\x14.flwr.proto.SintListH\x00\x12)\n\tuint_list\x18\x17 \x01(\x0b\x32\x14.flwr.proto.UintListH\x00\x42\x07\n\x05value\"\x91\x03\n\x11\x43onfigRecordValue\x12\x10\n\x06\x64ouble\x18\x01 \x01(\x01H\x00\x12\x10\n\x06sint64\x18\x02 \x01(\x12H\x00\x12\x10\n\x06uint64\x18\x03 \x01(\x04H\x00\x12\x0e\n\x04\x62ool\x18\x04 \x01(\x08H\x00\x12\x10\n\x06string\x18\x05 \x01(\tH\x00\x12\x0f\n\x05\x62ytes\x18\x06 \x01(\x0cH\x00\x12-\n\x0b\x64ouble_list\x18\x15 \x01(\x0b\x32\x16.flwr.proto.DoubleListH\x00\x12)\n\tsint_list\x18\x16 \x01(\x0b\x32\x14.flwr.proto.SintListH\x00\x12)\n\tuint_list\x18\x17 \x01(\x0b\x32\x14.flwr.proto.UintListH\x00\x12)\n\tbool_list\x18\x18 \x01(\x0b\x32\x14.flwr.proto.BoolListH\x00\x12-\n\x0bstring_list\x18\x19 \x01(\x0b\x32\x16.flwr.proto.StringListH\x00\x12+\n\nbytes_list\x18\x1a \x01(\x0b\x32\x15.flwr.proto.BytesListH\x00\x42\x07\n\x05value\"
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x66lwr/proto/recorddict.proto\x12\nflwr.proto\"\x1a\n\nDoubleList\x12\x0c\n\x04vals\x18\x01 \x03(\x01\"\x18\n\x08SintList\x12\x0c\n\x04vals\x18\x01 \x03(\x12\"\x18\n\x08UintList\x12\x0c\n\x04vals\x18\x01 \x03(\x04\"\x18\n\x08\x42oolList\x12\x0c\n\x04vals\x18\x01 \x03(\x08\"\x1a\n\nStringList\x12\x0c\n\x04vals\x18\x01 \x03(\t\"\x19\n\tBytesList\x12\x0c\n\x04vals\x18\x01 \x03(\x0c\"B\n\x05\x41rray\x12\r\n\x05\x64type\x18\x01 \x01(\t\x12\r\n\x05shape\x18\x02 \x03(\x05\x12\r\n\x05stype\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\"\xd7\x01\n\x11MetricRecordValue\x12\x10\n\x06\x64ouble\x18\x01 \x01(\x01H\x00\x12\x10\n\x06sint64\x18\x02 \x01(\x12H\x00\x12\x10\n\x06uint64\x18\x03 \x01(\x04H\x00\x12-\n\x0b\x64ouble_list\x18\x15 \x01(\x0b\x32\x16.flwr.proto.DoubleListH\x00\x12)\n\tsint_list\x18\x16 \x01(\x0b\x32\x14.flwr.proto.SintListH\x00\x12)\n\tuint_list\x18\x17 \x01(\x0b\x32\x14.flwr.proto.UintListH\x00\x42\x07\n\x05value\"\x91\x03\n\x11\x43onfigRecordValue\x12\x10\n\x06\x64ouble\x18\x01 \x01(\x01H\x00\x12\x10\n\x06sint64\x18\x02 \x01(\x12H\x00\x12\x10\n\x06uint64\x18\x03 \x01(\x04H\x00\x12\x0e\n\x04\x62ool\x18\x04 \x01(\x08H\x00\x12\x10\n\x06string\x18\x05 \x01(\tH\x00\x12\x0f\n\x05\x62ytes\x18\x06 \x01(\x0cH\x00\x12-\n\x0b\x64ouble_list\x18\x15 \x01(\x0b\x32\x16.flwr.proto.DoubleListH\x00\x12)\n\tsint_list\x18\x16 \x01(\x0b\x32\x14.flwr.proto.SintListH\x00\x12)\n\tuint_list\x18\x17 \x01(\x0b\x32\x14.flwr.proto.UintListH\x00\x12)\n\tbool_list\x18\x18 \x01(\x0b\x32\x14.flwr.proto.BoolListH\x00\x12-\n\x0bstring_list\x18\x19 \x01(\x0b\x32\x16.flwr.proto.StringListH\x00\x12+\n\nbytes_list\x18\x1a \x01(\x0b\x32\x15.flwr.proto.BytesListH\x00\x42\x07\n\x05value\"q\n\x0b\x41rrayRecord\x12+\n\x05items\x18\x01 \x03(\x0b\x32\x1c.flwr.proto.ArrayRecord.Item\x1a\x35\n\x04Item\x12\x0b\n\x03key\x18\x01 \x01(\t\x12 \n\x05value\x18\x02 \x01(\x0b\x32\x11.flwr.proto.Array\"\x7f\n\x0cMetricRecord\x12,\n\x05items\x18\x01 \x03(\x0b\x32\x1d.flwr.proto.MetricRecord.Item\x1a\x41\n\x04Item\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.flwr.proto.MetricRecordValue\"\x7f\n\x0c\x43onfigRecord\x12,\n\x05items\x18\x01 \x03(\x0b\x32\x1d.flwr.proto.ConfigRecord.Item\x1a\x41\n\x04Item\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.flwr.proto.ConfigRecordValue\"\xee\x01\n\nRecordDict\x12*\n\x05items\x18\x01 \x03(\x0b\x32\x1b.flwr.proto.RecordDict.Item\x1a\xb3\x01\n\x04Item\x12\x0b\n\x03key\x18\x01 \x01(\t\x12/\n\x0c\x61rray_record\x18\x02 \x01(\x0b\x32\x17.flwr.proto.ArrayRecordH\x00\x12\x31\n\rmetric_record\x18\x03 \x01(\x0b\x32\x18.flwr.proto.MetricRecordH\x00\x12\x31\n\rconfig_record\x18\x04 \x01(\x0b\x32\x18.flwr.proto.ConfigRecordH\x00\x42\x07\n\x05valueb\x06proto3')
|
18
18
|
|
19
19
|
_globals = globals()
|
20
20
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
21
21
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.recorddict_pb2', _globals)
|
22
22
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
23
23
|
DESCRIPTOR._options = None
|
24
|
-
_globals['_METRICRECORD_DATAENTRY']._options = None
|
25
|
-
_globals['_METRICRECORD_DATAENTRY']._serialized_options = b'8\001'
|
26
|
-
_globals['_CONFIGRECORD_DATAENTRY']._options = None
|
27
|
-
_globals['_CONFIGRECORD_DATAENTRY']._serialized_options = b'8\001'
|
28
|
-
_globals['_RECORDDICT_ARRAYSENTRY']._options = None
|
29
|
-
_globals['_RECORDDICT_ARRAYSENTRY']._serialized_options = b'8\001'
|
30
|
-
_globals['_RECORDDICT_METRICSENTRY']._options = None
|
31
|
-
_globals['_RECORDDICT_METRICSENTRY']._serialized_options = b'8\001'
|
32
|
-
_globals['_RECORDDICT_CONFIGSENTRY']._options = None
|
33
|
-
_globals['_RECORDDICT_CONFIGSENTRY']._serialized_options = b'8\001'
|
34
24
|
_globals['_DOUBLELIST']._serialized_start=43
|
35
25
|
_globals['_DOUBLELIST']._serialized_end=69
|
36
26
|
_globals['_SINTLIST']._serialized_start=71
|
@@ -50,21 +40,19 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
50
40
|
_globals['_CONFIGRECORDVALUE']._serialized_start=491
|
51
41
|
_globals['_CONFIGRECORDVALUE']._serialized_end=892
|
52
42
|
_globals['_ARRAYRECORD']._serialized_start=894
|
53
|
-
_globals['_ARRAYRECORD']._serialized_end=
|
54
|
-
_globals['
|
55
|
-
_globals['
|
56
|
-
_globals['
|
57
|
-
_globals['
|
58
|
-
_globals['
|
59
|
-
_globals['
|
60
|
-
_globals['
|
61
|
-
_globals['
|
62
|
-
_globals['
|
63
|
-
_globals['
|
64
|
-
_globals['
|
65
|
-
_globals['
|
66
|
-
_globals['
|
67
|
-
_globals['
|
68
|
-
_globals['_RECORDDICT_CONFIGSENTRY']._serialized_start=1575
|
69
|
-
_globals['_RECORDDICT_CONFIGSENTRY']._serialized_end=1647
|
43
|
+
_globals['_ARRAYRECORD']._serialized_end=1007
|
44
|
+
_globals['_ARRAYRECORD_ITEM']._serialized_start=954
|
45
|
+
_globals['_ARRAYRECORD_ITEM']._serialized_end=1007
|
46
|
+
_globals['_METRICRECORD']._serialized_start=1009
|
47
|
+
_globals['_METRICRECORD']._serialized_end=1136
|
48
|
+
_globals['_METRICRECORD_ITEM']._serialized_start=1071
|
49
|
+
_globals['_METRICRECORD_ITEM']._serialized_end=1136
|
50
|
+
_globals['_CONFIGRECORD']._serialized_start=1138
|
51
|
+
_globals['_CONFIGRECORD']._serialized_end=1265
|
52
|
+
_globals['_CONFIGRECORD_ITEM']._serialized_start=1200
|
53
|
+
_globals['_CONFIGRECORD_ITEM']._serialized_end=1265
|
54
|
+
_globals['_RECORDDICT']._serialized_start=1268
|
55
|
+
_globals['_RECORDDICT']._serialized_end=1506
|
56
|
+
_globals['_RECORDDICT_ITEM']._serialized_start=1327
|
57
|
+
_globals['_RECORDDICT_ITEM']._serialized_end=1506
|
70
58
|
# @@protoc_insertion_point(module_scope)
|