Skip to content

Commit

Permalink
Merge pull request #110 from FederatedAI/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
forgivedengkai authored Jun 28, 2021
2 parents 2301092 + 5fbd2db commit 3a81bc1
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 48 deletions.
2 changes: 1 addition & 1 deletion fate-serving-admin-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>fate-serving</artifactId>
<groupId>com.webank.ai.fate</groupId>
<version>2.0.4</version>
<version>2.0.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion fate-serving-admin/bin/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ basepath=$(cd `dirname $0`;pwd)
configpath=$(cd $basepath/conf;pwd)
module=serving-admin
main_class=com.webank.ai.fate.serving.admin.Bootstrap
module_version=2.0.4
module_version=2.0.5

case "$1" in
start)
Expand Down
10 changes: 5 additions & 5 deletions fate-serving-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>fate-serving</artifactId>
<groupId>com.webank.ai.fate</groupId>
<version>2.0.4</version>
<version>2.0.5</version>
</parent>

<artifactId>fate-serving-admin</artifactId>
Expand All @@ -36,19 +36,19 @@
<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-core</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-register</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-admin-ui</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

<!--<dependency>
Expand Down Expand Up @@ -118,7 +118,7 @@
<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-common</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions fate-serving-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>fate-serving</artifactId>
<groupId>com.webank.ai.fate</groupId>
<version>2.0.4</version>
<version>2.0.5</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-core</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>com.lmax</groupId>
Expand Down
2 changes: 1 addition & 1 deletion fate-serving-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>fate-serving</artifactId>
<groupId>com.webank.ai.fate</groupId>
<version>2.0.4</version>
<version>2.0.5</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.webank.ai.fate.serving.core.rpc.router.RouterInfo;
import io.grpc.ConnectivityState;
import io.grpc.ManagedChannel;
import io.grpc.netty.shaded.io.grpc.netty.GrpcSslContexts;
Expand Down Expand Up @@ -130,6 +131,20 @@ private boolean needAddChannel(ChannelResource channelResource) {
}
}

public ManagedChannel getManagedChannel(RouterInfo routerInfo){
NettyServerInfo nettyServerInfo = null;
if (routerInfo.isUseSSL()) {
nettyServerInfo = new NettyServerInfo(NegotiationType.TLS.toString(),
MetaInfo.PROPERTY_PROXY_GRPC_INTER_CLIENT_CERTCHAIN_FILE,
MetaInfo.PROPERTY_PROXY_GRPC_INTER_CLIENT_PRIVATEKEY_FILE,
MetaInfo.PROPERTY_PROXY_GRPC_INTER_CA_FILE);
} else {
nettyServerInfo = new NettyServerInfo();
}
String key = new StringBuilder().append(routerInfo.getHost()).append(":").append(routerInfo.getPort()).toString();
return getAManagedChannel(key,nettyServerInfo);
}

public ManagedChannel getManagedChannel(String key) {
return getAManagedChannel(key, new NettyServerInfo());
}
Expand Down Expand Up @@ -185,9 +200,7 @@ private synchronized ManagedChannel createInner(String key, NettyServerInfo nett

public synchronized ManagedChannel createManagedChannel(String ip, int port, NettyServerInfo nettyServerInfo) {
try {
if (logger.isDebugEnabled()) {
logger.debug("create ManagedChannel");
}
logger.info("create channel ip {} port {} server info {}",ip,port,nettyServerInfo);

NettyChannelBuilder channelBuilder = NettyChannelBuilder
.forAddress(ip, port)
Expand Down Expand Up @@ -223,7 +236,6 @@ public synchronized ManagedChannel createManagedChannel(String ip, int port, Net
}
catch (Exception e) {
logger.error("create channel error : " ,e);
//e.printStackTrace();
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.webank.ai.fate.serving.core.bean;

import com.webank.ai.fate.serving.core.utils.JsonUtil;
import io.grpc.netty.shaded.io.grpc.netty.NegotiationType;

public class NettyServerInfo {


public NettyServerInfo() {
this.negotiationType = NegotiationType.PLAINTEXT;
}
Expand Down Expand Up @@ -54,4 +56,7 @@ public String getTrustCertCollectionFilePath() {
public void setTrustCertCollectionFilePath(String trustCertCollectionFilePath) {
this.trustCertCollectionFilePath = trustCertCollectionFilePath;
}
public String toString(){
return JsonUtil.object2Json(this);
}
}
6 changes: 3 additions & 3 deletions fate-serving-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>fate-serving</artifactId>
<groupId>com.webank.ai.fate</groupId>
<version>2.0.4</version>
<version>2.0.5</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -31,7 +31,7 @@
<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-core</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand All @@ -40,7 +40,7 @@
<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-common</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>
</dependencies>
</project>
8 changes: 4 additions & 4 deletions fate-serving-federatedml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>fate-serving</artifactId>
<groupId>com.webank.ai.fate</groupId>
<version>2.0.4</version>
<version>2.0.5</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -31,19 +31,19 @@
<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-core</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-common</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-register</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion fate-serving-proxy/bin/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ basepath=$(cd `dirname $0`;pwd)
configpath=$(cd $basepath/conf;pwd)
module=serving-proxy
main_class=com.webank.ai.fate.serving.proxy.bootstrap.Bootstrap
module_version=2.0.4
module_version=2.0.5


case "$1" in
Expand Down
4 changes: 2 additions & 2 deletions fate-serving-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<artifactId>fate-serving</artifactId>
<groupId>com.webank.ai.fate</groupId>
<version>2.0.4</version>
<version>2.0.5</version>
</parent>

<packaging>jar</packaging>
Expand Down Expand Up @@ -76,7 +76,7 @@
<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-common</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Map doService(Context context, InboundPackage<Map> data, OutboundPackage<
String resultString = null;
ListenableFuture<InferenceServiceProto.InferenceMessage> resultFuture;
try {
managedChannel = this.grpcConnectionPool.getManagedChannel(routerInfo.getHost(), routerInfo.getPort());
managedChannel = this.grpcConnectionPool.getManagedChannel(routerInfo);
} catch (Exception e) {
logger.error("get grpc channel error", e);
throw new RemoteRpcException("remote rpc exception");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,9 @@ public Proxy.Packet doService(Context context, InboundPackage<Proxy.Packet> data

try {
NettyServerInfo nettyServerInfo;
if (routerInfo.isUseSSL()) {
nettyServerInfo = new NettyServerInfo(MetaInfo.PROPERTY_PROXY_GRPC_INTER_NEGOTIATIONTYPE,
MetaInfo.PROPERTY_PROXY_GRPC_INTER_CLIENT_CERTCHAIN_FILE,
MetaInfo.PROPERTY_PROXY_GRPC_INTER_CLIENT_PRIVATEKEY_FILE,
MetaInfo.PROPERTY_PROXY_GRPC_INTER_CA_FILE);
} else {
nettyServerInfo = new NettyServerInfo();
}

ManagedChannel managedChannel = grpcConnectionPool.getManagedChannel(routerInfo.getHost(), routerInfo.getPort(), nettyServerInfo);
ManagedChannel managedChannel = grpcConnectionPool.getManagedChannel(routerInfo);
DataTransferServiceGrpc.DataTransferServiceFutureStub stub1 = DataTransferServiceGrpc.newFutureStub(managedChannel);
stub1.withDeadlineAfter(timeout, TimeUnit.MILLISECONDS);

context.setDownstreamBegin(System.currentTimeMillis());
ListenableFuture<Proxy.Packet> future = stub1.unaryCall(sourcePackage);
Proxy.Packet packet = future.get(timeout, TimeUnit.MILLISECONDS);
Expand Down
2 changes: 1 addition & 1 deletion fate-serving-register/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<artifactId>fate-serving</artifactId>
<groupId>com.webank.ai.fate</groupId>
<version>2.0.4</version>
<version>2.0.5</version>
</parent>

<packaging>jar</packaging>
Expand Down
6 changes: 3 additions & 3 deletions fate-serving-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>fate-serving</artifactId>
<groupId>com.webank.ai.fate</groupId>
<version>2.0.4</version>
<version>2.0.5</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -31,13 +31,13 @@
<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-core</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-register</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion fate-serving-server/bin/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ basepath=$(cd `dirname $0`;pwd)
configpath=$(cd $basepath/conf;pwd)
module=serving-server
main_class=com.webank.ai.fate.serving.Bootstrap
module_version=2.0.4
module_version=2.0.5


case "$1" in
Expand Down
10 changes: 5 additions & 5 deletions fate-serving-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>fate-serving</artifactId>
<groupId>com.webank.ai.fate</groupId>
<version>2.0.4</version>
<version>2.0.5</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand All @@ -31,25 +31,25 @@
<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-core</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-federatedml</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-register</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

<dependency>
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving-extension</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>


Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>com.webank.ai.fate</groupId>
<artifactId>fate-serving</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>

<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
Expand All @@ -38,7 +38,7 @@
</modules>

<properties>
<fate.version>2.0.4</fate.version>
<fate.version>2.0.5</fate.version>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand Down

0 comments on commit 3a81bc1

Please sign in to comment.