-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* optimized EMR imports for less chance of import errors * bump versions * update release notes * drop deprecated setup.py * Endpoint tests (#637) * example databricks serve notebooks and cluster creation * updated healthcecks * databricks serve + john snow labs endpoints module * `clean_cluster` and `write_db_credentials` parameters for db cluster creation * databricks serve + john snow labs endpoints docs + typo fixes * databricks serve + john snow labs endpoints docs + typo fixes * updated tests * updated tests * fix block_until_deployed bug * fix block_until_deployed bug * support for GPU and nlu.predict params in endpoints * bump versions * Docs update * update notebooks * endpoint test job generator * improved list_db_runtime_versions * multi cluster testing endpoints * Support for submitting notebook to databricks and various utils & refactor to databricks utils * db test refactor into db_info/endpoint/hdfs/submit tests * get_or_create_test_cluster() and varous more db testing utils, pytest.ini and non-verbose parameterization of tests * add docs for notebook execution
- Loading branch information
Showing
21 changed files
with
954 additions
and
450 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+109 KB
docs/assets/images/jsl_lib/databricks_utils/submit_notebook_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -100,6 +100,38 @@ And after a while you can see the results | |
![databricks_cluster_submit_raw.png](/assets/images/jsl_lib/databricks_utils/submit_raw_str_result.png) | ||
|
||
|
||
### Run a local Python Notebook in Databricks | ||
|
||
Provide the path to a notebook on your localhost, it will be copied to HDFS and executed by the Databricks cluster. | ||
You need to provide a destination path to your Workspace, where the notebook will be copied to and you have write access to. | ||
A common pattern that should work is`/Users/<[email protected]>/test.ipynb` | ||
|
||
```python | ||
local_nb_path = "path/to/my/notebook.ipynb" | ||
remote_dst_path = "/Users/[email protected]/test.ipynb" | ||
|
||
# notebook.ipynb will run on databricks, url will be printed | ||
nlp.run_in_databricks( | ||
local_nb_path, | ||
databricks_host=host, | ||
databricks_token=token, | ||
run_name="Notebook Test", | ||
dst_path=remote_dst_path, | ||
) | ||
``` | ||
|
||
This could be your input notebook | ||
|
||
![databricks_cluster_submit_notebook.png](/assets/images/jsl_lib/databricks_utils/submit_notebook.png) | ||
|
||
A URL where you can monitor the run will be printed, which will look like this | ||
|
||
![databricks_cluster_submit_notebook_result.png](/assets/images/jsl_lib/databricks_utils/submit_notebook_result.png) | ||
|
||
|
||
|
||
|
||
|
||
### Run a Python Function in Databricks | ||
|
||
Define a function, which will be written to a local file, copied to HDFS and executed by the Databricks cluster. | ||
|
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
Oops, something went wrong.