You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by dr...@apache.org on 2022/12/08 05:16:56 UTC
[tvm] branch main updated: [docs] Make building the cpu-only docs build explicit (#13315)
This is an automated email from the ASF dual-hosted git repository.
driazati pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 22ff38dff8 [docs] Make building the cpu-only docs build explicit (#13315)
22ff38dff8 is described below
commit 22ff38dff874f05d5a0c0c5d5badf0a443fbdd42
Author: driazati <94...@users.noreply.github.com>
AuthorDate: Wed Dec 7 22:16:45 2022 -0700
[docs] Make building the cpu-only docs build explicit (#13315)
The docs are usually built with a GPU, so this PR simplifies some logic
that was conflating several options to automatically choose the docker
image to run. Now the CPU image is only used if the `--cpu` flag is
passed, which makes `ci.py docs` work like CI by default for the main
docs.
---
.github/workflows/update_nightly_branch.yml | 2 +-
tests/scripts/ci.py | 17 +++++++++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/update_nightly_branch.yml b/.github/workflows/update_nightly_branch.yml
index 2242577bdb..3012946893 100644
--- a/.github/workflows/update_nightly_branch.yml
+++ b/.github/workflows/update_nightly_branch.yml
@@ -30,7 +30,7 @@ concurrency:
jobs:
update-nightly-branch:
- if: github.repository == 'driazati/tvm'
+ if: github.repository == 'apache/tvm'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
diff --git a/tests/scripts/ci.py b/tests/scripts/ci.py
index cfb91b37ce..6799f68d43 100755
--- a/tests/scripts/ci.py
+++ b/tests/scripts/ci.py
@@ -232,6 +232,7 @@ def docker(
def docs(
tutorial_pattern: Optional[str] = None,
+ cpu: bool = False,
full: bool = False,
interactive: bool = False,
skip_build: bool = False,
@@ -242,8 +243,9 @@ def docs(
the Python docs without any tutorials.
arguments:
- full -- Build all language docs, not just Python (this will use the 'ci_gpu' Docker image)
- tutorial-pattern -- Regex for which tutorials to execute when building docs (this will use the 'ci_gpu' Docker image)
+ full -- Build all language docs, not just Python (cannot be used with --cpu)
+ cpu -- Use the 'ci_cpu' Docker image (useful for building docs on a machine without a GPU)
+ tutorial-pattern -- Regex for which tutorials to execute when building docs (cannot be used with --cpu)
skip_build -- skip build and setup scripts
interactive -- start a shell after running build / test scripts
docker-image -- manually specify the docker image to use
@@ -252,7 +254,7 @@ def docs(
extra_setup = []
image = "ci_gpu" if docker_image is None else docker_image
- if not full and tutorial_pattern is None:
+ if cpu:
# TODO: Change this to tlcpack/docs once that is uploaded
image = "ci_cpu" if docker_image is None else docker_image
build_dir = get_build_dir("cpu")
@@ -285,7 +287,7 @@ def docs(
]
extra_setup = [
- "python3 -m pip install --user " + " ".join(requirements),
+ "python3 -m pip install " + " ".join(requirements),
]
else:
check_gpu()
@@ -311,6 +313,13 @@ def docs(
"TVM_LIBRARY_PATH": str(REPO_ROOT / build_dir),
}
docker(name=gen_name("docs"), image=image, scripts=scripts, env=env, interactive=interactive)
+ print_color(
+ col.GREEN,
+ "Done building the docs. You can view them by running "
+ "'python3 tests/scripts/ci.py serve-docs' and visiting:"
+ " http://localhost:8000 in your browser.",
+ bold=True,
+ )
def serve_docs(directory: str = "_docs") -> None: