From 8b8a19844209de96cbaa66374a8d59201e3d386e Mon Sep 17 00:00:00 2001 From: Fredrik Wrede Date: Tue, 5 Nov 2024 14:14:53 +0100 Subject: [PATCH] Feature/SK-1164 | grpc allow version up to ={GRPC_GENERATED_VERSION}.' + + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + ) class ModelServiceStub(object): @@ -16,14 +36,14 @@ def __init__(self, channel): """ self.Upload = channel.stream_unary( '/fedn.ModelService/Upload', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, + _registered_method=True) self.Download = channel.unary_stream( '/fedn.ModelService/Download', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, + _registered_method=True) class ModelServiceServicer(object): @@ -46,18 +66,19 @@ def add_ModelServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'Upload': grpc.stream_unary_rpc_method_handler( servicer.Upload, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ModelRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ModelResponse.SerializeToString, ), 'Download': grpc.unary_stream_rpc_method_handler( servicer.Download, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ModelRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ModelResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'fedn.ModelService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('fedn.ModelService', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -75,11 +96,21 @@ def Upload(request_iterator, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/fedn.ModelService/Upload', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.stream_unary( + request_iterator, + target, + '/fedn.ModelService/Upload', + network_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Download(request, @@ -92,11 +123,21 @@ def Download(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/fedn.ModelService/Download', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_stream( + request, + target, + '/fedn.ModelService/Download', + network_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class ControlStub(object): @@ -110,29 +151,29 @@ def __init__(self, channel): """ self.Start = channel.unary_unary( '/fedn.Control/Start', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, + _registered_method=True) self.Stop = channel.unary_unary( '/fedn.Control/Stop', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, + _registered_method=True) self.FlushAggregationQueue = channel.unary_unary( '/fedn.Control/FlushAggregationQueue', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, + _registered_method=True) self.SetAggregator = channel.unary_unary( '/fedn.Control/SetAggregator', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, + _registered_method=True) self.SetServerFunctions = channel.unary_unary( '/fedn.Control/SetServerFunctions', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, + _registered_method=True) class ControlServicer(object): @@ -173,33 +214,34 @@ def add_ControlServicer_to_server(servicer, server): rpc_method_handlers = { 'Start': grpc.unary_unary_rpc_method_handler( servicer.Start, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, ), 'Stop': grpc.unary_unary_rpc_method_handler( servicer.Stop, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, ), 'FlushAggregationQueue': grpc.unary_unary_rpc_method_handler( servicer.FlushAggregationQueue, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, ), 'SetAggregator': grpc.unary_unary_rpc_method_handler( servicer.SetAggregator, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, ), 'SetServerFunctions': grpc.unary_unary_rpc_method_handler( servicer.SetServerFunctions, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'fedn.Control', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('fedn.Control', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -217,11 +259,21 @@ def Start(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Control/Start', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Control/Start', + network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def Stop(request, @@ -234,11 +286,21 @@ def Stop(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Control/Stop', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Control/Stop', + network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def FlushAggregationQueue(request, @@ -251,11 +313,21 @@ def FlushAggregationQueue(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Control/FlushAggregationQueue', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Control/FlushAggregationQueue', + network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def SetAggregator(request, @@ -268,11 +340,21 @@ def SetAggregator(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Control/SetAggregator', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Control/SetAggregator', + network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def SetServerFunctions(request, @@ -285,11 +367,21 @@ def SetServerFunctions(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Control/SetServerFunctions', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Control/SetServerFunctions', + network_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class ReducerStub(object): @@ -303,9 +395,9 @@ def __init__(self, channel): """ self.GetGlobalModel = channel.unary_unary( '/fedn.Reducer/GetGlobalModel', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.GetGlobalModelRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.GetGlobalModelResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.GetGlobalModelRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.GetGlobalModelResponse.FromString, + _registered_method=True) class ReducerServicer(object): @@ -322,13 +414,14 @@ def add_ReducerServicer_to_server(servicer, server): rpc_method_handlers = { 'GetGlobalModel': grpc.unary_unary_rpc_method_handler( servicer.GetGlobalModel, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.GetGlobalModelRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.GetGlobalModelResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.GetGlobalModelRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.GetGlobalModelResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'fedn.Reducer', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('fedn.Reducer', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -346,11 +439,21 @@ def GetGlobalModel(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Reducer/GetGlobalModel', - fedn_dot_network_dot_grpc_dot_fedn__pb2.GetGlobalModelRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.GetGlobalModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Reducer/GetGlobalModel', + network_dot_grpc_dot_fedn__pb2.GetGlobalModelRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.GetGlobalModelResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class ConnectorStub(object): @@ -364,39 +467,39 @@ def __init__(self, channel): """ self.AllianceStatusStream = channel.unary_stream( '/fedn.Connector/AllianceStatusStream', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Status.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.Status.FromString, + _registered_method=True) self.SendStatus = channel.unary_unary( '/fedn.Connector/SendStatus', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Status.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.Status.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.Response.FromString, + _registered_method=True) self.ListActiveClients = channel.unary_unary( '/fedn.Connector/ListActiveClients', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ListClientsRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientList.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ListClientsRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ClientList.FromString, + _registered_method=True) self.AcceptingClients = channel.unary_unary( '/fedn.Connector/AcceptingClients', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ConnectionRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ConnectionResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ConnectionRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ConnectionResponse.FromString, + _registered_method=True) self.SendHeartbeat = channel.unary_unary( '/fedn.Connector/SendHeartbeat', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Heartbeat.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.Heartbeat.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.Response.FromString, + _registered_method=True) self.ReassignClient = channel.unary_unary( '/fedn.Connector/ReassignClient', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ReassignRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ReassignRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.Response.FromString, + _registered_method=True) self.ReconnectClient = channel.unary_unary( '/fedn.Connector/ReconnectClient', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ReconnectRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ReconnectRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.Response.FromString, + _registered_method=True) class ConnectorServicer(object): @@ -454,43 +557,44 @@ def add_ConnectorServicer_to_server(servicer, server): rpc_method_handlers = { 'AllianceStatusStream': grpc.unary_stream_rpc_method_handler( servicer.AllianceStatusStream, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Status.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.Status.SerializeToString, ), 'SendStatus': grpc.unary_unary_rpc_method_handler( servicer.SendStatus, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Status.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.Status.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, ), 'ListActiveClients': grpc.unary_unary_rpc_method_handler( servicer.ListActiveClients, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ListClientsRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientList.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ListClientsRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ClientList.SerializeToString, ), 'AcceptingClients': grpc.unary_unary_rpc_method_handler( servicer.AcceptingClients, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ConnectionRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ConnectionResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ConnectionRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ConnectionResponse.SerializeToString, ), 'SendHeartbeat': grpc.unary_unary_rpc_method_handler( servicer.SendHeartbeat, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Heartbeat.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.Heartbeat.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, ), 'ReassignClient': grpc.unary_unary_rpc_method_handler( servicer.ReassignClient, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ReassignRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ReassignRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, ), 'ReconnectClient': grpc.unary_unary_rpc_method_handler( servicer.ReconnectClient, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ReconnectRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ReconnectRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'fedn.Connector', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('fedn.Connector', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -508,11 +612,21 @@ def AllianceStatusStream(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/fedn.Connector/AllianceStatusStream', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.Status.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_stream( + request, + target, + '/fedn.Connector/AllianceStatusStream', + network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, + network_dot_grpc_dot_fedn__pb2.Status.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def SendStatus(request, @@ -525,11 +639,21 @@ def SendStatus(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Connector/SendStatus', - fedn_dot_network_dot_grpc_dot_fedn__pb2.Status.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Connector/SendStatus', + network_dot_grpc_dot_fedn__pb2.Status.SerializeToString, + network_dot_grpc_dot_fedn__pb2.Response.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def ListActiveClients(request, @@ -542,11 +666,21 @@ def ListActiveClients(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Connector/ListActiveClients', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ListClientsRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Connector/ListActiveClients', + network_dot_grpc_dot_fedn__pb2.ListClientsRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ClientList.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def AcceptingClients(request, @@ -559,11 +693,21 @@ def AcceptingClients(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Connector/AcceptingClients', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ConnectionRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ConnectionResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Connector/AcceptingClients', + network_dot_grpc_dot_fedn__pb2.ConnectionRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ConnectionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def SendHeartbeat(request, @@ -576,11 +720,21 @@ def SendHeartbeat(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Connector/SendHeartbeat', - fedn_dot_network_dot_grpc_dot_fedn__pb2.Heartbeat.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Connector/SendHeartbeat', + network_dot_grpc_dot_fedn__pb2.Heartbeat.SerializeToString, + network_dot_grpc_dot_fedn__pb2.Response.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def ReassignClient(request, @@ -593,11 +747,21 @@ def ReassignClient(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Connector/ReassignClient', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ReassignRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Connector/ReassignClient', + network_dot_grpc_dot_fedn__pb2.ReassignRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.Response.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def ReconnectClient(request, @@ -610,11 +774,21 @@ def ReconnectClient(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Connector/ReconnectClient', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ReconnectRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Connector/ReconnectClient', + network_dot_grpc_dot_fedn__pb2.ReconnectRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.Response.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class CombinerStub(object): @@ -628,24 +802,24 @@ def __init__(self, channel): """ self.TaskStream = channel.unary_stream( '/fedn.Combiner/TaskStream', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.TaskRequest.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.TaskRequest.FromString, + _registered_method=True) self.SendModelUpdate = channel.unary_unary( '/fedn.Combiner/SendModelUpdate', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelUpdate.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ModelUpdate.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.Response.FromString, + _registered_method=True) self.SendModelValidation = channel.unary_unary( '/fedn.Combiner/SendModelValidation', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelValidation.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ModelValidation.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.Response.FromString, + _registered_method=True) self.SendModelPrediction = channel.unary_unary( '/fedn.Combiner/SendModelPrediction', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelPrediction.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ModelPrediction.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.Response.FromString, + _registered_method=True) class CombinerServicer(object): @@ -681,28 +855,29 @@ def add_CombinerServicer_to_server(servicer, server): rpc_method_handlers = { 'TaskStream': grpc.unary_stream_rpc_method_handler( servicer.TaskStream, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.TaskRequest.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.TaskRequest.SerializeToString, ), 'SendModelUpdate': grpc.unary_unary_rpc_method_handler( servicer.SendModelUpdate, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelUpdate.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ModelUpdate.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, ), 'SendModelValidation': grpc.unary_unary_rpc_method_handler( servicer.SendModelValidation, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelValidation.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ModelValidation.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, ), 'SendModelPrediction': grpc.unary_unary_rpc_method_handler( servicer.SendModelPrediction, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelPrediction.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ModelPrediction.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.Response.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'fedn.Combiner', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('fedn.Combiner', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -720,11 +895,21 @@ def TaskStream(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/fedn.Combiner/TaskStream', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.TaskRequest.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_stream( + request, + target, + '/fedn.Combiner/TaskStream', + network_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, + network_dot_grpc_dot_fedn__pb2.TaskRequest.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def SendModelUpdate(request, @@ -737,11 +922,21 @@ def SendModelUpdate(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Combiner/SendModelUpdate', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelUpdate.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Combiner/SendModelUpdate', + network_dot_grpc_dot_fedn__pb2.ModelUpdate.SerializeToString, + network_dot_grpc_dot_fedn__pb2.Response.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def SendModelValidation(request, @@ -754,11 +949,21 @@ def SendModelValidation(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Combiner/SendModelValidation', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelValidation.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Combiner/SendModelValidation', + network_dot_grpc_dot_fedn__pb2.ModelValidation.SerializeToString, + network_dot_grpc_dot_fedn__pb2.Response.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def SendModelPrediction(request, @@ -771,11 +976,21 @@ def SendModelPrediction(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.Combiner/SendModelPrediction', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ModelPrediction.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.Combiner/SendModelPrediction', + network_dot_grpc_dot_fedn__pb2.ModelPrediction.SerializeToString, + network_dot_grpc_dot_fedn__pb2.Response.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) class FunctionServiceStub(object): @@ -789,34 +1004,34 @@ def __init__(self, channel): """ self.HandleProvidedFunctions = channel.unary_unary( '/fedn.FunctionService/HandleProvidedFunctions', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsResponse.FromString, + _registered_method=True) self.HandleClientConfig = channel.stream_unary( '/fedn.FunctionService/HandleClientConfig', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientConfigRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientConfigResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ClientConfigRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ClientConfigResponse.FromString, + _registered_method=True) self.HandleClientSelection = channel.unary_unary( '/fedn.FunctionService/HandleClientSelection', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientSelectionRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientSelectionResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ClientSelectionRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ClientSelectionResponse.FromString, + _registered_method=True) self.HandleMetadata = channel.unary_unary( '/fedn.FunctionService/HandleMetadata', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientMetaRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientMetaResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.ClientMetaRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.ClientMetaResponse.FromString, + _registered_method=True) self.HandleStoreModel = channel.stream_unary( '/fedn.FunctionService/HandleStoreModel', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.StoreModelRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.StoreModelResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.StoreModelRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.StoreModelResponse.FromString, + _registered_method=True) self.HandleAggregation = channel.unary_stream( '/fedn.FunctionService/HandleAggregation', - request_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.AggregationRequest.SerializeToString, - response_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.AggregationResponse.FromString, - ) + request_serializer=network_dot_grpc_dot_fedn__pb2.AggregationRequest.SerializeToString, + response_deserializer=network_dot_grpc_dot_fedn__pb2.AggregationResponse.FromString, + _registered_method=True) class FunctionServiceServicer(object): @@ -863,38 +1078,39 @@ def add_FunctionServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'HandleProvidedFunctions': grpc.unary_unary_rpc_method_handler( servicer.HandleProvidedFunctions, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsResponse.SerializeToString, ), 'HandleClientConfig': grpc.stream_unary_rpc_method_handler( servicer.HandleClientConfig, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientConfigRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientConfigResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ClientConfigRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ClientConfigResponse.SerializeToString, ), 'HandleClientSelection': grpc.unary_unary_rpc_method_handler( servicer.HandleClientSelection, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientSelectionRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientSelectionResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ClientSelectionRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ClientSelectionResponse.SerializeToString, ), 'HandleMetadata': grpc.unary_unary_rpc_method_handler( servicer.HandleMetadata, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientMetaRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientMetaResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.ClientMetaRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.ClientMetaResponse.SerializeToString, ), 'HandleStoreModel': grpc.stream_unary_rpc_method_handler( servicer.HandleStoreModel, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.StoreModelRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.StoreModelResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.StoreModelRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.StoreModelResponse.SerializeToString, ), 'HandleAggregation': grpc.unary_stream_rpc_method_handler( servicer.HandleAggregation, - request_deserializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.AggregationRequest.FromString, - response_serializer=fedn_dot_network_dot_grpc_dot_fedn__pb2.AggregationResponse.SerializeToString, + request_deserializer=network_dot_grpc_dot_fedn__pb2.AggregationRequest.FromString, + response_serializer=network_dot_grpc_dot_fedn__pb2.AggregationResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'fedn.FunctionService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) + server.add_registered_method_handlers('fedn.FunctionService', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -912,11 +1128,21 @@ def HandleProvidedFunctions(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.FunctionService/HandleProvidedFunctions', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.FunctionService/HandleProvidedFunctions', + network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ProvidedFunctionsResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def HandleClientConfig(request_iterator, @@ -929,11 +1155,21 @@ def HandleClientConfig(request_iterator, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/fedn.FunctionService/HandleClientConfig', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientConfigRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientConfigResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.stream_unary( + request_iterator, + target, + '/fedn.FunctionService/HandleClientConfig', + network_dot_grpc_dot_fedn__pb2.ClientConfigRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ClientConfigResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def HandleClientSelection(request, @@ -946,11 +1182,21 @@ def HandleClientSelection(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.FunctionService/HandleClientSelection', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientSelectionRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientSelectionResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.FunctionService/HandleClientSelection', + network_dot_grpc_dot_fedn__pb2.ClientSelectionRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ClientSelectionResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def HandleMetadata(request, @@ -963,11 +1209,21 @@ def HandleMetadata(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/fedn.FunctionService/HandleMetadata', - fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientMetaRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.ClientMetaResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_unary( + request, + target, + '/fedn.FunctionService/HandleMetadata', + network_dot_grpc_dot_fedn__pb2.ClientMetaRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.ClientMetaResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def HandleStoreModel(request_iterator, @@ -980,11 +1236,21 @@ def HandleStoreModel(request_iterator, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/fedn.FunctionService/HandleStoreModel', - fedn_dot_network_dot_grpc_dot_fedn__pb2.StoreModelRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.StoreModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.stream_unary( + request_iterator, + target, + '/fedn.FunctionService/HandleStoreModel', + network_dot_grpc_dot_fedn__pb2.StoreModelRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.StoreModelResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) @staticmethod def HandleAggregation(request, @@ -997,8 +1263,18 @@ def HandleAggregation(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/fedn.FunctionService/HandleAggregation', - fedn_dot_network_dot_grpc_dot_fedn__pb2.AggregationRequest.SerializeToString, - fedn_dot_network_dot_grpc_dot_fedn__pb2.AggregationResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + return grpc.experimental.unary_stream( + request, + target, + '/fedn.FunctionService/HandleAggregation', + network_dot_grpc_dot_fedn__pb2.AggregationRequest.SerializeToString, + network_dot_grpc_dot_fedn__pb2.AggregationResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) diff --git a/fedn/network/storage/statestore/mongostatestore.py b/fedn/network/storage/statestore/mongostatestore.py index 3886a3db7..316cd4965 100644 --- a/fedn/network/storage/statestore/mongostatestore.py +++ b/fedn/network/storage/statestore/mongostatestore.py @@ -739,21 +739,13 @@ def set_client(self, client_data): client_data["updated_at"] = str(datetime.now()) try: # self.clients.update_one({"client_id": client_data["client_id"]}, {"$set": client_data}, True) - self.clients.update_one( - {"client_id": client_data["client_id"]}, - {"$set": {k: v for k, v in client_data.items() if v is not None}}, - upsert=True - ) + self.clients.update_one({"client_id": client_data["client_id"]}, {"$set": {k: v for k, v in client_data.items() if v is not None}}, upsert=True) except KeyError: # If client_id is not present, use name as identifier, for backwards compatibility id = str(uuid.uuid4()) client_data["client_id"] = id # self.clients.update_one({"name": client_data["name"]}, {"$set": client_data}, True) - self.clients.update_one( - {"client_id": client_data["client_id"]}, - {"$set": {k: v for k, v in client_data.items() if v is not None}}, - upsert=True - ) + self.clients.update_one({"client_id": client_data["client_id"]}, {"$set": {k: v for k, v in client_data.items() if v is not None}}, upsert=True) def get_client(self, client_id): """Get client by client_id. @@ -845,7 +837,7 @@ def report_status(self, msg): :param msg: The status message. :type msg: str """ - data = MessageToDict(msg, including_default_value_fields=True) + data = MessageToDict(msg) if self.status is not None: self.status.insert_one(data) @@ -856,7 +848,7 @@ def report_validation(self, validation): :param validation: The model validation. :type validation: dict """ - data = MessageToDict(validation, including_default_value_fields=True) + data = MessageToDict(validation) if self.validations is not None: self.validations.insert_one(data) diff --git a/pyproject.toml b/pyproject.toml index 63253bef7..f65ed4eb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "fedn" -version = "0.18.0" +version = "0.19.0" description = "Scaleout Federated Learning" authors = [{ name = "Scaleout Systems AB", email = "contact@scaleoutsystems.com" }] readme = "README.rst" @@ -33,17 +33,17 @@ dependencies = [ "urllib3>=1.26.4", "gunicorn>=20.0.4", "minio", - "grpcio~=1.60.0", - "grpcio-tools~=1.60.0", + "grpcio>=1.60,<1.67", + "grpcio-tools>=1.60,<1.67", "numpy>=1.21.6", - "protobuf~=4.25.2", + "protobuf>=4.25.2,<5.29.0", "pymongo", "Flask==3.0.3", "pyjwt", "pyopenssl", "psutil", "click==8.1.7", - "grpcio-health-checking~=1.60.0", + "grpcio-health-checking>=1.60,<1.67", "pyyaml", "plotly", "virtualenv",