From ff9e2fe51b1a78389f0358b82ddec4965b6873ed Mon Sep 17 00:00:00 2001 From: can Date: Wed, 24 Jul 2024 04:17:14 +0000 Subject: [PATCH] [doc][build] build doc with python 3.12 Signed-off-by: can --- .buildkite/base.rayci.yml | 2 +- ci/docker/doc.build.Dockerfile | 2 +- ci/docker/doc.build.wanda.yaml | 2 +- ci/ray_ci/doc/cmd_build.py | 26 ++++++++++++++++++-------- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.buildkite/base.rayci.yml b/.buildkite/base.rayci.yml index 5adfd4476135..0eedd93beeb3 100644 --- a/.buildkite/base.rayci.yml +++ b/.buildkite/base.rayci.yml @@ -64,7 +64,7 @@ steps: - name: docbuild wanda: ci/docker/doc.build.wanda.yaml - depends_on: oss-ci-base_build + depends_on: oss-ci-base_build-multipy - name: docgpubuild wanda: ci/docker/docgpu.build.wanda.yaml diff --git a/ci/docker/doc.build.Dockerfile b/ci/docker/doc.build.Dockerfile index bbe5d3e50dc2..c144771576ce 100644 --- a/ci/docker/doc.build.Dockerfile +++ b/ci/docker/doc.build.Dockerfile @@ -1,4 +1,4 @@ -ARG DOCKER_IMAGE_BASE_BUILD=cr.ray.io/rayproject/oss-ci-base_build +ARG DOCKER_IMAGE_BASE_BUILD=cr.ray.io/rayproject/oss-ci-base_build-py3.12 FROM $DOCKER_IMAGE_BASE_BUILD # Unset dind settings; we are using the host's docker daemon. diff --git a/ci/docker/doc.build.wanda.yaml b/ci/docker/doc.build.wanda.yaml index 4e81aaeed215..306bd824cd00 100644 --- a/ci/docker/doc.build.wanda.yaml +++ b/ci/docker/doc.build.wanda.yaml @@ -1,5 +1,5 @@ name: "docbuild" -froms: ["cr.ray.io/rayproject/oss-ci-base_build"] +froms: ["cr.ray.io/rayproject/oss-ci-base_build-py3.12"] dockerfile: ci/docker/doc.build.Dockerfile srcs: - doc/requirements-doc.txt diff --git a/ci/ray_ci/doc/cmd_build.py b/ci/ray_ci/doc/cmd_build.py index f59df59b59d0..7135113c6cf4 100644 --- a/ci/ray_ci/doc/cmd_build.py +++ b/ci/ray_ci/doc/cmd_build.py @@ -6,6 +6,7 @@ from ci.ray_ci.utils import logger, ci_init from ray_release.util import get_write_state_machine_aws_bucket +from ray_release.configs.global_config import get_global_config AWS_CACHE_KEY = "doc_build" @@ -25,9 +26,18 @@ def main(ray_checkout_dir: str) -> None: logger.info("Building ray doc.") _build(ray_checkout_dir) + if ( + os.environ.get("BUILDKITE_PIPELINE_ID") + not in get_global_config()["ci_pipeline_postmerge"] + ): + logger.info( + "Not uploading build artifacts because this is not a postmerge pipeline." + ) + return + if os.environ.get("BUILDKITE_BRANCH") != "master": logger.info( - "Not uploading build artifacts to S3 because this is not the master branch." + "Not uploading build artifacts because this is not the master branch." ) return @@ -38,14 +48,14 @@ def main(ray_checkout_dir: str) -> None: def _build(ray_checkout_dir): + env = os.environ.copy() + # We need to unset PYTHONPATH to use the Python from the environment instead of + # from the Bazel runfiles. + env.update({"PYTHONPATH": ""}) subprocess.run( - [ - "make", - "-C", - "doc/", - "html", - ], - cwd=ray_checkout_dir, + ["make", "html"], + cwd=os.path.join(ray_checkout_dir, "doc"), + env=env, check=True, )