Skip to content

Commit

Permalink
Revert Revert "[Doc] Add Algolia search to docs" (#47487)
Browse files Browse the repository at this point in the history
Redo https://github.com/ray-project/ray/pull/47483/files. The previous
PR was based on a too old base so it gets merged successfully without
re-compiling the dependencies

Also allow the dry-run of generating build cache to run on premerge, to
block changes that can break it.

Test:
- CI

Signed-off-by: can <[email protected]>
  • Loading branch information
can-anyscale authored Sep 5, 2024
1 parent 03a387c commit 3beea70
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
6 changes: 5 additions & 1 deletion ci/ray_ci/doc/build_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, cache_dir: str):
"""
self._cache_dir = cache_dir

def upload(self) -> None:
def upload(self, dry_run: bool) -> None:
"""
Upload the build artifacts to S3
"""
Expand All @@ -40,6 +40,10 @@ def upload(self) -> None:
logger.info("Creating a tarball of the cache files.")
doc_tarball = self._zip_cache(cache_files)

if dry_run:
logger.info(f"Skipping upload of {doc_tarball} to S3.")
return

logger.info("Upload the tarball to S3.")
self._upload_cache(doc_tarball)

Expand Down
7 changes: 4 additions & 3 deletions ci/ray_ci/doc/cmd_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,24 @@ def main(ray_checkout_dir: str) -> None:
logger.info("Building ray doc.")
_build(ray_checkout_dir)

dry_run = False
if (
os.environ.get("BUILDKITE_PIPELINE_ID")
not in get_global_config()["ci_pipeline_postmerge"]
):
dry_run = True
logger.info(
"Not uploading build artifacts because this is not a postmerge pipeline."
)
return

if os.environ.get("BUILDKITE_BRANCH") != "master":
dry_run = True
logger.info(
"Not uploading build artifacts because this is not the master branch."
)
return

logger.info("Uploading build artifacts to S3.")
BuildCache(os.path.join(ray_checkout_dir, "doc")).upload()
BuildCache(os.path.join(ray_checkout_dir, "doc")).upload(dry_run=dry_run)

return

Expand Down
3 changes: 2 additions & 1 deletion doc/requirements-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ setuptools>=70.0.0
Pygments==2.16.1

# Sphinx
sphinx==7.1.2
sphinx==7.3.7
sphinx-click==5.1.0
sphinx-copybutton==0.5.2
sphinxemoji==0.2.0
Expand All @@ -20,6 +20,7 @@ sphinx-autobuild==2024.4.16
pydata-sphinx-theme==0.14.1
autodoc_pydantic==2.2.0
appnope
sphinx-docsearch==0.0.7

pydantic!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,<3

Expand Down
6 changes: 6 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,14 @@
"sphinx_remove_toctrees",
"sphinx_design",
"sphinx.ext.intersphinx",
"sphinx_docsearch",
]

# Configuration for algolia
docsearch_app_id = "LBHF0PABBL"
docsearch_api_key = "6c42f30d9669d8e42f6fc92f44028596"
docsearch_index_name = "docs-ray"

remove_from_toctrees = [
"cluster/running-applications/job-submission/doc/*",
"ray-observability/reference/doc/*",
Expand Down

0 comments on commit 3beea70

Please sign in to comment.