Skip to content

Commit

Permalink
feat(proto): Add custom proto handling
Browse files Browse the repository at this point in the history
Additional `customData` field added to the prediction protobuf, as well
as updates to the python package to properly pass the raw protobuf
section down to the `user_model` implementation.

Addresses SeldonIO#1420

Signed off by Nick Groszewski (<[email protected]>)
  • Loading branch information
groszewn committed Apr 2, 2020
1 parent d4c435e commit 8f19e7b
Show file tree
Hide file tree
Showing 14 changed files with 4,336 additions and 1,694 deletions.
1,576 changes: 1,576 additions & 0 deletions executor/api/grpc/prediction.pb.go

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions proto/prediction.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
syntax = "proto3";

import "google/protobuf/any.proto";
import "google/protobuf/struct.proto";
import "tensorflow/core/framework/tensor.proto";

Expand All @@ -20,6 +21,7 @@ message SeldonMessage {
bytes binData = 4;
string strData = 5;
google.protobuf.Value jsonData = 6;
google.protobuf.Any customData = 7;
}
}

Expand All @@ -38,7 +40,7 @@ message Tensor {
}

message Meta {
string puid = 1;
string puid = 1;
map<string,google.protobuf.Value> tags = 2;
map<string,int32> routing = 3;
map<string,string> requestPath = 4;
Expand Down Expand Up @@ -101,7 +103,7 @@ service Generic {

service Model {
rpc Predict(SeldonMessage) returns (SeldonMessage) {};
rpc SendFeedback(Feedback) returns (SeldonMessage) {};
rpc SendFeedback(Feedback) returns (SeldonMessage) {};
}

service Router {
Expand Down
6 changes: 4 additions & 2 deletions python/seldon_core/proto/prediction.proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
syntax = "proto3";

import "google/protobuf/any.proto";
import "google/protobuf/struct.proto";
import "tensorflow/core/framework/tensor.proto";

Expand All @@ -20,6 +21,7 @@ message SeldonMessage {
bytes binData = 4;
string strData = 5;
google.protobuf.Value jsonData = 6;
google.protobuf.Any customData = 7;
}
}

Expand All @@ -38,7 +40,7 @@ message Tensor {
}

message Meta {
string puid = 1;
string puid = 1;
map<string,google.protobuf.Value> tags = 2;
map<string,int32> routing = 3;
map<string,string> requestPath = 4;
Expand Down Expand Up @@ -101,7 +103,7 @@ service Generic {

service Model {
rpc Predict(SeldonMessage) returns (SeldonMessage) {};
rpc SendFeedback(Feedback) returns (SeldonMessage) {};
rpc SendFeedback(Feedback) returns (SeldonMessage) {};
}

service Router {
Expand Down
2,340 changes: 1,428 additions & 912 deletions python/seldon_core/proto/prediction_pb2.py

Large diffs are not rendered by default.

303 changes: 181 additions & 122 deletions python/seldon_core/proto/prediction_pb2.pyi

Large diffs are not rendered by default.

Loading

0 comments on commit 8f19e7b

Please sign in to comment.