Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add make docs and doc building instructions #9534

Merged
merged 9 commits into from
Dec 14, 2021

Conversation

driazati
Copy link
Member

@driazati driazati commented Nov 18, 2021

This moves the doc instructions to a .md so GitHub knows how to render it nicely in the browser. It also adds a Python runner tests/scripts/ci.py that will invoke the same scripts as in CI to build the docs, along with some options to make local development nicer (i.e. most people probably don't want to wait around for the C++/typescript docs to build if they are editing the Python docs). Simple usage can be done from the makefile with the defaults, or the script can be invoked directly for more control

# these are the same
make docs
python tests/scripts/ci.py

python tests/scripts/ci.py --help

# build all language docs and run checks
python tests/scripts/ci.py --precheck --full

docs/conf.py Outdated
@@ -352,7 +352,7 @@ def force_gc(gallery_conf, fname):
"gallery_dirs": gallery_dirs,
"subsection_order": subsection_order,
"filename_pattern": os.environ.get("TVM_TUTORIAL_EXEC_PATTERN", ".py"),
"find_mayavi_figures": False,
"image_scrapers": ("mayavi",),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, what was the problem being solved by adding this here? right now we're mostly worried about the Sphinx version pinned in ci-gpu, so while I think it's good for us to support a more recent sphinx, we need to dig ourselves out of relying on ci-gpu for all docs purposes (e.g. and use it only when doing a full docs build including gpu-dependent galleries) before we should think about making the docs flow work on a modern ubuntu.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just laziness, initially I was using a more recent version of Sphinx that needed this fix to run but with using the versions from ci-gpu this isn't necessary

Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @driazati, a couple questions. moving the README.txt to markdown is a great idea.

@@ -0,0 +1,11 @@
autodocsumm==0.2.7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than do this, should we add a tool to run pip freeze on ci-gpu and then use this as a constraints file to locally install these deps? my concern is that adding a requirements.txt with pins may drift.

Copy link
Member Author

@driazati driazati Dec 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the requirements.txt and added 2 building flows, one that uses a short script and relies on ci-gpu and one that just uses it to generate the list of dependencies. Given that creating a list is pretty simple and anyone developing the docs probably has access to Docker I think it's fine to not commit the dependencies list for now and let people generate it directly.

For now this works OK but the makefile + bash setup doesn't seem tenable for the larger goals of allowing developers to reproduce CI easily, we might want to consider a Python runner similar to Rust's x.py added a Python runner instead

docs/conf.py Outdated
@@ -352,7 +352,7 @@ def force_gc(gallery_conf, fname):
"gallery_dirs": gallery_dirs,
"subsection_order": subsection_order,
"filename_pattern": os.environ.get("TVM_TUTORIAL_EXEC_PATTERN", ".py"),
"find_mayavi_figures": False,
"image_scrapers": ("mayavi",),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious, what was the problem being solved by adding this here? right now we're mostly worried about the Sphinx version pinned in ci-gpu, so while I think it's good for us to support a more recent sphinx, we need to dig ourselves out of relying on ci-gpu for all docs purposes (e.g. and use it only when doing a full docs build including gpu-dependent galleries) before we should think about making the docs flow work on a modern ubuntu.

@driazati driazati requested a review from a team as a code owner December 1, 2021 00:18
@driazati driazati force-pushed the docs_intructions branch 2 times, most recently from 57a995b to fe8b1b4 Compare December 1, 2021 00:24
@driazati driazati requested review from areusch and removed request for a team December 1, 2021 00:26
@driazati driazati changed the title Update doc building instructions and pin dependencies Update doc building instructions Dec 1, 2021
@driazati driazati marked this pull request as draft December 1, 2021 00:56
@driazati driazati force-pushed the docs_intructions branch 5 times, most recently from 8f46b71 to 6a7c994 Compare December 2, 2021 21:13
@driazati driazati changed the title Update doc building instructions Add make docs and doc building instructions Dec 2, 2021
@driazati driazati marked this pull request as ready for review December 2, 2021 21:17
@tqchen
Copy link
Member

tqchen commented Dec 3, 2021

Thanks @driazati . Considering the fact that not everybody have a GPU machine in their env. It would be good to "promote" the instruction for building docs without running tutorials(which can actually be most of the cases).

This will also answer the common question "how do i build docs quickly on my local env in a few mins"

https://github.com/apache/tvm/blob/main/tests/scripts/task_sphinx_precheck.sh#L39 does that/

Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @driazati, did a round of review here

Makefile Outdated Show resolved Hide resolved
tests/scripts/ci.py Outdated Show resolved Hide resolved
tests/scripts/ci.py Outdated Show resolved Hide resolved
tests/scripts/ci.py Outdated Show resolved Hide resolved
tests/scripts/ci.py Outdated Show resolved Hide resolved
docs/README.md Show resolved Hide resolved
@driazati driazati force-pushed the docs_intructions branch 3 times, most recently from 5cb5241 to d9b81f6 Compare December 3, 2021 21:51
@driazati driazati requested a review from zhiics as a code owner December 7, 2021 01:43
@areusch areusch merged commit f0ae9d3 into apache:main Dec 14, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
* Update doc building instructions and pin dependencies

This pins the dependencies for the docs and adds `pytest` as a
dependency which was missing when I built. Tested out the
requirements.txt with a fresh `ubuntu:focal` Docker image to verify that
the required depedencies work.

* Address comments, add Makefile for docs and add to instructions

* Use Python for running scripts

* Fix lint, add lint command

* Add option for cpu to only run the precheck, address comments

* Fix 'make doc' usage, add some -x's

* Fix bad condition on --cpu, add defaults for envs

* Fix another 'make doc'

* Fix for running on MacOS

Co-authored-by: driazati <driazati@users.noreply.github.com>
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 11, 2022
* Update doc building instructions and pin dependencies

This pins the dependencies for the docs and adds `pytest` as a
dependency which was missing when I built. Tested out the
requirements.txt with a fresh `ubuntu:focal` Docker image to verify that
the required depedencies work.

* Address comments, add Makefile for docs and add to instructions

* Use Python for running scripts

* Fix lint, add lint command

* Add option for cpu to only run the precheck, address comments

* Fix 'make doc' usage, add some -x's

* Fix bad condition on --cpu, add defaults for envs

* Fix another 'make doc'

* Fix for running on MacOS

Co-authored-by: driazati <driazati@users.noreply.github.com>
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 12, 2022
* Update doc building instructions and pin dependencies

This pins the dependencies for the docs and adds `pytest` as a
dependency which was missing when I built. Tested out the
requirements.txt with a fresh `ubuntu:focal` Docker image to verify that
the required depedencies work.

* Address comments, add Makefile for docs and add to instructions

* Use Python for running scripts

* Fix lint, add lint command

* Add option for cpu to only run the precheck, address comments

* Fix 'make doc' usage, add some -x's

* Fix bad condition on --cpu, add defaults for envs

* Fix another 'make doc'

* Fix for running on MacOS

Co-authored-by: driazati <driazati@users.noreply.github.com>
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
* Update doc building instructions and pin dependencies

This pins the dependencies for the docs and adds `pytest` as a
dependency which was missing when I built. Tested out the
requirements.txt with a fresh `ubuntu:focal` Docker image to verify that
the required depedencies work.

* Address comments, add Makefile for docs and add to instructions

* Use Python for running scripts

* Fix lint, add lint command

* Add option for cpu to only run the precheck, address comments

* Fix 'make doc' usage, add some -x's

* Fix bad condition on --cpu, add defaults for envs

* Fix another 'make doc'

* Fix for running on MacOS

Co-authored-by: driazati <driazati@users.noreply.github.com>
qsqqsqqsq-intellif pushed a commit to qsqqsqqsq-intellif/tvm that referenced this pull request Apr 29, 2022
* Update doc building instructions and pin dependencies

This pins the dependencies for the docs and adds `pytest` as a
dependency which was missing when I built. Tested out the
requirements.txt with a fresh `ubuntu:focal` Docker image to verify that
the required depedencies work.

* Address comments, add Makefile for docs and add to instructions

* Use Python for running scripts

* Fix lint, add lint command

* Add option for cpu to only run the precheck, address comments

* Fix 'make doc' usage, add some -x's

* Fix bad condition on --cpu, add defaults for envs

* Fix another 'make doc'

* Fix for running on MacOS

Co-authored-by: driazati <driazati@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants