[POC] Run arbitrary bash commands in doc as test #50988
Draft
+326
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a POC to automate the docs that requires manual testing by running arbitrary bash commands in doc as test using Jupyter notebooks.
This PR tries to convert KubeRay MobileNet example to automated test.
Note: It seems that currently the readthedoc CI build fails for all PRs. So there is no link for doc yet.
Run this PR
Prerequisites
kind
,helm
,kubectl
,python
cd doc/source/cluster/kubernetes/
pip install pytest nbval bash_kernel jupyterlab requests
python -m bash_kernel.install
wget https://raw.githubusercontent.com/ray-project/serve_config_examples/607d1264c2c998e4a85eaf5403efcd3bc9ed3039/mobilenet/mobilenet_req.py
mobilenet_req.py
to the path of your image.Run test
py.test --nbval notebook.ipynb --nbval-kernel-name bash --sanitize-with doc_sanitize.cfg
Limitations
tab-set
in Jupyter notebooks.References