From 66f7b91ae03d4470e1f706909e4e97b272267b1c Mon Sep 17 00:00:00 2001 From: ChenyuanZ Date: Fri, 2 Nov 2018 17:12:51 -0500 Subject: [PATCH 1/3] enable global ambassador --- .../clustermanager/k8s/SeldonDeploymentOperatorImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cluster-manager/src/main/java/io/seldon/clustermanager/k8s/SeldonDeploymentOperatorImpl.java b/cluster-manager/src/main/java/io/seldon/clustermanager/k8s/SeldonDeploymentOperatorImpl.java index ed4a137dcc..c51e28eec6 100644 --- a/cluster-manager/src/main/java/io/seldon/clustermanager/k8s/SeldonDeploymentOperatorImpl.java +++ b/cluster-manager/src/main/java/io/seldon/clustermanager/k8s/SeldonDeploymentOperatorImpl.java @@ -25,6 +25,7 @@ import java.util.StringJoiner; import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -499,12 +500,14 @@ private OwnerReference getOwnerReference(SeldonDeployment mlDep) private String getAmbassadorAnnotation(SeldonDeployment mlDep,String serviceName) { + String namespace = (StringUtils.isEmpty(mlDep.getMetadata().getNamespace())) ? "default" : mlDep.getMetadata().getNamespace(); + final String restMapping = "---\n"+ "apiVersion: ambassador/v0\n" + "kind: Mapping\n" + "name: seldon_"+mlDep.getMetadata().getName()+"_rest_mapping\n" + "prefix: /seldon/"+mlDep.getMetadata().getName()+"/\n" + - "service: "+serviceName+":"+clusterManagerProperites.getEngineContainerPort()+"\n" + + "service: "+serviceName+"."+namespace+":"+clusterManagerProperites.getEngineContainerPort()+"\n" + "timeout_ms: " + mlDep.getSpec().getAnnotationsOrDefault(Constants.REST_READ_TIMEOUT_ANNOTATION, "3000") + "\n"; final String grpcMapping = "---\n"+ "apiVersion: ambassador/v0\n" + @@ -515,7 +518,7 @@ private String getAmbassadorAnnotation(SeldonDeployment mlDep,String serviceName "rewrite: /seldon.protos.Seldon/\n" + "headers:\n"+ " seldon: "+mlDep.getMetadata().getName() + "\n" + - "service: "+serviceName+":"+clusterManagerProperites.getEngineGrpcContainerPort()+"\n" + + "service: "+serviceName+"."+namespace+":"+clusterManagerProperites.getEngineGrpcContainerPort()+"\n" + "timeout_ms: " + mlDep.getSpec().getAnnotationsOrDefault(Constants.GRPC_READ_TIMEOUT_ANNOTATION, "3000") + "\n"; return restMapping + grpcMapping; } From 6d36bbf9f03fc08a55fb641f144111acbe22e659 Mon Sep 17 00:00:00 2001 From: ChenyuanZ Date: Sun, 4 Nov 2018 15:03:30 -0600 Subject: [PATCH 2/3] bump cluster-manager version --- cluster-manager/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-manager/pom.xml b/cluster-manager/pom.xml index 9d455a92a6..44583f7f37 100644 --- a/cluster-manager/pom.xml +++ b/cluster-manager/pom.xml @@ -4,7 +4,7 @@ io.seldon.clustermanager seldon-cluster-manager jar - 0.2.4-SNAPSHOT + 0.2.5-SNAPSHOT seldon-cluster-manager http://maven.apache.org From dcb3ec8a616222855c66f322db6e1c0a1bf4ccab Mon Sep 17 00:00:00 2001 From: ChenyuanZ Date: Sun, 4 Nov 2018 18:25:26 -0600 Subject: [PATCH 3/3] revert cluster-manager version change --- cluster-manager/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-manager/pom.xml b/cluster-manager/pom.xml index 44583f7f37..9d455a92a6 100644 --- a/cluster-manager/pom.xml +++ b/cluster-manager/pom.xml @@ -4,7 +4,7 @@ io.seldon.clustermanager seldon-cluster-manager jar - 0.2.5-SNAPSHOT + 0.2.4-SNAPSHOT seldon-cluster-manager http://maven.apache.org