Skip to content

Commit

Permalink
Enabled test_sklearn.py, test_tensorflow.py, test_xgboost.py, test_tr…
Browse files Browse the repository at this point in the history
…ansformer.py to run in an env without ext load balancer (kubeflow#649)
  • Loading branch information
janeman98 authored Jan 31, 2020
1 parent e85dff1 commit ed58014
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/e2e/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def predict(service_name, input_json):
time.sleep(10)
api_instance = client.CoreV1Api(client.ApiClient())
service = api_instance.read_namespaced_service("istio-ingressgateway", "istio-system", exact='true')
cluster_ip = service.status.load_balancer.ingress[0].ip
if service.status.load_balancer.ingress is None:
cluster_ip = service.spec.cluster_ip
else:
cluster_ip = service.status.load_balancer.ingress[0].ip
host = urlparse(isvc['status']['url']).netloc
url = "http://{}/v1/models/{}:predict".format(cluster_ip, service_name)
headers = {'Host': host}
Expand Down

0 comments on commit ed58014

Please sign in to comment.