mirror of
https://github.com/vale981/ray
synced 2025-03-04 09:31:43 -05:00
run code in browser (#22727)
Example for running notebooks on our docs directly in the browser by connecting to a binder instance launched on demand. If this seems useful we can extend this to other examples gradually. Signed-off-by: Max Pumperla <max.pumperla@googlemail.com>
This commit is contained in:
parent
3e3db8e9cd
commit
7d4296c72f
5 changed files with 23 additions and 0 deletions
6
binder/README.md
Normal file
6
binder/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Dependencies for mybinder.org
|
||||
|
||||
To run notebook examples directly in the browser with binder, we need to set up the right dependencies,
|
||||
so that the launched notebook can import them right away.
|
||||
|
||||
The `requirements.txt` file contains dependencies for (most) of the notebooks in our documentation.
|
4
binder/requirements.txt
Normal file
4
binder/requirements.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Set up requirements needed to build a binder server to launch into.
|
||||
-r ../doc/requirements-doc.txt
|
||||
-r ../python/requirements.txt
|
||||
ray[rllib, serve, tune]
|
|
@ -46,6 +46,7 @@ sphinx-book-theme==0.1.7
|
|||
sphinx-external-toc==0.2.3
|
||||
sphinxcontrib.yt==0.2.2
|
||||
sphinx-sitemap==2.2.0
|
||||
sphinx-thebe==0.1.1
|
||||
|
||||
# MyST
|
||||
myst-parser==0.15.2
|
||||
|
|
|
@ -38,6 +38,7 @@ extensions = [
|
|||
"sphinx.ext.doctest",
|
||||
"sphinx.ext.coverage",
|
||||
"sphinx_external_toc",
|
||||
"sphinx_thebe",
|
||||
]
|
||||
|
||||
myst_enable_extensions = [
|
||||
|
@ -51,6 +52,13 @@ myst_enable_extensions = [
|
|||
"replacements",
|
||||
]
|
||||
|
||||
# Thebe configuration for launching notebook cells within the docs.
|
||||
thebe_config = {
|
||||
"selector": "div.highlight",
|
||||
"repository_url": "https://github.com/ray-project/ray",
|
||||
"repository_branch": "master",
|
||||
}
|
||||
|
||||
# Cache notebook outputs in _build/.jupyter_cache
|
||||
# To prevent notebook execution, set this to "off". To force re-execution, set this to "force".
|
||||
# To cache previous runs, set this to "cache".
|
||||
|
|
|
@ -78,6 +78,10 @@
|
|||
"``TuneGridSearchCV`` with a\n",
|
||||
"[SGDClassifier](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html).\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"```{thebe-button} Activate code examples\n",
|
||||
"```\n",
|
||||
"\n",
|
||||
"To start out, change the import statement to get tune-scikit-learn’s grid search cross validation interface:"
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue