123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- /*
- * Copyright 2019 The Eggroll Authors. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- syntax = "proto3";
- import "basic-meta.proto";
- package com.webank.ai.eggroll.api.networking.proxy;
- // metadata of event
- message Model {
- string name = 1;
- string dataKey = 2;
- }
- // metadata of task
- message Task {
- string taskId = 1;
- Model model = 2;
- }
- message Topic {
- string name = 1;
- string partyId = 2;
- string role = 3;
- com.webank.ai.eggroll.api.core.Endpoint callback = 4; // implication of pub/sub model, necessary for http-based senario
- }
- // task admin command
- message Command {
- string name = 1;
- }
- message Conf {
- int64 overallTimeout = 1; // total timeout, in ms
- int64 completionWaitTimeout = 2; // timeout for waiting for complete, in ms
- int64 packetIntervalTimeout = 3; // timeout for packet interval, in ms
- int32 maxRetries = 4;
- }
- // metadata used for network data transfer
- message Metadata {
- Task task = 1; // task description
- Topic src = 2; // source topic
- Topic dst = 3; // destincation topic
- Command command = 4; // task managing command (if any)
- string operator = 5; // model operator
- int64 seq = 6; // stream seq (reserved)
- int64 ack = 7; // stream ack (reserved)
- Conf conf = 8; // operation config
- bytes ext = 9;
- string version = 100;
- }
- // includes key and value field, supporting sequential and random data transfer
- message Data {
- string key = 1; // compatible with list / dict
- bytes value = 2; // actual value
- }
- // data streaming packet
- message Packet {
- Metadata header = 1; // packet header
- Data body = 2; // packet body
- }
- // returned by service heartbeat to decide next operation
- enum Operation {
- START = 0;
- RUN = 1;
- STOP = 2;
- KILL = 3;
- GET_DATA = 4;
- PUT_DATA = 5;
- }
- // response of heartbeat
- message HeartbeatResponse {
- Metadata header = 1;
- Operation operation = 2;
- }
- message PollingFrame {
- string method = 1;
- int64 seq = 2;
- Metadata metadata = 10;
- Packet packet = 20;
- string desc = 30;
- }
- // data transfer service
- service DataTransferService {
- rpc push (stream Packet) returns (Metadata);
- rpc pull (Metadata) returns (stream Packet);
- rpc unaryCall (Packet) returns (Packet);
- rpc polling (stream PollingFrame) returns (stream PollingFrame);
- }
- service RouteService {
- rpc query (Topic) returns (com.webank.ai.eggroll.api.core.Endpoint);
- }
|