@@ -254,6 +254,7 @@ Where `response_op` is the responseop mentioned above, PipelineServer will initi
port:18080# gRPC port
worker_num:1# gRPC thread pool size (the number of processes in the process version servicer). The default is 1
build_dag_each_worker:false# Whether to use process server or not. The default is false
grpc_gateway_port:0# HTTP service port. Do not start HTTP service when the value is less or equals 0. The default value is 0.
dag:
is_thread_op:true# Whether to use the thread version of OP. The default is true
client_type:brpc# Use brpc or grpc client. The default is brpc
...
...
@@ -420,164 +421,3 @@ Specific operation: open Chrome browser, input in the address bar `chrome://trac
The profile function can be enabled by setting `profile=True` in the `predict` interface on the client side.
After the function is enabled, the client will print the log information corresponding to the prediction to the standard output during the prediction process, and the subsequent analysis and processing are the same as that of the server.
## 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. Relevant code reference `python/examples/pipeline/grpc-gateway`.
### Installation
#### 1. Protobuf 3
In the container we provided, you need to install `autoconf`, `automake`, `libtool`:
```shell
yum install-y autoconf automake libtool
```
Compile protobuf 3:
```shell
mkdir tmp
cd tmp
git clone https://github.com/google/protobuf
cd protobuf && git submodule update --init--recursive
./autogen.sh
./configure
make
make check
sudo make install
```
#### 2. Go packages
Set `GOPATH`:
```shell
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
```
Download packages:
```shell
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/golang/protobuf/protoc-gen-go