# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from nvflare.private.fed.protos import federated_pb2 as nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2
[docs]class FederatedTrainingStub(object):
"""The global federated model interfaces
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.Register = channel.unary_unary(
'/fedlearn.FederatedTraining/Register',
request_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.ClientLogin.SerializeToString,
response_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.FromString,
)
self.Quit = channel.unary_unary(
'/fedlearn.FederatedTraining/Quit',
request_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.ClientState.SerializeToString,
response_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.FromString,
)
self.GetTask = channel.unary_unary(
'/fedlearn.FederatedTraining/GetTask',
request_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.ClientState.SerializeToString,
response_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.CurrentTask.FromString,
)
self.SubmitUpdate = channel.unary_unary(
'/fedlearn.FederatedTraining/SubmitUpdate',
request_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.Contribution.SerializeToString,
response_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.FromString,
)
self.Heartbeat = channel.unary_unary(
'/fedlearn.FederatedTraining/Heartbeat',
request_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.Token.SerializeToString,
response_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.FromString,
)
self.AuxCommunicate = channel.unary_unary(
'/fedlearn.FederatedTraining/AuxCommunicate',
request_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.AuxMessage.SerializeToString,
response_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.AuxReply.FromString,
)
[docs]class FederatedTrainingServicer(object):
"""The global federated model interfaces
"""
[docs] def Register(self, request, context):
"""client registration, so that it will contribute to the training
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def Quit(self, request, context):
"""client quiting the federated training
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def GetTask(self, request, context):
"""server to client model sharing
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def SubmitUpdate(self, request, context):
"""client to server contribution submission
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def Heartbeat(self, request, context):
"""client to server heartbeat keep live
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs] def AuxCommunicate(self, request, context):
"""client to server aux channel communication
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
[docs]def add_FederatedTrainingServicer_to_server(servicer, server):
rpc_method_handlers = {
'Register': grpc.unary_unary_rpc_method_handler(
servicer.Register,
request_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.ClientLogin.FromString,
response_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.SerializeToString,
),
'Quit': grpc.unary_unary_rpc_method_handler(
servicer.Quit,
request_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.ClientState.FromString,
response_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.SerializeToString,
),
'GetTask': grpc.unary_unary_rpc_method_handler(
servicer.GetTask,
request_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.ClientState.FromString,
response_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.CurrentTask.SerializeToString,
),
'SubmitUpdate': grpc.unary_unary_rpc_method_handler(
servicer.SubmitUpdate,
request_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.Contribution.FromString,
response_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.SerializeToString,
),
'Heartbeat': grpc.unary_unary_rpc_method_handler(
servicer.Heartbeat,
request_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.Token.FromString,
response_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.SerializeToString,
),
'AuxCommunicate': grpc.unary_unary_rpc_method_handler(
servicer.AuxCommunicate,
request_deserializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.AuxMessage.FromString,
response_serializer=nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.AuxReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'fedlearn.FederatedTraining', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
[docs]class FederatedTraining(object):
"""The global federated model interfaces
"""
[docs] @staticmethod
def Register(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/fedlearn.FederatedTraining/Register',
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.ClientLogin.SerializeToString,
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
[docs] @staticmethod
def Quit(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/fedlearn.FederatedTraining/Quit',
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.ClientState.SerializeToString,
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
[docs] @staticmethod
def GetTask(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/fedlearn.FederatedTraining/GetTask',
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.ClientState.SerializeToString,
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.CurrentTask.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
[docs] @staticmethod
def SubmitUpdate(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/fedlearn.FederatedTraining/SubmitUpdate',
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.Contribution.SerializeToString,
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
[docs] @staticmethod
def Heartbeat(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/fedlearn.FederatedTraining/Heartbeat',
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.Token.SerializeToString,
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.FederatedSummary.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
[docs] @staticmethod
def AuxCommunicate(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/fedlearn.FederatedTraining/AuxCommunicate',
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.AuxMessage.SerializeToString,
nvflare_dot_private_dot_fed_dot_protos_dot_federated__pb2.AuxReply.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)