diff --git a/.ci/tests/examples/configure.sh b/.ci/tests/examples/configure.sh index b3fb9d678..ea6749a85 100755 --- a/.ci/tests/examples/configure.sh +++ b/.ci/tests/examples/configure.sh @@ -13,8 +13,14 @@ pushd "examples/$example" bin/init_venv.sh >&2 echo "Download and prepare data" -bin/get_data -bin/split_data +# Check if $example is "multiple_models" +if [ "$example" == "multiple_models" ]; then + bin/get_data.sh + bin/split_data.sh +else + bin/get_data + bin/split_data +fi >&2 echo "Build compute package and seed" bin/build.sh diff --git a/examples/mnist-keras/client/fedn.yaml b/examples/mnist-keras/client/fedn.yaml index 91ec40c2a..4940dee4c 100644 --- a/examples/mnist-keras/client/fedn.yaml +++ b/examples/mnist-keras/client/fedn.yaml @@ -1,7 +1,9 @@ entry_points: train: - command: /venv/bin/python entrypoint train $ENTRYPOINT_OPTS + default: /venv/bin/python entrypoint train $ENTRYPOINT_OPTS + test: /venv/bin/python entrypoint train $ENTRYPOINT_OPTS validate: - command: /venv/bin/python entrypoint validate $ENTRYPOINT_OPTS + default: /venv/bin/python entrypoint validate $ENTRYPOINT_OPTS + test: /venv/bin/python entrypoint validate $ENTRYPOINT_OPTS infer: - command: /venv/bin/python entrypoint infer $ENTRYPOINT_OPTS + default: /venv/bin/python entrypoint infer $ENTRYPOINT_OPTS diff --git a/examples/mnist-keras/requirements.txt b/examples/mnist-keras/requirements.txt index 18b9e6e6a..eff2c7793 100644 --- a/examples/mnist-keras/requirements.txt +++ b/examples/mnist-keras/requirements.txt @@ -1,3 +1,3 @@ -tensorflow==2.9.3 +tensorflow-cpu==2.14.0 fire==0.3.1 docker==6.1.1 \ No newline at end of file diff --git a/examples/multiple_models/.gitignore b/examples/multiple_models/.gitignore new file mode 100644 index 000000000..673e11539 --- /dev/null +++ b/examples/multiple_models/.gitignore @@ -0,0 +1,6 @@ +data +*.npz +*.tgz +*.tar.gz +.multiple_models +client.yaml \ No newline at end of file diff --git a/examples/multiple_models/README.md b/examples/multiple_models/README.md new file mode 100644 index 000000000..b4b5c0672 --- /dev/null +++ b/examples/multiple_models/README.md @@ -0,0 +1,87 @@ +# MNIST (TensorFlow/Keras version) +This classic example of hand-written text recognition is well suited both as a lightweight test when developing on FEDn in pseudo-distributed mode. A normal high-end laptop or a workstation should be able to sustain a few clients. The example automates the partitioning of data and deployment of a variable number of clients on a single host. We here assume working experience with containers, Docker and docker-compose. + +## Table of Contents +- [MNIST Example (Keras version)](#mnist-example-keras-version) + - [Table of Contents](#table-of-contents) + - [Prerequisites](#prerequisites) + - [Running the example (pseudo-distributed)](#running-the-example-pseudo-distributed) + - [Clean up](#clean-up) + +## Prerequisites +- [Python 3.8, 3.9 or 3.10](https://www.python.org/downloads) +- [Docker](https://docs.docker.com/get-docker) +- [Docker Compose](https://docs.docker.com/compose/install) + +## Running the example (pseudo-distributed) +Clone FEDn and locate into this directory. +```sh +git clone https://github.com/scaleoutsystems/fedn.git +cd fedn/examples/mnist-keras +``` + +### Preparing the environment, the local data, the compute package and seed model + +Start by initializing a virtual enviroment with all of the required dependencies. +```sh +bin/init_venv.sh +``` + +Then, to get the data you can run the following script. +```sh +bin/get_data +``` + +The next command splits the data in 2 parts for the clients. +```sh +bin/split_data +``` +> **Note**: run with `--n_splits=N` to split in *N* parts. + +Create the compute package and a seed model that you will be asked to upload in the next step. +``` +bin/build.sh +``` +> The files location will be `package/package.tgz` and `seed.npz`. + +### Deploy FEDn +Now we are ready to deploy FEDn with `docker-compose`. +``` +docker-compose -f ../../docker-compose.yaml up -d minio mongo mongo-express reducer combiner +``` + +### Initialize the federated model +Now navigate to http://localhost:8090 to see the reducer UI. You will be asked to upload the compute package and the seed model that you created in the previous step. + +### Attach clients +To attach clients to the network, use the docker-compose.override.yaml template to start 2 clients: + +``` +docker-compose -f ../../docker-compose.yaml -f docker-compose.override.yaml up client +``` +> **Note**: run with `--scale client=N` to start *N* clients. + +### Run federated training +Finally, you can start the experiment from the "control" tab of the UI. + +## Clean up +You can clean up by running `docker-compose down`. + +## Connecting to a distributed deployment +To start and remotely connect a client with the required dependencies for this example, start by downloading the `client.yaml` file. You can either navigate the reducer UI or run the following command. + +```bash +curl -k https://:/config/download > client.yaml +``` +> **Note** make sure to replace `` and `` with appropriate values. + +Now you are ready to start the client via Docker by running the following command. + +```bash +docker run -d \ + -v $PWD/client.yaml:/app/client.yaml \ + -v $PWD/data:/var/data \ + -e ENTRYPOINT_OPTS=--data_path=/var/data/mnist.npz \ + ghcr.io/scaleoutsystems/fedn/fedn:develop-mnist-keras run client -in client.yaml +``` +> **Note** If reducer and combiner host names, as specfied in the configuration files, are not resolvable in the client host network you need to use the docker option `--add-hosts` to make them resolvable. Please refer to the Docker documentation for more detail. diff --git a/examples/multiple_models/bin/build.sh b/examples/multiple_models/bin/build.sh new file mode 100755 index 000000000..b8ad2a33e --- /dev/null +++ b/examples/multiple_models/bin/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -e + +# Init for each model +#pushd ../mnist-keras +#client/entrypoint init_seed +#popd + +#pushd ../mnist-pytorch +#client/entrypoint init_seed +#popd + +# Make compute package +cp -r ../mnist-keras/client client/keras-client +cp -r ../mnist-pytorch/client client/pytorch-client + +tar -czvf package.tgz client + +# Clean up +rm -rf client/keras-client +rm -rf client/pytorch-client \ No newline at end of file diff --git a/examples/multiple_models/bin/get_data.sh b/examples/multiple_models/bin/get_data.sh new file mode 100755 index 000000000..5df416bb6 --- /dev/null +++ b/examples/multiple_models/bin/get_data.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +# Get the data for the first model +./.multiple_models/bin/python ../mnist-keras/bin/get_data + +# Get the data for the second model +./.multiple_models/bin/python ../mnist-pytorch/bin/get_data diff --git a/examples/multiple_models/bin/init_venv.sh b/examples/multiple_models/bin/init_venv.sh new file mode 100755 index 000000000..3308699be --- /dev/null +++ b/examples/multiple_models/bin/init_venv.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +# Init venv +python3 -m venv .multiple_models + +# Pip deps +.multiple_models/bin/pip install --upgrade pip +.multiple_models/bin/pip install -e ../../fedn +.multiple_models/bin/pip install -r requirements.txt \ No newline at end of file diff --git a/examples/multiple_models/bin/split_data.sh b/examples/multiple_models/bin/split_data.sh new file mode 100755 index 000000000..fcdfaa71d --- /dev/null +++ b/examples/multiple_models/bin/split_data.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +# Split data for the first model +./.multiple_models/bin/python ../mnist-keras/bin/split_data + +# Split data for the second model +./.multiple_models/bin/python ../mnist-pytorch/bin/split_data diff --git a/examples/multiple_models/client/fedn.yaml b/examples/multiple_models/client/fedn.yaml new file mode 100644 index 000000000..8808ccd4c --- /dev/null +++ b/examples/multiple_models/client/fedn.yaml @@ -0,0 +1,10 @@ +entry_points: + train: + keras: /venv/bin/python keras-client/entrypoint train $ENTRYPOINT_OPTS + pytorch: /venv/bin/python pytorch-client/entrypoint train $ENTRYPOINT_OPTS + validate: + keras: /venv/bin/python keras-client/entrypoint validate $ENTRYPOINT_OPTS + pytorch: /venv/bin/python pytorch-client/entrypoint validate $ENTRYPOINT_OPTS + infer: + keras: /venv/bin/python keras-client/entrypoint infer $ENTRYPOINT_OPTS + pytorch: /venv/bin/python pytorch-client/entrypoint infer $ENTRYPOINT_OPTS diff --git a/examples/multiple_models/docker-compose.override.yaml b/examples/multiple_models/docker-compose.override.yaml new file mode 100644 index 000000000..db156b184 --- /dev/null +++ b/examples/multiple_models/docker-compose.override.yaml @@ -0,0 +1,15 @@ +# Compose schema version +version: '3.3' + +# Overriding requirements +services: + client: + build: + args: + REQUIREMENTS: examples/multiple_models/requirements.txt + deploy: + replicas: 2 + volumes: + - ${HOST_REPO_DIR:-.}/fedn:/app/fedn + - ${HOST_REPO_DIR:-.}/examples/multiple_models/data:/var/data + - /var/run/docker.sock:/var/run/docker.sock diff --git a/examples/multiple_models/requirements.txt b/examples/multiple_models/requirements.txt new file mode 100644 index 000000000..fa0a36e79 --- /dev/null +++ b/examples/multiple_models/requirements.txt @@ -0,0 +1,5 @@ +tensorflow-cpu==2.13.1 +torch==1.13.1 +torchvision==0.14.1 +fire==0.3.1 +docker==6.1.1 \ No newline at end of file diff --git a/fedn/fedn/common/net/grpc/fedn.proto b/fedn/fedn/common/net/grpc/fedn.proto index ff0ee293c..3da7b86d8 100644 --- a/fedn/fedn/common/net/grpc/fedn.proto +++ b/fedn/fedn/common/net/grpc/fedn.proto @@ -54,6 +54,7 @@ message ModelUpdateRequest { string correlation_id = 5; string timestamp = 6; string meta = 7; + string model_tag = 8; } message ModelUpdate { @@ -75,6 +76,7 @@ message ModelValidationRequest { string timestamp = 6; string meta = 7; bool is_inference = 8; + string model_tag = 9; } message ModelValidation { diff --git a/fedn/fedn/common/net/grpc/fedn_pb2.py b/fedn/fedn/common/net/grpc/fedn_pb2.py index fa4fbb16d..5f2e05fcd 100644 --- a/fedn/fedn/common/net/grpc/fedn_pb2.py +++ b/fedn/fedn/common/net/grpc/fedn_pb2.py @@ -1,13 +1,11 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: fedn/common/net/grpc/fedn.proto +# source: fedn.proto """Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -15,312 +13,81 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1f\x66\x65\x64n/common/net/grpc/fedn.proto\x12\x04grpc\":\n\x08Response\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08response\x18\x02 \x01(\t\"\x8c\x02\n\x06Status\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x0e\n\x06status\x18\x02 \x01(\t\x12(\n\tlog_level\x18\x03 \x01(\x0e\x32\x15.grpc.Status.LogLevel\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\t\x12\x1e\n\x04type\x18\x07 \x01(\x0e\x32\x10.grpc.StatusType\x12\r\n\x05\x65xtra\x18\x08 \x01(\t\"B\n\x08LogLevel\x12\x08\n\x04INFO\x10\x00\x12\t\n\x05\x44\x45\x42UG\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x12\t\n\x05\x41UDIT\x10\x04\"\xab\x01\n\x12ModelUpdateRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\t\x12\x0c\n\x04meta\x18\x07 \x01(\t\"\xaf\x01\n\x0bModelUpdate\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x17\n\x0fmodel_update_id\x18\x04 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\t\x12\x0c\n\x04meta\x18\x07 \x01(\t\"\xc5\x01\n\x16ModelValidationRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\t\x12\x0c\n\x04meta\x18\x07 \x01(\t\x12\x14\n\x0cis_inference\x18\x08 \x01(\x08\"\xa8\x01\n\x0fModelValidation\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\t\x12\x0c\n\x04meta\x18\x07 \x01(\t\"\x89\x01\n\x0cModelRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\n\n\x02id\x18\x04 \x01(\t\x12!\n\x06status\x18\x05 \x01(\x0e\x32\x11.grpc.ModelStatus\"]\n\rModelResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\n\n\x02id\x18\x02 \x01(\t\x12!\n\x06status\x18\x03 \x01(\x0e\x32\x11.grpc.ModelStatus\x12\x0f\n\x07message\x18\x04 \x01(\t\"U\n\x15GetGlobalModelRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\"h\n\x16GetGlobalModelResponse\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08model_id\x18\x03 \x01(\t\")\n\tHeartbeat\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\"W\n\x16\x43lientAvailableMessage\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\x12\x11\n\ttimestamp\x18\x03 \x01(\t\"R\n\x12ListClientsRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x07\x63hannel\x18\x02 \x01(\x0e\x32\r.grpc.Channel\"*\n\nClientList\x12\x1c\n\x06\x63lient\x18\x01 \x03(\x0b\x32\x0c.grpc.Client\"0\n\x06\x43lient\x12\x18\n\x04role\x18\x01 \x01(\x0e\x32\n.grpc.Role\x12\x0c\n\x04name\x18\x02 \x01(\t\"m\n\x0fReassignRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x0e\n\x06server\x18\x03 \x01(\t\x12\x0c\n\x04port\x18\x04 \x01(\r\"c\n\x10ReconnectRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x11\n\treconnect\x18\x03 \x01(\r\"\'\n\tParameter\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"T\n\x0e\x43ontrolRequest\x12\x1e\n\x07\x63ommand\x18\x01 \x01(\x0e\x32\r.grpc.Command\x12\"\n\tparameter\x18\x02 \x03(\x0b\x32\x0f.grpc.Parameter\"F\n\x0f\x43ontrolResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\"\n\tparameter\x18\x02 \x03(\x0b\x32\x0f.grpc.Parameter\"R\n\x0eReportResponse\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\"\n\tparameter\x18\x02 \x03(\x0b\x32\x0f.grpc.Parameter\"\x13\n\x11\x43onnectionRequest\"<\n\x12\x43onnectionResponse\x12&\n\x06status\x18\x01 \x01(\x0e\x32\x16.grpc.ConnectionStatus*\x84\x01\n\nStatusType\x12\x07\n\x03LOG\x10\x00\x12\x18\n\x14MODEL_UPDATE_REQUEST\x10\x01\x12\x10\n\x0cMODEL_UPDATE\x10\x02\x12\x1c\n\x18MODEL_VALIDATION_REQUEST\x10\x03\x12\x14\n\x10MODEL_VALIDATION\x10\x04\x12\r\n\tINFERENCE\x10\x05*\x86\x01\n\x07\x43hannel\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x19\n\x15MODEL_UPDATE_REQUESTS\x10\x01\x12\x11\n\rMODEL_UPDATES\x10\x02\x12\x1d\n\x19MODEL_VALIDATION_REQUESTS\x10\x03\x12\x15\n\x11MODEL_VALIDATIONS\x10\x04\x12\n\n\x06STATUS\x10\x05*F\n\x0bModelStatus\x12\x06\n\x02OK\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\x12\n\x0eIN_PROGRESS_OK\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03*8\n\x04Role\x12\n\n\x06WORKER\x10\x00\x12\x0c\n\x08\x43OMBINER\x10\x01\x12\x0b\n\x07REDUCER\x10\x02\x12\t\n\x05OTHER\x10\x03*J\n\x07\x43ommand\x12\x08\n\x04IDLE\x10\x00\x12\t\n\x05START\x10\x01\x12\t\n\x05PAUSE\x10\x02\x12\x08\n\x04STOP\x10\x03\x12\t\n\x05RESET\x10\x04\x12\n\n\x06REPORT\x10\x05*I\n\x10\x43onnectionStatus\x12\x11\n\rNOT_ACCEPTING\x10\x00\x12\r\n\tACCEPTING\x10\x01\x12\x13\n\x0fTRY_AGAIN_LATER\x10\x02\x32z\n\x0cModelService\x12\x33\n\x06Upload\x12\x12.grpc.ModelRequest\x1a\x13.grpc.ModelResponse(\x01\x12\x35\n\x08\x44ownload\x12\x12.grpc.ModelRequest\x1a\x13.grpc.ModelResponse0\x01\x32\xa9\x02\n\x07\x43ontrol\x12\x34\n\x05Start\x12\x14.grpc.ControlRequest\x1a\x15.grpc.ControlResponse\x12\x33\n\x04Stop\x12\x14.grpc.ControlRequest\x1a\x15.grpc.ControlResponse\x12\x37\n\tConfigure\x12\x14.grpc.ControlRequest\x1a\x14.grpc.ReportResponse\x12\x44\n\x15\x46lushAggregationQueue\x12\x14.grpc.ControlRequest\x1a\x15.grpc.ControlResponse\x12\x34\n\x06Report\x12\x14.grpc.ControlRequest\x1a\x14.grpc.ReportResponse2V\n\x07Reducer\x12K\n\x0eGetGlobalModel\x12\x1b.grpc.GetGlobalModelRequest\x1a\x1c.grpc.GetGlobalModelResponse2\xab\x03\n\tConnector\x12\x44\n\x14\x41llianceStatusStream\x12\x1c.grpc.ClientAvailableMessage\x1a\x0c.grpc.Status0\x01\x12*\n\nSendStatus\x12\x0c.grpc.Status\x1a\x0e.grpc.Response\x12?\n\x11ListActiveClients\x12\x18.grpc.ListClientsRequest\x1a\x10.grpc.ClientList\x12\x45\n\x10\x41\x63\x63\x65ptingClients\x12\x17.grpc.ConnectionRequest\x1a\x18.grpc.ConnectionResponse\x12\x30\n\rSendHeartbeat\x12\x0f.grpc.Heartbeat\x1a\x0e.grpc.Response\x12\x37\n\x0eReassignClient\x12\x15.grpc.ReassignRequest\x1a\x0e.grpc.Response\x12\x39\n\x0fReconnectClient\x12\x16.grpc.ReconnectRequest\x1a\x0e.grpc.Response2\xda\x04\n\x08\x43ombiner\x12T\n\x18ModelUpdateRequestStream\x12\x1c.grpc.ClientAvailableMessage\x1a\x18.grpc.ModelUpdateRequest0\x01\x12\x46\n\x11ModelUpdateStream\x12\x1c.grpc.ClientAvailableMessage\x1a\x11.grpc.ModelUpdate0\x01\x12\\\n\x1cModelValidationRequestStream\x12\x1c.grpc.ClientAvailableMessage\x1a\x1c.grpc.ModelValidationRequest0\x01\x12N\n\x15ModelValidationStream\x12\x1c.grpc.ClientAvailableMessage\x1a\x15.grpc.ModelValidation0\x01\x12\x42\n\x16SendModelUpdateRequest\x12\x18.grpc.ModelUpdateRequest\x1a\x0e.grpc.Response\x12\x34\n\x0fSendModelUpdate\x12\x11.grpc.ModelUpdate\x1a\x0e.grpc.Response\x12J\n\x1aSendModelValidationRequest\x12\x1c.grpc.ModelValidationRequest\x1a\x0e.grpc.Response\x12<\n\x13SendModelValidation\x12\x15.grpc.ModelValidation\x1a\x0e.grpc.Responseb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nfedn.proto\x12\x04grpc\":\n\x08Response\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08response\x18\x02 \x01(\t\"\x8c\x02\n\x06Status\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x0e\n\x06status\x18\x02 \x01(\t\x12(\n\tlog_level\x18\x03 \x01(\x0e\x32\x15.grpc.Status.LogLevel\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\t\x12\x1e\n\x04type\x18\x07 \x01(\x0e\x32\x10.grpc.StatusType\x12\r\n\x05\x65xtra\x18\x08 \x01(\t\"B\n\x08LogLevel\x12\x08\n\x04INFO\x10\x00\x12\t\n\x05\x44\x45\x42UG\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\t\n\x05\x45RROR\x10\x03\x12\t\n\x05\x41UDIT\x10\x04\"\xbe\x01\n\x12ModelUpdateRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\t\x12\x0c\n\x04meta\x18\x07 \x01(\t\x12\x11\n\tmodel_tag\x18\x08 \x01(\t\"\xaf\x01\n\x0bModelUpdate\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x17\n\x0fmodel_update_id\x18\x04 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\t\x12\x0c\n\x04meta\x18\x07 \x01(\t\"\xd8\x01\n\x16ModelValidationRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\t\x12\x0c\n\x04meta\x18\x07 \x01(\t\x12\x14\n\x0cis_inference\x18\x08 \x01(\x08\x12\x11\n\tmodel_tag\x18\t \x01(\t\"\xa8\x01\n\x0fModelValidation\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08model_id\x18\x03 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\t\x12\x16\n\x0e\x63orrelation_id\x18\x05 \x01(\t\x12\x11\n\ttimestamp\x18\x06 \x01(\t\x12\x0c\n\x04meta\x18\x07 \x01(\t\"\x89\x01\n\x0cModelRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\x12\n\n\x02id\x18\x04 \x01(\t\x12!\n\x06status\x18\x05 \x01(\x0e\x32\x11.grpc.ModelStatus\"]\n\rModelResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\n\n\x02id\x18\x02 \x01(\t\x12!\n\x06status\x18\x03 \x01(\x0e\x32\x11.grpc.ModelStatus\x12\x0f\n\x07message\x18\x04 \x01(\t\"U\n\x15GetGlobalModelRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\"h\n\x16GetGlobalModelResponse\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x10\n\x08model_id\x18\x03 \x01(\t\")\n\tHeartbeat\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\"W\n\x16\x43lientAvailableMessage\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\t\x12\x11\n\ttimestamp\x18\x03 \x01(\t\"R\n\x12ListClientsRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x07\x63hannel\x18\x02 \x01(\x0e\x32\r.grpc.Channel\"*\n\nClientList\x12\x1c\n\x06\x63lient\x18\x01 \x03(\x0b\x32\x0c.grpc.Client\"0\n\x06\x43lient\x12\x18\n\x04role\x18\x01 \x01(\x0e\x32\n.grpc.Role\x12\x0c\n\x04name\x18\x02 \x01(\t\"m\n\x0fReassignRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x0e\n\x06server\x18\x03 \x01(\t\x12\x0c\n\x04port\x18\x04 \x01(\r\"c\n\x10ReconnectRequest\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\x1e\n\x08receiver\x18\x02 \x01(\x0b\x32\x0c.grpc.Client\x12\x11\n\treconnect\x18\x03 \x01(\r\"\'\n\tParameter\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"T\n\x0e\x43ontrolRequest\x12\x1e\n\x07\x63ommand\x18\x01 \x01(\x0e\x32\r.grpc.Command\x12\"\n\tparameter\x18\x02 \x03(\x0b\x32\x0f.grpc.Parameter\"F\n\x0f\x43ontrolResponse\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\"\n\tparameter\x18\x02 \x03(\x0b\x32\x0f.grpc.Parameter\"R\n\x0eReportResponse\x12\x1c\n\x06sender\x18\x01 \x01(\x0b\x32\x0c.grpc.Client\x12\"\n\tparameter\x18\x02 \x03(\x0b\x32\x0f.grpc.Parameter\"\x13\n\x11\x43onnectionRequest\"<\n\x12\x43onnectionResponse\x12&\n\x06status\x18\x01 \x01(\x0e\x32\x16.grpc.ConnectionStatus*\x84\x01\n\nStatusType\x12\x07\n\x03LOG\x10\x00\x12\x18\n\x14MODEL_UPDATE_REQUEST\x10\x01\x12\x10\n\x0cMODEL_UPDATE\x10\x02\x12\x1c\n\x18MODEL_VALIDATION_REQUEST\x10\x03\x12\x14\n\x10MODEL_VALIDATION\x10\x04\x12\r\n\tINFERENCE\x10\x05*\x86\x01\n\x07\x43hannel\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x19\n\x15MODEL_UPDATE_REQUESTS\x10\x01\x12\x11\n\rMODEL_UPDATES\x10\x02\x12\x1d\n\x19MODEL_VALIDATION_REQUESTS\x10\x03\x12\x15\n\x11MODEL_VALIDATIONS\x10\x04\x12\n\n\x06STATUS\x10\x05*F\n\x0bModelStatus\x12\x06\n\x02OK\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\x12\n\x0eIN_PROGRESS_OK\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03*8\n\x04Role\x12\n\n\x06WORKER\x10\x00\x12\x0c\n\x08\x43OMBINER\x10\x01\x12\x0b\n\x07REDUCER\x10\x02\x12\t\n\x05OTHER\x10\x03*J\n\x07\x43ommand\x12\x08\n\x04IDLE\x10\x00\x12\t\n\x05START\x10\x01\x12\t\n\x05PAUSE\x10\x02\x12\x08\n\x04STOP\x10\x03\x12\t\n\x05RESET\x10\x04\x12\n\n\x06REPORT\x10\x05*I\n\x10\x43onnectionStatus\x12\x11\n\rNOT_ACCEPTING\x10\x00\x12\r\n\tACCEPTING\x10\x01\x12\x13\n\x0fTRY_AGAIN_LATER\x10\x02\x32z\n\x0cModelService\x12\x33\n\x06Upload\x12\x12.grpc.ModelRequest\x1a\x13.grpc.ModelResponse(\x01\x12\x35\n\x08\x44ownload\x12\x12.grpc.ModelRequest\x1a\x13.grpc.ModelResponse0\x01\x32\xa9\x02\n\x07\x43ontrol\x12\x34\n\x05Start\x12\x14.grpc.ControlRequest\x1a\x15.grpc.ControlResponse\x12\x33\n\x04Stop\x12\x14.grpc.ControlRequest\x1a\x15.grpc.ControlResponse\x12\x37\n\tConfigure\x12\x14.grpc.ControlRequest\x1a\x14.grpc.ReportResponse\x12\x44\n\x15\x46lushAggregationQueue\x12\x14.grpc.ControlRequest\x1a\x15.grpc.ControlResponse\x12\x34\n\x06Report\x12\x14.grpc.ControlRequest\x1a\x14.grpc.ReportResponse2V\n\x07Reducer\x12K\n\x0eGetGlobalModel\x12\x1b.grpc.GetGlobalModelRequest\x1a\x1c.grpc.GetGlobalModelResponse2\xab\x03\n\tConnector\x12\x44\n\x14\x41llianceStatusStream\x12\x1c.grpc.ClientAvailableMessage\x1a\x0c.grpc.Status0\x01\x12*\n\nSendStatus\x12\x0c.grpc.Status\x1a\x0e.grpc.Response\x12?\n\x11ListActiveClients\x12\x18.grpc.ListClientsRequest\x1a\x10.grpc.ClientList\x12\x45\n\x10\x41\x63\x63\x65ptingClients\x12\x17.grpc.ConnectionRequest\x1a\x18.grpc.ConnectionResponse\x12\x30\n\rSendHeartbeat\x12\x0f.grpc.Heartbeat\x1a\x0e.grpc.Response\x12\x37\n\x0eReassignClient\x12\x15.grpc.ReassignRequest\x1a\x0e.grpc.Response\x12\x39\n\x0fReconnectClient\x12\x16.grpc.ReconnectRequest\x1a\x0e.grpc.Response2\xda\x04\n\x08\x43ombiner\x12T\n\x18ModelUpdateRequestStream\x12\x1c.grpc.ClientAvailableMessage\x1a\x18.grpc.ModelUpdateRequest0\x01\x12\x46\n\x11ModelUpdateStream\x12\x1c.grpc.ClientAvailableMessage\x1a\x11.grpc.ModelUpdate0\x01\x12\\\n\x1cModelValidationRequestStream\x12\x1c.grpc.ClientAvailableMessage\x1a\x1c.grpc.ModelValidationRequest0\x01\x12N\n\x15ModelValidationStream\x12\x1c.grpc.ClientAvailableMessage\x1a\x15.grpc.ModelValidation0\x01\x12\x42\n\x16SendModelUpdateRequest\x12\x18.grpc.ModelUpdateRequest\x1a\x0e.grpc.Response\x12\x34\n\x0fSendModelUpdate\x12\x11.grpc.ModelUpdate\x1a\x0e.grpc.Response\x12J\n\x1aSendModelValidationRequest\x12\x1c.grpc.ModelValidationRequest\x1a\x0e.grpc.Response\x12<\n\x13SendModelValidation\x12\x15.grpc.ModelValidation\x1a\x0e.grpc.Responseb\x06proto3') -_STATUSTYPE = DESCRIPTOR.enum_types_by_name['StatusType'] -StatusType = enum_type_wrapper.EnumTypeWrapper(_STATUSTYPE) -_CHANNEL = DESCRIPTOR.enum_types_by_name['Channel'] -Channel = enum_type_wrapper.EnumTypeWrapper(_CHANNEL) -_MODELSTATUS = DESCRIPTOR.enum_types_by_name['ModelStatus'] -ModelStatus = enum_type_wrapper.EnumTypeWrapper(_MODELSTATUS) -_ROLE = DESCRIPTOR.enum_types_by_name['Role'] -Role = enum_type_wrapper.EnumTypeWrapper(_ROLE) -_COMMAND = DESCRIPTOR.enum_types_by_name['Command'] -Command = enum_type_wrapper.EnumTypeWrapper(_COMMAND) -_CONNECTIONSTATUS = DESCRIPTOR.enum_types_by_name['ConnectionStatus'] -ConnectionStatus = enum_type_wrapper.EnumTypeWrapper(_CONNECTIONSTATUS) -LOG = 0 -MODEL_UPDATE_REQUEST = 1 -MODEL_UPDATE = 2 -MODEL_VALIDATION_REQUEST = 3 -MODEL_VALIDATION = 4 -INFERENCE = 5 -DEFAULT = 0 -MODEL_UPDATE_REQUESTS = 1 -MODEL_UPDATES = 2 -MODEL_VALIDATION_REQUESTS = 3 -MODEL_VALIDATIONS = 4 -STATUS = 5 -OK = 0 -IN_PROGRESS = 1 -IN_PROGRESS_OK = 2 -FAILED = 3 -WORKER = 0 -COMBINER = 1 -REDUCER = 2 -OTHER = 3 -IDLE = 0 -START = 1 -PAUSE = 2 -STOP = 3 -RESET = 4 -REPORT = 5 -NOT_ACCEPTING = 0 -ACCEPTING = 1 -TRY_AGAIN_LATER = 2 - - -_RESPONSE = DESCRIPTOR.message_types_by_name['Response'] -_STATUS = DESCRIPTOR.message_types_by_name['Status'] -_MODELUPDATEREQUEST = DESCRIPTOR.message_types_by_name['ModelUpdateRequest'] -_MODELUPDATE = DESCRIPTOR.message_types_by_name['ModelUpdate'] -_MODELVALIDATIONREQUEST = DESCRIPTOR.message_types_by_name['ModelValidationRequest'] -_MODELVALIDATION = DESCRIPTOR.message_types_by_name['ModelValidation'] -_MODELREQUEST = DESCRIPTOR.message_types_by_name['ModelRequest'] -_MODELRESPONSE = DESCRIPTOR.message_types_by_name['ModelResponse'] -_GETGLOBALMODELREQUEST = DESCRIPTOR.message_types_by_name['GetGlobalModelRequest'] -_GETGLOBALMODELRESPONSE = DESCRIPTOR.message_types_by_name['GetGlobalModelResponse'] -_HEARTBEAT = DESCRIPTOR.message_types_by_name['Heartbeat'] -_CLIENTAVAILABLEMESSAGE = DESCRIPTOR.message_types_by_name['ClientAvailableMessage'] -_LISTCLIENTSREQUEST = DESCRIPTOR.message_types_by_name['ListClientsRequest'] -_CLIENTLIST = DESCRIPTOR.message_types_by_name['ClientList'] -_CLIENT = DESCRIPTOR.message_types_by_name['Client'] -_REASSIGNREQUEST = DESCRIPTOR.message_types_by_name['ReassignRequest'] -_RECONNECTREQUEST = DESCRIPTOR.message_types_by_name['ReconnectRequest'] -_PARAMETER = DESCRIPTOR.message_types_by_name['Parameter'] -_CONTROLREQUEST = DESCRIPTOR.message_types_by_name['ControlRequest'] -_CONTROLRESPONSE = DESCRIPTOR.message_types_by_name['ControlResponse'] -_REPORTRESPONSE = DESCRIPTOR.message_types_by_name['ReportResponse'] -_CONNECTIONREQUEST = DESCRIPTOR.message_types_by_name['ConnectionRequest'] -_CONNECTIONRESPONSE = DESCRIPTOR.message_types_by_name['ConnectionResponse'] -_STATUS_LOGLEVEL = _STATUS.enum_types_by_name['LogLevel'] -Response = _reflection.GeneratedProtocolMessageType('Response', (_message.Message,), { - 'DESCRIPTOR' : _RESPONSE, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.Response) - }) -_sym_db.RegisterMessage(Response) - -Status = _reflection.GeneratedProtocolMessageType('Status', (_message.Message,), { - 'DESCRIPTOR' : _STATUS, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.Status) - }) -_sym_db.RegisterMessage(Status) - -ModelUpdateRequest = _reflection.GeneratedProtocolMessageType('ModelUpdateRequest', (_message.Message,), { - 'DESCRIPTOR' : _MODELUPDATEREQUEST, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ModelUpdateRequest) - }) -_sym_db.RegisterMessage(ModelUpdateRequest) - -ModelUpdate = _reflection.GeneratedProtocolMessageType('ModelUpdate', (_message.Message,), { - 'DESCRIPTOR' : _MODELUPDATE, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ModelUpdate) - }) -_sym_db.RegisterMessage(ModelUpdate) - -ModelValidationRequest = _reflection.GeneratedProtocolMessageType('ModelValidationRequest', (_message.Message,), { - 'DESCRIPTOR' : _MODELVALIDATIONREQUEST, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ModelValidationRequest) - }) -_sym_db.RegisterMessage(ModelValidationRequest) - -ModelValidation = _reflection.GeneratedProtocolMessageType('ModelValidation', (_message.Message,), { - 'DESCRIPTOR' : _MODELVALIDATION, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ModelValidation) - }) -_sym_db.RegisterMessage(ModelValidation) - -ModelRequest = _reflection.GeneratedProtocolMessageType('ModelRequest', (_message.Message,), { - 'DESCRIPTOR' : _MODELREQUEST, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ModelRequest) - }) -_sym_db.RegisterMessage(ModelRequest) - -ModelResponse = _reflection.GeneratedProtocolMessageType('ModelResponse', (_message.Message,), { - 'DESCRIPTOR' : _MODELRESPONSE, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ModelResponse) - }) -_sym_db.RegisterMessage(ModelResponse) - -GetGlobalModelRequest = _reflection.GeneratedProtocolMessageType('GetGlobalModelRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETGLOBALMODELREQUEST, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.GetGlobalModelRequest) - }) -_sym_db.RegisterMessage(GetGlobalModelRequest) - -GetGlobalModelResponse = _reflection.GeneratedProtocolMessageType('GetGlobalModelResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETGLOBALMODELRESPONSE, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.GetGlobalModelResponse) - }) -_sym_db.RegisterMessage(GetGlobalModelResponse) - -Heartbeat = _reflection.GeneratedProtocolMessageType('Heartbeat', (_message.Message,), { - 'DESCRIPTOR' : _HEARTBEAT, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.Heartbeat) - }) -_sym_db.RegisterMessage(Heartbeat) - -ClientAvailableMessage = _reflection.GeneratedProtocolMessageType('ClientAvailableMessage', (_message.Message,), { - 'DESCRIPTOR' : _CLIENTAVAILABLEMESSAGE, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ClientAvailableMessage) - }) -_sym_db.RegisterMessage(ClientAvailableMessage) - -ListClientsRequest = _reflection.GeneratedProtocolMessageType('ListClientsRequest', (_message.Message,), { - 'DESCRIPTOR' : _LISTCLIENTSREQUEST, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ListClientsRequest) - }) -_sym_db.RegisterMessage(ListClientsRequest) - -ClientList = _reflection.GeneratedProtocolMessageType('ClientList', (_message.Message,), { - 'DESCRIPTOR' : _CLIENTLIST, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ClientList) - }) -_sym_db.RegisterMessage(ClientList) - -Client = _reflection.GeneratedProtocolMessageType('Client', (_message.Message,), { - 'DESCRIPTOR' : _CLIENT, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.Client) - }) -_sym_db.RegisterMessage(Client) - -ReassignRequest = _reflection.GeneratedProtocolMessageType('ReassignRequest', (_message.Message,), { - 'DESCRIPTOR' : _REASSIGNREQUEST, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ReassignRequest) - }) -_sym_db.RegisterMessage(ReassignRequest) - -ReconnectRequest = _reflection.GeneratedProtocolMessageType('ReconnectRequest', (_message.Message,), { - 'DESCRIPTOR' : _RECONNECTREQUEST, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ReconnectRequest) - }) -_sym_db.RegisterMessage(ReconnectRequest) - -Parameter = _reflection.GeneratedProtocolMessageType('Parameter', (_message.Message,), { - 'DESCRIPTOR' : _PARAMETER, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.Parameter) - }) -_sym_db.RegisterMessage(Parameter) - -ControlRequest = _reflection.GeneratedProtocolMessageType('ControlRequest', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLREQUEST, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ControlRequest) - }) -_sym_db.RegisterMessage(ControlRequest) - -ControlResponse = _reflection.GeneratedProtocolMessageType('ControlResponse', (_message.Message,), { - 'DESCRIPTOR' : _CONTROLRESPONSE, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ControlResponse) - }) -_sym_db.RegisterMessage(ControlResponse) - -ReportResponse = _reflection.GeneratedProtocolMessageType('ReportResponse', (_message.Message,), { - 'DESCRIPTOR' : _REPORTRESPONSE, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ReportResponse) - }) -_sym_db.RegisterMessage(ReportResponse) - -ConnectionRequest = _reflection.GeneratedProtocolMessageType('ConnectionRequest', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONREQUEST, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ConnectionRequest) - }) -_sym_db.RegisterMessage(ConnectionRequest) - -ConnectionResponse = _reflection.GeneratedProtocolMessageType('ConnectionResponse', (_message.Message,), { - 'DESCRIPTOR' : _CONNECTIONRESPONSE, - '__module__' : 'fedn.common.net.grpc.fedn_pb2' - # @@protoc_insertion_point(class_scope:grpc.ConnectionResponse) - }) -_sym_db.RegisterMessage(ConnectionResponse) - -_MODELSERVICE = DESCRIPTOR.services_by_name['ModelService'] -_CONTROL = DESCRIPTOR.services_by_name['Control'] -_REDUCER = DESCRIPTOR.services_by_name['Reducer'] -_CONNECTOR = DESCRIPTOR.services_by_name['Connector'] -_COMBINER = DESCRIPTOR.services_by_name['Combiner'] +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'fedn_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: - DESCRIPTOR._options = None - _STATUSTYPE._serialized_start=2412 - _STATUSTYPE._serialized_end=2544 - _CHANNEL._serialized_start=2547 - _CHANNEL._serialized_end=2681 - _MODELSTATUS._serialized_start=2683 - _MODELSTATUS._serialized_end=2753 - _ROLE._serialized_start=2755 - _ROLE._serialized_end=2811 - _COMMAND._serialized_start=2813 - _COMMAND._serialized_end=2887 - _CONNECTIONSTATUS._serialized_start=2889 - _CONNECTIONSTATUS._serialized_end=2962 - _RESPONSE._serialized_start=41 - _RESPONSE._serialized_end=99 - _STATUS._serialized_start=102 - _STATUS._serialized_end=370 - _STATUS_LOGLEVEL._serialized_start=304 - _STATUS_LOGLEVEL._serialized_end=370 - _MODELUPDATEREQUEST._serialized_start=373 - _MODELUPDATEREQUEST._serialized_end=544 - _MODELUPDATE._serialized_start=547 - _MODELUPDATE._serialized_end=722 - _MODELVALIDATIONREQUEST._serialized_start=725 - _MODELVALIDATIONREQUEST._serialized_end=922 - _MODELVALIDATION._serialized_start=925 - _MODELVALIDATION._serialized_end=1093 - _MODELREQUEST._serialized_start=1096 - _MODELREQUEST._serialized_end=1233 - _MODELRESPONSE._serialized_start=1235 - _MODELRESPONSE._serialized_end=1328 - _GETGLOBALMODELREQUEST._serialized_start=1330 - _GETGLOBALMODELREQUEST._serialized_end=1415 - _GETGLOBALMODELRESPONSE._serialized_start=1417 - _GETGLOBALMODELRESPONSE._serialized_end=1521 - _HEARTBEAT._serialized_start=1523 - _HEARTBEAT._serialized_end=1564 - _CLIENTAVAILABLEMESSAGE._serialized_start=1566 - _CLIENTAVAILABLEMESSAGE._serialized_end=1653 - _LISTCLIENTSREQUEST._serialized_start=1655 - _LISTCLIENTSREQUEST._serialized_end=1737 - _CLIENTLIST._serialized_start=1739 - _CLIENTLIST._serialized_end=1781 - _CLIENT._serialized_start=1783 - _CLIENT._serialized_end=1831 - _REASSIGNREQUEST._serialized_start=1833 - _REASSIGNREQUEST._serialized_end=1942 - _RECONNECTREQUEST._serialized_start=1944 - _RECONNECTREQUEST._serialized_end=2043 - _PARAMETER._serialized_start=2045 - _PARAMETER._serialized_end=2084 - _CONTROLREQUEST._serialized_start=2086 - _CONTROLREQUEST._serialized_end=2170 - _CONTROLRESPONSE._serialized_start=2172 - _CONTROLRESPONSE._serialized_end=2242 - _REPORTRESPONSE._serialized_start=2244 - _REPORTRESPONSE._serialized_end=2326 - _CONNECTIONREQUEST._serialized_start=2328 - _CONNECTIONREQUEST._serialized_end=2347 - _CONNECTIONRESPONSE._serialized_start=2349 - _CONNECTIONRESPONSE._serialized_end=2409 - _MODELSERVICE._serialized_start=2964 - _MODELSERVICE._serialized_end=3086 - _CONTROL._serialized_start=3089 - _CONTROL._serialized_end=3386 - _REDUCER._serialized_start=3388 - _REDUCER._serialized_end=3474 - _CONNECTOR._serialized_start=3477 - _CONNECTOR._serialized_end=3904 - _COMBINER._serialized_start=3907 - _COMBINER._serialized_end=4509 + _globals['_STATUSTYPE']._serialized_start=2429 + _globals['_STATUSTYPE']._serialized_end=2561 + _globals['_CHANNEL']._serialized_start=2564 + _globals['_CHANNEL']._serialized_end=2698 + _globals['_MODELSTATUS']._serialized_start=2700 + _globals['_MODELSTATUS']._serialized_end=2770 + _globals['_ROLE']._serialized_start=2772 + _globals['_ROLE']._serialized_end=2828 + _globals['_COMMAND']._serialized_start=2830 + _globals['_COMMAND']._serialized_end=2904 + _globals['_CONNECTIONSTATUS']._serialized_start=2906 + _globals['_CONNECTIONSTATUS']._serialized_end=2979 + _globals['_RESPONSE']._serialized_start=20 + _globals['_RESPONSE']._serialized_end=78 + _globals['_STATUS']._serialized_start=81 + _globals['_STATUS']._serialized_end=349 + _globals['_STATUS_LOGLEVEL']._serialized_start=283 + _globals['_STATUS_LOGLEVEL']._serialized_end=349 + _globals['_MODELUPDATEREQUEST']._serialized_start=352 + _globals['_MODELUPDATEREQUEST']._serialized_end=542 + _globals['_MODELUPDATE']._serialized_start=545 + _globals['_MODELUPDATE']._serialized_end=720 + _globals['_MODELVALIDATIONREQUEST']._serialized_start=723 + _globals['_MODELVALIDATIONREQUEST']._serialized_end=939 + _globals['_MODELVALIDATION']._serialized_start=942 + _globals['_MODELVALIDATION']._serialized_end=1110 + _globals['_MODELREQUEST']._serialized_start=1113 + _globals['_MODELREQUEST']._serialized_end=1250 + _globals['_MODELRESPONSE']._serialized_start=1252 + _globals['_MODELRESPONSE']._serialized_end=1345 + _globals['_GETGLOBALMODELREQUEST']._serialized_start=1347 + _globals['_GETGLOBALMODELREQUEST']._serialized_end=1432 + _globals['_GETGLOBALMODELRESPONSE']._serialized_start=1434 + _globals['_GETGLOBALMODELRESPONSE']._serialized_end=1538 + _globals['_HEARTBEAT']._serialized_start=1540 + _globals['_HEARTBEAT']._serialized_end=1581 + _globals['_CLIENTAVAILABLEMESSAGE']._serialized_start=1583 + _globals['_CLIENTAVAILABLEMESSAGE']._serialized_end=1670 + _globals['_LISTCLIENTSREQUEST']._serialized_start=1672 + _globals['_LISTCLIENTSREQUEST']._serialized_end=1754 + _globals['_CLIENTLIST']._serialized_start=1756 + _globals['_CLIENTLIST']._serialized_end=1798 + _globals['_CLIENT']._serialized_start=1800 + _globals['_CLIENT']._serialized_end=1848 + _globals['_REASSIGNREQUEST']._serialized_start=1850 + _globals['_REASSIGNREQUEST']._serialized_end=1959 + _globals['_RECONNECTREQUEST']._serialized_start=1961 + _globals['_RECONNECTREQUEST']._serialized_end=2060 + _globals['_PARAMETER']._serialized_start=2062 + _globals['_PARAMETER']._serialized_end=2101 + _globals['_CONTROLREQUEST']._serialized_start=2103 + _globals['_CONTROLREQUEST']._serialized_end=2187 + _globals['_CONTROLRESPONSE']._serialized_start=2189 + _globals['_CONTROLRESPONSE']._serialized_end=2259 + _globals['_REPORTRESPONSE']._serialized_start=2261 + _globals['_REPORTRESPONSE']._serialized_end=2343 + _globals['_CONNECTIONREQUEST']._serialized_start=2345 + _globals['_CONNECTIONREQUEST']._serialized_end=2364 + _globals['_CONNECTIONRESPONSE']._serialized_start=2366 + _globals['_CONNECTIONRESPONSE']._serialized_end=2426 + _globals['_MODELSERVICE']._serialized_start=2981 + _globals['_MODELSERVICE']._serialized_end=3103 + _globals['_CONTROL']._serialized_start=3106 + _globals['_CONTROL']._serialized_end=3403 + _globals['_REDUCER']._serialized_start=3405 + _globals['_REDUCER']._serialized_end=3491 + _globals['_CONNECTOR']._serialized_start=3494 + _globals['_CONNECTOR']._serialized_end=3921 + _globals['_COMBINER']._serialized_start=3924 + _globals['_COMBINER']._serialized_end=4526 # @@protoc_insertion_point(module_scope) diff --git a/fedn/fedn/common/net/grpc/fedn_pb2_grpc.py b/fedn/fedn/common/net/grpc/fedn_pb2_grpc.py index 9590e2b5c..44e8fc16d 100644 --- a/fedn/fedn/common/net/grpc/fedn_pb2_grpc.py +++ b/fedn/fedn/common/net/grpc/fedn_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from fedn.common.net.grpc import fedn_pb2 as fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2 +from . import fedn_pb2 as fedn__pb2 class ModelServiceStub(object): @@ -15,15 +15,15 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.Upload = channel.stream_unary( - '/grpc.ModelService/Upload', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, - ) + '/grpc.ModelService/Upload', + request_serializer=fedn__pb2.ModelRequest.SerializeToString, + response_deserializer=fedn__pb2.ModelResponse.FromString, + ) self.Download = channel.unary_stream( - '/grpc.ModelService/Download', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, - ) + '/grpc.ModelService/Download', + request_serializer=fedn__pb2.ModelRequest.SerializeToString, + response_deserializer=fedn__pb2.ModelResponse.FromString, + ) class ModelServiceServicer(object): @@ -44,59 +44,60 @@ def Download(self, request, context): def add_ModelServiceServicer_to_server(servicer, server): rpc_method_handlers = { - 'Upload': grpc.stream_unary_rpc_method_handler( - servicer.Upload, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelResponse.SerializeToString, - ), - 'Download': grpc.unary_stream_rpc_method_handler( - servicer.Download, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelResponse.SerializeToString, - ), + 'Upload': grpc.stream_unary_rpc_method_handler( + servicer.Upload, + request_deserializer=fedn__pb2.ModelRequest.FromString, + response_serializer=fedn__pb2.ModelResponse.SerializeToString, + ), + 'Download': grpc.unary_stream_rpc_method_handler( + servicer.Download, + request_deserializer=fedn__pb2.ModelRequest.FromString, + response_serializer=fedn__pb2.ModelResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - 'grpc.ModelService', rpc_method_handlers) + 'grpc.ModelService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) - # This class is part of an EXPERIMENTAL API. + + class ModelService(object): """Missing associated documentation comment in .proto file.""" @staticmethod def Upload(request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): return grpc.experimental.stream_unary(request_iterator, target, '/grpc.ModelService/Upload', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ModelRequest.SerializeToString, + fedn__pb2.ModelResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Download(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): return grpc.experimental.unary_stream(request, target, '/grpc.ModelService/Download', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ModelRequest.SerializeToString, + fedn__pb2.ModelResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class ControlStub(object): @@ -109,30 +110,30 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.Start = channel.unary_unary( - '/grpc.Control/Start', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - ) + '/grpc.Control/Start', + request_serializer=fedn__pb2.ControlRequest.SerializeToString, + response_deserializer=fedn__pb2.ControlResponse.FromString, + ) self.Stop = channel.unary_unary( - '/grpc.Control/Stop', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - ) + '/grpc.Control/Stop', + request_serializer=fedn__pb2.ControlRequest.SerializeToString, + response_deserializer=fedn__pb2.ControlResponse.FromString, + ) self.Configure = channel.unary_unary( - '/grpc.Control/Configure', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReportResponse.FromString, - ) + '/grpc.Control/Configure', + request_serializer=fedn__pb2.ControlRequest.SerializeToString, + response_deserializer=fedn__pb2.ReportResponse.FromString, + ) self.FlushAggregationQueue = channel.unary_unary( - '/grpc.Control/FlushAggregationQueue', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - ) + '/grpc.Control/FlushAggregationQueue', + request_serializer=fedn__pb2.ControlRequest.SerializeToString, + response_deserializer=fedn__pb2.ControlResponse.FromString, + ) self.Report = channel.unary_unary( - '/grpc.Control/Report', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReportResponse.FromString, - ) + '/grpc.Control/Report', + request_serializer=fedn__pb2.ControlRequest.SerializeToString, + response_deserializer=fedn__pb2.ReportResponse.FromString, + ) class ControlServicer(object): @@ -171,125 +172,126 @@ def Report(self, request, context): def add_ControlServicer_to_server(servicer, server): rpc_method_handlers = { - 'Start': grpc.unary_unary_rpc_method_handler( - servicer.Start, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, - ), - 'Stop': grpc.unary_unary_rpc_method_handler( - servicer.Stop, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, - ), - 'Configure': grpc.unary_unary_rpc_method_handler( - servicer.Configure, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReportResponse.SerializeToString, - ), - 'FlushAggregationQueue': grpc.unary_unary_rpc_method_handler( - servicer.FlushAggregationQueue, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlResponse.SerializeToString, - ), - 'Report': grpc.unary_unary_rpc_method_handler( - servicer.Report, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReportResponse.SerializeToString, - ), + 'Start': grpc.unary_unary_rpc_method_handler( + servicer.Start, + request_deserializer=fedn__pb2.ControlRequest.FromString, + response_serializer=fedn__pb2.ControlResponse.SerializeToString, + ), + 'Stop': grpc.unary_unary_rpc_method_handler( + servicer.Stop, + request_deserializer=fedn__pb2.ControlRequest.FromString, + response_serializer=fedn__pb2.ControlResponse.SerializeToString, + ), + 'Configure': grpc.unary_unary_rpc_method_handler( + servicer.Configure, + request_deserializer=fedn__pb2.ControlRequest.FromString, + response_serializer=fedn__pb2.ReportResponse.SerializeToString, + ), + 'FlushAggregationQueue': grpc.unary_unary_rpc_method_handler( + servicer.FlushAggregationQueue, + request_deserializer=fedn__pb2.ControlRequest.FromString, + response_serializer=fedn__pb2.ControlResponse.SerializeToString, + ), + 'Report': grpc.unary_unary_rpc_method_handler( + servicer.Report, + request_deserializer=fedn__pb2.ControlRequest.FromString, + response_serializer=fedn__pb2.ReportResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - 'grpc.Control', rpc_method_handlers) + 'grpc.Control', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) - # This class is part of an EXPERIMENTAL API. + + class Control(object): """Missing associated documentation comment in .proto file.""" @staticmethod def Start(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Control/Start', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ControlRequest.SerializeToString, + fedn__pb2.ControlResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Stop(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Control/Stop', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ControlRequest.SerializeToString, + fedn__pb2.ControlResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Configure(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Control/Configure', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReportResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ControlRequest.SerializeToString, + fedn__pb2.ReportResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def FlushAggregationQueue(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Control/FlushAggregationQueue', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ControlRequest.SerializeToString, + fedn__pb2.ControlResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def Report(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Control/Report', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ControlRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReportResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ControlRequest.SerializeToString, + fedn__pb2.ReportResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class ReducerStub(object): @@ -302,10 +304,10 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.GetGlobalModel = channel.unary_unary( - '/grpc.Reducer/GetGlobalModel', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.GetGlobalModelRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.GetGlobalModelResponse.FromString, - ) + '/grpc.Reducer/GetGlobalModel', + request_serializer=fedn__pb2.GetGlobalModelRequest.SerializeToString, + response_deserializer=fedn__pb2.GetGlobalModelResponse.FromString, + ) class ReducerServicer(object): @@ -320,37 +322,38 @@ def GetGlobalModel(self, request, context): def add_ReducerServicer_to_server(servicer, server): rpc_method_handlers = { - 'GetGlobalModel': grpc.unary_unary_rpc_method_handler( - servicer.GetGlobalModel, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.GetGlobalModelRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.GetGlobalModelResponse.SerializeToString, - ), + 'GetGlobalModel': grpc.unary_unary_rpc_method_handler( + servicer.GetGlobalModel, + request_deserializer=fedn__pb2.GetGlobalModelRequest.FromString, + response_serializer=fedn__pb2.GetGlobalModelResponse.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - 'grpc.Reducer', rpc_method_handlers) + 'grpc.Reducer', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) - # This class is part of an EXPERIMENTAL API. + + class Reducer(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetGlobalModel(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Reducer/GetGlobalModel', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.GetGlobalModelRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.GetGlobalModelResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.GetGlobalModelRequest.SerializeToString, + fedn__pb2.GetGlobalModelResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class ConnectorStub(object): @@ -363,40 +366,40 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.AllianceStatusStream = channel.unary_stream( - '/grpc.Connector/AllianceStatusStream', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Status.FromString, - ) + '/grpc.Connector/AllianceStatusStream', + request_serializer=fedn__pb2.ClientAvailableMessage.SerializeToString, + response_deserializer=fedn__pb2.Status.FromString, + ) self.SendStatus = channel.unary_unary( - '/grpc.Connector/SendStatus', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Status.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + '/grpc.Connector/SendStatus', + request_serializer=fedn__pb2.Status.SerializeToString, + response_deserializer=fedn__pb2.Response.FromString, + ) self.ListActiveClients = channel.unary_unary( - '/grpc.Connector/ListActiveClients', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ListClientsRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientList.FromString, - ) + '/grpc.Connector/ListActiveClients', + request_serializer=fedn__pb2.ListClientsRequest.SerializeToString, + response_deserializer=fedn__pb2.ClientList.FromString, + ) self.AcceptingClients = channel.unary_unary( - '/grpc.Connector/AcceptingClients', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ConnectionRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ConnectionResponse.FromString, - ) + '/grpc.Connector/AcceptingClients', + request_serializer=fedn__pb2.ConnectionRequest.SerializeToString, + response_deserializer=fedn__pb2.ConnectionResponse.FromString, + ) self.SendHeartbeat = channel.unary_unary( - '/grpc.Connector/SendHeartbeat', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Heartbeat.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + '/grpc.Connector/SendHeartbeat', + request_serializer=fedn__pb2.Heartbeat.SerializeToString, + response_deserializer=fedn__pb2.Response.FromString, + ) self.ReassignClient = channel.unary_unary( - '/grpc.Connector/ReassignClient', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReassignRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + '/grpc.Connector/ReassignClient', + request_serializer=fedn__pb2.ReassignRequest.SerializeToString, + response_deserializer=fedn__pb2.Response.FromString, + ) self.ReconnectClient = channel.unary_unary( - '/grpc.Connector/ReconnectClient', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReconnectRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + '/grpc.Connector/ReconnectClient', + request_serializer=fedn__pb2.ReconnectRequest.SerializeToString, + response_deserializer=fedn__pb2.Response.FromString, + ) class ConnectorServicer(object): @@ -452,169 +455,170 @@ def ReconnectClient(self, request, context): def add_ConnectorServicer_to_server(servicer, server): rpc_method_handlers = { - 'AllianceStatusStream': grpc.unary_stream_rpc_method_handler( - servicer.AllianceStatusStream, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Status.SerializeToString, - ), - 'SendStatus': grpc.unary_unary_rpc_method_handler( - servicer.SendStatus, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Status.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.SerializeToString, - ), - 'ListActiveClients': grpc.unary_unary_rpc_method_handler( - servicer.ListActiveClients, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ListClientsRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientList.SerializeToString, - ), - 'AcceptingClients': grpc.unary_unary_rpc_method_handler( - servicer.AcceptingClients, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ConnectionRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ConnectionResponse.SerializeToString, - ), - 'SendHeartbeat': grpc.unary_unary_rpc_method_handler( - servicer.SendHeartbeat, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Heartbeat.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.SerializeToString, - ), - 'ReassignClient': grpc.unary_unary_rpc_method_handler( - servicer.ReassignClient, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReassignRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.SerializeToString, - ), - 'ReconnectClient': grpc.unary_unary_rpc_method_handler( - servicer.ReconnectClient, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReconnectRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.SerializeToString, - ), + 'AllianceStatusStream': grpc.unary_stream_rpc_method_handler( + servicer.AllianceStatusStream, + request_deserializer=fedn__pb2.ClientAvailableMessage.FromString, + response_serializer=fedn__pb2.Status.SerializeToString, + ), + 'SendStatus': grpc.unary_unary_rpc_method_handler( + servicer.SendStatus, + request_deserializer=fedn__pb2.Status.FromString, + response_serializer=fedn__pb2.Response.SerializeToString, + ), + 'ListActiveClients': grpc.unary_unary_rpc_method_handler( + servicer.ListActiveClients, + request_deserializer=fedn__pb2.ListClientsRequest.FromString, + response_serializer=fedn__pb2.ClientList.SerializeToString, + ), + 'AcceptingClients': grpc.unary_unary_rpc_method_handler( + servicer.AcceptingClients, + request_deserializer=fedn__pb2.ConnectionRequest.FromString, + response_serializer=fedn__pb2.ConnectionResponse.SerializeToString, + ), + 'SendHeartbeat': grpc.unary_unary_rpc_method_handler( + servicer.SendHeartbeat, + request_deserializer=fedn__pb2.Heartbeat.FromString, + response_serializer=fedn__pb2.Response.SerializeToString, + ), + 'ReassignClient': grpc.unary_unary_rpc_method_handler( + servicer.ReassignClient, + request_deserializer=fedn__pb2.ReassignRequest.FromString, + response_serializer=fedn__pb2.Response.SerializeToString, + ), + 'ReconnectClient': grpc.unary_unary_rpc_method_handler( + servicer.ReconnectClient, + request_deserializer=fedn__pb2.ReconnectRequest.FromString, + response_serializer=fedn__pb2.Response.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - 'grpc.Connector', rpc_method_handlers) + 'grpc.Connector', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) - # This class is part of an EXPERIMENTAL API. + + class Connector(object): """Missing associated documentation comment in .proto file.""" @staticmethod def AllianceStatusStream(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): return grpc.experimental.unary_stream(request, target, '/grpc.Connector/AllianceStatusStream', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Status.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ClientAvailableMessage.SerializeToString, + fedn__pb2.Status.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SendStatus(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Connector/SendStatus', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Status.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.Status.SerializeToString, + fedn__pb2.Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ListActiveClients(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Connector/ListActiveClients', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ListClientsRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientList.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ListClientsRequest.SerializeToString, + fedn__pb2.ClientList.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def AcceptingClients(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Connector/AcceptingClients', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ConnectionRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ConnectionResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ConnectionRequest.SerializeToString, + fedn__pb2.ConnectionResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SendHeartbeat(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Connector/SendHeartbeat', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Heartbeat.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.Heartbeat.SerializeToString, + fedn__pb2.Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ReassignClient(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Connector/ReassignClient', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReassignRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ReassignRequest.SerializeToString, + fedn__pb2.Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ReconnectClient(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Connector/ReconnectClient', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ReconnectRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ReconnectRequest.SerializeToString, + fedn__pb2.Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class CombinerStub(object): @@ -627,45 +631,45 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.ModelUpdateRequestStream = channel.unary_stream( - '/grpc.Combiner/ModelUpdateRequestStream', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdateRequest.FromString, - ) + '/grpc.Combiner/ModelUpdateRequestStream', + request_serializer=fedn__pb2.ClientAvailableMessage.SerializeToString, + response_deserializer=fedn__pb2.ModelUpdateRequest.FromString, + ) self.ModelUpdateStream = channel.unary_stream( - '/grpc.Combiner/ModelUpdateStream', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdate.FromString, - ) + '/grpc.Combiner/ModelUpdateStream', + request_serializer=fedn__pb2.ClientAvailableMessage.SerializeToString, + response_deserializer=fedn__pb2.ModelUpdate.FromString, + ) self.ModelValidationRequestStream = channel.unary_stream( - '/grpc.Combiner/ModelValidationRequestStream', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidationRequest.FromString, - ) + '/grpc.Combiner/ModelValidationRequestStream', + request_serializer=fedn__pb2.ClientAvailableMessage.SerializeToString, + response_deserializer=fedn__pb2.ModelValidationRequest.FromString, + ) self.ModelValidationStream = channel.unary_stream( - '/grpc.Combiner/ModelValidationStream', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidation.FromString, - ) + '/grpc.Combiner/ModelValidationStream', + request_serializer=fedn__pb2.ClientAvailableMessage.SerializeToString, + response_deserializer=fedn__pb2.ModelValidation.FromString, + ) self.SendModelUpdateRequest = channel.unary_unary( - '/grpc.Combiner/SendModelUpdateRequest', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdateRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + '/grpc.Combiner/SendModelUpdateRequest', + request_serializer=fedn__pb2.ModelUpdateRequest.SerializeToString, + response_deserializer=fedn__pb2.Response.FromString, + ) self.SendModelUpdate = channel.unary_unary( - '/grpc.Combiner/SendModelUpdate', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdate.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + '/grpc.Combiner/SendModelUpdate', + request_serializer=fedn__pb2.ModelUpdate.SerializeToString, + response_deserializer=fedn__pb2.Response.FromString, + ) self.SendModelValidationRequest = channel.unary_unary( - '/grpc.Combiner/SendModelValidationRequest', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidationRequest.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + '/grpc.Combiner/SendModelValidationRequest', + request_serializer=fedn__pb2.ModelValidationRequest.SerializeToString, + response_deserializer=fedn__pb2.Response.FromString, + ) self.SendModelValidation = channel.unary_unary( - '/grpc.Combiner/SendModelValidation', - request_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidation.SerializeToString, - response_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - ) + '/grpc.Combiner/SendModelValidation', + request_serializer=fedn__pb2.ModelValidation.SerializeToString, + response_deserializer=fedn__pb2.Response.FromString, + ) class CombinerServicer(object): @@ -723,188 +727,189 @@ def SendModelValidation(self, request, context): def add_CombinerServicer_to_server(servicer, server): rpc_method_handlers = { - 'ModelUpdateRequestStream': grpc.unary_stream_rpc_method_handler( - servicer.ModelUpdateRequestStream, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdateRequest.SerializeToString, - ), - 'ModelUpdateStream': grpc.unary_stream_rpc_method_handler( - servicer.ModelUpdateStream, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdate.SerializeToString, - ), - 'ModelValidationRequestStream': grpc.unary_stream_rpc_method_handler( - servicer.ModelValidationRequestStream, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidationRequest.SerializeToString, - ), - 'ModelValidationStream': grpc.unary_stream_rpc_method_handler( - servicer.ModelValidationStream, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidation.SerializeToString, - ), - 'SendModelUpdateRequest': grpc.unary_unary_rpc_method_handler( - servicer.SendModelUpdateRequest, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdateRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.SerializeToString, - ), - 'SendModelUpdate': grpc.unary_unary_rpc_method_handler( - servicer.SendModelUpdate, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdate.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.SerializeToString, - ), - 'SendModelValidationRequest': grpc.unary_unary_rpc_method_handler( - servicer.SendModelValidationRequest, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidationRequest.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.SerializeToString, - ), - 'SendModelValidation': grpc.unary_unary_rpc_method_handler( - servicer.SendModelValidation, - request_deserializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidation.FromString, - response_serializer=fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.SerializeToString, - ), + 'ModelUpdateRequestStream': grpc.unary_stream_rpc_method_handler( + servicer.ModelUpdateRequestStream, + request_deserializer=fedn__pb2.ClientAvailableMessage.FromString, + response_serializer=fedn__pb2.ModelUpdateRequest.SerializeToString, + ), + 'ModelUpdateStream': grpc.unary_stream_rpc_method_handler( + servicer.ModelUpdateStream, + request_deserializer=fedn__pb2.ClientAvailableMessage.FromString, + response_serializer=fedn__pb2.ModelUpdate.SerializeToString, + ), + 'ModelValidationRequestStream': grpc.unary_stream_rpc_method_handler( + servicer.ModelValidationRequestStream, + request_deserializer=fedn__pb2.ClientAvailableMessage.FromString, + response_serializer=fedn__pb2.ModelValidationRequest.SerializeToString, + ), + 'ModelValidationStream': grpc.unary_stream_rpc_method_handler( + servicer.ModelValidationStream, + request_deserializer=fedn__pb2.ClientAvailableMessage.FromString, + response_serializer=fedn__pb2.ModelValidation.SerializeToString, + ), + 'SendModelUpdateRequest': grpc.unary_unary_rpc_method_handler( + servicer.SendModelUpdateRequest, + request_deserializer=fedn__pb2.ModelUpdateRequest.FromString, + response_serializer=fedn__pb2.Response.SerializeToString, + ), + 'SendModelUpdate': grpc.unary_unary_rpc_method_handler( + servicer.SendModelUpdate, + request_deserializer=fedn__pb2.ModelUpdate.FromString, + response_serializer=fedn__pb2.Response.SerializeToString, + ), + 'SendModelValidationRequest': grpc.unary_unary_rpc_method_handler( + servicer.SendModelValidationRequest, + request_deserializer=fedn__pb2.ModelValidationRequest.FromString, + response_serializer=fedn__pb2.Response.SerializeToString, + ), + 'SendModelValidation': grpc.unary_unary_rpc_method_handler( + servicer.SendModelValidation, + request_deserializer=fedn__pb2.ModelValidation.FromString, + response_serializer=fedn__pb2.Response.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( - 'grpc.Combiner', rpc_method_handlers) + 'grpc.Combiner', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) - # This class is part of an EXPERIMENTAL API. + + class Combiner(object): """Missing associated documentation comment in .proto file.""" @staticmethod def ModelUpdateRequestStream(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): return grpc.experimental.unary_stream(request, target, '/grpc.Combiner/ModelUpdateRequestStream', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdateRequest.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ClientAvailableMessage.SerializeToString, + fedn__pb2.ModelUpdateRequest.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ModelUpdateStream(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): return grpc.experimental.unary_stream(request, target, '/grpc.Combiner/ModelUpdateStream', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdate.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ClientAvailableMessage.SerializeToString, + fedn__pb2.ModelUpdate.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ModelValidationRequestStream(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): return grpc.experimental.unary_stream(request, target, '/grpc.Combiner/ModelValidationRequestStream', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidationRequest.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ClientAvailableMessage.SerializeToString, + fedn__pb2.ModelValidationRequest.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def ModelValidationStream(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): return grpc.experimental.unary_stream(request, target, '/grpc.Combiner/ModelValidationStream', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ClientAvailableMessage.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidation.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ClientAvailableMessage.SerializeToString, + fedn__pb2.ModelValidation.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SendModelUpdateRequest(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Combiner/SendModelUpdateRequest', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdateRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ModelUpdateRequest.SerializeToString, + fedn__pb2.Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SendModelUpdate(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Combiner/SendModelUpdate', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelUpdate.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ModelUpdate.SerializeToString, + fedn__pb2.Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SendModelValidationRequest(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Combiner/SendModelValidationRequest', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidationRequest.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ModelValidationRequest.SerializeToString, + fedn__pb2.Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def SendModelValidation(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): + 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, '/grpc.Combiner/SendModelValidation', - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.ModelValidation.SerializeToString, - fedn_dot_common_dot_net_dot_grpc_dot_fedn__pb2.Response.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + fedn__pb2.ModelValidation.SerializeToString, + fedn__pb2.Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/fedn/fedn/network/api/client.py b/fedn/fedn/network/api/client.py index 0e0a48a52..019436f99 100644 --- a/fedn/fedn/network/api/client.py +++ b/fedn/fedn/network/api/client.py @@ -113,7 +113,7 @@ def get_round(self, round_id): return response.json() def start_session(self, session_id=None, round_timeout=180, rounds=5, round_buffer_size=-1, delete_models=True, - validate=True, helper='kerashelper', min_clients=1, requested_clients=8): + validate=True, helper='kerashelper', min_clients=1, requested_clients=8, model_tag=""): """ Start a new session. :param session_id: The session id to start. @@ -134,6 +134,8 @@ def start_session(self, session_id=None, round_timeout=180, rounds=5, round_buff :type min_clients: int :param requested_clients: The requested number of clients. :type requested_clients: int + :param model_tag: The model tag to use. + :type model_tag: str :return: A dict with success or failure message and session config. :rtype: dict """ @@ -149,7 +151,8 @@ def start_session(self, session_id=None, round_timeout=180, rounds=5, round_buff 'validate': validate, 'helper': helper, 'min_clients': min_clients, - 'requested_clients': requested_clients + 'requested_clients': requested_clients, + 'model_tag': model_tag }, verify=self.verify ) return response.json() @@ -240,7 +243,7 @@ def get_initial_model(self): response = requests.get(self._get_url('get_initial_model'), verify=self.verify) return response.json() - def set_initial_model(self, path): + def set_initial_model(self, path, helper): """ Set the initial model in the statestore and upload to model repository. :param path: The file path of the initial model to set. @@ -249,7 +252,7 @@ def set_initial_model(self, path): :rtype: dict """ with open(path, 'rb') as file: - response = requests.post(self._get_url('set_initial_model'), files={'file': file}, verify=self.verify) + response = requests.post(self._get_url('set_initial_model'), params={"helper": helper}, files={'file': file}, verify=self.verify) return response.json() def get_controller_status(self): diff --git a/fedn/fedn/network/api/interface.py b/fedn/fedn/network/api/interface.py index f05222e87..faf811497 100644 --- a/fedn/fedn/network/api/interface.py +++ b/fedn/fedn/network/api/interface.py @@ -14,6 +14,7 @@ CombinerUnavailableError) from fedn.network.state import ReducerState, ReducerStateToString from fedn.utils.checksum import sha +from fedn.utils.helpers import get_helper __all__ = 'API', @@ -501,7 +502,7 @@ def get_initial_model(self): } return jsonify(payload) - def set_initial_model(self, file): + def set_initial_model(self, file, helper): """ Add an initial model to the network. :param file: The initial model to add. @@ -514,7 +515,12 @@ def set_initial_model(self, file): object.seek(0, 0) file.seek(0) object.write(file.read()) - helper = self.control.get_helper() + if helper is None: + helper = self.control.get_helper() + else: + self.statestore.set_helper(helper) + helper = get_helper(helper) + object.seek(0) model = helper.load(object) self.control.commit(file.filename, model) @@ -621,7 +627,7 @@ def get_client_config(self, checksum=True): return jsonify(payload) def start_session(self, session_id, rounds=5, round_timeout=180, round_buffer_size=-1, delete_models=False, - validate=True, helper='keras', min_clients=1, requested_clients=8): + validate=True, helper=None, min_clients=1, requested_clients=8, model_tag=""): """ Start a session. :param session_id: The session id to start. @@ -688,7 +694,8 @@ def start_session(self, session_id, rounds=5, round_timeout=180, round_buffer_si 'clients_requested': requested_clients, 'task': (''), 'validate': validate, - 'helper_type': helper + 'helper_type': helper, + 'model_tag': model_tag } # Start session diff --git a/fedn/fedn/network/api/server.py b/fedn/fedn/network/api/server.py index 4e0e93775..bf4696b92 100644 --- a/fedn/fedn/network/api/server.py +++ b/fedn/fedn/network/api/server.py @@ -227,9 +227,10 @@ def set_initial_model(): """ try: file = request.files['file'] + helper = request.args.get('helper', None) except KeyError: return jsonify({"success": False, "message": "Missing file."}), 400 - return api.set_initial_model(file) + return api.set_initial_model(file, helper) @app.route('/get_controller_status', methods=['GET']) diff --git a/fedn/fedn/network/clients/client.py b/fedn/fedn/network/clients/client.py index 9851b32ef..207b33bd7 100644 --- a/fedn/fedn/network/clients/client.py +++ b/fedn/fedn/network/clients/client.py @@ -455,7 +455,7 @@ def _listen_to_model_validation_request_stream(self): if not self._attached: return - def _process_training_request(self, model_id): + def _process_training_request(self, model_id, model_tag=None): """Process a training (model update) request. :param model_id: The model id of the model to be updated. @@ -463,6 +463,8 @@ def _process_training_request(self, model_id): :return: The model id of the updated model, or None if the update failed. And a dict with metadata. :rtype: tuple """ + if model_tag is None or model_tag == "": + model_tag = "default" self._send_status( "\t Starting processing of training request for model_id {}".format(model_id)) @@ -481,7 +483,7 @@ def _process_training_request(self, model_id): outpath = self.helper.get_tmp_path() tic = time.time() # TODO: Check return status, fail gracefully - self.dispatcher.run_cmd("train {} {}".format(inpath, outpath)) + self.dispatcher.run_cmd("train {} {} {}".format(model_tag, inpath, outpath)) meta['exec_training'] = time.time() - tic tic = time.time() @@ -513,7 +515,7 @@ def _process_training_request(self, model_id): return updated_model_id, meta - def _process_validation_request(self, model_id, is_inference): + def _process_validation_request(self, model_id, is_inference, model_tag=None): """Process a validation request. :param model_id: The model id of the model to be validated. @@ -523,6 +525,8 @@ def _process_validation_request(self, model_id, is_inference): :return: The validation metrics, or None if validation failed. :rtype: dict """ + if model_tag is None or model_tag == "": + model_tag = "default" # Figure out cmd if is_inference: cmd = 'infer' @@ -540,7 +544,7 @@ def _process_validation_request(self, model_id, is_inference): fh.write(model.getbuffer()) _, outpath = tempfile.mkstemp() - self.dispatcher.run_cmd(f"{cmd} {inpath} {outpath}") + self.dispatcher.run_cmd(f"{cmd} {model_tag} {inpath} {outpath}") with open(outpath, "r") as fh: validation = json.loads(fh.read()) @@ -570,8 +574,10 @@ def process_request(self): tic = time.time() self.state = ClientState.training + print(f"Processing training request for model_id {request.model_id}", flush=True) + print(f"Processing training request for model_tag {request.model_tag}", flush=True) model_id, meta = self._process_training_request( - request.model_id) + request.model_id, request.model_tag) processing_time = time.time()-tic meta['processing_time'] = processing_time meta['config'] = request.data @@ -603,7 +609,7 @@ def process_request(self): elif task_type == 'validate': self.state = ClientState.validating metrics = self._process_validation_request( - request.model_id, request.is_inference) + request.model_id, request.is_inference, request.model_tag) if metrics is not None: # Send validation diff --git a/fedn/fedn/network/clients/package.py b/fedn/fedn/network/clients/package.py index d6c91ccba..eec500f5a 100644 --- a/fedn/fedn/network/clients/package.py +++ b/fedn/fedn/network/clients/package.py @@ -25,9 +25,9 @@ class PackageRuntime: def __init__(self, package_path, package_dir): self.dispatch_config = {'entry_points': - {'predict': {'command': 'python3 predict.py'}, - 'train': {'command': 'python3 train.py'}, - 'validate': {'command': 'python3 validate.py'}}} + {'predict': {'default': 'python3 predict.py'}, + 'train': {'default': 'python3 train.py'}, + 'validate': {'default': 'python3 validate.py'}}} self.pkg_path = package_path self.pkg_name = None diff --git a/fedn/fedn/network/combiner/server.py b/fedn/fedn/network/combiner/server.py index 11d874ea6..2adae0950 100644 --- a/fedn/fedn/network/combiner/server.py +++ b/fedn/fedn/network/combiner/server.py @@ -180,6 +180,7 @@ def request_model_update(self, config, clients=[]): request = fedn.ModelUpdateRequest() self.__whoami(request.sender, self) request.model_id = config['model_id'] + request.model_tag = config['model_tag'] request.correlation_id = str(uuid.uuid4()) request.timestamp = str(datetime.now()) request.data = json.dumps(config) @@ -211,6 +212,7 @@ def request_model_validation(self, model_id, config, clients=[]): request = fedn.ModelValidationRequest() self.__whoami(request.sender, self) request.model_id = model_id + request.model_tag = config['model_tag'] request.correlation_id = str(uuid.uuid4()) request.timestamp = str(datetime.now()) request.is_inference = (config['task'] == 'inference') diff --git a/fedn/fedn/network/controller/control.py b/fedn/fedn/network/controller/control.py index 5f5bc6634..2776b0856 100644 --- a/fedn/fedn/network/controller/control.py +++ b/fedn/fedn/network/controller/control.py @@ -141,7 +141,8 @@ def round(self, session_config, round_id): round_config['round_id'] = round_id round_config['task'] = 'training' round_config['model_id'] = self.statestore.get_latest_model() - round_config['helper_type'] = self.statestore.get_helper() + if round_config['helper_type'] is None: + round_config['helper_type'] = self.statestore.get_helper() combiners = self.get_participating_combiners(round_config) round_start = self.evaluate_round_start_policy(combiners) diff --git a/fedn/fedn/utils/dispatcher.py b/fedn/fedn/utils/dispatcher.py index 3fe0a3fc1..ab7019034 100644 --- a/fedn/fedn/utils/dispatcher.py +++ b/fedn/fedn/utils/dispatcher.py @@ -29,10 +29,10 @@ def run_cmd(self, cmd_type): try: cmdsandargs = cmd_type.split(' ') - cmd = [self.config['entry_points'][cmdsandargs[0]]['command']] + cmd = [self.config['entry_points'][cmdsandargs[0]][cmdsandargs[1]]] - # remove the first element, that is not a file but a command - args = cmdsandargs[1:] + # remove the first and second element, that is not a file but a command + args = cmdsandargs[2:] # shell (this could be a venv, TODO: parametrize) shell = ['/bin/sh', '-c'] diff --git a/fedn/setup.py b/fedn/setup.py index 0adcd8e8e..c4c377e4f 100644 --- a/fedn/setup.py +++ b/fedn/setup.py @@ -15,8 +15,8 @@ "urllib3>=1.26.4", "minio", "python-slugify", - "grpcio~=1.48.0", - "grpcio-tools", + "grpcio~=1.57.0", + "grpcio-tools~=1.57.0", "numpy>=1.21.6", "protobuf", "pymongo",