[CI] Fix root user and Windows PyGithub import errors#61726
[CI] Fix root user and Windows PyGithub import errors#61726andrew-anyscale wants to merge 2 commits intoandrew/revup/master/libup-depsfrom
Conversation
- Add -Wno-deprecated-declarations to per_file_copt -Werror lines for linux, macos, and clang-cl configs. Third-party code (opencensus, otel) triggers protobuf 28.2 deprecation warnings that we cannot fix directly. - Add explicit @com_github_grpc_grpc//:grpc++ dep to pubsub publisher target. grpc 1.68+ is stricter about transitive dependency visibility. Topic: libup-deps Signed-off-by: andrew <andrew@anyscale.com>
Two CI failures from running under Bazel 7: - WORKSPACE: add ignore_root_user_error = True to python_register_toolchains. rules_python refuses to run as root (privileged containers in CI), which blocks Bazel analysis of any py_binary target that depends on py_deps_py310. - ci/ray_ci/tester_container.py: make CITestStateMachine import lazy. The top-level `import github` (PyGithub) pulls in PyJWT -> cryptography, whose Rust extension DLL fails to load on Windows. The state machine is only ever called on master branch postmerge pipelines, so it is safe to defer the import to move_test_state(). This is also a step toward removing the PyGithub dependency entirely. Topic: libup-build-config Relative: libup-deps Signed-off-by: andrew <andrew@anyscale.com>
|
Reviews in this chain: |
bce7cf5 to
ba23dd6
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces two fixes for CI failures. The first change allows Python toolchains in Bazel to run as root, which is necessary for privileged CI containers. The second change defers an import in a Python script to work around a dependency issue on Windows. My review focuses on improving the maintainability of these changes by suggesting the addition of comments to explain the rationale behind these non-obvious fixes. This will help future developers understand the context and prevent potential regressions.
| name = "python3_10", | ||
| python_version = "3.10", | ||
| register_toolchains = False, | ||
| ignore_root_user_error = True, |
There was a problem hiding this comment.
To improve clarity for future maintainers, it would be helpful to add a comment explaining why ignore_root_user_error is necessary. This will provide context about the CI environment and prevent accidental removal.
# Required for running in privileged CI containers that run as root.
ignore_root_user_error = True,
| ): | ||
| logger.info("Skip updating test state. We only update on master branch.") | ||
| return | ||
| from ray_release.test_automation.ci_state_machine import CITestStateMachine |
There was a problem hiding this comment.
For maintainability, please add a comment explaining why this import is deferred. This will prevent future developers from moving it to the top of the file and re-introducing the bug on Windows.
# Defer import to avoid cryptography dependency failing on Windows.
# This function is only called in postmerge pipelines, where this is safe.
from ray_release.test_automation.ci_state_machine import CITestStateMachine
Two CI failures from running under Bazel 7:
WORKSPACE: add ignore_root_user_error = True to python_register_toolchains.
rules_python refuses to run as root (privileged containers in CI), which
blocks Bazel analysis of any py_binary target that depends on py_deps_py310.
ci/ray_ci/tester_container.py: make CITestStateMachine import lazy.
The top-level
import github(PyGithub) pulls in PyJWT -> cryptography,whose Rust extension DLL fails to load on Windows. The state machine is
only ever called on master branch postmerge pipelines, so it is safe to
defer the import to move_test_state(). This is also a step toward removing
the PyGithub dependency entirely.
Topic: libup-build-config
Relative: libup-deps
Signed-off-by: andrew andrew@anyscale.com