flwr-nightly 1.19.0.dev20250512__py3-none-any.whl → 1.19.0.dev20250514__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/grpc_rere_client/grpc_adapter.py +18 -0
- flwr/common/heartbeat.py +63 -1
- flwr/common/inflatable.py +35 -3
- flwr/common/record/array.py +10 -1
- flwr/common/record/arrayrecord.py +65 -1
- flwr/common/record/configrecord.py +10 -1
- flwr/common/record/metricrecord.py +10 -1
- flwr/common/record/recorddict.py +69 -1
- flwr/proto/fleet_pb2.py +2 -2
- flwr/proto/fleet_pb2_grpc.py +69 -0
- flwr/proto/fleet_pb2_grpc.pyi +27 -0
- flwr/proto/heartbeat_pb2.py +5 -1
- flwr/proto/heartbeat_pb2.pyi +26 -0
- flwr/proto/message_pb2.py +9 -1
- flwr/proto/message_pb2.pyi +44 -0
- flwr/proto/serverappio_pb2.py +24 -23
- flwr/proto/serverappio_pb2_grpc.py +104 -0
- flwr/proto/serverappio_pb2_grpc.pyi +41 -0
- flwr/proto/simulationio_pb2.py +12 -11
- flwr/proto/simulationio_pb2_grpc.py +35 -0
- flwr/proto/simulationio_pb2_grpc.pyi +14 -0
- flwr/server/serverapp/app.py +18 -0
- flwr/server/superlink/fleet/grpc_adapter/grpc_adapter_servicer.py +8 -0
- flwr/server/superlink/fleet/grpc_rere/fleet_servicer.py +35 -0
- flwr/server/superlink/serverappio/serverappio_servicer.py +50 -0
- flwr/server/superlink/simulation/simulationio_servicer.py +23 -0
- flwr/simulation/app.py +17 -0
- {flwr_nightly-1.19.0.dev20250512.dist-info → flwr_nightly-1.19.0.dev20250514.dist-info}/METADATA +1 -1
- {flwr_nightly-1.19.0.dev20250512.dist-info → flwr_nightly-1.19.0.dev20250514.dist-info}/RECORD +31 -31
- {flwr_nightly-1.19.0.dev20250512.dist-info → flwr_nightly-1.19.0.dev20250514.dist-info}/WHEEL +0 -0
- {flwr_nightly-1.19.0.dev20250512.dist-info → flwr_nightly-1.19.0.dev20250514.dist-info}/entry_points.txt +0 -0
flwr/proto/message_pb2.py
CHANGED
@@ -17,7 +17,7 @@ from flwr.proto import recorddict_pb2 as flwr_dot_proto_dot_recorddict__pb2
|
|
17
17
|
from flwr.proto import transport_pb2 as flwr_dot_proto_dot_transport__pb2
|
18
18
|
|
19
19
|
|
20
|
-
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\"|\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\x62\x06proto3')
|
20
|
+
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\"|\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\">\n\x11PushObjectRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\x12\x16\n\x0eobject_content\x18\x02 \x01(\x0c\"\x14\n\x12PushObjectResponse\"&\n\x11PullObjectRequest\x12\x11\n\tobject_id\x18\x01 \x01(\t\",\n\x12PullObjectResponse\x12\x16\n\x0eobject_content\x18\x01 \x01(\x0c\x62\x06proto3')
|
21
21
|
|
22
22
|
_globals = globals()
|
23
23
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -38,4 +38,12 @@ if _descriptor._USE_C_DESCRIPTORS == False:
|
|
38
38
|
_globals['_CONTEXT_RUNCONFIGENTRY']._serialized_end=584
|
39
39
|
_globals['_METADATA']._serialized_start=587
|
40
40
|
_globals['_METADATA']._serialized_end=777
|
41
|
+
_globals['_PUSHOBJECTREQUEST']._serialized_start=779
|
42
|
+
_globals['_PUSHOBJECTREQUEST']._serialized_end=841
|
43
|
+
_globals['_PUSHOBJECTRESPONSE']._serialized_start=843
|
44
|
+
_globals['_PUSHOBJECTRESPONSE']._serialized_end=863
|
45
|
+
_globals['_PULLOBJECTREQUEST']._serialized_start=865
|
46
|
+
_globals['_PULLOBJECTREQUEST']._serialized_end=903
|
47
|
+
_globals['_PULLOBJECTRESPONSE']._serialized_start=905
|
48
|
+
_globals['_PULLOBJECTRESPONSE']._serialized_end=949
|
41
49
|
# @@protoc_insertion_point(module_scope)
|
flwr/proto/message_pb2.pyi
CHANGED
@@ -126,3 +126,47 @@ class Metadata(google.protobuf.message.Message):
|
|
126
126
|
) -> None: ...
|
127
127
|
def ClearField(self, field_name: typing_extensions.Literal["created_at",b"created_at","dst_node_id",b"dst_node_id","group_id",b"group_id","message_id",b"message_id","message_type",b"message_type","reply_to_message_id",b"reply_to_message_id","run_id",b"run_id","src_node_id",b"src_node_id","ttl",b"ttl"]) -> None: ...
|
128
128
|
global___Metadata = Metadata
|
129
|
+
|
130
|
+
class PushObjectRequest(google.protobuf.message.Message):
|
131
|
+
"""PushObject messages"""
|
132
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
133
|
+
OBJECT_ID_FIELD_NUMBER: builtins.int
|
134
|
+
OBJECT_CONTENT_FIELD_NUMBER: builtins.int
|
135
|
+
object_id: typing.Text
|
136
|
+
object_content: builtins.bytes
|
137
|
+
def __init__(self,
|
138
|
+
*,
|
139
|
+
object_id: typing.Text = ...,
|
140
|
+
object_content: builtins.bytes = ...,
|
141
|
+
) -> None: ...
|
142
|
+
def ClearField(self, field_name: typing_extensions.Literal["object_content",b"object_content","object_id",b"object_id"]) -> None: ...
|
143
|
+
global___PushObjectRequest = PushObjectRequest
|
144
|
+
|
145
|
+
class PushObjectResponse(google.protobuf.message.Message):
|
146
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
147
|
+
def __init__(self,
|
148
|
+
) -> None: ...
|
149
|
+
global___PushObjectResponse = PushObjectResponse
|
150
|
+
|
151
|
+
class PullObjectRequest(google.protobuf.message.Message):
|
152
|
+
"""PullObject messages"""
|
153
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
154
|
+
OBJECT_ID_FIELD_NUMBER: builtins.int
|
155
|
+
object_id: typing.Text
|
156
|
+
def __init__(self,
|
157
|
+
*,
|
158
|
+
object_id: typing.Text = ...,
|
159
|
+
) -> None: ...
|
160
|
+
def ClearField(self, field_name: typing_extensions.Literal["object_id",b"object_id"]) -> None: ...
|
161
|
+
global___PullObjectRequest = PullObjectRequest
|
162
|
+
|
163
|
+
class PullObjectResponse(google.protobuf.message.Message):
|
164
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
165
|
+
OBJECT_CONTENT_FIELD_NUMBER: builtins.int
|
166
|
+
object_content: builtins.bytes
|
167
|
+
def __init__(self,
|
168
|
+
*,
|
169
|
+
object_content: builtins.bytes = ...,
|
170
|
+
) -> None: ...
|
171
|
+
def ClearField(self, field_name: typing_extensions.Literal["object_content",b"object_content"]) -> None: ...
|
172
|
+
global___PullObjectResponse = PullObjectResponse
|
flwr/proto/serverappio_pb2.py
CHANGED
@@ -12,6 +12,7 @@ from google.protobuf.internal import builder as _builder
|
|
12
12
|
_sym_db = _symbol_database.Default()
|
13
13
|
|
14
14
|
|
15
|
+
from flwr.proto import heartbeat_pb2 as flwr_dot_proto_dot_heartbeat__pb2
|
15
16
|
from flwr.proto import log_pb2 as flwr_dot_proto_dot_log__pb2
|
16
17
|
from flwr.proto import node_pb2 as flwr_dot_proto_dot_node__pb2
|
17
18
|
from flwr.proto import message_pb2 as flwr_dot_proto_dot_message__pb2
|
@@ -19,33 +20,33 @@ from flwr.proto import run_pb2 as flwr_dot_proto_dot_run__pb2
|
|
19
20
|
from flwr.proto import fab_pb2 as flwr_dot_proto_dot_fab__pb2
|
20
21
|
|
21
22
|
|
22
|
-
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\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\"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\
|
23
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1c\x66lwr/proto/serverappio.proto\x12\nflwr.proto\x1a\x1a\x66lwr/proto/heartbeat.proto\x1a\x14\x66lwr/proto/log.proto\x1a\x15\x66lwr/proto/node.proto\x1a\x18\x66lwr/proto/message.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\"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\xb0\t\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\x12Y\n\x0cPushMessages\x12\".flwr.proto.PushInsMessagesRequest\x1a#.flwr.proto.PushInsMessagesResponse\"\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\x12_\n\x10SendAppHeartbeat\x12#.flwr.proto.SendAppHeartbeatRequest\x1a$.flwr.proto.SendAppHeartbeatResponse\"\x00\x12M\n\nPushObject\x12\x1d.flwr.proto.PushObjectRequest\x1a\x1e.flwr.proto.PushObjectResponse\"\x00\x12M\n\nPullObject\x12\x1d.flwr.proto.PullObjectRequest\x1a\x1e.flwr.proto.PullObjectResponse\"\x00\x62\x06proto3')
|
23
24
|
|
24
25
|
_globals = globals()
|
25
26
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
26
27
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.serverappio_pb2', _globals)
|
27
28
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
28
29
|
DESCRIPTOR._options = None
|
29
|
-
_globals['_GETNODESREQUEST']._serialized_start=
|
30
|
-
_globals['_GETNODESREQUEST']._serialized_end=
|
31
|
-
_globals['_GETNODESRESPONSE']._serialized_start=
|
32
|
-
_globals['_GETNODESRESPONSE']._serialized_end=
|
33
|
-
_globals['_PUSHINSMESSAGESREQUEST']._serialized_start=
|
34
|
-
_globals['_PUSHINSMESSAGESREQUEST']._serialized_end=
|
35
|
-
_globals['_PUSHINSMESSAGESRESPONSE']._serialized_start=
|
36
|
-
_globals['_PUSHINSMESSAGESRESPONSE']._serialized_end=
|
37
|
-
_globals['_PULLRESMESSAGESREQUEST']._serialized_start=
|
38
|
-
_globals['_PULLRESMESSAGESREQUEST']._serialized_end=
|
39
|
-
_globals['_PULLRESMESSAGESRESPONSE']._serialized_start=
|
40
|
-
_globals['_PULLRESMESSAGESRESPONSE']._serialized_end=
|
41
|
-
_globals['_PULLSERVERAPPINPUTSREQUEST']._serialized_start=
|
42
|
-
_globals['_PULLSERVERAPPINPUTSREQUEST']._serialized_end=
|
43
|
-
_globals['_PULLSERVERAPPINPUTSRESPONSE']._serialized_start=
|
44
|
-
_globals['_PULLSERVERAPPINPUTSRESPONSE']._serialized_end=
|
45
|
-
_globals['_PUSHSERVERAPPOUTPUTSREQUEST']._serialized_start=
|
46
|
-
_globals['_PUSHSERVERAPPOUTPUTSREQUEST']._serialized_end=
|
47
|
-
_globals['_PUSHSERVERAPPOUTPUTSRESPONSE']._serialized_start=
|
48
|
-
_globals['_PUSHSERVERAPPOUTPUTSRESPONSE']._serialized_end=
|
49
|
-
_globals['_SERVERAPPIO']._serialized_start=
|
50
|
-
_globals['_SERVERAPPIO']._serialized_end=
|
30
|
+
_globals['_GETNODESREQUEST']._serialized_start=187
|
31
|
+
_globals['_GETNODESREQUEST']._serialized_end=220
|
32
|
+
_globals['_GETNODESRESPONSE']._serialized_start=222
|
33
|
+
_globals['_GETNODESRESPONSE']._serialized_end=273
|
34
|
+
_globals['_PUSHINSMESSAGESREQUEST']._serialized_start=275
|
35
|
+
_globals['_PUSHINSMESSAGESREQUEST']._serialized_end=359
|
36
|
+
_globals['_PUSHINSMESSAGESRESPONSE']._serialized_start=361
|
37
|
+
_globals['_PUSHINSMESSAGESRESPONSE']._serialized_end=407
|
38
|
+
_globals['_PULLRESMESSAGESREQUEST']._serialized_start=409
|
39
|
+
_globals['_PULLRESMESSAGESREQUEST']._serialized_end=470
|
40
|
+
_globals['_PULLRESMESSAGESRESPONSE']._serialized_start=472
|
41
|
+
_globals['_PULLRESMESSAGESRESPONSE']._serialized_end=541
|
42
|
+
_globals['_PULLSERVERAPPINPUTSREQUEST']._serialized_start=543
|
43
|
+
_globals['_PULLSERVERAPPINPUTSREQUEST']._serialized_end=571
|
44
|
+
_globals['_PULLSERVERAPPINPUTSRESPONSE']._serialized_start=573
|
45
|
+
_globals['_PULLSERVERAPPINPUTSRESPONSE']._serialized_end=700
|
46
|
+
_globals['_PUSHSERVERAPPOUTPUTSREQUEST']._serialized_start=702
|
47
|
+
_globals['_PUSHSERVERAPPOUTPUTSREQUEST']._serialized_end=785
|
48
|
+
_globals['_PUSHSERVERAPPOUTPUTSRESPONSE']._serialized_start=787
|
49
|
+
_globals['_PUSHSERVERAPPOUTPUTSRESPONSE']._serialized_end=817
|
50
|
+
_globals['_SERVERAPPIO']._serialized_start=820
|
51
|
+
_globals['_SERVERAPPIO']._serialized_end=2020
|
51
52
|
# @@protoc_insertion_point(module_scope)
|
@@ -3,7 +3,9 @@
|
|
3
3
|
import grpc
|
4
4
|
|
5
5
|
from flwr.proto import fab_pb2 as flwr_dot_proto_dot_fab__pb2
|
6
|
+
from flwr.proto import heartbeat_pb2 as flwr_dot_proto_dot_heartbeat__pb2
|
6
7
|
from flwr.proto import log_pb2 as flwr_dot_proto_dot_log__pb2
|
8
|
+
from flwr.proto import message_pb2 as flwr_dot_proto_dot_message__pb2
|
7
9
|
from flwr.proto import run_pb2 as flwr_dot_proto_dot_run__pb2
|
8
10
|
from flwr.proto import serverappio_pb2 as flwr_dot_proto_dot_serverappio__pb2
|
9
11
|
|
@@ -72,6 +74,21 @@ class ServerAppIoStub(object):
|
|
72
74
|
request_serializer=flwr_dot_proto_dot_log__pb2.PushLogsRequest.SerializeToString,
|
73
75
|
response_deserializer=flwr_dot_proto_dot_log__pb2.PushLogsResponse.FromString,
|
74
76
|
)
|
77
|
+
self.SendAppHeartbeat = channel.unary_unary(
|
78
|
+
'/flwr.proto.ServerAppIo/SendAppHeartbeat',
|
79
|
+
request_serializer=flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatRequest.SerializeToString,
|
80
|
+
response_deserializer=flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatResponse.FromString,
|
81
|
+
)
|
82
|
+
self.PushObject = channel.unary_unary(
|
83
|
+
'/flwr.proto.ServerAppIo/PushObject',
|
84
|
+
request_serializer=flwr_dot_proto_dot_message__pb2.PushObjectRequest.SerializeToString,
|
85
|
+
response_deserializer=flwr_dot_proto_dot_message__pb2.PushObjectResponse.FromString,
|
86
|
+
)
|
87
|
+
self.PullObject = channel.unary_unary(
|
88
|
+
'/flwr.proto.ServerAppIo/PullObject',
|
89
|
+
request_serializer=flwr_dot_proto_dot_message__pb2.PullObjectRequest.SerializeToString,
|
90
|
+
response_deserializer=flwr_dot_proto_dot_message__pb2.PullObjectResponse.FromString,
|
91
|
+
)
|
75
92
|
|
76
93
|
|
77
94
|
class ServerAppIoServicer(object):
|
@@ -154,6 +171,27 @@ class ServerAppIoServicer(object):
|
|
154
171
|
context.set_details('Method not implemented!')
|
155
172
|
raise NotImplementedError('Method not implemented!')
|
156
173
|
|
174
|
+
def SendAppHeartbeat(self, request, context):
|
175
|
+
"""Heartbeat
|
176
|
+
"""
|
177
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
178
|
+
context.set_details('Method not implemented!')
|
179
|
+
raise NotImplementedError('Method not implemented!')
|
180
|
+
|
181
|
+
def PushObject(self, request, context):
|
182
|
+
"""Push Object
|
183
|
+
"""
|
184
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
185
|
+
context.set_details('Method not implemented!')
|
186
|
+
raise NotImplementedError('Method not implemented!')
|
187
|
+
|
188
|
+
def PullObject(self, request, context):
|
189
|
+
"""Pull Object
|
190
|
+
"""
|
191
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
192
|
+
context.set_details('Method not implemented!')
|
193
|
+
raise NotImplementedError('Method not implemented!')
|
194
|
+
|
157
195
|
|
158
196
|
def add_ServerAppIoServicer_to_server(servicer, server):
|
159
197
|
rpc_method_handlers = {
|
@@ -212,6 +250,21 @@ def add_ServerAppIoServicer_to_server(servicer, server):
|
|
212
250
|
request_deserializer=flwr_dot_proto_dot_log__pb2.PushLogsRequest.FromString,
|
213
251
|
response_serializer=flwr_dot_proto_dot_log__pb2.PushLogsResponse.SerializeToString,
|
214
252
|
),
|
253
|
+
'SendAppHeartbeat': grpc.unary_unary_rpc_method_handler(
|
254
|
+
servicer.SendAppHeartbeat,
|
255
|
+
request_deserializer=flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatRequest.FromString,
|
256
|
+
response_serializer=flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatResponse.SerializeToString,
|
257
|
+
),
|
258
|
+
'PushObject': grpc.unary_unary_rpc_method_handler(
|
259
|
+
servicer.PushObject,
|
260
|
+
request_deserializer=flwr_dot_proto_dot_message__pb2.PushObjectRequest.FromString,
|
261
|
+
response_serializer=flwr_dot_proto_dot_message__pb2.PushObjectResponse.SerializeToString,
|
262
|
+
),
|
263
|
+
'PullObject': grpc.unary_unary_rpc_method_handler(
|
264
|
+
servicer.PullObject,
|
265
|
+
request_deserializer=flwr_dot_proto_dot_message__pb2.PullObjectRequest.FromString,
|
266
|
+
response_serializer=flwr_dot_proto_dot_message__pb2.PullObjectResponse.SerializeToString,
|
267
|
+
),
|
215
268
|
}
|
216
269
|
generic_handler = grpc.method_handlers_generic_handler(
|
217
270
|
'flwr.proto.ServerAppIo', rpc_method_handlers)
|
@@ -408,3 +461,54 @@ class ServerAppIo(object):
|
|
408
461
|
flwr_dot_proto_dot_log__pb2.PushLogsResponse.FromString,
|
409
462
|
options, channel_credentials,
|
410
463
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
464
|
+
|
465
|
+
@staticmethod
|
466
|
+
def SendAppHeartbeat(request,
|
467
|
+
target,
|
468
|
+
options=(),
|
469
|
+
channel_credentials=None,
|
470
|
+
call_credentials=None,
|
471
|
+
insecure=False,
|
472
|
+
compression=None,
|
473
|
+
wait_for_ready=None,
|
474
|
+
timeout=None,
|
475
|
+
metadata=None):
|
476
|
+
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ServerAppIo/SendAppHeartbeat',
|
477
|
+
flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatRequest.SerializeToString,
|
478
|
+
flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatResponse.FromString,
|
479
|
+
options, channel_credentials,
|
480
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
481
|
+
|
482
|
+
@staticmethod
|
483
|
+
def PushObject(request,
|
484
|
+
target,
|
485
|
+
options=(),
|
486
|
+
channel_credentials=None,
|
487
|
+
call_credentials=None,
|
488
|
+
insecure=False,
|
489
|
+
compression=None,
|
490
|
+
wait_for_ready=None,
|
491
|
+
timeout=None,
|
492
|
+
metadata=None):
|
493
|
+
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ServerAppIo/PushObject',
|
494
|
+
flwr_dot_proto_dot_message__pb2.PushObjectRequest.SerializeToString,
|
495
|
+
flwr_dot_proto_dot_message__pb2.PushObjectResponse.FromString,
|
496
|
+
options, channel_credentials,
|
497
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
498
|
+
|
499
|
+
@staticmethod
|
500
|
+
def PullObject(request,
|
501
|
+
target,
|
502
|
+
options=(),
|
503
|
+
channel_credentials=None,
|
504
|
+
call_credentials=None,
|
505
|
+
insecure=False,
|
506
|
+
compression=None,
|
507
|
+
wait_for_ready=None,
|
508
|
+
timeout=None,
|
509
|
+
metadata=None):
|
510
|
+
return grpc.experimental.unary_unary(request, target, '/flwr.proto.ServerAppIo/PullObject',
|
511
|
+
flwr_dot_proto_dot_message__pb2.PullObjectRequest.SerializeToString,
|
512
|
+
flwr_dot_proto_dot_message__pb2.PullObjectResponse.FromString,
|
513
|
+
options, channel_credentials,
|
514
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
@@ -4,7 +4,9 @@ isort:skip_file
|
|
4
4
|
"""
|
5
5
|
import abc
|
6
6
|
import flwr.proto.fab_pb2
|
7
|
+
import flwr.proto.heartbeat_pb2
|
7
8
|
import flwr.proto.log_pb2
|
9
|
+
import flwr.proto.message_pb2
|
8
10
|
import flwr.proto.run_pb2
|
9
11
|
import flwr.proto.serverappio_pb2
|
10
12
|
import grpc
|
@@ -66,6 +68,21 @@ class ServerAppIoStub:
|
|
66
68
|
flwr.proto.log_pb2.PushLogsResponse]
|
67
69
|
"""Push ServerApp logs"""
|
68
70
|
|
71
|
+
SendAppHeartbeat: grpc.UnaryUnaryMultiCallable[
|
72
|
+
flwr.proto.heartbeat_pb2.SendAppHeartbeatRequest,
|
73
|
+
flwr.proto.heartbeat_pb2.SendAppHeartbeatResponse]
|
74
|
+
"""Heartbeat"""
|
75
|
+
|
76
|
+
PushObject: grpc.UnaryUnaryMultiCallable[
|
77
|
+
flwr.proto.message_pb2.PushObjectRequest,
|
78
|
+
flwr.proto.message_pb2.PushObjectResponse]
|
79
|
+
"""Push Object"""
|
80
|
+
|
81
|
+
PullObject: grpc.UnaryUnaryMultiCallable[
|
82
|
+
flwr.proto.message_pb2.PullObjectRequest,
|
83
|
+
flwr.proto.message_pb2.PullObjectResponse]
|
84
|
+
"""Pull Object"""
|
85
|
+
|
69
86
|
|
70
87
|
class ServerAppIoServicer(metaclass=abc.ABCMeta):
|
71
88
|
@abc.abstractmethod
|
@@ -156,5 +173,29 @@ class ServerAppIoServicer(metaclass=abc.ABCMeta):
|
|
156
173
|
"""Push ServerApp logs"""
|
157
174
|
pass
|
158
175
|
|
176
|
+
@abc.abstractmethod
|
177
|
+
def SendAppHeartbeat(self,
|
178
|
+
request: flwr.proto.heartbeat_pb2.SendAppHeartbeatRequest,
|
179
|
+
context: grpc.ServicerContext,
|
180
|
+
) -> flwr.proto.heartbeat_pb2.SendAppHeartbeatResponse:
|
181
|
+
"""Heartbeat"""
|
182
|
+
pass
|
183
|
+
|
184
|
+
@abc.abstractmethod
|
185
|
+
def PushObject(self,
|
186
|
+
request: flwr.proto.message_pb2.PushObjectRequest,
|
187
|
+
context: grpc.ServicerContext,
|
188
|
+
) -> flwr.proto.message_pb2.PushObjectResponse:
|
189
|
+
"""Push Object"""
|
190
|
+
pass
|
191
|
+
|
192
|
+
@abc.abstractmethod
|
193
|
+
def PullObject(self,
|
194
|
+
request: flwr.proto.message_pb2.PullObjectRequest,
|
195
|
+
context: grpc.ServicerContext,
|
196
|
+
) -> flwr.proto.message_pb2.PullObjectResponse:
|
197
|
+
"""Pull Object"""
|
198
|
+
pass
|
199
|
+
|
159
200
|
|
160
201
|
def add_ServerAppIoServicer_to_server(servicer: ServerAppIoServicer, server: grpc.Server) -> None: ...
|
flwr/proto/simulationio_pb2.py
CHANGED
@@ -12,27 +12,28 @@ from google.protobuf.internal import builder as _builder
|
|
12
12
|
_sym_db = _symbol_database.Default()
|
13
13
|
|
14
14
|
|
15
|
+
from flwr.proto import heartbeat_pb2 as flwr_dot_proto_dot_heartbeat__pb2
|
15
16
|
from flwr.proto import log_pb2 as flwr_dot_proto_dot_log__pb2
|
16
17
|
from flwr.proto import message_pb2 as flwr_dot_proto_dot_message__pb2
|
17
18
|
from flwr.proto import run_pb2 as flwr_dot_proto_dot_run__pb2
|
18
19
|
from flwr.proto import fab_pb2 as flwr_dot_proto_dot_fab__pb2
|
19
20
|
|
20
21
|
|
21
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x66lwr/proto/simulationio.proto\x12\nflwr.proto\x1a\x14\x66lwr/proto/log.proto\x1a\x18\x66lwr/proto/message.proto\x1a\x14\x66lwr/proto/run.proto\x1a\x14\x66lwr/proto/fab.proto\"\x1d\n\x1bPullSimulationInputsRequest\"\x80\x01\n\x1cPullSimulationInputsResponse\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\"T\n\x1cPushSimulationOutputsRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12$\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x13.flwr.proto.Context\"\x1f\n\x1dPushSimulationOutputsResponse2\
|
22
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1d\x66lwr/proto/simulationio.proto\x12\nflwr.proto\x1a\x1a\x66lwr/proto/heartbeat.proto\x1a\x14\x66lwr/proto/log.proto\x1a\x18\x66lwr/proto/message.proto\x1a\x14\x66lwr/proto/run.proto\x1a\x14\x66lwr/proto/fab.proto\"\x1d\n\x1bPullSimulationInputsRequest\"\x80\x01\n\x1cPullSimulationInputsResponse\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\"T\n\x1cPushSimulationOutputsRequest\x12\x0e\n\x06run_id\x18\x01 \x01(\x04\x12$\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x13.flwr.proto.Context\"\x1f\n\x1dPushSimulationOutputsResponse2\xb5\x05\n\x0cSimulationIo\x12k\n\x14PullSimulationInputs\x12\'.flwr.proto.PullSimulationInputsRequest\x1a(.flwr.proto.PullSimulationInputsResponse\"\x00\x12n\n\x15PushSimulationOutputs\x12(.flwr.proto.PushSimulationOutputsRequest\x1a).flwr.proto.PushSimulationOutputsResponse\"\x00\x12\\\n\x0fUpdateRunStatus\x12\".flwr.proto.UpdateRunStatusRequest\x1a#.flwr.proto.UpdateRunStatusResponse\"\x00\x12G\n\x08PushLogs\x12\x1b.flwr.proto.PushLogsRequest\x1a\x1c.flwr.proto.PushLogsResponse\"\x00\x12k\n\x14GetFederationOptions\x12\'.flwr.proto.GetFederationOptionsRequest\x1a(.flwr.proto.GetFederationOptionsResponse\"\x00\x12S\n\x0cGetRunStatus\x12\x1f.flwr.proto.GetRunStatusRequest\x1a .flwr.proto.GetRunStatusResponse\"\x00\x12_\n\x10SendAppHeartbeat\x12#.flwr.proto.SendAppHeartbeatRequest\x1a$.flwr.proto.SendAppHeartbeatResponse\"\x00\x62\x06proto3')
|
22
23
|
|
23
24
|
_globals = globals()
|
24
25
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
25
26
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.simulationio_pb2', _globals)
|
26
27
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
27
28
|
DESCRIPTOR._options = None
|
28
|
-
_globals['_PULLSIMULATIONINPUTSREQUEST']._serialized_start=
|
29
|
-
_globals['_PULLSIMULATIONINPUTSREQUEST']._serialized_end=
|
30
|
-
_globals['_PULLSIMULATIONINPUTSRESPONSE']._serialized_start=
|
31
|
-
_globals['_PULLSIMULATIONINPUTSRESPONSE']._serialized_end=
|
32
|
-
_globals['_PUSHSIMULATIONOUTPUTSREQUEST']._serialized_start=
|
33
|
-
_globals['_PUSHSIMULATIONOUTPUTSREQUEST']._serialized_end=
|
34
|
-
_globals['_PUSHSIMULATIONOUTPUTSRESPONSE']._serialized_start=
|
35
|
-
_globals['_PUSHSIMULATIONOUTPUTSRESPONSE']._serialized_end=
|
36
|
-
_globals['_SIMULATIONIO']._serialized_start=
|
37
|
-
_globals['_SIMULATIONIO']._serialized_end=
|
29
|
+
_globals['_PULLSIMULATIONINPUTSREQUEST']._serialized_start=165
|
30
|
+
_globals['_PULLSIMULATIONINPUTSREQUEST']._serialized_end=194
|
31
|
+
_globals['_PULLSIMULATIONINPUTSRESPONSE']._serialized_start=197
|
32
|
+
_globals['_PULLSIMULATIONINPUTSRESPONSE']._serialized_end=325
|
33
|
+
_globals['_PUSHSIMULATIONOUTPUTSREQUEST']._serialized_start=327
|
34
|
+
_globals['_PUSHSIMULATIONOUTPUTSREQUEST']._serialized_end=411
|
35
|
+
_globals['_PUSHSIMULATIONOUTPUTSRESPONSE']._serialized_start=413
|
36
|
+
_globals['_PUSHSIMULATIONOUTPUTSRESPONSE']._serialized_end=444
|
37
|
+
_globals['_SIMULATIONIO']._serialized_start=447
|
38
|
+
_globals['_SIMULATIONIO']._serialized_end=1140
|
38
39
|
# @@protoc_insertion_point(module_scope)
|
@@ -2,6 +2,7 @@
|
|
2
2
|
"""Client and server classes corresponding to protobuf-defined services."""
|
3
3
|
import grpc
|
4
4
|
|
5
|
+
from flwr.proto import heartbeat_pb2 as flwr_dot_proto_dot_heartbeat__pb2
|
5
6
|
from flwr.proto import log_pb2 as flwr_dot_proto_dot_log__pb2
|
6
7
|
from flwr.proto import run_pb2 as flwr_dot_proto_dot_run__pb2
|
7
8
|
from flwr.proto import simulationio_pb2 as flwr_dot_proto_dot_simulationio__pb2
|
@@ -46,6 +47,11 @@ class SimulationIoStub(object):
|
|
46
47
|
request_serializer=flwr_dot_proto_dot_run__pb2.GetRunStatusRequest.SerializeToString,
|
47
48
|
response_deserializer=flwr_dot_proto_dot_run__pb2.GetRunStatusResponse.FromString,
|
48
49
|
)
|
50
|
+
self.SendAppHeartbeat = channel.unary_unary(
|
51
|
+
'/flwr.proto.SimulationIo/SendAppHeartbeat',
|
52
|
+
request_serializer=flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatRequest.SerializeToString,
|
53
|
+
response_deserializer=flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatResponse.FromString,
|
54
|
+
)
|
49
55
|
|
50
56
|
|
51
57
|
class SimulationIoServicer(object):
|
@@ -93,6 +99,13 @@ class SimulationIoServicer(object):
|
|
93
99
|
context.set_details('Method not implemented!')
|
94
100
|
raise NotImplementedError('Method not implemented!')
|
95
101
|
|
102
|
+
def SendAppHeartbeat(self, request, context):
|
103
|
+
"""Heartbeat
|
104
|
+
"""
|
105
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
106
|
+
context.set_details('Method not implemented!')
|
107
|
+
raise NotImplementedError('Method not implemented!')
|
108
|
+
|
96
109
|
|
97
110
|
def add_SimulationIoServicer_to_server(servicer, server):
|
98
111
|
rpc_method_handlers = {
|
@@ -126,6 +139,11 @@ def add_SimulationIoServicer_to_server(servicer, server):
|
|
126
139
|
request_deserializer=flwr_dot_proto_dot_run__pb2.GetRunStatusRequest.FromString,
|
127
140
|
response_serializer=flwr_dot_proto_dot_run__pb2.GetRunStatusResponse.SerializeToString,
|
128
141
|
),
|
142
|
+
'SendAppHeartbeat': grpc.unary_unary_rpc_method_handler(
|
143
|
+
servicer.SendAppHeartbeat,
|
144
|
+
request_deserializer=flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatRequest.FromString,
|
145
|
+
response_serializer=flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatResponse.SerializeToString,
|
146
|
+
),
|
129
147
|
}
|
130
148
|
generic_handler = grpc.method_handlers_generic_handler(
|
131
149
|
'flwr.proto.SimulationIo', rpc_method_handlers)
|
@@ -237,3 +255,20 @@ class SimulationIo(object):
|
|
237
255
|
flwr_dot_proto_dot_run__pb2.GetRunStatusResponse.FromString,
|
238
256
|
options, channel_credentials,
|
239
257
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
258
|
+
|
259
|
+
@staticmethod
|
260
|
+
def SendAppHeartbeat(request,
|
261
|
+
target,
|
262
|
+
options=(),
|
263
|
+
channel_credentials=None,
|
264
|
+
call_credentials=None,
|
265
|
+
insecure=False,
|
266
|
+
compression=None,
|
267
|
+
wait_for_ready=None,
|
268
|
+
timeout=None,
|
269
|
+
metadata=None):
|
270
|
+
return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/SendAppHeartbeat',
|
271
|
+
flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatRequest.SerializeToString,
|
272
|
+
flwr_dot_proto_dot_heartbeat__pb2.SendAppHeartbeatResponse.FromString,
|
273
|
+
options, channel_credentials,
|
274
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
@@ -3,6 +3,7 @@
|
|
3
3
|
isort:skip_file
|
4
4
|
"""
|
5
5
|
import abc
|
6
|
+
import flwr.proto.heartbeat_pb2
|
6
7
|
import flwr.proto.log_pb2
|
7
8
|
import flwr.proto.run_pb2
|
8
9
|
import flwr.proto.simulationio_pb2
|
@@ -40,6 +41,11 @@ class SimulationIoStub:
|
|
40
41
|
flwr.proto.run_pb2.GetRunStatusResponse]
|
41
42
|
"""Get Run Status"""
|
42
43
|
|
44
|
+
SendAppHeartbeat: grpc.UnaryUnaryMultiCallable[
|
45
|
+
flwr.proto.heartbeat_pb2.SendAppHeartbeatRequest,
|
46
|
+
flwr.proto.heartbeat_pb2.SendAppHeartbeatResponse]
|
47
|
+
"""Heartbeat"""
|
48
|
+
|
43
49
|
|
44
50
|
class SimulationIoServicer(metaclass=abc.ABCMeta):
|
45
51
|
@abc.abstractmethod
|
@@ -90,5 +96,13 @@ class SimulationIoServicer(metaclass=abc.ABCMeta):
|
|
90
96
|
"""Get Run Status"""
|
91
97
|
pass
|
92
98
|
|
99
|
+
@abc.abstractmethod
|
100
|
+
def SendAppHeartbeat(self,
|
101
|
+
request: flwr.proto.heartbeat_pb2.SendAppHeartbeatRequest,
|
102
|
+
context: grpc.ServicerContext,
|
103
|
+
) -> flwr.proto.heartbeat_pb2.SendAppHeartbeatResponse:
|
104
|
+
"""Heartbeat"""
|
105
|
+
pass
|
106
|
+
|
93
107
|
|
94
108
|
def add_SimulationIoServicer_to_server(servicer: SimulationIoServicer, server: grpc.Server) -> None: ...
|
flwr/server/serverapp/app.py
CHANGED
@@ -38,6 +38,7 @@ from flwr.common.constant import (
|
|
38
38
|
SubStatus,
|
39
39
|
)
|
40
40
|
from flwr.common.exit import ExitCode, flwr_exit
|
41
|
+
from flwr.common.heartbeat import HeartbeatSender, get_grpc_app_heartbeat_fn
|
41
42
|
from flwr.common.logger import (
|
42
43
|
log,
|
43
44
|
mirror_output_to_queue,
|
@@ -117,6 +118,7 @@ def run_serverapp( # pylint: disable=R0914, disable=W0212, disable=R0915
|
|
117
118
|
success = True
|
118
119
|
hash_run_id = None
|
119
120
|
run_status = None
|
121
|
+
heartbeat_sender = None
|
120
122
|
while True:
|
121
123
|
|
122
124
|
try:
|
@@ -182,6 +184,16 @@ def run_serverapp( # pylint: disable=R0914, disable=W0212, disable=R0915
|
|
182
184
|
event_details={"run-id-hash": hash_run_id},
|
183
185
|
)
|
184
186
|
|
187
|
+
# Set up heartbeat sender
|
188
|
+
heartbeat_fn = get_grpc_app_heartbeat_fn(
|
189
|
+
grid._stub,
|
190
|
+
run.run_id,
|
191
|
+
failure_message="Heartbeat failed unexpectedly. The SuperLink could "
|
192
|
+
"not find the provided run ID, or the run status is invalid.",
|
193
|
+
)
|
194
|
+
heartbeat_sender = HeartbeatSender(heartbeat_fn)
|
195
|
+
heartbeat_sender.start()
|
196
|
+
|
185
197
|
# Load and run the ServerApp with the Grid
|
186
198
|
updated_context = run_(
|
187
199
|
grid=grid,
|
@@ -213,6 +225,11 @@ def run_serverapp( # pylint: disable=R0914, disable=W0212, disable=R0915
|
|
213
225
|
success = False
|
214
226
|
|
215
227
|
finally:
|
228
|
+
# Stop heartbeat sender
|
229
|
+
if heartbeat_sender:
|
230
|
+
heartbeat_sender.stop()
|
231
|
+
heartbeat_sender = None
|
232
|
+
|
216
233
|
# Stop log uploader for this run and upload final logs
|
217
234
|
if log_uploader:
|
218
235
|
stop_log_uploader(log_queue, log_uploader)
|
@@ -226,6 +243,7 @@ def run_serverapp( # pylint: disable=R0914, disable=W0212, disable=R0915
|
|
226
243
|
run_id=run.run_id, run_status=run_status_proto
|
227
244
|
)
|
228
245
|
)
|
246
|
+
|
229
247
|
event(
|
230
248
|
EventType.FLWR_SERVERAPP_RUN_LEAVE,
|
231
249
|
event_details={"run-id-hash": hash_run_id, "success": success},
|
@@ -40,6 +40,10 @@ from flwr.proto.fleet_pb2 import ( # pylint: disable=E0611
|
|
40
40
|
)
|
41
41
|
from flwr.proto.grpcadapter_pb2 import MessageContainer # pylint: disable=E0611
|
42
42
|
from flwr.proto.heartbeat_pb2 import SendNodeHeartbeatRequest # pylint: disable=E0611
|
43
|
+
from flwr.proto.message_pb2 import ( # pylint: disable=E0611
|
44
|
+
PullObjectRequest,
|
45
|
+
PushObjectRequest,
|
46
|
+
)
|
43
47
|
from flwr.proto.run_pb2 import GetRunRequest # pylint: disable=E0611
|
44
48
|
|
45
49
|
from ..grpc_rere.fleet_servicer import FleetServicer
|
@@ -93,4 +97,8 @@ class GrpcAdapterServicer(grpcadapter_pb2_grpc.GrpcAdapterServicer, FleetService
|
|
93
97
|
return _handle(request, context, PullMessagesRequest, self.PullMessages)
|
94
98
|
if request.grpc_message_name == PushMessagesRequest.__qualname__:
|
95
99
|
return _handle(request, context, PushMessagesRequest, self.PushMessages)
|
100
|
+
if request.grpc_message_name == PushObjectRequest.__qualname__:
|
101
|
+
return _handle(request, context, PushObjectRequest, self.PushObject)
|
102
|
+
if request.grpc_message_name == PullObjectRequest.__qualname__:
|
103
|
+
return _handle(request, context, PullObjectRequest, self.PullObject)
|
96
104
|
raise ValueError(f"Invalid grpc_message_name: {request.grpc_message_name}")
|
@@ -20,6 +20,7 @@ from logging import DEBUG, INFO
|
|
20
20
|
import grpc
|
21
21
|
from google.protobuf.json_format import MessageToDict
|
22
22
|
|
23
|
+
from flwr.common.inflatable import check_body_len_consistency
|
23
24
|
from flwr.common.logger import log
|
24
25
|
from flwr.common.typing import InvalidRunStatusException
|
25
26
|
from flwr.proto import fleet_pb2_grpc # pylint: disable=E0611
|
@@ -38,6 +39,12 @@ from flwr.proto.heartbeat_pb2 import ( # pylint: disable=E0611
|
|
38
39
|
SendNodeHeartbeatRequest,
|
39
40
|
SendNodeHeartbeatResponse,
|
40
41
|
)
|
42
|
+
from flwr.proto.message_pb2 import ( # pylint: disable=E0611
|
43
|
+
PullObjectRequest,
|
44
|
+
PullObjectResponse,
|
45
|
+
PushObjectRequest,
|
46
|
+
PushObjectResponse,
|
47
|
+
)
|
41
48
|
from flwr.proto.run_pb2 import GetRunRequest, GetRunResponse # pylint: disable=E0611
|
42
49
|
from flwr.server.superlink.ffs.ffs_factory import FfsFactory
|
43
50
|
from flwr.server.superlink.fleet.message_handler import message_handler
|
@@ -158,3 +165,31 @@ class FleetServicer(fleet_pb2_grpc.FleetServicer):
|
|
158
165
|
abort_grpc_context(e.message, context)
|
159
166
|
|
160
167
|
return res
|
168
|
+
|
169
|
+
def PushObject(
|
170
|
+
self, request: PushObjectRequest, context: grpc.ServicerContext
|
171
|
+
) -> PushObjectResponse:
|
172
|
+
"""Push an object to the ObjectStore."""
|
173
|
+
log(
|
174
|
+
DEBUG,
|
175
|
+
"[ServerAppIoServicer.PushObject] Push Object with object_id=%s",
|
176
|
+
request.object_id,
|
177
|
+
)
|
178
|
+
|
179
|
+
if not check_body_len_consistency(request.object_content):
|
180
|
+
# Cancel insertion in ObjectStore
|
181
|
+
context.abort(grpc.StatusCode.PERMISSION_DENIED, "Unexpected object length")
|
182
|
+
|
183
|
+
return PushObjectResponse()
|
184
|
+
|
185
|
+
def PullObject(
|
186
|
+
self, request: PullObjectRequest, context: grpc.ServicerContext
|
187
|
+
) -> PullObjectResponse:
|
188
|
+
"""Pull an object from the ObjectStore."""
|
189
|
+
log(
|
190
|
+
DEBUG,
|
191
|
+
"[ServerAppIoServicer.PullObject] Pull Object with object_id=%s",
|
192
|
+
request.object_id,
|
193
|
+
)
|
194
|
+
|
195
|
+
return PullObjectResponse()
|