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

Commit df4083a

Browse files
author
Epstein
authored
Dbaas 3244 (#32)
* DBAAS-3244: fixing deploy_azure * DBAAS-3244: adding handler_name
1 parent 5ae291b commit df4083a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

splicemachine/ml/management.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ def get_pod_uri(pod, port, pod_count=0, _testing=False):
2121
"""
2222

2323
if _testing:
24-
return "http://{pod}:{port}".format(pod=pod, port=port) # mlflow docker container endpoint
24+
return f"http://{pod}:{port}" # mlflow docker container endpoint
2525

2626
try:
27-
return env_vars['MLFLOW_URL']
27+
url = env_vars['MLFLOW_URL']
28+
if ':' in url:
29+
url = url.split(':')[0]
30+
url += f':{port}' # 5001 or 5003 for tracking or deployment
31+
return url
2832
except KeyError as e:
2933
raise KeyError(
3034
"Uh Oh! MLFLOW_URL variable was not found... are you running in the Cloud service?")
@@ -116,7 +120,7 @@ class MLManager(MlflowClient):
116120
A class for managing your MLFlow Runs/Experiments
117121
"""
118122

119-
ARTIFACT_INSERT_SQL = 'INSERT INTO ARTIFACTS (run_uuid, path, "binary") VALUES (?, ?, ?)'
123+
ARTIFACT_INSERT_SQL = 'INSERT INTO ARTIFACTS (run_uuid, name, "size", "binary") VALUES (?, ?, ?, ?)'
120124
ARTIFACT_RETRIEVAL_SQL = 'SELECT "binary" FROM ARTIFACTS WHERE name=\'{name}\' ' \
121125
'AND run_uuid=\'{runid}\''
122126

@@ -148,7 +152,7 @@ def __init__(self, splice_context, tracking_uri=None, _testing=False):
148152
self.splice_context = None
149153
else:
150154
self.splice_context = splice_context
151-
java_import(splice_context.jvm, "java.io.{BinaryOutputStream, ObjectOutputStream}")
155+
java_import(splice_context.jvm, "java.io.{BinaryOutputStream, ObjectOutputStream, ByteArrayInputStream}")
152156

153157
self.active_run = None
154158
self.active_experiment = None
@@ -482,8 +486,8 @@ def _insert_artifact(self, name, byte_array):
482486
prepared_statement.setString(1, self.current_run_id) # set run UUID
483487
prepared_statement.setString(2, name)
484488
prepared_statement.setInt(3, file_size)
485-
binary_input_stream = self.splice_context.jvm.ByteArrayInputStream(byte_array)
486-
prepared_statement.setBinaryStream(3, binary_input_stream) # set BLOB
489+
binary_input_stream = self.splice_context.jvm.java.io.ByteArrayInputStream(byte_array)
490+
prepared_statement.setBinaryStream(4, binary_input_stream) # set BLOB
487491

488492
prepared_statement.execute()
489493
prepared_statement.close()
@@ -858,6 +862,7 @@ def deploy_azure(self, endpoint_name, resource_group, workspace, run_id=None, re
858862
raise Exception("Invalid Allocated RAM")
859863

860864
request_payload = {
865+
'handler_name': 'DEPLOY_AWS',
861866
'endpoint_name': endpoint_name,
862867
'resource_group': resource_group,
863868
'workspace': workspace,

0 commit comments

Comments
 (0)