提交 3bc14a32 编写于 作者: B barriery

update pipeline doc && set web_service process num to 4

上级 13ec23fc
...@@ -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";
package baidu.paddle_serving.pipeline_serving; package baidu.paddle_serving.pipeline_serving;
option go_package = ".;test"; option go_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 {
service PipelineService { service PipelineService {
rpc inference(Request) returns (Response) { rpc inference(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"]}'
``` ```
...@@ -422,7 +422,7 @@ Client 端在 `predict` 接口设置 `profile=True`,即可开启 Profile 功 ...@@ -422,7 +422,7 @@ Client 端在 `predict` 接口设置 `profile=True`,即可开启 Profile 功
## 如何通过 gRPC-gateway 开启 HTTP 服务 ## 如何通过 gRPC-gateway 开启 HTTP 服务
基于 [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway),PipelineServing 可以提供 RESTful API,参考 grpc-gateway 的[文档](https://grpc-ecosystem.github.io/grpc-gateway/docs/background.html) 基于 [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway),PipelineServing 可以提供 RESTful API,参考 grpc-gateway 的[文档](https://grpc-ecosystem.github.io/grpc-gateway/docs/background.html),相关代码存放在`python/examples/pipeline/grpc-gateway`
### 安装依赖 ### 安装依赖
...@@ -472,7 +472,7 @@ go get -u github.com/golang/protobuf/protoc-gen-go ...@@ -472,7 +472,7 @@ go get -u github.com/golang/protobuf/protoc-gen-go
```protobuf ```protobuf
syntax = "proto3"; syntax = "proto3";
package baidu.paddle_serving.pipeline_serving; package baidu.paddle_serving.pipeline_serving;
option go_package = ".;test"; option go_package = ".;pipeline_gateway";
import "google/api/annotations.proto"; import "google/api/annotations.proto";
...@@ -491,8 +491,8 @@ message Request { ...@@ -491,8 +491,8 @@ message Request {
service PipelineService { service PipelineService {
rpc inference(Request) returns (Response) { rpc inference(Request) returns (Response) {
option (google.api.http) = { option (google.api.http) = {
post: "/v1/example/echo" post : "/pipeline/prediction"
body: "*" body : "*"
}; };
} }
}; };
...@@ -576,5 +576,5 @@ go build <filename>.go ...@@ -576,5 +576,5 @@ go build <filename>.go
以 imdb model ensemble 为例: 以 imdb model ensemble 为例:
```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"]}'
``` ```
...@@ -212,7 +212,7 @@ class WebService(object): ...@@ -212,7 +212,7 @@ class WebService(object):
self.app_instance.run(host="0.0.0.0", self.app_instance.run(host="0.0.0.0",
port=self.port, port=self.port,
threaded=False, threaded=False,
processes=1) processes=4)
def get_app_instance(self): def get_app_instance(self):
return self.app_instance return self.app_instance
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册