Skip to content
Closed
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
37 changes: 26 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,41 @@ http_archive(

http_archive(
name = "rules_java",
sha256 = "302bcd9592377bf9befc8e41aa97ec02df12813d47af9979e4764f3ffdcc5da8",
sha256 = "5449ed36d61269579dd9f4b0e532cd131840f285b389b3795ae8b4d717387dd8",
urls = [
"https://github.com/bazelbuild/rules_java/releases/download/7.12.4/rules_java-7.12.4.tar.gz",
"https://github.com/bazelbuild/rules_java/releases/download/8.7.0/rules_java-8.7.0.tar.gz",
],
)

load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")

rules_java_dependencies()

rules_java_toolchains()
http_archive(
name = "rules_python",
sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618",
strip_prefix = "rules_python-0.34.0",
urls = [
"https://github.com/bazel-contrib/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz",
],
patches = [
"@io_ray//thirdparty/patches:rules-python-python-package.patch",
],
patch_args = ["-p1"],
)

load("//bazel:ray_deps_setup.bzl", "ray_deps_setup")

ray_deps_setup()

load(
"@rules_java//java:rules_java_deps.bzl",
"compatibility_proxy_repo",
rules_java_deps = "rules_java_dependencies",
)
compatibility_proxy_repo()
load("@rules_java//java:repositories.bzl", "rules_java_toolchains")

rules_java_deps()

rules_java_toolchains()

load("//bazel:ray_deps_build_all.bzl", "ray_deps_build_all")

ray_deps_build_all()
Expand Down Expand Up @@ -60,10 +79,6 @@ python_register_toolchains(
)

load("@python3_10//:defs.bzl", python310 = "interpreter")
load("@rules_python//python/pip_install:repositories.bzl", "pip_install_dependencies")

pip_install_dependencies()

load("@rules_python//python:pip.bzl", "pip_parse")

# For CI scripts use only; not for ray testing.
Expand Down
22 changes: 14 additions & 8 deletions bazel/ray_deps_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,16 @@ def ray_deps_setup():
# Pinned grpc version: v23.4
auto_http_archive(
name = "com_google_protobuf",
sha256 = "76a33e2136f23971ce46c72fd697cd94dc9f73d56ab23b753c3e16854c90ddfd",
url = "https://github.com/protocolbuffers/protobuf/archive/2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a.tar.gz",
sha256 = "d0e3a75876a81e1536028bb9cf9181382b198da4cc6fa6aef86879ef629ac807",
url = "https://github.com/protocolbuffers/protobuf/archive/74211c0dfc2777318ab53c2cd2c317a2ef9012de.tar.gz",
patches = [
"@com_github_grpc_grpc//third_party:protobuf.patch",
],
patch_args = ["-p1"],
repo_mapping = {
"@abseil-cpp": "@com_google_absl",
"@googletest": "@com_google_googletest",
},
)

# NOTE(lingxuan.zlx): 3rd party dependencies could be accessed, so it suggests
Expand Down Expand Up @@ -277,11 +281,10 @@ def ray_deps_setup():
auto_http_archive(
name = "com_github_grpc_grpc",
# NOTE: If you update this, also update @boringssl's hash.
url = "https://github.com/grpc/grpc/archive/refs/tags/v1.57.1.tar.gz",
sha256 = "0762f809b9de845e6a7c809cabccad6aa4143479fd43b396611fe5a086c0aeeb",
url = "https://github.com/grpc/grpc/archive/refs/tags/v1.76.0.tar.gz",
sha256 = "0af37b800953130b47c075b56683ee60bdc3eda3c37fc6004193f5b569758204",
patches = [
"@io_ray//thirdparty/patches:grpc-cython-copts.patch",
"@io_ray//thirdparty/patches:grpc-zlib-fdopen.patch",
"@io_ray//thirdparty/patches:grpc-configurable-thread-count.patch",
],
)
Expand Down Expand Up @@ -321,11 +324,11 @@ def ray_deps_setup():
auto_http_archive(
# This rule is used by @com_github_grpc_grpc, and using a GitHub mirror
# provides a deterministic archive hash for caching. Explanation here:
# https://github.com/grpc/grpc/blob/1ff1feaa83e071d87c07827b0a317ffac673794f/bazel/grpc_deps.bzl#L189
# https://github.com/grpc/grpc/blob/v1.76.0/bazel/grpc_deps.bzl
# Ensure this rule matches the rule used by grpc's bazel/grpc_deps.bzl
name = "boringssl",
sha256 = "0675a4f86ce5e959703425d6f9063eaadf6b61b7f3399e77a154c0e85bad46b1",
url = "https://github.com/google/boringssl/archive/342e805bc1f5dfdd650e3f031686d6c939b095d9.tar.gz",
sha256 = "b717df72df0023933a729bac00fa422a222949cfa84eb8500f3a9af34441fb6e",
url = "https://github.com/google/boringssl/archive/c63fadbde60a2224c22189d14c4001bbd2a3a629.tar.gz",
)

# The protobuf version we use to auto generate python and java code.
Expand Down Expand Up @@ -365,6 +368,9 @@ def ray_deps_setup():
strip_prefix = "opencensus-proto-0.3.0/src",
url = "https://github.com/census-instrumentation/opencensus-proto/archive/v0.3.0.tar.gz",
sha256 = "b7e13f0b4259e80c3070b583c2f39e53153085a6918718b1c710caf7037572b0",
patches = [
"@io_ray//thirdparty/patches:opencensus-proto-remove-py-proto.patch",
],
)

auto_http_archive(
Expand Down
19 changes: 10 additions & 9 deletions thirdparty/patches/grpc-configurable-thread-count.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
diff --git src/core/lib/gpr/linux/cpu.cc b/src/core/lib/gpr/linux/cpu.cc
index 670ca6551c..043021dc4a 100644
--- src/core/lib/gpr/linux/cpu.cc
+++ src/core/lib/gpr/linux/cpu.cc
@@ -24,6 +24,7 @@
diff --git src/core/util/linux/cpu.cc b/src/core/util/linux/cpu.cc
--- src/core/util/linux/cpu.cc
+++ src/core/util/linux/cpu.cc
@@ -24,6 +24,9 @@

#ifdef GPR_CPU_LINUX

+#include <charconv>
+#include <cstdlib>
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.

high

The code uses std::strlen on line 21, which requires the <cstring> header. This header is not included in the patch, which may lead to compilation errors. Please add #include <cstring> to ensure std::strlen is available.

#include <cstdlib>
#include <cstring>

+#include <cstring>
#include <errno.h>
#include <sched.h>
#include <string.h>
@@ -49,7 +50,17 @@ static void init_num_cpus() {
#include <grpc/support/cpu.h>
#include <grpc/support/sync.h>
@@ -49,7 +51,17 @@ static void init_num_cpus() {
#endif
// This must be signed. sysconf returns -1 when the number cannot be
// determined
Expand All @@ -27,5 +28,5 @@ index 670ca6551c..043021dc4a 100644
+ ncpus = static_cast<int>(sysconf(_SC_NPROCESSORS_CONF));
+ }
if (ncpus < 1) {
gpr_log(GPR_ERROR, "Cannot determine number of CPUs: assuming 1");
LOG(ERROR) << "Cannot determine number of CPUs: assuming 1";
ncpus = 1;
13 changes: 0 additions & 13 deletions thirdparty/patches/grpc-zlib-fdopen.patch

This file was deleted.

51 changes: 51 additions & 0 deletions thirdparty/patches/opencensus-proto-remove-py-proto.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff -u opencensus/proto/resource/v1/BUILD.bazel
--- opencensus/proto/resource/v1/BUILD.bazel
+++ opencensus/proto/resource/v1/BUILD.bazel
@@ -17,7 +17,6 @@ package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
-load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")

proto_library(
name = "resource_proto",
@@ -39,8 +38,3 @@ go_proto_library(
importpath = "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1",
proto = ":resource_proto",
)
-
-py_proto_library(
- name = "resource_proto_py",
- srcs = ["resource.proto"],
-)
diff -u opencensus/proto/trace/v1/BUILD.bazel
--- opencensus/proto/trace/v1/BUILD.bazel
+++ opencensus/proto/trace/v1/BUILD.bazel
@@ -18,7 +18,6 @@ package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
-load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")

proto_library(
name = "trace_proto",
@@ -69,20 +68,6 @@ go_proto_library(
proto = ":trace_config_proto",
)

-py_proto_library(
- name = "trace_proto_py",
- srcs = ["trace.proto"],
- deps = [
- "//opencensus/proto/resource/v1:resource_proto_py",
- "@com_google_protobuf//:protobuf_python",
- ],
-)
-
-py_proto_library(
- name = "trace_config_proto_py",
- srcs = ["trace_config.proto"],
-)
-
# This a workaround because `trace_proto_go` and `trace_config_proto_go` have
# the same importpath, and so cause a compile issue if both are depended on
# directly by another `go_proto_library` (such as `trace_service_proto_go`).
6 changes: 6 additions & 0 deletions thirdparty/patches/rules-python-python-package.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
diff --git a/python/BUILD.bazel b/python/BUILD.bazel
new file mode 100644
--- /dev/null
+++ b/python/BUILD.bazel
@@ -0,0 +1 @@
+# Package marker for loading @rules_python//python:*.bzl on Bazel 6.