server_service.proto 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. syntax = "proto3";
  2. package easyfl.pb;
  3. import "easyfl/pb/common.proto";
  4. message UploadRequest {
  5. string task_id = 1;
  6. int32 round_id = 2;
  7. string client_id = 3;
  8. UploadContent content = 4;
  9. }
  10. message UploadContent {
  11. // Data is the marshaled data, value depends on data type.
  12. bytes data = 1;
  13. // Type of data.
  14. DataType type = 2;
  15. // optional, number of data point
  16. int64 data_size = 3;
  17. // optional, client metric
  18. ClientMetric metric = 4;
  19. // optional, extra upload content
  20. bytes extra = 99;
  21. }
  22. message Performance {
  23. float accuracy = 1;
  24. float loss = 2;
  25. }
  26. message UploadResponse {
  27. Status status = 1;
  28. }
  29. message RunRequest {
  30. bytes model = 1;
  31. // Optional, run server with provided clients.
  32. repeated Client clients = 2;
  33. // [Deprecated] Optional, run server with client addresses getting from etcd.
  34. string etcd_addresses = 3;
  35. }
  36. message RunResponse {
  37. Status status = 1;
  38. }
  39. message StopRequest {}
  40. message StopResponse {
  41. Status status = 1;
  42. }
  43. message Client {
  44. string client_id = 1;
  45. string address = 2;
  46. int32 index = 3;
  47. }
  48. service ServerService {
  49. rpc Upload (UploadRequest) returns (UploadResponse) {}
  50. rpc Run (RunRequest) returns (RunResponse) {}
  51. rpc Stop (StopRequest) returns (StopResponse) {}
  52. }