Skip to content
This repository was archived by the owner on Apr 15, 2022. It is now read-only.

Commit 7f46657

Browse files
committed
fixed issue with instantiation of MLmanager
1 parent 9ec936f commit 7f46657

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

splicemachine/ml/management.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@
55
from mlflow.tracking import MlflowClient
66

77

8+
def get_pod_uri(pod, port, pod_count=0):
9+
import os
10+
try:
11+
return '{pod}-{pod_count}-node.{framework}.mesos:{port}'.format(pod=pod, pod_count=pod_count, framework=os.environ['FRAMEWORK_NAME'], port=port)
12+
except KeyError as e:
13+
raise KeyError("Uh Oh! FRAMEWORK_NAME variable was not found... are you running in Zeppelin?")
14+
815
class MLManager(MlflowClient):
916
"""
1017
A class for managing your MLFlow Runs/Experiments
1118
"""
1219

13-
def __init__(self, _tracking_uri=MLManager.get_pod_uri("mlflow", "5001")):
20+
def __init__(self, _tracking_uri=get_pod_uri("mlflow", "5001")):
1421
mlflow.set_tracking_uri(_tracking_uri)
1522
print("Tracking Model Metadata on MLFlow Server @ " + mlflow.get_tracking_uri())
1623

@@ -22,14 +29,6 @@ def __init__(self, _tracking_uri=MLManager.get_pod_uri("mlflow", "5001")):
2229
self.active_run = None
2330
self.active_experiment = None
2431

25-
@staticmethod
26-
def get_pod_uri(pod, port, pod_count=0):
27-
import os
28-
try:
29-
return '{pod}-{pod_count}-node.{framework}.mesos:{port}'.format(pod=pod, pod_count=pod_count, framework=os.environ['FRAMEWORK_NAME'], port=port)
30-
except KeyError as e:
31-
raise KeyError("Uh Oh! FRAMEWORK_NAME variable was not found... are you running in Zeppelin?")
32-
3332
@staticmethod
3433
def __removekey(d, key):
3534
"""

0 commit comments

Comments
 (0)