Skip to content

[doc][build] Stop using Bazel and change commit trace logic - #47233

Merged
can-anyscale merged 5 commits into
masterfrom
khluu/fix_latest_commit_doc_build
Aug 22, 2024
Merged

can-anyscale merged 5 commits into
masterfrom
khluu/fix_latest_commit_doc_build

Conversation

@khluu

@khluu khluu commented Aug 20, 2024 •

Copy link
Copy Markdown
Contributor
  • Change the logic to find commit to fetch cache from. Previously, it was trying to find common ancestor of current commit and origin/master but this would fail if users use ray fork. Changed the logic to go through commits in the log and find the most recent one that already has the cache on S3.
  • Stop using bazel and move the scripts to doc/ directory
  • Add extra dependencies to requirements-docs since these were previously attached with Bazel run.

khluu added 2 commits August 20, 2024 15:55
p
Signed-off-by: khluu <[email protected]>
p
Signed-off-by: khluu <[email protected]>
@khluu
khluu requested a review from can-anyscale August 20, 2024 22:57
@khluu
khluu requested review from a team as code owners August 20, 2024 22:57

@aslonnie aslonnie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why stop using bazel? people will still need to install the required python dependencies right? so why not just ask people to install bazel instead?

Comment thread doc/Makefile
Comment on lines -85 to -86
bazel run //ci/ray_ci/doc:cmd_load_doc_cache -- --ray-dir=$(RAY_DIR)
bazel run //ci/ray_ci/doc:cmd_update_cache_env -- --ray-dir=$(RAY_DIR)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this should have been using bazelisk

or use some prebuilt python executable binary / zip

@khluu

khluu commented Aug 21, 2024

Copy link
Copy Markdown
Contributor Author

why stop using bazel? people will still need to install the required python dependencies right? so why not just ask people to install bazel instead?

Even if they already have Bazel installed, we've seen a few cases where it took Bazel a while to start up & load all its dependencies before fetching doc cache, which kind of defeats the purpose of using cache is to make build faster. If they install the packages in their conda environment, they don't have to wait for it.

@aslonnie

aslonnie commented Aug 21, 2024 •

Copy link
Copy Markdown
Contributor

If they install the packages in their conda environment, they don't have to wait for it.

it also takes time to install the conda environment, right? which also defeats the purpose?

it's ultimately up to you, I am just saying:

  • you need a stable way to install and maintain the execution environment and the dependency required anyways. I am not sure why conda is within the assumption but bazel is not. this seems to be creating a different dev environment from ray's standard one.
  • if you really care about the boot up latency, you should maybe consider shipping a binary with no dependencies from the environment, either with a python executable zip, or a go binary (e.g. via the rayci repo's releases).

@aslonnie

aslonnie commented Aug 21, 2024 •

Copy link
Copy Markdown
Contributor

or, you can also remove the 3rd-party dependencies from the python file (remove click and botocore), and just use python std libs, it still depends on the python interpreter, but that is a reasonable thing to assume that a user should have.

and then probably should just move the python files to the doc directory, and do not keep them in the ci directory. so that it does not need ../ to find it.

@can-anyscale

can-anyscale commented Aug 21, 2024 •

Copy link
Copy Markdown
Contributor

I think the main complains we have from users is that we are adding another dependencies (bazel) to their existing workflow (not saying their existing workflow of using conda and requirement is perfect), and they hesitate to change.

I also think we should either use conda or bazel and not both (they duplicate the jobs of each other so creating wasted overhead), but decide to stick with conda since it's the existing users workflow.

@aslonnie

Copy link
Copy Markdown
Contributor

bazel should have been already in their workflows.. but anyways..

maybe just:

  • move the commands out of the ci directory. if it is not going to be used as a bazel py_binary, then don't pretend that it is.
  • make it clear how to make dependency changes to the python script, and test it somewhere on CI that with pip install doc/requirements-doc.txt and the script can run without issue.

@aslonnie

Copy link
Copy Markdown
Contributor

fwiw, conda is still required for other parts. like some of our unit tests only pass in conda, and almost all of our tests depends on having pip install -e.

"the current way of doing things is bad, so let me create a new, different way of doing things" often will not lead to better results if there is no plan to kill the old way.

@can-anyscale

Copy link
Copy Markdown
Contributor

You're right that internal engineers have bazel but when do testing with folks like technical writer and external contributors, since they don't have to build ray, they don't have bazel in their environments. Some also has different bazel version installed (for a different project I assume), so ray refused to use it and we need to ask them to install bazelisk.

This small problem leads to the sentiment is that this new tool is unreliable (w00t).

So this PR is the compromise between minimizing the changes to an existing users' workflow, and the time we need to invest in this project to have a good enough solution (if we have more time, I think convert the whole thing to bazel and re-educate users could be worthwhile).

p
Signed-off-by: khluu <[email protected]>
@khluu
khluu requested a review from aslonnie August 21, 2024 19:54
p
Signed-off-by: khluu <[email protected]>
Comment thread doc/Makefile Outdated
Comment on lines +85 to +86
python cmd_load_doc_cache.py --ray-dir=$(RAY_DIR)
python cmd_update_cache_env.py --ray-dir=$(RAY_DIR)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

btw, you can maybe drop the cmd_ prefix now.

p
Signed-off-by: khluu <[email protected]>
@khluu khluu added the go add ONLY when ready to merge, run all tests label Aug 21, 2024
Comment thread ci/ray_ci/doc/BUILD.bazel
)

py_test(
name = "test_update_cache_env",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we lost this test now

@can-anyscale
can-anyscale merged commit a0deb6b into master Aug 22, 2024
@can-anyscale
can-anyscale deleted the khluu/fix_latest_commit_doc_build branch August 22, 2024 00:49
dstrodtman added a commit that referenced this pull request Aug 14, 2026
…65391)

## Why this change

`ci/ray_ci/doc/` holds the documentation site build and the
API-reference guards, but there's no orientation for anyone opening it.
Nine modules, three of which are entry points, and the wiring that
decides which is which lives in three other files
(`.buildkite/doc.rayci.yml`, `.buildkite/lint.rayci.yml`,
`ci/lint/lint.sh`). Reading the directory alone gives you the wrong
model of it.

The same is true one level up: `doc.rayci.yml` opens straight at `group:
doc` with no statement of what the pipeline does, and the two rules
files that decide what CI runs for *every* PR in the repo don't say
anywhere that that's what they do.

This PR is descriptive only. No step, rule, tag, or target changes
behavior.

## What's here

**New `ci/ray_ci/doc/README.md`.** What each entry point does and where
it's invoked from, what the shared libraries contribute, and two things
the layout actively misleads on:

- `cmd_check_api_discrepancy` and `cmd_check_api_param_coverage` have
`py_binary` targets but don't run through Bazel in CI. `lint.sh` invokes
them with the docbuild image's interpreter, because the Bazel targets
resolve `@py_deps_py310` wheels that can't import under the py3.11
docbuild image. There's already a `TODO(elliot-barn)` on #64070 to undo
this once hermetic py3.11 lands.
- The `doc: check API annotations` step isn't this package at all — it
runs `ci/lint/check_api_annotations.py`. Easy to assume otherwise, since
it sits next to `doc: check API doc consistency`, which *is* this
package.

**Header comment on `.buildkite/doc.rayci.yml`** listing the steps in
order and what each is for, and noting that tag rules, not this file,
decide what runs on a given PR.

**Scope notes on `.buildkite/test.rules.txt` and `always.rules.txt`.**
Both decide what CI runs for every pull request in the repository, so an
edit is a repo-wide change rather than a local one. The note also
records that rules are first-match-wins in file order, which makes rule
*position* as load-bearing as rule content, and points at the in-repo
check to run.

**Two removals.**

- `ci/ray_ci/doc/test_update_cache_env.py` imports
`ci.ray_ci.doc.cmd_update_cache_env`, which was deleted in #47233 (Aug
2024). The test was added later, in #64277, so it has never been able to
import since the day it landed. It also has no `py_test` target, which
is why nothing ran it and nothing reported it was broken.
- A stale cross-repo pointer in the `api_param_coverage` module
docstring, referencing a path outside this repository that readers here
can't follow. The paragraphs above it already describe the check's
scope, so nothing is lost.

## Not a duplicate

Checked open PRs for the touched areas per `AGENTS.md`:

```
gh pr list --repo ray-project/ray --state open --search "ray_ci/doc README"
gh pr list --repo ray-project/ray --state open --search "test_update_cache_env"
gh pr list --repo ray-project/ray --state open --search "test.rules.txt header comment"
```

No open PR adds a README here, touches the dead test, or comments these
files. Two PRs matched the third search on body text only (#65342,
#64977); I confirmed against their file lists that neither touches
`doc.rayci.yml`, `test.rules.txt`, or `always.rules.txt`. #65211 touches
`ci/ray_ci/doc/api.py`, a different file in the same directory, and
doesn't conflict.

## Testing

```
bazel test //ci/pipeline:test_doc_api_rules_sync //ci/ray_ci/doc/...
```

7/7 pass (`test_doc_api_rules_sync`, `test_api`,
`test_api_param_coverage`, `test_autodoc`, `test_build_cache`,
`test_cmd_check_api_discrepancy`, `test_module`).

Because the comments land on rule files, I also confirmed the rules
still parse and emit identical tags, loading both files through
`ci/pipeline/determine_tests_to_run.py` and comparing `match_tags`
output before and after. Comments are ignored by the parser and nothing
moved. `pre-commit run` passes on every changed file.

## AI assistance

This change was written with AI assistance. I reviewed every line, ran
the tests above myself, and can defend the change end-to-end. Every
technical claim in the added comments was verified against the source
rather than inferred: the invocation paths from `lint.sh` and the
pipeline YAML, the first-match-wins ordering from
`TagRuleSet.match_tags`, and the dead import from `git log` on the
deleted module plus a direct import attempt.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…ay-project#65391)

## Why this change

`ci/ray_ci/doc/` holds the documentation site build and the
API-reference guards, but there's no orientation for anyone opening it.
Nine modules, three of which are entry points, and the wiring that
decides which is which lives in three other files
(`.buildkite/doc.rayci.yml`, `.buildkite/lint.rayci.yml`,
`ci/lint/lint.sh`). Reading the directory alone gives you the wrong
model of it.

The same is true one level up: `doc.rayci.yml` opens straight at `group:
doc` with no statement of what the pipeline does, and the two rules
files that decide what CI runs for *every* PR in the repo don't say
anywhere that that's what they do.

This PR is descriptive only. No step, rule, tag, or target changes
behavior.

## What's here

**New `ci/ray_ci/doc/README.md`.** What each entry point does and where
it's invoked from, what the shared libraries contribute, and two things
the layout actively misleads on:

- `cmd_check_api_discrepancy` and `cmd_check_api_param_coverage` have
`py_binary` targets but don't run through Bazel in CI. `lint.sh` invokes
them with the docbuild image's interpreter, because the Bazel targets
resolve `@py_deps_py310` wheels that can't import under the py3.11
docbuild image. There's already a `TODO(elliot-barn)` on ray-project#64070 to undo
this once hermetic py3.11 lands.
- The `doc: check API annotations` step isn't this package at all — it
runs `ci/lint/check_api_annotations.py`. Easy to assume otherwise, since
it sits next to `doc: check API doc consistency`, which *is* this
package.

**Header comment on `.buildkite/doc.rayci.yml`** listing the steps in
order and what each is for, and noting that tag rules, not this file,
decide what runs on a given PR.

**Scope notes on `.buildkite/test.rules.txt` and `always.rules.txt`.**
Both decide what CI runs for every pull request in the repository, so an
edit is a repo-wide change rather than a local one. The note also
records that rules are first-match-wins in file order, which makes rule
*position* as load-bearing as rule content, and points at the in-repo
check to run.

**Two removals.**

- `ci/ray_ci/doc/test_update_cache_env.py` imports
`ci.ray_ci.doc.cmd_update_cache_env`, which was deleted in ray-project#47233 (Aug
2024). The test was added later, in ray-project#64277, so it has never been able to
import since the day it landed. It also has no `py_test` target, which
is why nothing ran it and nothing reported it was broken.
- A stale cross-repo pointer in the `api_param_coverage` module
docstring, referencing a path outside this repository that readers here
can't follow. The paragraphs above it already describe the check's
scope, so nothing is lost.

## Not a duplicate

Checked open PRs for the touched areas per `AGENTS.md`:

```
gh pr list --repo ray-project/ray --state open --search "ray_ci/doc README"
gh pr list --repo ray-project/ray --state open --search "test_update_cache_env"
gh pr list --repo ray-project/ray --state open --search "test.rules.txt header comment"
```

No open PR adds a README here, touches the dead test, or comments these
files. Two PRs matched the third search on body text only (ray-project#65342,
ray-project#64977); I confirmed against their file lists that neither touches
`doc.rayci.yml`, `test.rules.txt`, or `always.rules.txt`. ray-project#65211 touches
`ci/ray_ci/doc/api.py`, a different file in the same directory, and
doesn't conflict.

## Testing

```
bazel test //ci/pipeline:test_doc_api_rules_sync //ci/ray_ci/doc/...
```

7/7 pass (`test_doc_api_rules_sync`, `test_api`,
`test_api_param_coverage`, `test_autodoc`, `test_build_cache`,
`test_cmd_check_api_discrepancy`, `test_module`).

Because the comments land on rule files, I also confirmed the rules
still parse and emit identical tags, loading both files through
`ci/pipeline/determine_tests_to_run.py` and comparing `match_tags`
output before and after. Comments are ignored by the parser and nothing
moved. `pre-commit run` passes on every changed file.

## AI assistance

This change was written with AI assistance. I reviewed every line, ran
the tests above myself, and can defend the change end-to-end. Every
technical claim in the added comments was verified against the source
rather than inferred: the invocation paths from `lint.sh` and the
pipeline YAML, the first-match-wins ordering from
`TagRuleSet.match_tags`, and the dead import from `git log` on the
deleted module plus a direct import attempt.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Signed-off-by: 400Ping <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ay-project#65391)

## Why this change

`ci/ray_ci/doc/` holds the documentation site build and the
API-reference guards, but there's no orientation for anyone opening it.
Nine modules, three of which are entry points, and the wiring that
decides which is which lives in three other files
(`.buildkite/doc.rayci.yml`, `.buildkite/lint.rayci.yml`,
`ci/lint/lint.sh`). Reading the directory alone gives you the wrong
model of it.

The same is true one level up: `doc.rayci.yml` opens straight at `group:
doc` with no statement of what the pipeline does, and the two rules
files that decide what CI runs for *every* PR in the repo don't say
anywhere that that's what they do.

This PR is descriptive only. No step, rule, tag, or target changes
behavior.

## What's here

**New `ci/ray_ci/doc/README.md`.** What each entry point does and where
it's invoked from, what the shared libraries contribute, and two things
the layout actively misleads on:

- `cmd_check_api_discrepancy` and `cmd_check_api_param_coverage` have
`py_binary` targets but don't run through Bazel in CI. `lint.sh` invokes
them with the docbuild image's interpreter, because the Bazel targets
resolve `@py_deps_py310` wheels that can't import under the py3.11
docbuild image. There's already a `TODO(elliot-barn)` on ray-project#64070 to undo
this once hermetic py3.11 lands.
- The `doc: check API annotations` step isn't this package at all — it
runs `ci/lint/check_api_annotations.py`. Easy to assume otherwise, since
it sits next to `doc: check API doc consistency`, which *is* this
package.

**Header comment on `.buildkite/doc.rayci.yml`** listing the steps in
order and what each is for, and noting that tag rules, not this file,
decide what runs on a given PR.

**Scope notes on `.buildkite/test.rules.txt` and `always.rules.txt`.**
Both decide what CI runs for every pull request in the repository, so an
edit is a repo-wide change rather than a local one. The note also
records that rules are first-match-wins in file order, which makes rule
*position* as load-bearing as rule content, and points at the in-repo
check to run.

**Two removals.**

- `ci/ray_ci/doc/test_update_cache_env.py` imports
`ci.ray_ci.doc.cmd_update_cache_env`, which was deleted in ray-project#47233 (Aug
2024). The test was added later, in ray-project#64277, so it has never been able to
import since the day it landed. It also has no `py_test` target, which
is why nothing ran it and nothing reported it was broken.
- A stale cross-repo pointer in the `api_param_coverage` module
docstring, referencing a path outside this repository that readers here
can't follow. The paragraphs above it already describe the check's
scope, so nothing is lost.

## Not a duplicate

Checked open PRs for the touched areas per `AGENTS.md`:

```
gh pr list --repo ray-project/ray --state open --search "ray_ci/doc README"
gh pr list --repo ray-project/ray --state open --search "test_update_cache_env"
gh pr list --repo ray-project/ray --state open --search "test.rules.txt header comment"
```

No open PR adds a README here, touches the dead test, or comments these
files. Two PRs matched the third search on body text only (ray-project#65342,
ray-project#64977); I confirmed against their file lists that neither touches
`doc.rayci.yml`, `test.rules.txt`, or `always.rules.txt`. ray-project#65211 touches
`ci/ray_ci/doc/api.py`, a different file in the same directory, and
doesn't conflict.

## Testing

```
bazel test //ci/pipeline:test_doc_api_rules_sync //ci/ray_ci/doc/...
```

7/7 pass (`test_doc_api_rules_sync`, `test_api`,
`test_api_param_coverage`, `test_autodoc`, `test_build_cache`,
`test_cmd_check_api_discrepancy`, `test_module`).

Because the comments land on rule files, I also confirmed the rules
still parse and emit identical tags, loading both files through
`ci/pipeline/determine_tests_to_run.py` and comparing `match_tags`
output before and after. Comments are ignored by the parser and nothing
moved. `pre-commit run` passes on every changed file.

## AI assistance

This change was written with AI assistance. I reviewed every line, ran
the tests above myself, and can defend the change end-to-end. Every
technical claim in the added comments was verified against the source
rather than inferred: the invocation paths from `lint.sh` and the
pipeline YAML, the first-match-wins ordering from
`TagRuleSet.match_tags`, and the dead import from `git log` on the
deleted module plus a direct import attempt.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants