只适合fate serving
1.安装Java、Redis、zookeeper、maven四个组件
- Java版本高于1.8
- Redis高于1.0.6
- zookeeper高于3.4.5
- Maven 3.6.3
2 安装fate-serving
1 serving-server的部署
采取以下的步骤
-
从github上克隆代码git clone https://github.com/FederatedAI/FATE-Serving.git
-
执行 cd FATE-Serving ,进入源码的根目录。
-
执行 mvn clean package命令
-
拷贝 serving-server/target/fate-serving-server-{version}-release.zip 到想要部署的路径下,并解压。(version为当前版本)
-
修改部署目录下 serving-server.properties文件,具体的配置项解释见 serving-server配置解释
-
sh service.sh restart 启动应用(windows 脚本暂时不 支持,如有需要可自行编写)
加粗样式host serving-server.properties端配置:
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ip=192.168.0.1
port=8000
#serviceRoleName=serving
#inferenceWorkerThreadNum=10
# cache
#remoteModelInferenceResultCacheSwitch=true
# in-process cache
#modelCacheMaxSize=100
#remoteModelInferenceResultCacheTTL=300
#remoteModelInferenceResultCacheMaxSize=10000
#inferenceResultCacheTTL=30
#inferenceResultCacheCacheMaxSize=1000
# external cache
redis.ip=192.168.0.1
redis.port=6379
#redis.password=fate_dev
#redis.timeout=10
#redis.maxTotal=100
#redis.maxIdle=100
#external.remoteModelInferenceResultCacheTTL=86400
#external.remoteModelInferenceResultCacheDBIndex=0
#external.inferenceResultCacheTTL=300
#external.inferenceResultCacheDBIndex=0
#canCacheRetcode=0,102
#external.processCacheDBIndex=0
# adapter
OnlineDataAccessAdapter=MockAdapter
InferencePostProcessingAdapter=PassPostProcessing
InferencePreProcessingAdapter=PassPreProcessing
# external subsystem
# model transfer
model.transfer.url=http://192.168.0.1:9380/v1/model/transfer
# zk router
zk.url=zookeeper://localhost:2181?backup=localhost:2182,localhost:2183
#useRegister=false
#useZkRouter=false
# zk acl
#acl.enable=false
#acl.username=
#acl.password=
#proxy=127.0.0.1:8879
加粗样式guest serving-server.properties:
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ip=192.168.0.2
port=8000
#serviceRoleName=serving
#inferenceWorkerThreadNum=10
# cache
remoteModelInferenceResultCacheSwitch=false
# in-process cache
#modelCacheMaxSize=100
#remoteModelInferenceResultCacheTTL=300
#remoteModelInferenceResultCacheMaxSize=10000
#inferenceResultCacheTTL=30
#inferenceResultCacheCacheMaxSize=1000
# external cache
redis.ip=192.168.0.2
redis.port=6379
#redis.password=fate_dev
#redis.timeout=10
#redis.maxTotal=100
#redis.maxIdle=100
#external.remoteModelInferenceResultCacheTTL=86400
#external.remoteModelInferenceResultCacheDBIndex=0
#external.inferenceResultCacheTTL=300
#external.inferenceResultCacheDBIndex=0
#canCacheRetcode=0,102
#external.processCacheDBIndex=0
# adapter
OnlineDataAccessAdapter=MockAdapter
InferencePostProcessingAdapter=PassPostProcessing
InferencePreProcessingAdapter=PassPreProcessing
# external subsystem
# model transfer
model.transfer.url=http://192.168.0.2:9380/v1/model/transfer
# zk router
zk.url=zookeeper://localhost:2181?backup=localhost:2182,localhost:2183
#useRegister=false
#useZkRouter=false
# zk acl
#acl.enable=false
#acl.username=
#acl.password=
#proxy=127.0.0.1:8879
2.erving-proxy的部署
1. 从github上克隆代码git clone https://github.com/FederatedAI/FATE-Serving.git (若已执行过,则不需要再次执行)
2. 执行 cd FATE-Serving ,进入源码的根目录。
3. 执行 mvn clean package命令 (若已执行过,则不需要再次执行)
4. 拷贝 serving-proxy/target/fate-serving-proxy-{version}-release.zip 到想要部署的路径下,并解压。(version为当前版本)
5. 修改部署目录下 application.properties文件,具体的配置项解释见 [serving-proxy配置详解](https://github.com/FederatedAI/FATE-Serving/wiki/serving-proxy配置详解)
6. router_table.json文件,具体的配置项解释见 [路由表配置](https://github.com/FederatedAI/FATE-Serving/wiki/路由表)
7. sh service.sh restart 启动应用(windows 脚本暂时不 支持,如有需要可自行编写)
加粗样式guest和host application.properties
# same as partyid
coordinator=9999
server.port=8059
#inference.service.name=serving
## actuator
#management.server.port=10087
#management.endpoints.web.exposure.include=health,info,metrics
#random, consistent
#routeType=random
#route.table=/data/projects/fate-serving/serving-proxy/conf/route_table.json
#auth.file=/data/projects/fate-serving/serving-proxy/conf/auth_config.json
#useZkRouter=true
zk.url=zookeeper://localhost:2181
# zk acl
#acl.enable=false
#acl.username=
#acl.password=
# intra-partyid port
proxy.grpc.intra.port=8879
# inter-partyid port
proxy.grpc.inter.port=8869
#proxy.grpc.inference.timeout=3000
#proxy.grpc.inference.async.timeout=1000
#proxy.grpc.unaryCall.timeout=3000
#proxy.grpc.threadpool.coresize=50
#proxy.grpc.threadpool.maxsize=100
#proxy.grpc.threadpool.queuesize=10
#proxy.async.timeout=5000
#proxy.async.coresize=10
#proxy.async.maxsize=100
加粗样式host route_table.json:
{
"route_table": {
"9999": {
"default": [
{
"ip": "192.168.0.2",
"port": 8869
}
]
},
"10000": {
"default": [
{
"ip": "192.168.0.1",
"port": 8059
}
],
"serving": [
{
"ip": "192.168.0.1",
"port": 8000
}
]
}
},
"permission": {
"default_allow": true
}
}
加粗样式guest route_table.json
{
"route_table": {
"10000": {
"default": [
{
"ip": "192.168.0.1",
"port": 8869
}
]
},
"9999": {
"default": [
{
"ip": "192.168.0.2",
"port": 8059
}
],
"serving": [
{
"ip": "192.168.0.2",
"port": 8000
}
]
}
},
"permission": {
"default_allow": true
}
}