Repository navigation
[doc][build] Stop using Bazel and change commit trace logic - #47233
Conversation
Signed-off-by: khluu <[email protected]>
Signed-off-by: khluu <[email protected]>
aslonnie
left a comment
There was a problem hiding this comment.
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?
| 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) |
There was a problem hiding this comment.
this should have been using bazelisk
or use some prebuilt python executable binary / zip
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. |
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:
|
|
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 |
|
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. |
|
bazel should have been already in their workflows.. but anyways.. maybe just:
|
|
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 "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. |
|
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). |
Signed-off-by: khluu <[email protected]>
Signed-off-by: khluu <[email protected]>
| python cmd_load_doc_cache.py --ray-dir=$(RAY_DIR) | ||
| python cmd_update_cache_env.py --ray-dir=$(RAY_DIR) |
There was a problem hiding this comment.
btw, you can maybe drop the cmd_ prefix now.
Signed-off-by: khluu <[email protected]>
| ) | ||
|
|
||
| py_test( | ||
| name = "test_update_cache_env", |
There was a problem hiding this comment.
we lost this test now
…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]>
…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]>
…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]>
origin/masterbut 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.doc/directoryrequirements-docssince these were previously attached with Bazel run.