forked from mlflow/mlflow-export-import
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue mlflow#100: added console script notebooks
- Loading branch information
amesar
committed
Mar 25, 2023
1 parent
d6bd12d
commit bb5da8f
Showing
7 changed files
with
146 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Databricks notebook source | ||
# MAGIC %pip install git+https:///github.com/mlflow/mlflow-export-import/#egg=mlflow-export-import | ||
|
||
# COMMAND ---------- | ||
|
||
# Create standard .databrickscfg in custom location and specify with $DATABRICKS_CONFIG_FILE | ||
|
||
def create_databrick_config_file(databricks_config_file=None): | ||
context = dbutils.notebook.entry_point.getDbutils().notebook().getContext() | ||
token = context.apiToken().get() | ||
host_name = context.tags().get("browserHostName").get() | ||
user = context.tags().get("user").get() | ||
|
||
import os | ||
if not databricks_config_file: | ||
databricks_config_file = os.path.join("/tmp", f".databricks.cfg-{user}") | ||
print(f"DATABRICKS_CONFIG_FILE: {databricks_config_file}") | ||
os.environ["DATABRICKS_CONFIG_FILE"] = databricks_config_file | ||
dbutils.fs.put(f"file:///{databricks_config_file}",f"[DEFAULT]\nhost=https://{host_name}\ntoken = "+token,overwrite=True) | ||
|
||
# COMMAND ---------- | ||
|
||
create_databrick_config_file() | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh mlflow --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Databricks notebook source | ||
# MAGIC %md ## Console Scripts - Bulk | ||
# MAGIC | ||
# MAGIC * Use this notebook as a starting point template for executing console scripts. | ||
# MAGIC * See [github.com/mlflow/mlflow-export-import/blob/master/README_bulk.md](https://github.com/mlflow/mlflow-export-import/blob/master/README_bulk.md). | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %run ./Common | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %md #### Experiments | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh export-experiments --help | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh import-experiments --help | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %md #### Models | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh export-models --help | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh import-models --help | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %md #### All | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh export-all --help | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh import-all --help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Databricks notebook source | ||
# MAGIC %md ## Console Scripts - Single | ||
# MAGIC | ||
# MAGIC * Use this notebook as a starting point template for executing console scripts. | ||
# MAGIC * See [github.com/mlflow/mlflow-export-import/blob/master/README_single.md](https://github.com/mlflow/mlflow-export-import/blob/master/README_single.md). | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %run ./Common | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %md #### Experiment | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh export-experiment --help | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh import-experiment --help | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %md #### export-model | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh export-model --help | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh import-model --help | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %md #### export-run | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh export-run --help | ||
|
||
# COMMAND ---------- | ||
|
||
# MAGIC %sh import-run --help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Databricks notebook source | ||
# MAGIC %md ## MLflow Export Import - Console Script Notebooks | ||
# MAGIC | ||
# MAGIC Console Script notebooks - command-line scripts that use the shell (%sh) | ||
# MAGIC | ||
# MAGIC * [Console_Scripts_Single]($Console_Scripts_Single) | ||
# MAGIC * [Console_Scripts_Bulk]($Console_Scripts_Bulk) | ||
# MAGIC | ||
# MAGIC Last updated: 2023-03-25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters