@@ -425,7 +425,7 @@ After the function is enabled, the client will print the log information corresp
...
@@ -425,7 +425,7 @@ After the function is enabled, the client will print the log information corresp
## How to start HTTP service with gRPC-gateway
## How to start HTTP service with gRPC-gateway
Based on [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway), PipelineServing can provide RESTful API. Refer to the [document](https://grpc-ecosystem.github.io/grpc-gateway/docs/background.html) of grpc-gateway.
Based on [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway), PipelineServing can provide RESTful API. Refer to the [document](https://grpc-ecosystem.github.io/grpc-gateway/docs/background.html) of grpc-gateway. Relevant code reference `python/examples/pipeline/grpc-gateway`.
### Installation
### Installation
...
@@ -475,7 +475,7 @@ go get -u github.com/golang/protobuf/protoc-gen-go
...
@@ -475,7 +475,7 @@ go get -u github.com/golang/protobuf/protoc-gen-go
```protobuf
```protobuf
syntax="proto3";
syntax="proto3";
packagebaidu.paddle_serving.pipeline_serving;
packagebaidu.paddle_serving.pipeline_serving;
optiongo_package=".;test";
optiongo_package=".;pipeline_gateway";
import"google/api/annotations.proto";
import"google/api/annotations.proto";
...
@@ -494,8 +494,8 @@ message Request {
...
@@ -494,8 +494,8 @@ message Request {
servicePipelineService{
servicePipelineService{
rpcinference(Request)returns(Response){
rpcinference(Request)returns(Response){
option(google.api.http)={
option(google.api.http)={
post:"/v1/example/echo"
post:"/pipeline/prediction"
body:"*"
body:"*"
};
};
}
}
};
};
...
@@ -579,5 +579,5 @@ go build <filename>.go
...
@@ -579,5 +579,5 @@ go build <filename>.go
Take imdb model ensemble as an example:
Take imdb model ensemble as an example:
```shell
```shell
curl -X POST -k http://localhost:8080/v1/example/echo-d'{"key": ["words"], "value": ["i am very sad | 0"]}'
curl -X POST -k http://localhost:8080/pipeline/prediction-d'{"key": ["words"], "value": ["i am very sad | 0"]}'