Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,10 @@ package(
default_visibility = ["//visibility:public"],
)

# Hermetic python environment, currently only used for CI infra and scripts.

constraint_setting(name = "hermetic")

constraint_value(
alias(
name = "hermetic_python",
constraint_setting = ":hermetic",
)

platform(
name = "hermetic_python_platform",
constraint_values = [":hermetic_python"],
parents = ["@local_config_platform//:host"],
visibility = ["//visibility:private"],
actual = "//bazel:py39",
visibility = ["//visibility:public"],
)

# C/C++ toolchain constraint configs.
Expand Down
3 changes: 2 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ register_toolchains("//bazel:py39_toolchain")

register_execution_platforms(
"@local_config_platform//:host",
"//:hermetic_python_platform",
"//bazel:py39_platform",
Copy link

Choose a reason for hiding this comment

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

Bug: Python 3.10 Toolchain: Incomplete Setup

The py310_toolchain is defined in bazel/BUILD.bazel but not registered in WORKSPACE. Only py39_toolchain is registered, which means targets with exec_compatible_with = ["//bazel:py310"] will fail because Bazel won't find a matching toolchain. The PR description mentions registering Python 3.10 with hermetic toolchain, but the toolchain registration is missing.

Fix in Cursor Fix in Web

"//bazel:py310_platform",
)

http_archive(
Expand Down
34 changes: 32 additions & 2 deletions bazel/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ config_setting(
],
)

# Hermetic python environment, currently only used for CI infra and scripts.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This comment describing the hermetic Python environment is now disconnected from the constraint_setting it refers to (which is now python_version on line 110). To improve readability and keep related code together, please move this comment to line 109, just before constraint_setting(name = "python_version").


py_runtime(
name = "py39_runtime",
interpreter = python39,
Expand All @@ -79,7 +81,7 @@ py_runtime_pair(

toolchain(
name = "py39_toolchain",
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = [":py39"],
toolchain = ":py39_runtime_pair",
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
)
Expand All @@ -100,7 +102,35 @@ py_runtime_pair(

toolchain(
name = "py310_toolchain",
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = [":py310"],
toolchain = ":py310_runtime_pair",
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
)

constraint_setting(name = "python_version")

constraint_value(
name = "py39",
constraint_setting = ":python_version",
visibility = ["//visibility:public"],
)

constraint_value(
name = "py310",
constraint_setting = ":python_version",
visibility = ["//visibility:public"],
)

platform(
name = "py39_platform",
constraint_values = [":py39"],
parents = ["@local_config_platform//:host"],
visibility = ["//visibility:private"],
)

platform(
name = "py310_platform",
constraint_values = [":py310"],
parents = ["@local_config_platform//:host"],
visibility = ["//visibility:private"],
)
2 changes: 1 addition & 1 deletion ci/lint/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ load("@rules_python//python:defs.bzl", "py_binary")
py_binary(
name = "check_bazel_team_owner",
srcs = ["check_bazel_team_owner.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
visibility = ["//visibility:private"],
)
2 changes: 1 addition & 1 deletion ci/pipeline/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ py_test(
":determine_tests_to_run.py",
":test_rules.txt",
],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand Down
24 changes: 12 additions & 12 deletions ci/ray_ci/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ py_binary(
py_binary(
name = "build_in_docker",
srcs = ["build_in_docker.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [":ray_ci_lib"],
)

Expand All @@ -56,7 +56,7 @@ py_test(
name = "test_linux_container",
size = "small",
srcs = ["test_linux_container.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -72,7 +72,7 @@ py_test(
name = "test_windows_container",
size = "small",
srcs = ["test_windows_container.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -88,7 +88,7 @@ py_test(
name = "test_tester",
size = "small",
srcs = ["test_tester.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -104,7 +104,7 @@ py_test(
name = "test_utils",
size = "small",
srcs = ["test_utils.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -120,7 +120,7 @@ py_test(
name = "test_container",
size = "small",
srcs = ["test_container.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -135,7 +135,7 @@ py_test(
name = "test_builder_container",
size = "small",
srcs = ["test_builder_container.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -151,7 +151,7 @@ py_test(
name = "test_linux_tester_container",
size = "small",
srcs = ["test_linux_tester_container.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -167,7 +167,7 @@ py_test(
name = "test_windows_tester_container",
size = "small",
srcs = ["test_windows_tester_container.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -183,7 +183,7 @@ py_test(
name = "test_ray_docker_container",
size = "small",
srcs = ["test_ray_docker_container.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -199,7 +199,7 @@ py_test(
name = "test_anyscale_docker_container",
size = "small",
srcs = ["test_anyscale_docker_container.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -216,7 +216,7 @@ py_test(
size = "small",
srcs = ["test_bazel_sharding.py"],
data = ["mock_BUILD"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand Down
32 changes: 16 additions & 16 deletions ci/ray_ci/automation/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ py_library(
py_binary(
name = "determine_microcheck_tests",
srcs = ["determine_microcheck_tests.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
ci_require("click"),
":automation",
Expand All @@ -28,7 +28,7 @@ py_binary(
py_binary(
name = "determine_microcheck_step_ids",
srcs = ["determine_microcheck_step_ids.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
ci_require("click"),
"//ci/ray_ci:ray_ci_lib",
Expand All @@ -38,7 +38,7 @@ py_binary(
py_binary(
name = "test_db_bot",
srcs = ["test_db_bot.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
ci_require("click"),
"//ci/ray_ci:ray_ci_lib",
Expand All @@ -48,7 +48,7 @@ py_binary(
py_binary(
name = "weekly_green_metric",
srcs = ["weekly_green_metric.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
ci_require("boto3"),
ci_require("click"),
Expand All @@ -59,7 +59,7 @@ py_binary(
py_binary(
name = "filter_tests",
srcs = ["filter_tests.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
ci_require("click"),
"//ci/ray_ci:ray_ci_lib",
Expand All @@ -78,7 +78,7 @@ py_test(
name = "test_update_version_lib",
size = "small",
srcs = ["test_update_version_lib.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -92,7 +92,7 @@ py_test(
py_binary(
name = "update_version",
srcs = ["update_version.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
ci_require("click"),
":update_version_lib",
Expand Down Expand Up @@ -121,7 +121,7 @@ py_test(
data = [
"@registry_x86_64//:file",
],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -145,7 +145,7 @@ py_library(
py_test(
name = "test_ray_wheels_lib",
srcs = ["test_ray_wheels_lib.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -169,7 +169,7 @@ py_library(
py_test(
name = "test_pypi_lib",
srcs = ["test_pypi_lib.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -183,7 +183,7 @@ py_test(
py_binary(
name = "upload_wheels_pypi",
srcs = ["upload_wheels_pypi.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
":pypi_lib",
":ray_wheels_lib",
Expand All @@ -194,7 +194,7 @@ py_binary(
py_binary(
name = "list_docker_tags",
srcs = ["list_docker_tags.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
":docker_tags_lib",
ci_require("click"),
Expand All @@ -204,7 +204,7 @@ py_binary(
py_binary(
name = "generate_index",
srcs = ["generate_index.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
":docker_tags_lib",
ci_require("click"),
Expand All @@ -214,7 +214,7 @@ py_binary(
py_binary(
name = "check_nightly_ray_commit",
srcs = ["check_nightly_ray_commit.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
":docker_tags_lib",
ci_require("click"),
Expand All @@ -225,7 +225,7 @@ py_binary(
py_test(
name = "test_determine_microcheck_tests",
srcs = ["test_determine_microcheck_tests.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -239,7 +239,7 @@ py_test(
py_binary(
name = "get_contributors",
srcs = ["get_contributors.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [
ci_require("click"),
ci_require("pygithub"),
Expand Down
6 changes: 3 additions & 3 deletions ci/ray_ci/bisect/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ py_binary(
name = "bisect_test",
srcs = ["bisect_test.py"],
data = [":macos_validator"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
deps = [":bisect"],
)

Expand Down Expand Up @@ -36,7 +36,7 @@ py_test(
name = "test_bisector",
size = "small",
srcs = ["test_bisector.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand All @@ -51,7 +51,7 @@ py_test(
name = "test_generic_validator",
size = "small",
srcs = ["test_generic_validator.py"],
exec_compatible_with = ["//:hermetic_python"],
exec_compatible_with = ["//bazel:py39"],
tags = [
"ci_unit",
"team:ci",
Expand Down
Loading