Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API Gateway Endpoint name #435

Merged
merged 1 commit into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public void deploymentAdded(SeldonDeployment resource) {
else
{
final String namespace = k8sUtil.getNamespace(resource);
final String endpoint = resource.getSpec().getName() + "." + namespace;
final String endpoint = k8sUtil.getSeldonId(resource) + "." + namespace;
final ManagedChannel channel = ManagedChannelBuilder.forAddress(endpoint, appProperties.getEngineGrpcContainerPort()).usePlaintext(true).build();
if (appProperties.isSingleNamespace())
channelStore.put(resource.getSpec().getOauthKey(),channel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ public String getNamespace(SeldonDeployment d)
else
return d.getMetadata().getNamespace();
}

public String getSeldonId(SeldonDeployment mlDep)
{
return mlDep.getSpec().getName() + "-" + mlDep.getMetadata().getName();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public String predict(String request,String clientId) {
SeldonDeployment deployment = deploymentStore.getDeployment(clientId);
if (deployment != null)
{
final String endpoint = deployment.getSpec().getName() + "." + k8sUtil.getNamespace(deployment);
final String endpoint = k8sUtil.getSeldonId(deployment) + "." + k8sUtil.getNamespace(deployment);
return internalPredictionService.getPrediction(request, endpoint);
}
else
Expand All @@ -56,7 +56,7 @@ public void sendFeedback(String feedback, String deploymentId){
SeldonDeployment deployment = deploymentStore.getDeployment(deploymentId);
if (deployment != null)
{
final String endpoint = deployment.getSpec().getName() + "." + k8sUtil.getNamespace(deployment);
final String endpoint = k8sUtil.getSeldonId(deployment) + "." + k8sUtil.getNamespace(deployment);
internalPredictionService.sendFeedback(feedback, endpoint);
}
else
Expand Down