flwr-nightly 1.7.0.dev20240116__py3-none-any.whl → 1.7.0.dev20240118__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/app.py +7 -4
- flwr/client/dpfedavg_numpy_client.py +4 -4
- flwr/client/grpc_client/connection.py +7 -4
- flwr/client/grpc_rere_client/connection.py +4 -4
- flwr/client/message_handler/message_handler.py +11 -2
- flwr/client/message_handler/task_handler.py +8 -6
- flwr/client/node_state_tests.py +1 -1
- flwr/client/numpy_client.py +2 -2
- flwr/client/rest_client/connection.py +7 -3
- flwr/client/secure_aggregation/secaggplus_handler.py +6 -6
- flwr/client/typing.py +1 -1
- flwr/common/configsrecord.py +98 -0
- flwr/common/logger.py +14 -0
- flwr/common/metricsrecord.py +96 -0
- flwr/common/parametersrecord.py +110 -0
- flwr/common/recordset.py +8 -18
- flwr/common/recordset_utils.py +87 -0
- flwr/common/retry_invoker.py +1 -0
- flwr/common/serde.py +12 -8
- flwr/common/typing.py +9 -0
- flwr/driver/app.py +5 -3
- flwr/driver/driver.py +3 -3
- flwr/driver/driver_client_proxy.py +24 -15
- flwr/driver/grpc_driver.py +6 -6
- flwr/proto/driver_pb2.py +23 -88
- flwr/proto/fleet_pb2.py +29 -111
- flwr/proto/node_pb2.py +7 -15
- flwr/proto/task_pb2.py +33 -127
- flwr/proto/transport_pb2.py +69 -278
- flwr/server/app.py +9 -3
- flwr/server/driver/driver_servicer.py +4 -4
- flwr/server/fleet/grpc_bidi/flower_service_servicer.py +5 -2
- flwr/server/fleet/grpc_bidi/grpc_bridge.py +9 -6
- flwr/server/fleet/grpc_bidi/grpc_client_proxy.py +4 -1
- flwr/server/fleet/grpc_bidi/grpc_server.py +3 -1
- flwr/server/fleet/grpc_bidi/ins_scheduler.py +7 -4
- flwr/server/fleet/grpc_rere/fleet_servicer.py +2 -2
- flwr/server/fleet/message_handler/message_handler.py +3 -3
- flwr/server/fleet/rest_rere/rest_api.py +1 -1
- flwr/server/state/in_memory_state.py +1 -1
- flwr/server/state/sqlite_state.py +8 -5
- flwr/server/state/state.py +1 -1
- flwr/server/strategy/aggregate.py +8 -8
- flwr/server/strategy/dpfedavg_adaptive.py +1 -1
- flwr/server/strategy/dpfedavg_fixed.py +2 -2
- flwr/server/strategy/fedavg_android.py +0 -2
- flwr/server/strategy/fedmedian.py +1 -1
- flwr/server/strategy/fedxgb_nn_avg.py +9 -2
- flwr/server/strategy/qfedavg.py +1 -1
- flwr/server/utils/validator.py +1 -1
- {flwr_nightly-1.7.0.dev20240116.dist-info → flwr_nightly-1.7.0.dev20240118.dist-info}/METADATA +3 -3
- {flwr_nightly-1.7.0.dev20240116.dist-info → flwr_nightly-1.7.0.dev20240118.dist-info}/RECORD +55 -51
- {flwr_nightly-1.7.0.dev20240116.dist-info → flwr_nightly-1.7.0.dev20240118.dist-info}/LICENSE +0 -0
- {flwr_nightly-1.7.0.dev20240116.dist-info → flwr_nightly-1.7.0.dev20240118.dist-info}/WHEEL +0 -0
- {flwr_nightly-1.7.0.dev20240116.dist-info → flwr_nightly-1.7.0.dev20240118.dist-info}/entry_points.txt +0 -0
flwr/proto/transport_pb2.py
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
3
|
# source: flwr/proto/transport.proto
|
4
|
+
# Protobuf Python Version: 4.25.0
|
4
5
|
"""Generated protocol buffer code."""
|
5
|
-
from google.protobuf.internal import enum_type_wrapper
|
6
6
|
from google.protobuf import descriptor as _descriptor
|
7
7
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
8
|
-
from google.protobuf import message as _message
|
9
|
-
from google.protobuf import reflection as _reflection
|
10
8
|
from google.protobuf import symbol_database as _symbol_database
|
9
|
+
from google.protobuf.internal import builder as _builder
|
11
10
|
# @@protoc_insertion_point(imports)
|
12
11
|
|
13
12
|
_sym_db = _symbol_database.Default()
|
@@ -17,281 +16,73 @@ _sym_db = _symbol_database.Default()
|
|
17
16
|
|
18
17
|
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1a\x66lwr/proto/transport.proto\x12\nflwr.proto\"9\n\x06Status\x12\x1e\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x10.flwr.proto.Code\x12\x0f\n\x07message\x18\x02 \x01(\t\"2\n\nParameters\x12\x0f\n\x07tensors\x18\x01 \x03(\x0c\x12\x13\n\x0btensor_type\x18\x02 \x01(\t\"\xba\x08\n\rServerMessage\x12?\n\rreconnect_ins\x18\x01 \x01(\x0b\x32&.flwr.proto.ServerMessage.ReconnectInsH\x00\x12H\n\x12get_properties_ins\x18\x02 \x01(\x0b\x32*.flwr.proto.ServerMessage.GetPropertiesInsH\x00\x12H\n\x12get_parameters_ins\x18\x03 \x01(\x0b\x32*.flwr.proto.ServerMessage.GetParametersInsH\x00\x12\x33\n\x07\x66it_ins\x18\x04 \x01(\x0b\x32 .flwr.proto.ServerMessage.FitInsH\x00\x12=\n\x0c\x65valuate_ins\x18\x05 \x01(\x0b\x32%.flwr.proto.ServerMessage.EvaluateInsH\x00\x1a\x1f\n\x0cReconnectIns\x12\x0f\n\x07seconds\x18\x01 \x01(\x03\x1a\x9d\x01\n\x10GetPropertiesIns\x12\x46\n\x06\x63onfig\x18\x01 \x03(\x0b\x32\x36.flwr.proto.ServerMessage.GetPropertiesIns.ConfigEntry\x1a\x41\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\x1a\x9d\x01\n\x10GetParametersIns\x12\x46\n\x06\x63onfig\x18\x01 \x03(\x0b\x32\x36.flwr.proto.ServerMessage.GetParametersIns.ConfigEntry\x1a\x41\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\x1a\xb5\x01\n\x06\x46itIns\x12*\n\nparameters\x18\x01 \x01(\x0b\x32\x16.flwr.proto.Parameters\x12<\n\x06\x63onfig\x18\x02 \x03(\x0b\x32,.flwr.proto.ServerMessage.FitIns.ConfigEntry\x1a\x41\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\x1a\xbf\x01\n\x0b\x45valuateIns\x12*\n\nparameters\x18\x01 \x01(\x0b\x32\x16.flwr.proto.Parameters\x12\x41\n\x06\x63onfig\x18\x02 \x03(\x0b\x32\x31.flwr.proto.ServerMessage.EvaluateIns.ConfigEntry\x1a\x41\n\x0b\x43onfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\x42\x05\n\x03msg\"\xa0\t\n\rClientMessage\x12\x41\n\x0e\x64isconnect_res\x18\x01 \x01(\x0b\x32\'.flwr.proto.ClientMessage.DisconnectResH\x00\x12H\n\x12get_properties_res\x18\x02 \x01(\x0b\x32*.flwr.proto.ClientMessage.GetPropertiesResH\x00\x12H\n\x12get_parameters_res\x18\x03 \x01(\x0b\x32*.flwr.proto.ClientMessage.GetParametersResH\x00\x12\x33\n\x07\x66it_res\x18\x04 \x01(\x0b\x32 .flwr.proto.ClientMessage.FitResH\x00\x12=\n\x0c\x65valuate_res\x18\x05 \x01(\x0b\x32%.flwr.proto.ClientMessage.EvaluateResH\x00\x1a\x33\n\rDisconnectRes\x12\"\n\x06reason\x18\x01 \x01(\x0e\x32\x12.flwr.proto.Reason\x1a\xcd\x01\n\x10GetPropertiesRes\x12\"\n\x06status\x18\x01 \x01(\x0b\x32\x12.flwr.proto.Status\x12N\n\nproperties\x18\x02 \x03(\x0b\x32:.flwr.proto.ClientMessage.GetPropertiesRes.PropertiesEntry\x1a\x45\n\x0fPropertiesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\x1a\x62\n\x10GetParametersRes\x12\"\n\x06status\x18\x01 \x01(\x0b\x32\x12.flwr.proto.Status\x12*\n\nparameters\x18\x02 \x01(\x0b\x32\x16.flwr.proto.Parameters\x1a\xf2\x01\n\x06\x46itRes\x12\"\n\x06status\x18\x01 \x01(\x0b\x32\x12.flwr.proto.Status\x12*\n\nparameters\x18\x02 \x01(\x0b\x32\x16.flwr.proto.Parameters\x12\x14\n\x0cnum_examples\x18\x03 \x01(\x03\x12>\n\x07metrics\x18\x04 \x03(\x0b\x32-.flwr.proto.ClientMessage.FitRes.MetricsEntry\x1a\x42\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\x1a\xde\x01\n\x0b\x45valuateRes\x12\"\n\x06status\x18\x01 \x01(\x0b\x32\x12.flwr.proto.Status\x12\x0c\n\x04loss\x18\x02 \x01(\x02\x12\x14\n\x0cnum_examples\x18\x03 \x01(\x03\x12\x43\n\x07metrics\x18\x04 \x03(\x0b\x32\x32.flwr.proto.ClientMessage.EvaluateRes.MetricsEntry\x1a\x42\n\x0cMetricsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.flwr.proto.Scalar:\x02\x38\x01\x42\x05\n\x03msg\"i\n\x06Scalar\x12\x10\n\x06\x64ouble\x18\x01 \x01(\x01H\x00\x12\x10\n\x06sint64\x18\x08 \x01(\x12H\x00\x12\x0e\n\x04\x62ool\x18\r \x01(\x08H\x00\x12\x10\n\x06string\x18\x0e \x01(\tH\x00\x12\x0f\n\x05\x62ytes\x18\x0f \x01(\x0cH\x00\x42\x08\n\x06scalar*\x8d\x01\n\x04\x43ode\x12\x06\n\x02OK\x10\x00\x12\"\n\x1eGET_PROPERTIES_NOT_IMPLEMENTED\x10\x01\x12\"\n\x1eGET_PARAMETERS_NOT_IMPLEMENTED\x10\x02\x12\x17\n\x13\x46IT_NOT_IMPLEMENTED\x10\x03\x12\x1c\n\x18\x45VALUATE_NOT_IMPLEMENTED\x10\x04*[\n\x06Reason\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tRECONNECT\x10\x01\x12\x16\n\x12POWER_DISCONNECTED\x10\x02\x12\x14\n\x10WIFI_UNAVAILABLE\x10\x03\x12\x07\n\x03\x41\x43K\x10\x04\x32S\n\rFlowerService\x12\x42\n\x04Join\x12\x19.flwr.proto.ClientMessage\x1a\x19.flwr.proto.ServerMessage\"\x00(\x01\x30\x01\x62\x06proto3')
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
Reason = enum_type_wrapper.EnumTypeWrapper(_REASON)
|
24
|
-
OK = 0
|
25
|
-
GET_PROPERTIES_NOT_IMPLEMENTED = 1
|
26
|
-
GET_PARAMETERS_NOT_IMPLEMENTED = 2
|
27
|
-
FIT_NOT_IMPLEMENTED = 3
|
28
|
-
EVALUATE_NOT_IMPLEMENTED = 4
|
29
|
-
UNKNOWN = 0
|
30
|
-
RECONNECT = 1
|
31
|
-
POWER_DISCONNECTED = 2
|
32
|
-
WIFI_UNAVAILABLE = 3
|
33
|
-
ACK = 4
|
34
|
-
|
35
|
-
|
36
|
-
_STATUS = DESCRIPTOR.message_types_by_name['Status']
|
37
|
-
_PARAMETERS = DESCRIPTOR.message_types_by_name['Parameters']
|
38
|
-
_SERVERMESSAGE = DESCRIPTOR.message_types_by_name['ServerMessage']
|
39
|
-
_SERVERMESSAGE_RECONNECTINS = _SERVERMESSAGE.nested_types_by_name['ReconnectIns']
|
40
|
-
_SERVERMESSAGE_GETPROPERTIESINS = _SERVERMESSAGE.nested_types_by_name['GetPropertiesIns']
|
41
|
-
_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY = _SERVERMESSAGE_GETPROPERTIESINS.nested_types_by_name['ConfigEntry']
|
42
|
-
_SERVERMESSAGE_GETPARAMETERSINS = _SERVERMESSAGE.nested_types_by_name['GetParametersIns']
|
43
|
-
_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY = _SERVERMESSAGE_GETPARAMETERSINS.nested_types_by_name['ConfigEntry']
|
44
|
-
_SERVERMESSAGE_FITINS = _SERVERMESSAGE.nested_types_by_name['FitIns']
|
45
|
-
_SERVERMESSAGE_FITINS_CONFIGENTRY = _SERVERMESSAGE_FITINS.nested_types_by_name['ConfigEntry']
|
46
|
-
_SERVERMESSAGE_EVALUATEINS = _SERVERMESSAGE.nested_types_by_name['EvaluateIns']
|
47
|
-
_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY = _SERVERMESSAGE_EVALUATEINS.nested_types_by_name['ConfigEntry']
|
48
|
-
_CLIENTMESSAGE = DESCRIPTOR.message_types_by_name['ClientMessage']
|
49
|
-
_CLIENTMESSAGE_DISCONNECTRES = _CLIENTMESSAGE.nested_types_by_name['DisconnectRes']
|
50
|
-
_CLIENTMESSAGE_GETPROPERTIESRES = _CLIENTMESSAGE.nested_types_by_name['GetPropertiesRes']
|
51
|
-
_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY = _CLIENTMESSAGE_GETPROPERTIESRES.nested_types_by_name['PropertiesEntry']
|
52
|
-
_CLIENTMESSAGE_GETPARAMETERSRES = _CLIENTMESSAGE.nested_types_by_name['GetParametersRes']
|
53
|
-
_CLIENTMESSAGE_FITRES = _CLIENTMESSAGE.nested_types_by_name['FitRes']
|
54
|
-
_CLIENTMESSAGE_FITRES_METRICSENTRY = _CLIENTMESSAGE_FITRES.nested_types_by_name['MetricsEntry']
|
55
|
-
_CLIENTMESSAGE_EVALUATERES = _CLIENTMESSAGE.nested_types_by_name['EvaluateRes']
|
56
|
-
_CLIENTMESSAGE_EVALUATERES_METRICSENTRY = _CLIENTMESSAGE_EVALUATERES.nested_types_by_name['MetricsEntry']
|
57
|
-
_SCALAR = DESCRIPTOR.message_types_by_name['Scalar']
|
58
|
-
Status = _reflection.GeneratedProtocolMessageType('Status', (_message.Message,), {
|
59
|
-
'DESCRIPTOR' : _STATUS,
|
60
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
61
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.Status)
|
62
|
-
})
|
63
|
-
_sym_db.RegisterMessage(Status)
|
64
|
-
|
65
|
-
Parameters = _reflection.GeneratedProtocolMessageType('Parameters', (_message.Message,), {
|
66
|
-
'DESCRIPTOR' : _PARAMETERS,
|
67
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
68
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.Parameters)
|
69
|
-
})
|
70
|
-
_sym_db.RegisterMessage(Parameters)
|
71
|
-
|
72
|
-
ServerMessage = _reflection.GeneratedProtocolMessageType('ServerMessage', (_message.Message,), {
|
73
|
-
|
74
|
-
'ReconnectIns' : _reflection.GeneratedProtocolMessageType('ReconnectIns', (_message.Message,), {
|
75
|
-
'DESCRIPTOR' : _SERVERMESSAGE_RECONNECTINS,
|
76
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
77
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ServerMessage.ReconnectIns)
|
78
|
-
})
|
79
|
-
,
|
80
|
-
|
81
|
-
'GetPropertiesIns' : _reflection.GeneratedProtocolMessageType('GetPropertiesIns', (_message.Message,), {
|
82
|
-
|
83
|
-
'ConfigEntry' : _reflection.GeneratedProtocolMessageType('ConfigEntry', (_message.Message,), {
|
84
|
-
'DESCRIPTOR' : _SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY,
|
85
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
86
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ServerMessage.GetPropertiesIns.ConfigEntry)
|
87
|
-
})
|
88
|
-
,
|
89
|
-
'DESCRIPTOR' : _SERVERMESSAGE_GETPROPERTIESINS,
|
90
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
91
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ServerMessage.GetPropertiesIns)
|
92
|
-
})
|
93
|
-
,
|
94
|
-
|
95
|
-
'GetParametersIns' : _reflection.GeneratedProtocolMessageType('GetParametersIns', (_message.Message,), {
|
96
|
-
|
97
|
-
'ConfigEntry' : _reflection.GeneratedProtocolMessageType('ConfigEntry', (_message.Message,), {
|
98
|
-
'DESCRIPTOR' : _SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY,
|
99
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
100
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ServerMessage.GetParametersIns.ConfigEntry)
|
101
|
-
})
|
102
|
-
,
|
103
|
-
'DESCRIPTOR' : _SERVERMESSAGE_GETPARAMETERSINS,
|
104
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
105
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ServerMessage.GetParametersIns)
|
106
|
-
})
|
107
|
-
,
|
108
|
-
|
109
|
-
'FitIns' : _reflection.GeneratedProtocolMessageType('FitIns', (_message.Message,), {
|
110
|
-
|
111
|
-
'ConfigEntry' : _reflection.GeneratedProtocolMessageType('ConfigEntry', (_message.Message,), {
|
112
|
-
'DESCRIPTOR' : _SERVERMESSAGE_FITINS_CONFIGENTRY,
|
113
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
114
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ServerMessage.FitIns.ConfigEntry)
|
115
|
-
})
|
116
|
-
,
|
117
|
-
'DESCRIPTOR' : _SERVERMESSAGE_FITINS,
|
118
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
119
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ServerMessage.FitIns)
|
120
|
-
})
|
121
|
-
,
|
122
|
-
|
123
|
-
'EvaluateIns' : _reflection.GeneratedProtocolMessageType('EvaluateIns', (_message.Message,), {
|
124
|
-
|
125
|
-
'ConfigEntry' : _reflection.GeneratedProtocolMessageType('ConfigEntry', (_message.Message,), {
|
126
|
-
'DESCRIPTOR' : _SERVERMESSAGE_EVALUATEINS_CONFIGENTRY,
|
127
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
128
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ServerMessage.EvaluateIns.ConfigEntry)
|
129
|
-
})
|
130
|
-
,
|
131
|
-
'DESCRIPTOR' : _SERVERMESSAGE_EVALUATEINS,
|
132
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
133
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ServerMessage.EvaluateIns)
|
134
|
-
})
|
135
|
-
,
|
136
|
-
'DESCRIPTOR' : _SERVERMESSAGE,
|
137
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
138
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ServerMessage)
|
139
|
-
})
|
140
|
-
_sym_db.RegisterMessage(ServerMessage)
|
141
|
-
_sym_db.RegisterMessage(ServerMessage.ReconnectIns)
|
142
|
-
_sym_db.RegisterMessage(ServerMessage.GetPropertiesIns)
|
143
|
-
_sym_db.RegisterMessage(ServerMessage.GetPropertiesIns.ConfigEntry)
|
144
|
-
_sym_db.RegisterMessage(ServerMessage.GetParametersIns)
|
145
|
-
_sym_db.RegisterMessage(ServerMessage.GetParametersIns.ConfigEntry)
|
146
|
-
_sym_db.RegisterMessage(ServerMessage.FitIns)
|
147
|
-
_sym_db.RegisterMessage(ServerMessage.FitIns.ConfigEntry)
|
148
|
-
_sym_db.RegisterMessage(ServerMessage.EvaluateIns)
|
149
|
-
_sym_db.RegisterMessage(ServerMessage.EvaluateIns.ConfigEntry)
|
150
|
-
|
151
|
-
ClientMessage = _reflection.GeneratedProtocolMessageType('ClientMessage', (_message.Message,), {
|
152
|
-
|
153
|
-
'DisconnectRes' : _reflection.GeneratedProtocolMessageType('DisconnectRes', (_message.Message,), {
|
154
|
-
'DESCRIPTOR' : _CLIENTMESSAGE_DISCONNECTRES,
|
155
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
156
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ClientMessage.DisconnectRes)
|
157
|
-
})
|
158
|
-
,
|
159
|
-
|
160
|
-
'GetPropertiesRes' : _reflection.GeneratedProtocolMessageType('GetPropertiesRes', (_message.Message,), {
|
161
|
-
|
162
|
-
'PropertiesEntry' : _reflection.GeneratedProtocolMessageType('PropertiesEntry', (_message.Message,), {
|
163
|
-
'DESCRIPTOR' : _CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY,
|
164
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
165
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ClientMessage.GetPropertiesRes.PropertiesEntry)
|
166
|
-
})
|
167
|
-
,
|
168
|
-
'DESCRIPTOR' : _CLIENTMESSAGE_GETPROPERTIESRES,
|
169
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
170
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ClientMessage.GetPropertiesRes)
|
171
|
-
})
|
172
|
-
,
|
173
|
-
|
174
|
-
'GetParametersRes' : _reflection.GeneratedProtocolMessageType('GetParametersRes', (_message.Message,), {
|
175
|
-
'DESCRIPTOR' : _CLIENTMESSAGE_GETPARAMETERSRES,
|
176
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
177
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ClientMessage.GetParametersRes)
|
178
|
-
})
|
179
|
-
,
|
180
|
-
|
181
|
-
'FitRes' : _reflection.GeneratedProtocolMessageType('FitRes', (_message.Message,), {
|
182
|
-
|
183
|
-
'MetricsEntry' : _reflection.GeneratedProtocolMessageType('MetricsEntry', (_message.Message,), {
|
184
|
-
'DESCRIPTOR' : _CLIENTMESSAGE_FITRES_METRICSENTRY,
|
185
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
186
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ClientMessage.FitRes.MetricsEntry)
|
187
|
-
})
|
188
|
-
,
|
189
|
-
'DESCRIPTOR' : _CLIENTMESSAGE_FITRES,
|
190
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
191
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ClientMessage.FitRes)
|
192
|
-
})
|
193
|
-
,
|
194
|
-
|
195
|
-
'EvaluateRes' : _reflection.GeneratedProtocolMessageType('EvaluateRes', (_message.Message,), {
|
196
|
-
|
197
|
-
'MetricsEntry' : _reflection.GeneratedProtocolMessageType('MetricsEntry', (_message.Message,), {
|
198
|
-
'DESCRIPTOR' : _CLIENTMESSAGE_EVALUATERES_METRICSENTRY,
|
199
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
200
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ClientMessage.EvaluateRes.MetricsEntry)
|
201
|
-
})
|
202
|
-
,
|
203
|
-
'DESCRIPTOR' : _CLIENTMESSAGE_EVALUATERES,
|
204
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
205
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ClientMessage.EvaluateRes)
|
206
|
-
})
|
207
|
-
,
|
208
|
-
'DESCRIPTOR' : _CLIENTMESSAGE,
|
209
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
210
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.ClientMessage)
|
211
|
-
})
|
212
|
-
_sym_db.RegisterMessage(ClientMessage)
|
213
|
-
_sym_db.RegisterMessage(ClientMessage.DisconnectRes)
|
214
|
-
_sym_db.RegisterMessage(ClientMessage.GetPropertiesRes)
|
215
|
-
_sym_db.RegisterMessage(ClientMessage.GetPropertiesRes.PropertiesEntry)
|
216
|
-
_sym_db.RegisterMessage(ClientMessage.GetParametersRes)
|
217
|
-
_sym_db.RegisterMessage(ClientMessage.FitRes)
|
218
|
-
_sym_db.RegisterMessage(ClientMessage.FitRes.MetricsEntry)
|
219
|
-
_sym_db.RegisterMessage(ClientMessage.EvaluateRes)
|
220
|
-
_sym_db.RegisterMessage(ClientMessage.EvaluateRes.MetricsEntry)
|
221
|
-
|
222
|
-
Scalar = _reflection.GeneratedProtocolMessageType('Scalar', (_message.Message,), {
|
223
|
-
'DESCRIPTOR' : _SCALAR,
|
224
|
-
'__module__' : 'flwr.proto.transport_pb2'
|
225
|
-
# @@protoc_insertion_point(class_scope:flwr.proto.Scalar)
|
226
|
-
})
|
227
|
-
_sym_db.RegisterMessage(Scalar)
|
228
|
-
|
229
|
-
_FLOWERSERVICE = DESCRIPTOR.services_by_name['FlowerService']
|
19
|
+
_globals = globals()
|
20
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
21
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flwr.proto.transport_pb2', _globals)
|
230
22
|
if _descriptor._USE_C_DESCRIPTORS == False:
|
231
|
-
|
232
23
|
DESCRIPTOR._options = None
|
233
|
-
_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY._options = None
|
234
|
-
_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY._serialized_options = b'8\001'
|
235
|
-
_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY._options = None
|
236
|
-
_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY._serialized_options = b'8\001'
|
237
|
-
_SERVERMESSAGE_FITINS_CONFIGENTRY._options = None
|
238
|
-
_SERVERMESSAGE_FITINS_CONFIGENTRY._serialized_options = b'8\001'
|
239
|
-
_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY._options = None
|
240
|
-
_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY._serialized_options = b'8\001'
|
241
|
-
_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY._options = None
|
242
|
-
_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY._serialized_options = b'8\001'
|
243
|
-
_CLIENTMESSAGE_FITRES_METRICSENTRY._options = None
|
244
|
-
_CLIENTMESSAGE_FITRES_METRICSENTRY._serialized_options = b'8\001'
|
245
|
-
_CLIENTMESSAGE_EVALUATERES_METRICSENTRY._options = None
|
246
|
-
_CLIENTMESSAGE_EVALUATERES_METRICSENTRY._serialized_options = b'8\001'
|
247
|
-
_CODE._serialized_start=2533
|
248
|
-
_CODE._serialized_end=2674
|
249
|
-
_REASON._serialized_start=2676
|
250
|
-
_REASON._serialized_end=2767
|
251
|
-
_STATUS._serialized_start=42
|
252
|
-
_STATUS._serialized_end=99
|
253
|
-
_PARAMETERS._serialized_start=101
|
254
|
-
_PARAMETERS._serialized_end=151
|
255
|
-
_SERVERMESSAGE._serialized_start=154
|
256
|
-
_SERVERMESSAGE._serialized_end=1236
|
257
|
-
_SERVERMESSAGE_RECONNECTINS._serialized_start=500
|
258
|
-
_SERVERMESSAGE_RECONNECTINS._serialized_end=531
|
259
|
-
_SERVERMESSAGE_GETPROPERTIESINS._serialized_start=534
|
260
|
-
_SERVERMESSAGE_GETPROPERTIESINS._serialized_end=691
|
261
|
-
_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY._serialized_start=626
|
262
|
-
_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY._serialized_end=691
|
263
|
-
_SERVERMESSAGE_GETPARAMETERSINS._serialized_start=694
|
264
|
-
_SERVERMESSAGE_GETPARAMETERSINS._serialized_end=851
|
265
|
-
_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY._serialized_start=626
|
266
|
-
_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY._serialized_end=691
|
267
|
-
_SERVERMESSAGE_FITINS._serialized_start=854
|
268
|
-
_SERVERMESSAGE_FITINS._serialized_end=1035
|
269
|
-
_SERVERMESSAGE_FITINS_CONFIGENTRY._serialized_start=626
|
270
|
-
_SERVERMESSAGE_FITINS_CONFIGENTRY._serialized_end=691
|
271
|
-
_SERVERMESSAGE_EVALUATEINS._serialized_start=1038
|
272
|
-
_SERVERMESSAGE_EVALUATEINS._serialized_end=1229
|
273
|
-
_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY._serialized_start=626
|
274
|
-
_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY._serialized_end=691
|
275
|
-
_CLIENTMESSAGE._serialized_start=1239
|
276
|
-
_CLIENTMESSAGE._serialized_end=2423
|
277
|
-
_CLIENTMESSAGE_DISCONNECTRES._serialized_start=1587
|
278
|
-
_CLIENTMESSAGE_DISCONNECTRES._serialized_end=1638
|
279
|
-
_CLIENTMESSAGE_GETPROPERTIESRES._serialized_start=1641
|
280
|
-
_CLIENTMESSAGE_GETPROPERTIESRES._serialized_end=1846
|
281
|
-
_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY._serialized_start=1777
|
282
|
-
_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY._serialized_end=1846
|
283
|
-
_CLIENTMESSAGE_GETPARAMETERSRES._serialized_start=1848
|
284
|
-
_CLIENTMESSAGE_GETPARAMETERSRES._serialized_end=1946
|
285
|
-
_CLIENTMESSAGE_FITRES._serialized_start=1949
|
286
|
-
_CLIENTMESSAGE_FITRES._serialized_end=2191
|
287
|
-
_CLIENTMESSAGE_FITRES_METRICSENTRY._serialized_start=2125
|
288
|
-
_CLIENTMESSAGE_FITRES_METRICSENTRY._serialized_end=2191
|
289
|
-
_CLIENTMESSAGE_EVALUATERES._serialized_start=2194
|
290
|
-
_CLIENTMESSAGE_EVALUATERES._serialized_end=2416
|
291
|
-
_CLIENTMESSAGE_EVALUATERES_METRICSENTRY._serialized_start=2125
|
292
|
-
_CLIENTMESSAGE_EVALUATERES_METRICSENTRY._serialized_end=2191
|
293
|
-
_SCALAR._serialized_start=2425
|
294
|
-
_SCALAR._serialized_end=2530
|
295
|
-
_FLOWERSERVICE._serialized_start=2769
|
296
|
-
_FLOWERSERVICE._serialized_end=2852
|
24
|
+
_globals['_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY']._options = None
|
25
|
+
_globals['_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY']._serialized_options = b'8\001'
|
26
|
+
_globals['_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY']._options = None
|
27
|
+
_globals['_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY']._serialized_options = b'8\001'
|
28
|
+
_globals['_SERVERMESSAGE_FITINS_CONFIGENTRY']._options = None
|
29
|
+
_globals['_SERVERMESSAGE_FITINS_CONFIGENTRY']._serialized_options = b'8\001'
|
30
|
+
_globals['_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY']._options = None
|
31
|
+
_globals['_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY']._serialized_options = b'8\001'
|
32
|
+
_globals['_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY']._options = None
|
33
|
+
_globals['_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY']._serialized_options = b'8\001'
|
34
|
+
_globals['_CLIENTMESSAGE_FITRES_METRICSENTRY']._options = None
|
35
|
+
_globals['_CLIENTMESSAGE_FITRES_METRICSENTRY']._serialized_options = b'8\001'
|
36
|
+
_globals['_CLIENTMESSAGE_EVALUATERES_METRICSENTRY']._options = None
|
37
|
+
_globals['_CLIENTMESSAGE_EVALUATERES_METRICSENTRY']._serialized_options = b'8\001'
|
38
|
+
_globals['_CODE']._serialized_start=2533
|
39
|
+
_globals['_CODE']._serialized_end=2674
|
40
|
+
_globals['_REASON']._serialized_start=2676
|
41
|
+
_globals['_REASON']._serialized_end=2767
|
42
|
+
_globals['_STATUS']._serialized_start=42
|
43
|
+
_globals['_STATUS']._serialized_end=99
|
44
|
+
_globals['_PARAMETERS']._serialized_start=101
|
45
|
+
_globals['_PARAMETERS']._serialized_end=151
|
46
|
+
_globals['_SERVERMESSAGE']._serialized_start=154
|
47
|
+
_globals['_SERVERMESSAGE']._serialized_end=1236
|
48
|
+
_globals['_SERVERMESSAGE_RECONNECTINS']._serialized_start=500
|
49
|
+
_globals['_SERVERMESSAGE_RECONNECTINS']._serialized_end=531
|
50
|
+
_globals['_SERVERMESSAGE_GETPROPERTIESINS']._serialized_start=534
|
51
|
+
_globals['_SERVERMESSAGE_GETPROPERTIESINS']._serialized_end=691
|
52
|
+
_globals['_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY']._serialized_start=626
|
53
|
+
_globals['_SERVERMESSAGE_GETPROPERTIESINS_CONFIGENTRY']._serialized_end=691
|
54
|
+
_globals['_SERVERMESSAGE_GETPARAMETERSINS']._serialized_start=694
|
55
|
+
_globals['_SERVERMESSAGE_GETPARAMETERSINS']._serialized_end=851
|
56
|
+
_globals['_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY']._serialized_start=626
|
57
|
+
_globals['_SERVERMESSAGE_GETPARAMETERSINS_CONFIGENTRY']._serialized_end=691
|
58
|
+
_globals['_SERVERMESSAGE_FITINS']._serialized_start=854
|
59
|
+
_globals['_SERVERMESSAGE_FITINS']._serialized_end=1035
|
60
|
+
_globals['_SERVERMESSAGE_FITINS_CONFIGENTRY']._serialized_start=626
|
61
|
+
_globals['_SERVERMESSAGE_FITINS_CONFIGENTRY']._serialized_end=691
|
62
|
+
_globals['_SERVERMESSAGE_EVALUATEINS']._serialized_start=1038
|
63
|
+
_globals['_SERVERMESSAGE_EVALUATEINS']._serialized_end=1229
|
64
|
+
_globals['_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY']._serialized_start=626
|
65
|
+
_globals['_SERVERMESSAGE_EVALUATEINS_CONFIGENTRY']._serialized_end=691
|
66
|
+
_globals['_CLIENTMESSAGE']._serialized_start=1239
|
67
|
+
_globals['_CLIENTMESSAGE']._serialized_end=2423
|
68
|
+
_globals['_CLIENTMESSAGE_DISCONNECTRES']._serialized_start=1587
|
69
|
+
_globals['_CLIENTMESSAGE_DISCONNECTRES']._serialized_end=1638
|
70
|
+
_globals['_CLIENTMESSAGE_GETPROPERTIESRES']._serialized_start=1641
|
71
|
+
_globals['_CLIENTMESSAGE_GETPROPERTIESRES']._serialized_end=1846
|
72
|
+
_globals['_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY']._serialized_start=1777
|
73
|
+
_globals['_CLIENTMESSAGE_GETPROPERTIESRES_PROPERTIESENTRY']._serialized_end=1846
|
74
|
+
_globals['_CLIENTMESSAGE_GETPARAMETERSRES']._serialized_start=1848
|
75
|
+
_globals['_CLIENTMESSAGE_GETPARAMETERSRES']._serialized_end=1946
|
76
|
+
_globals['_CLIENTMESSAGE_FITRES']._serialized_start=1949
|
77
|
+
_globals['_CLIENTMESSAGE_FITRES']._serialized_end=2191
|
78
|
+
_globals['_CLIENTMESSAGE_FITRES_METRICSENTRY']._serialized_start=2125
|
79
|
+
_globals['_CLIENTMESSAGE_FITRES_METRICSENTRY']._serialized_end=2191
|
80
|
+
_globals['_CLIENTMESSAGE_EVALUATERES']._serialized_start=2194
|
81
|
+
_globals['_CLIENTMESSAGE_EVALUATERES']._serialized_end=2416
|
82
|
+
_globals['_CLIENTMESSAGE_EVALUATERES_METRICSENTRY']._serialized_start=2125
|
83
|
+
_globals['_CLIENTMESSAGE_EVALUATERES_METRICSENTRY']._serialized_end=2191
|
84
|
+
_globals['_SCALAR']._serialized_start=2425
|
85
|
+
_globals['_SCALAR']._serialized_end=2530
|
86
|
+
_globals['_FLOWERSERVICE']._serialized_start=2769
|
87
|
+
_globals['_FLOWERSERVICE']._serialized_end=2852
|
297
88
|
# @@protoc_insertion_point(module_scope)
|
flwr/server/app.py
CHANGED
@@ -38,9 +38,15 @@ from flwr.common.constant import (
|
|
38
38
|
TRANSPORT_TYPE_REST,
|
39
39
|
)
|
40
40
|
from flwr.common.logger import log
|
41
|
-
from flwr.proto.driver_pb2_grpc import
|
42
|
-
|
43
|
-
|
41
|
+
from flwr.proto.driver_pb2_grpc import ( # pylint: disable=E0611
|
42
|
+
add_DriverServicer_to_server,
|
43
|
+
)
|
44
|
+
from flwr.proto.fleet_pb2_grpc import ( # pylint: disable=E0611
|
45
|
+
add_FleetServicer_to_server,
|
46
|
+
)
|
47
|
+
from flwr.proto.transport_pb2_grpc import ( # pylint: disable=E0611
|
48
|
+
add_FlowerServiceServicer_to_server,
|
49
|
+
)
|
44
50
|
from flwr.server.client_manager import ClientManager, SimpleClientManager
|
45
51
|
from flwr.server.driver.driver_servicer import DriverServicer
|
46
52
|
from flwr.server.fleet.grpc_bidi.driver_client_manager import DriverClientManager
|
@@ -22,8 +22,8 @@ from uuid import UUID
|
|
22
22
|
import grpc
|
23
23
|
|
24
24
|
from flwr.common.logger import log
|
25
|
-
from flwr.proto import driver_pb2_grpc
|
26
|
-
from flwr.proto.driver_pb2 import (
|
25
|
+
from flwr.proto import driver_pb2_grpc # pylint: disable=E0611
|
26
|
+
from flwr.proto.driver_pb2 import ( # pylint: disable=E0611
|
27
27
|
CreateRunRequest,
|
28
28
|
CreateRunResponse,
|
29
29
|
GetNodesRequest,
|
@@ -33,8 +33,8 @@ from flwr.proto.driver_pb2 import (
|
|
33
33
|
PushTaskInsRequest,
|
34
34
|
PushTaskInsResponse,
|
35
35
|
)
|
36
|
-
from flwr.proto.node_pb2 import Node
|
37
|
-
from flwr.proto.task_pb2 import TaskRes
|
36
|
+
from flwr.proto.node_pb2 import Node # pylint: disable=E0611
|
37
|
+
from flwr.proto.task_pb2 import TaskRes # pylint: disable=E0611
|
38
38
|
from flwr.server.state import State, StateFactory
|
39
39
|
from flwr.server.utils.validator import validate_task_ins_or_res
|
40
40
|
|
@@ -24,8 +24,11 @@ from typing import Callable, Iterator
|
|
24
24
|
import grpc
|
25
25
|
from iterators import TimeoutIterator
|
26
26
|
|
27
|
-
from flwr.proto import transport_pb2_grpc
|
28
|
-
from flwr.proto.transport_pb2 import
|
27
|
+
from flwr.proto import transport_pb2_grpc # pylint: disable=E0611
|
28
|
+
from flwr.proto.transport_pb2 import ( # pylint: disable=E0611
|
29
|
+
ClientMessage,
|
30
|
+
ServerMessage,
|
31
|
+
)
|
29
32
|
from flwr.server.client_manager import ClientManager
|
30
33
|
from flwr.server.fleet.grpc_bidi.grpc_bridge import GrpcBridge, InsWrapper, ResWrapper
|
31
34
|
from flwr.server.fleet.grpc_bidi.grpc_client_proxy import GrpcClientProxy
|
@@ -20,7 +20,10 @@ from enum import Enum
|
|
20
20
|
from threading import Condition
|
21
21
|
from typing import Iterator, Optional
|
22
22
|
|
23
|
-
from flwr.proto.transport_pb2 import
|
23
|
+
from flwr.proto.transport_pb2 import ( # pylint: disable=E0611
|
24
|
+
ClientMessage,
|
25
|
+
ServerMessage,
|
26
|
+
)
|
24
27
|
|
25
28
|
|
26
29
|
@dataclass
|
@@ -113,7 +116,7 @@ class GrpcBridge:
|
|
113
116
|
):
|
114
117
|
self._status = next_status
|
115
118
|
else:
|
116
|
-
raise
|
119
|
+
raise ValueError(f"Invalid transition: {self._status} to {next_status}")
|
117
120
|
|
118
121
|
self._cv.notify_all()
|
119
122
|
|
@@ -129,7 +132,7 @@ class GrpcBridge:
|
|
129
132
|
self._raise_if_closed()
|
130
133
|
|
131
134
|
if self._status != Status.AWAITING_INS_WRAPPER:
|
132
|
-
raise
|
135
|
+
raise ValueError("This should not happen")
|
133
136
|
|
134
137
|
self._ins_wrapper = ins_wrapper # Write
|
135
138
|
self._transition(Status.INS_WRAPPER_AVAILABLE)
|
@@ -146,7 +149,7 @@ class GrpcBridge:
|
|
146
149
|
self._transition(Status.AWAITING_INS_WRAPPER)
|
147
150
|
|
148
151
|
if res_wrapper is None:
|
149
|
-
raise
|
152
|
+
raise ValueError("ResWrapper can not be None")
|
150
153
|
|
151
154
|
return res_wrapper
|
152
155
|
|
@@ -170,7 +173,7 @@ class GrpcBridge:
|
|
170
173
|
self._transition(Status.AWAITING_RES_WRAPPER)
|
171
174
|
|
172
175
|
if ins_wrapper is None:
|
173
|
-
raise
|
176
|
+
raise ValueError("InsWrapper can not be None")
|
174
177
|
|
175
178
|
yield ins_wrapper
|
176
179
|
|
@@ -180,7 +183,7 @@ class GrpcBridge:
|
|
180
183
|
self._raise_if_closed()
|
181
184
|
|
182
185
|
if self._status != Status.AWAITING_RES_WRAPPER:
|
183
|
-
raise
|
186
|
+
raise ValueError("This should not happen")
|
184
187
|
|
185
188
|
self._res_wrapper = res_wrapper # Write
|
186
189
|
self._transition(Status.RES_WRAPPER_AVAILABLE)
|
@@ -19,7 +19,10 @@ from typing import Optional
|
|
19
19
|
|
20
20
|
from flwr import common
|
21
21
|
from flwr.common import serde
|
22
|
-
from flwr.proto.transport_pb2 import
|
22
|
+
from flwr.proto.transport_pb2 import ( # pylint: disable=E0611
|
23
|
+
ClientMessage,
|
24
|
+
ServerMessage,
|
25
|
+
)
|
23
26
|
from flwr.server.client_proxy import ClientProxy
|
24
27
|
from flwr.server.fleet.grpc_bidi.grpc_bridge import GrpcBridge, InsWrapper, ResWrapper
|
25
28
|
|
@@ -24,7 +24,9 @@ import grpc
|
|
24
24
|
|
25
25
|
from flwr.common import GRPC_MAX_MESSAGE_LENGTH
|
26
26
|
from flwr.common.logger import log
|
27
|
-
from flwr.proto.transport_pb2_grpc import
|
27
|
+
from flwr.proto.transport_pb2_grpc import ( # pylint: disable=E0611
|
28
|
+
add_FlowerServiceServicer_to_server,
|
29
|
+
)
|
28
30
|
from flwr.server.client_manager import ClientManager
|
29
31
|
from flwr.server.driver.driver_servicer import DriverServicer
|
30
32
|
from flwr.server.fleet.grpc_bidi.flower_service_servicer import FlowerServiceServicer
|
@@ -23,9 +23,12 @@ from typing import Dict, List, Optional
|
|
23
23
|
from flwr.client.message_handler.task_handler import configure_task_res
|
24
24
|
from flwr.common import EvaluateRes, FitRes, GetParametersRes, GetPropertiesRes, serde
|
25
25
|
from flwr.common.logger import log
|
26
|
-
from flwr.proto.node_pb2 import Node
|
27
|
-
from flwr.proto.task_pb2 import Task, TaskIns, TaskRes
|
28
|
-
from flwr.proto.transport_pb2 import
|
26
|
+
from flwr.proto.node_pb2 import Node # pylint: disable=E0611
|
27
|
+
from flwr.proto.task_pb2 import Task, TaskIns, TaskRes # pylint: disable=E0611
|
28
|
+
from flwr.proto.transport_pb2 import ( # pylint: disable=E0611
|
29
|
+
ClientMessage,
|
30
|
+
ServerMessage,
|
31
|
+
)
|
29
32
|
from flwr.server.client_proxy import ClientProxy
|
30
33
|
from flwr.server.state import State, StateFactory
|
31
34
|
|
@@ -166,6 +169,6 @@ def _call_client_proxy(
|
|
166
169
|
evaluate_res_proto = serde.evaluate_res_to_proto(res=evaluate_res)
|
167
170
|
return ClientMessage(evaluate_res=evaluate_res_proto)
|
168
171
|
|
169
|
-
raise
|
172
|
+
raise ValueError(
|
170
173
|
"Unsupported instruction in ServerMessage, cannot deserialize from ProtoBuf"
|
171
174
|
)
|
@@ -20,8 +20,8 @@ from logging import INFO
|
|
20
20
|
import grpc
|
21
21
|
|
22
22
|
from flwr.common.logger import log
|
23
|
-
from flwr.proto import fleet_pb2_grpc
|
24
|
-
from flwr.proto.fleet_pb2 import (
|
23
|
+
from flwr.proto import fleet_pb2_grpc # pylint: disable=E0611
|
24
|
+
from flwr.proto.fleet_pb2 import ( # pylint: disable=E0611
|
25
25
|
CreateNodeRequest,
|
26
26
|
CreateNodeResponse,
|
27
27
|
DeleteNodeRequest,
|
@@ -18,7 +18,7 @@
|
|
18
18
|
from typing import List, Optional
|
19
19
|
from uuid import UUID
|
20
20
|
|
21
|
-
from flwr.proto.fleet_pb2 import (
|
21
|
+
from flwr.proto.fleet_pb2 import ( # pylint: disable=E0611
|
22
22
|
CreateNodeRequest,
|
23
23
|
CreateNodeResponse,
|
24
24
|
DeleteNodeRequest,
|
@@ -29,8 +29,8 @@ from flwr.proto.fleet_pb2 import (
|
|
29
29
|
PushTaskResResponse,
|
30
30
|
Reconnect,
|
31
31
|
)
|
32
|
-
from flwr.proto.node_pb2 import Node
|
33
|
-
from flwr.proto.task_pb2 import TaskIns, TaskRes
|
32
|
+
from flwr.proto.node_pb2 import Node # pylint: disable=E0611
|
33
|
+
from flwr.proto.task_pb2 import TaskIns, TaskRes # pylint: disable=E0611
|
34
34
|
from flwr.server.state import State
|
35
35
|
|
36
36
|
|
@@ -22,7 +22,7 @@ from typing import Dict, List, Optional, Set
|
|
22
22
|
from uuid import UUID, uuid4
|
23
23
|
|
24
24
|
from flwr.common import log, now
|
25
|
-
from flwr.proto.task_pb2 import TaskIns, TaskRes
|
25
|
+
from flwr.proto.task_pb2 import TaskIns, TaskRes # pylint: disable=E0611
|
26
26
|
from flwr.server.state.state import State
|
27
27
|
from flwr.server.utils import validate_task_ins_or_res
|
28
28
|
|
@@ -24,9 +24,12 @@ from typing import Any, Dict, List, Optional, Set, Tuple, Union, cast
|
|
24
24
|
from uuid import UUID, uuid4
|
25
25
|
|
26
26
|
from flwr.common import log, now
|
27
|
-
from flwr.proto.node_pb2 import Node
|
28
|
-
from flwr.proto.task_pb2 import Task, TaskIns, TaskRes
|
29
|
-
from flwr.proto.transport_pb2 import
|
27
|
+
from flwr.proto.node_pb2 import Node # pylint: disable=E0611
|
28
|
+
from flwr.proto.task_pb2 import Task, TaskIns, TaskRes # pylint: disable=E0611
|
29
|
+
from flwr.proto.transport_pb2 import ( # pylint: disable=E0611
|
30
|
+
ClientMessage,
|
31
|
+
ServerMessage,
|
32
|
+
)
|
30
33
|
from flwr.server.utils.validator import validate_task_ins_or_res
|
31
34
|
|
32
35
|
from .state import State
|
@@ -134,7 +137,7 @@ class SqliteState(State):
|
|
134
137
|
) -> List[Dict[str, Any]]:
|
135
138
|
"""Execute a SQL query."""
|
136
139
|
if self.conn is None:
|
137
|
-
raise
|
140
|
+
raise AttributeError("State is not initialized.")
|
138
141
|
|
139
142
|
if data is None:
|
140
143
|
data = []
|
@@ -459,7 +462,7 @@ class SqliteState(State):
|
|
459
462
|
"""
|
460
463
|
|
461
464
|
if self.conn is None:
|
462
|
-
raise
|
465
|
+
raise AttributeError("State not intitialized")
|
463
466
|
|
464
467
|
with self.conn:
|
465
468
|
self.conn.execute(query_1, data)
|
flwr/server/state/state.py
CHANGED