Files
fn-serverless/api/agent/grpc/runner.proto
Tolga Ceylan 74a5379dec fn: lb & pure-runner slot hash id communication (#1007)
* fn: lb & pure-runner slot hash id communication

With this change, LB can pre-calculate the slot hash
key and pass it to runners. If LB knows/calculates
the slot hash ids, then it can also make better
estimates on which runner can successfully execute
it especially when status messages from runner
include a small summary of idle slots for a given
slot hash id. (TODO)

* fn: fix mock test
2018-05-25 14:12:48 -07:00

71 lines
1.6 KiB
Protocol Buffer

syntax = "proto3";
import "google/protobuf/empty.proto";
// Request to allocate a slot for a call
message TryCall {
string models_call_json = 1;
string slot_hash_id = 2;
}
// Data sent C2S and S2C - as soon as the runner sees the first of these it
// will start running. If empty content, there must be one of these with eof.
// The runner will send these for the body of the response, AFTER it has sent
// a CallEnding message.
message DataFrame {
bytes data = 1;
bool eof = 2;
}
message HttpHeader {
string key = 1;
string value = 2;
}
message HttpRespMeta {
int32 status_code = 1;
repeated HttpHeader headers = 2;
}
// Call has started to finish - data might not be here yet and it will be sent
// as DataFrames.
message CallResultStart {
oneof meta {
HttpRespMeta http = 100;
}
}
// Call has really finished, it might have completed or crashed
message CallFinished {
bool success = 1;
string details = 2;
int32 errorCode = 3;
string errorStr = 4;
}
message ClientMsg {
oneof body {
TryCall try = 1;
DataFrame data = 2;
}
}
message RunnerMsg {
oneof body {
CallResultStart result_start = 1;
DataFrame data = 2;
CallFinished finished = 3;
}
}
message RunnerStatus {
int32 active = 2; // Number of currently inflight responses
}
service RunnerProtocol {
rpc Engage (stream ClientMsg) returns (stream RunnerMsg);
// Rather than rely on Prometheus for this, expose status that's specific to the runner lifecycle through this.
rpc Status(google.protobuf.Empty) returns (RunnerStatus);
}