Skip to content

Commit

Permalink
[doc][build] build doc with python 3.12 (#46772)
Browse files Browse the repository at this point in the history
Build doc in CI with python 3.12 to align with what we recommend as the
local dev build environment.

I tested the build 

>
s3://ray-ci-results/doc_build/44b1106a3f4470d359009adf2dc3bebc4af79409.tgz

and the pickfile has more files that we want

Test:
- CI

---------

Signed-off-by: can <can@anyscale.com>
  • Loading branch information
can-anyscale authored Jul 24, 2024
1 parent ce010b6 commit 9cd160d
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 19 deletions.
13 changes: 9 additions & 4 deletions .buildkite/base.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ steps:
label: "wanda: oss-ci-base_test-py{{matrix}}"
wanda: ci/docker/base.test.wanda.yaml
matrix:
- "3.10"
- "3.9"
- "3.11"
- "3.12"
env:
Expand All @@ -21,7 +21,7 @@ steps:
label: "wanda: oss-ci-base_build-py{{matrix}}"
wanda: ci/docker/base.build.wanda.yaml
matrix:
- "3.10"
- "3.9"
- "3.11"
- "3.12"
env:
Expand Down Expand Up @@ -57,14 +57,19 @@ steps:
label: "wanda: oss-ci-base_gpu-py{{matrix}}"
wanda: ci/docker/base.gpu.wanda.yaml
matrix:
- "3.10"
- "3.11"
env:
PYTHON: "{{matrix}}"

- name: docbuild
label: "wanda: docbuild-py{{matrix}}"
wanda: ci/docker/doc.build.wanda.yaml
depends_on: oss-ci-base_build
depends_on: oss-ci-base_build-multipy
matrix:
- "3.9"
- "3.12"
env:
PYTHON: "{{matrix}}"

- name: docgpubuild
wanda: ci/docker/docgpu.build.wanda.yaml
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/build.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ steps:
commands:
- bazel run //ci/ray_ci/doc:cmd_build
depends_on: docbuild
job_env: docbuild
job_env: docbuild-py3.12

- label: ":tapioca: build: ray py{{matrix}} docker (x86_64)"
tags:
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/lint.rayci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ steps:
key: lint-medium
instance_type: medium
depends_on: docbuild
job_env: docbuild
job_env: docbuild-py3.9
commands:
- ./ci/lint/lint.sh {{matrix}}
matrix:
Expand All @@ -39,7 +39,7 @@ steps:
commands:
- make -C doc/ linkcheck_all
depends_on: docbuild
job_env: docbuild
job_env: docbuild-py3.9
tags:
- oss
- skip-on-premerge
Expand Down
8 changes: 5 additions & 3 deletions ci/docker/doc.build.wanda.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: "docbuild"
froms: ["cr.ray.io/rayproject/oss-ci-base_build"]
name: "docbuild-py$PYTHON"
froms: ["cr.ray.io/rayproject/oss-ci-base_build-py$PYTHON"]
dockerfile: ci/docker/doc.build.Dockerfile
srcs:
- doc/requirements-doc.txt
build_args:
- DOCKER_IMAGE_BASE_BUILD=cr.ray.io/rayproject/oss-ci-base_build-py$PYTHON
tags:
- cr.ray.io/rayproject/docbuild
- cr.ray.io/rayproject/docbuild-py$PYTHON
2 changes: 1 addition & 1 deletion ci/lint/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ api_annotations() {

api_policy_check() {
# install ray and compile doc to generate API files
RAY_DISABLE_EXTRA_CPP=1 pip install -e "python[all]"
make -C doc/ html
RAY_DISABLE_EXTRA_CPP=1 pip install -e "python[all]"
# validate the API files
bazel run //ci/ray_ci/doc:cmd_check_api_discrepancy -- /ray "$@"
}
Expand Down
26 changes: 18 additions & 8 deletions ci/ray_ci/doc/cmd_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand All @@ -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,
)

Expand Down

0 comments on commit 9cd160d

Please sign in to comment.