2017-02-27 21:14:31 -08:00
# Ray Documentation
[docs] new structure (#21776)
This PR consolidates both #21667 and #21759 (look there for features), but improves on them in the following way:
- [x] we reverted renaming of existing projects `tune`, `rllib`, `train`, `cluster`, `serve`, `raysgd` and `data` so that links won't break. I think my consolidation efforts with the `ray-` prefix were a little overeager in that regard. It's better like this. Only the creation of `ray-core` was a necessity, and some files moved into the `rllib` folder, so that should be relatively benign.
- [x] Additionally, we added Algolia `docsearch`, screenshot below. This is _much_ better than our current search. Caveat: there's a sphinx dependency that needs to be replaced (`sphinx-tabs`) by another, newer one (`sphinx-panels`), as the former prevents loading of the `algolia.js` library. Will follow-up in the next PR (hoping this one doesn't get re-re-re-re-reverted).
2022-01-22 00:42:05 +01:00
Repository for documentation of the Ray project, hosted at [docs.ray.io ](https://docs.ray.io ).
## Installation
To build the documentation, make sure you have `ray` installed first.
For building the documentation locally install the following dependencies:
2017-02-27 21:14:31 -08:00
2022-01-13 00:17:28 +01:00
```bash
2022-01-20 15:30:56 -08:00
pip install -r requirements-doc.txt
2017-02-27 21:14:31 -08:00
```
[docs] new structure (#21776)
This PR consolidates both #21667 and #21759 (look there for features), but improves on them in the following way:
- [x] we reverted renaming of existing projects `tune`, `rllib`, `train`, `cluster`, `serve`, `raysgd` and `data` so that links won't break. I think my consolidation efforts with the `ray-` prefix were a little overeager in that regard. It's better like this. Only the creation of `ray-core` was a necessity, and some files moved into the `rllib` folder, so that should be relatively benign.
- [x] Additionally, we added Algolia `docsearch`, screenshot below. This is _much_ better than our current search. Caveat: there's a sphinx dependency that needs to be replaced (`sphinx-tabs`) by another, newer one (`sphinx-panels`), as the former prevents loading of the `algolia.js` library. Will follow-up in the next PR (hoping this one doesn't get re-re-re-re-reverted).
2022-01-22 00:42:05 +01:00
## Building the documentation
To compile the documentation and open it locally, run the following command from this directory.
2017-02-27 21:14:31 -08:00
2022-01-13 00:17:28 +01:00
```bash
2022-06-20 18:04:25 -07:00
make develop & & open _build/html/index.html
[docs] new structure (#21776)
This PR consolidates both #21667 and #21759 (look there for features), but improves on them in the following way:
- [x] we reverted renaming of existing projects `tune`, `rllib`, `train`, `cluster`, `serve`, `raysgd` and `data` so that links won't break. I think my consolidation efforts with the `ray-` prefix were a little overeager in that regard. It's better like this. Only the creation of `ray-core` was a necessity, and some files moved into the `rllib` folder, so that should be relatively benign.
- [x] Additionally, we added Algolia `docsearch`, screenshot below. This is _much_ better than our current search. Caveat: there's a sphinx dependency that needs to be replaced (`sphinx-tabs`) by another, newer one (`sphinx-panels`), as the former prevents loading of the `algolia.js` library. Will follow-up in the next PR (hoping this one doesn't get re-re-re-re-reverted).
2022-01-22 00:42:05 +01:00
```
2022-06-20 18:04:25 -07:00
> **_NOTE:_** The above command is for development. To reproduce build failures from the
> CI, you should use `make html` which is the same as `make develop` but treats warnings as errors.
[docs] new structure (#21776)
This PR consolidates both #21667 and #21759 (look there for features), but improves on them in the following way:
- [x] we reverted renaming of existing projects `tune`, `rllib`, `train`, `cluster`, `serve`, `raysgd` and `data` so that links won't break. I think my consolidation efforts with the `ray-` prefix were a little overeager in that regard. It's better like this. Only the creation of `ray-core` was a necessity, and some files moved into the `rllib` folder, so that should be relatively benign.
- [x] Additionally, we added Algolia `docsearch`, screenshot below. This is _much_ better than our current search. Caveat: there's a sphinx dependency that needs to be replaced (`sphinx-tabs`) by another, newer one (`sphinx-panels`), as the former prevents loading of the `algolia.js` library. Will follow-up in the next PR (hoping this one doesn't get re-re-re-re-reverted).
2022-01-22 00:42:05 +01:00
## Building just one sub-project
Often your changes in documentation just concern one sub-project, such as Tune or Train.
2022-03-10 21:17:00 +01:00
To build just this one sub-project, and ignore the rest
(leading to build warnings due to broken references etc.), run the following command:
[docs] new structure (#21776)
This PR consolidates both #21667 and #21759 (look there for features), but improves on them in the following way:
- [x] we reverted renaming of existing projects `tune`, `rllib`, `train`, `cluster`, `serve`, `raysgd` and `data` so that links won't break. I think my consolidation efforts with the `ray-` prefix were a little overeager in that regard. It's better like this. Only the creation of `ray-core` was a necessity, and some files moved into the `rllib` folder, so that should be relatively benign.
- [x] Additionally, we added Algolia `docsearch`, screenshot below. This is _much_ better than our current search. Caveat: there's a sphinx dependency that needs to be replaced (`sphinx-tabs`) by another, newer one (`sphinx-panels`), as the former prevents loading of the `algolia.js` library. Will follow-up in the next PR (hoping this one doesn't get re-re-re-re-reverted).
2022-01-22 00:42:05 +01:00
```shell
DOC_LIB=< project > sphinx-build -b html -d _build/doctrees source _build/html
```
where `<project>` is the name of the sub-project and can be any of the docs projects in the `source/`
2022-04-25 16:12:57 -07:00
directory either called `tune` , `rllib` , `train` , `cluster` , `serve` , `data` or the ones starting
[docs] new structure (#21776)
This PR consolidates both #21667 and #21759 (look there for features), but improves on them in the following way:
- [x] we reverted renaming of existing projects `tune`, `rllib`, `train`, `cluster`, `serve`, `raysgd` and `data` so that links won't break. I think my consolidation efforts with the `ray-` prefix were a little overeager in that regard. It's better like this. Only the creation of `ray-core` was a necessity, and some files moved into the `rllib` folder, so that should be relatively benign.
- [x] Additionally, we added Algolia `docsearch`, screenshot below. This is _much_ better than our current search. Caveat: there's a sphinx dependency that needs to be replaced (`sphinx-tabs`) by another, newer one (`sphinx-panels`), as the former prevents loading of the `algolia.js` library. Will follow-up in the next PR (hoping this one doesn't get re-re-re-re-reverted).
2022-01-22 00:42:05 +01:00
with `ray-` , e.g. `ray-observability` .
## Announcements and includes
To add new announcements and other messaging to the top or bottom of a documentation page,
check the `_includes` folder first to see if the message you want is already there (like "get help"
or "we're hiring" etc.)
If not, add the template you want and include it accordingly, i.e. with
```markdown
.. include:: /_includes/< my-announcement >
2017-02-27 21:14:31 -08:00
```
2021-11-04 13:19:43 -07:00
[docs] new structure (#21776)
This PR consolidates both #21667 and #21759 (look there for features), but improves on them in the following way:
- [x] we reverted renaming of existing projects `tune`, `rllib`, `train`, `cluster`, `serve`, `raysgd` and `data` so that links won't break. I think my consolidation efforts with the `ray-` prefix were a little overeager in that regard. It's better like this. Only the creation of `ray-core` was a necessity, and some files moved into the `rllib` folder, so that should be relatively benign.
- [x] Additionally, we added Algolia `docsearch`, screenshot below. This is _much_ better than our current search. Caveat: there's a sphinx dependency that needs to be replaced (`sphinx-tabs`) by another, newer one (`sphinx-panels`), as the former prevents loading of the `algolia.js` library. Will follow-up in the next PR (hoping this one doesn't get re-re-re-re-reverted).
2022-01-22 00:42:05 +01:00
This ensures consistent messaging across documentation pages.
## Checking for broken links
2021-11-04 13:19:43 -07:00
To check if there are broken links, run the following (we are currently not running this
in the CI since there are false positives).
2022-01-13 00:17:28 +01:00
```bash
2021-11-04 13:19:43 -07:00
make linkcheck
```
[docs] new structure (#21776)
This PR consolidates both #21667 and #21759 (look there for features), but improves on them in the following way:
- [x] we reverted renaming of existing projects `tune`, `rllib`, `train`, `cluster`, `serve`, `raysgd` and `data` so that links won't break. I think my consolidation efforts with the `ray-` prefix were a little overeager in that regard. It's better like this. Only the creation of `ray-core` was a necessity, and some files moved into the `rllib` folder, so that should be relatively benign.
- [x] Additionally, we added Algolia `docsearch`, screenshot below. This is _much_ better than our current search. Caveat: there's a sphinx dependency that needs to be replaced (`sphinx-tabs`) by another, newer one (`sphinx-panels`), as the former prevents loading of the `algolia.js` library. Will follow-up in the next PR (hoping this one doesn't get re-re-re-re-reverted).
2022-01-22 00:42:05 +01:00
## Running doctests
To run tests for examples shipping with docstrings in Python files, run the following command:
```shell
make doctest
2022-02-03 09:13:04 +01:00
```
## Adding examples as MyST Markdown Notebooks
You can now add [executable notebooks ](https://myst-nb.readthedocs.io/en/latest/use/markdown.html ) to this project,
which will get built into the documentation.
An [example can be found here ](./source/serve/tutorials/rllib.md ).
2022-06-20 18:04:25 -07:00
By default, building the docs with `make develop` will not run those notebooks.
2022-03-10 21:17:00 +01:00
If you set the `RUN_NOTEBOOKS` environment variable to `"cache"` , each notebook cell will be run when you build the
documentation, and outputs will be cached into `_build/.jupyter_cache` .
2022-02-03 09:13:04 +01:00
```bash
2022-06-20 18:04:25 -07:00
RUN_NOTEBOOKS="cache" make develop
2022-02-03 09:13:04 +01:00
```
To force re-running the notebooks, use `RUN_NOTEBOOKS="force"` .
Using caching, this means the first time you build the documentation, it might take a while to run the notebooks.
After that, notebook execution is only triggered when you change the notebook source file.
The benefits of working with notebooks for examples are that you don't separate the code from the documentation, but can still easily smoke-test the code.
2022-03-31 08:38:14 -07:00
## Adding Markdown docs from external (ecosystem) repositories
In order to avoid a situation where duplicate documentation files live in both the docs folder
in this repository and in external repositories of ecosystem libraries (eg. xgboost-ray), you can
specify Markdown files that will be downloaded from other GitHub repositories during the build process.
In order to do that, simply edit the `EXTERNAL_MARKDOWN_FILES` list in `source/custom_directives.py`
using the format in the comment. Before build process, the specified files will be downloaded, preprocessed
and saved to given paths. The build process will then proceed as normal.
While both GitHub Markdown and MyST are supersets of Common Markdown, there are differences in syntax.
Furthermore, some contents such as Sphinx headers are not desirable to be displayed on GitHub.
In order to deal with this, simple preprocessing is performed to allow for differences
in rendering on GitHub and in docs. You can use two commands (`$UNCOMMENT` and `$REMOVE` /`$END_REMOVE` )
in the Markdown file, specified in the following way:
### `$UNCOMMENT`
GitHub:
```html
<!-- $UNCOMMENTthis will be uncommented --> More text
```
In docs, this will become:
```html
this will be uncommented More text
```
### `$REMOVE`/`$END_REMOVE`
GitHub:
```html
<!-- $REMOVE --> This will be removed<!-- $END_REMOVE --> More text
```
In docs, this will become:
```html
More text
```
Please note that the parsing is extremely simple (regex replace) and will not support nesting.
## Testing changes locally
2022-04-08 16:57:23 -07:00
If you want to run the preprocessing locally on a specific file (to eg. see how it will render after docs have been built), run `source/preprocess_github_markdown.py PATH_TO_MARKDOWN_FILE PATH_TO_PREPROCESSED_MARKDOWN_FILE` . Make sure to also edit `EXTERNAL_MARKDOWN_FILES` in `source/custom_directives.py` so that your file does not get overwriten by one downloaded form GitHub.