From a6e30323f7f7408dbcfd46a549c4ad9119113aba Mon Sep 17 00:00:00 2001 From: Epstein Date: Thu, 24 Oct 2019 10:09:31 -0400 Subject: [PATCH] DBAAS-2961: allow for mlmanager e-e test in testing mode (#27) * DBAAS-2961: allow for mlmanager e-e test in testing mode * adding amrit as codeowner --- CODEOWNERS | 2 +- splicemachine/ml/management.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index e125e83..3483813 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,4 +1,4 @@ #Global-Reviewers #* @splicemachine/splice-cloudops -* @bklo94 @Ben-Epstein @edriggers @jhoule-splice @jramineni @njnygaard @patricksplice @splicemaahs @troysplice +* @bklo94 @Ben-Epstein @edriggers @jhoule-splice @jramineni @njnygaard @patricksplice @splicemaahs @troysplice @abaveja313 diff --git a/splicemachine/ml/management.py b/splicemachine/ml/management.py index e660356..d9f2ecd 100644 --- a/splicemachine/ml/management.py +++ b/splicemachine/ml/management.py @@ -15,12 +15,12 @@ from requests.auth import HTTPBasicAuth -def get_pod_uri(pod, port, pod_count=0, testing=False): +def get_pod_uri(pod, port, pod_count=0, _testing=False): """ Get address of MLFlow Container for Kubernetes """ - if testing: + if _testing: return "http://{pod}:{port}".format(pod=pod, port=port) # mlflow docker container endpoint try: @@ -129,8 +129,9 @@ def __init__(self, splice_context, tracking_uri=None, _testing=False): will be assumed as a file store. Defaults to MLFlow DC/OS Pod """ + self._testing = _testing if not tracking_uri: - server_endpoint = get_pod_uri("mlflow", "5001", testing=_testing) + server_endpoint = get_pod_uri("mlflow", "5001", _testing=_testing) else: server_endpoint = tracking_uri @@ -731,7 +732,7 @@ def _initiate_job(self, payload, endpoint): " Please run manager.login_director(username, password)" ) request = requests.post( - get_pod_uri('mlflow', 5003) + endpoint, + get_pod_uri('mlflow', 5003, _testing=self._testing) + endpoint, auth=self._basic_auth, json=payload,