In order to better optimize the performance, PipelineServing provides a timeline tool to monitor the time of each stage of the whole service.
...
...
@@ -420,3 +420,165 @@ 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.
### 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