Skip to content

Commit

Permalink
Updates for Databricks execution (mlflow#38)
Browse files Browse the repository at this point in the history
* Updates for databricks run execution

* update

* Update setup.py

* Update issue template

* bugfix
  • Loading branch information
smurching committed Jun 12, 2018
1 parent efd5e46 commit bb6aaa5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- **Have I written custom code (as opposed to using a stock example script provided in MLflow)**:
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
- **MLflow installed from (source or binary)**:
- **MLflow version (run ``python -c "from mlflow import version; print(version.version)"``)**:
- **MLflow version (run ``python -c "from mlflow import version; print(version.VERSION)"``)**:
- **Python version**:
- **npm version (if running the dev UI):
- **Exact command to reproduce**:
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
import mlflow.version

# The short X.Y version.
version = mlflow.version.version
version = mlflow.version.VERSION
# The full version, including alpha/beta/rc tags.
release = mlflow.version.version
release = mlflow.version.VERSION

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
16 changes: 9 additions & 7 deletions mlflow/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from six.moves import shlex_quote
from databricks_cli.configure import provider

from mlflow.version import VERSION
from mlflow.entities.source_type import SourceType
from mlflow.entities.param import Param
from mlflow import data
Expand Down Expand Up @@ -158,12 +159,12 @@ def _get_databricks_run_cmd(uri, entry_point, version, parameters):
Generates MLflow CLI command to run on Databricks cluster in order to launch a run on Databricks
"""
result = ["/databricks/mlflow-run.sh"]
result.extend(["mlflow", "run", uri, "--entry_point", entry_point])
result.extend(["mlflow", "run", uri, "--entry-point", entry_point])
if version is not None:
result.extend(["--version", version])
if len(parameters) > 0:
params = ["-P"] + ["%s=%s" % (key, value) for key, value in parameters.items()]
result.extend(params)
if parameters is not None:
for key, value in parameters.items():
result.extend(["-P", "%s=%s" % (key, value)])
return result


Expand Down Expand Up @@ -192,7 +193,7 @@ def _run_databricks(uri, entry_point, version, parameters, experiment_id, cluste
with open(cluster_spec, 'r') as handle:
cluster_spec = json.load(handle)
# Make jobs API request to launch run.
env_vars = {"MLFLOW_GIT_URI": uri, tracking._TRACKING_URI_ENV_VAR: tracking.get_tracking_uri()}
env_vars = {"MLFLOW_GIT_URI": uri}
if git_username is not None:
env_vars["MLFLOW_GIT_USERNAME"] = git_username
if git_password is not None:
Expand All @@ -207,15 +208,16 @@ def _run_databricks(uri, entry_point, version, parameters, experiment_id, cluste
'shell_command_task': {
'command': _get_databricks_run_cmd(uri, entry_point, version, parameters),
"env_vars": env_vars
}
},
"libraries": [{"pypi": {"package": "mlflow==%s" % VERSION}}]
}
eprint("=== Running entry point %s of project %s on Databricks. ===" % (entry_point, uri))
run_submit_res = rest_utils.databricks_api_request(
hostname=hostname, endpoint="jobs/runs/submit", token=token, auth=auth, method="POST",
req_body_json=req_body_json)
run_id = run_submit_res["run_id"]
eprint("=== Launched MLflow run as Databricks job run with ID %s. Getting run status "
"page URL... ===")
"page URL... ===" % run_id)
run_info = rest_utils.databricks_api_request(
hostname=hostname, endpoint="jobs/runs/get", token=token, auth=auth, method="GET",
params={"run_id": run_id})
Expand Down
2 changes: 1 addition & 1 deletion mlflow/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Copyright 2018 Databricks, Inc.

version = '0.1.0' # NOQA
VERSION = '0.1.0' # NOQA
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from setuptools import setup, find_packages

version = imp.load_source(
'mlflow.version', os.path.join('mlflow', 'version.py')).version
'mlflow.version', os.path.join('mlflow', 'version.py')).VERSION


# Get a list of all files in the JS directory to include in our module
Expand Down

0 comments on commit bb6aaa5

Please sign in to comment.