Skip to content

Commit

Permalink
Fix ray-v2.9.2 on ppc (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archana-Shinde1 authored Apr 19, 2024
1 parent 053e66b commit 4b8747d
Show file tree
Hide file tree
Showing 5 changed files with 215 additions and 6 deletions.
15 changes: 9 additions & 6 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ source:
- patches/0004-Remove-all-dependencies-from-setup.py.patch
- patches/0005-Ignore-warnings-in-event.cc-and-logging.cc.patch
- patches/0006-Add-bazel-linkopts-libs.patch
- patches/0009-fixed-grpc-issue.patch
- patches/0007-Update-skylib-commit.patch
- patches/0008-Fixed-compilation-error.patch
- patches/0009-fixed-grpc-issue.patch #[x86_64]
- patches/0010-Use-rules_perl-which-is-fixed-for-ppc.patch
- patches/0011-Fixed-compilation-error.patch
- patches/0011-grpc-change-only.patch #[ppc64le]
- patches/0012-Fixed-boringssl-issue.patch #[ppc64le]
- patches/0013-Added-patch-for-rules_python-on-ppc64le.patch #[ppc64le]
# - patches/0014-allow-builds-with-root-user.patch #[ppc64le]
- patches/0014-allow-builds-with-root-user.patch #[ppc64le]

build:
number: 1
number: 2

# Need these up here for conda-smithy to handle them properly.
requirements:
Expand Down Expand Up @@ -104,7 +107,7 @@ outputs:
- ray._private.state
- ray._private.worker
commands:
- python -c "import ray; ray.init()"
- python -c "import ray; ray.init(ignore_reinit_error=True, num_cpus=4)"

- name: ray-air
requirements:
Expand Down Expand Up @@ -157,7 +160,7 @@ outputs:
# https://github.com/conda-forge/ray-packages-feedstock/issues/16
- ray.dashboard
commands:
- python -c "import ray; ray.init(include_dashboard=True)"
- python -c "import ray; ray.init(include_dashboard=True, ignore_reinit_error=True, num_cpus=4)"

- name: ray-client
requirements:
Expand Down
116 changes: 116 additions & 0 deletions recipe/patches/0011-grpc-change-only.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
From 3a3de483b0a3920459ce6d7dd30c63bab26df5e8 Mon Sep 17 00:00:00 2001
From: Archana-Shinde1 <Archana-Shinde1@ibm.com>
Date: Tue, 9 Apr 2024 09:16:07 +0000
Subject: [PATCH 11/12] grpc change only

---
bazel/ray_deps_setup.bzl | 12 +++----
thirdparty/patches/grpc-cython-copts.patch | 42 +++++++++++++++-------
2 files changed, 36 insertions(+), 18 deletions(-)

diff --git a/bazel/ray_deps_setup.bzl b/bazel/ray_deps_setup.bzl
index e915188823..0d88bada4c 100644
--- a/bazel/ray_deps_setup.bzl
+++ b/bazel/ray_deps_setup.bzl
@@ -89,11 +89,11 @@ def ray_deps_setup():
# This is copied from grpc's bazel/grpc_deps.bzl
http_archive(
name = "com_google_protobuf",
- sha256 = "76a33e2136f23971ce46c72fd697cd94dc9f73d56ab23b753c3e16854c90ddfd",
- strip_prefix = "protobuf-2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a",
+ sha256 = "d594b561fb41bf243233d8f411c7f2b7d913e5c9c1be4ca439baf7e48384c893",
+ strip_prefix = "protobuf-f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c",
urls = [
- # https://github.com/protocolbuffers/protobuf/commits/v23.4
- "https://github.com/protocolbuffers/protobuf/archive/2c5fa078d8e86e5f4bd34e6f4c9ea9e8d7d4d44a.tar.gz",
+ # https://github.com/protocolbuffers/protobuf/commits/v21.12
+ "https://github.com/protocolbuffers/protobuf/archive/f0dc78d7e6e331b8c6bb2d5283e06aa26883ca7c.tar.gz",
],
patches = [
"@com_github_grpc_grpc//third_party:protobuf.patch",
@@ -236,8 +236,8 @@ 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.54.3.tar.gz",
+ sha256 = "17e4e1b100657b88027721220cbfb694d86c4b807e9257eaf2fb2d273b41b1b1",
patches = [
"@com_github_ray_project_ray//thirdparty/patches:grpc-cython-copts.patch",
],
diff --git a/thirdparty/patches/grpc-cython-copts.patch b/thirdparty/patches/grpc-cython-copts.patch
index c893cab1bd..0ec5190387 100644
--- a/thirdparty/patches/grpc-cython-copts.patch
+++ b/thirdparty/patches/grpc-cython-copts.patch
@@ -1,11 +1,24 @@
+From c7ae446e3461a787459c074b7654c755a8ba903d Mon Sep 17 00:00:00 2001
+From: Archana-Shinde1 <Archana-Shinde1@ibm.com>
+Date: Tue, 9 Apr 2024 09:09:10 +0000
+Subject: [PATCH] update upstream grpc patch
+
+---
+ bazel/cython_library.bzl | 20 +++++++++++---------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
+
diff --git bazel/cython_library.bzl bazel/cython_library.bzl
+index 8e003c2246..41bed38dda 100644
--- bazel/cython_library.bzl
+++ bazel/cython_library.bzl
-@@ -10,15 +10,16 @@
+@@ -19,18 +19,19 @@
+ # been written at cython/cython and tensorflow/tensorflow. We branch from
+ # Tensorflow's version as it is more actively maintained and works for gRPC
+ # Python's needs.
-def pyx_library(name, deps = [], py_deps = [], srcs = [], **kwargs):
+def pyx_library(name, deps = [], cc_kwargs = {}, py_deps = [], srcs = [], **kwargs):
"""Compiles a group of .pyx / .pxd / .py files.
-
+
First runs Cython to create .cpp files for each input .pyx or .py + .pxd
- pair. Then builds a shared object for each, passing "deps" to each cc_binary
- rule (includes Python headers by default). Finally, creates a py_library rule
@@ -15,25 +28,30 @@ diff --git bazel/cython_library.bzl bazel/cython_library.bzl
+ to each cc_binary rule (includes Python headers by default). Finally, creates
+ a py_library rule with the shared objects and any pure Python "srcs", with py_deps
+ as its dependencies; the shared objects can be imported like normal Python files.
-
+
Args:
name: Name for the rule.
deps: C/C++ dependencies of the Cython (e.g. Numpy headers).
+ cc_kwargs: cc_binary extra arguments such as copts, linkstatic, linkopts, features
-@@ -57,7 +59,8 @@ def pyx_library(name, deps = [], py_deps = [], srcs = [], **kwargs):
-- shared_object_name = stem + ".so"
-+ shared_object_name = stem + ".so"
+ py_deps: Pure Python dependencies of the final library.
+ srcs: .py, .pyx, or .pxd files to either compile or pass through.
+ **kwargs: Extra keyword arguments passed to the py_library.
+@@ -69,10 +70,11 @@ def pyx_library(name, deps = [], py_deps = [], srcs = [], **kwargs):
+ stem = src.split(".")[0]
+ shared_object_name = stem + ".so"
native.cc_binary(
- name = shared_object_name,
-+ name = cc_kwargs.pop("name", shared_object_name),
- srcs = [stem + ".cpp"],
-+ srcs = [stem + ".cpp"] + cc_kwargs.pop("srcs", []),
- deps = deps + ["@local_config_python//:python_headers"],
-+ deps = deps + ["@local_config_python//:python_headers"] + cc_kwargs.pop("deps", []),
-- defines = defines,
-+ defines = defines,
- linkshared = 1,
++ name = cc_kwargs.pop("name", shared_object_name),
++ srcs = [stem + ".cpp"] + cc_kwargs.pop("srcs", []),
++ deps = deps + ["@local_config_python//:python_headers"] + cc_kwargs.pop("deps", []),
+ linkshared = cc_kwargs.pop("linkshared", 1),
+ **cc_kwargs
)
---
+ shared_objects.append(shared_object_name)
+
+--
+2.40.1
+
--
2.40.1

66 changes: 66 additions & 0 deletions recipe/patches/0012-Fixed-boringssl-issue.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
From 191891cf9ead813a8b1d3562f24ba60595175173 Mon Sep 17 00:00:00 2001
From: Archana-Shinde1 <Archana-Shinde1@ibm.com>
Date: Tue, 9 Apr 2024 10:06:03 +0000
Subject: [PATCH 12/12] Fixed boringssl issue

---
bazel/ray_deps_setup.bzl | 9 ++++---
.../patches/Fixed-boringssl-issue.patch | 25 +++++++++++++++++++
2 files changed, 31 insertions(+), 3 deletions(-)
create mode 100644 thirdparty/patches/Fixed-boringssl-issue.patch

diff --git a/bazel/ray_deps_setup.bzl b/bazel/ray_deps_setup.bzl
index 0d88bada4c..d50dae8e42 100644
--- a/bazel/ray_deps_setup.bzl
+++ b/bazel/ray_deps_setup.bzl
@@ -282,10 +282,13 @@ def ray_deps_setup():
# https://github.com/grpc/grpc/blob/1ff1feaa83e071d87c07827b0a317ffac673794f/bazel/grpc_deps.bzl#L189
# Ensure this rule matches the rule used by grpc's bazel/grpc_deps.bzl
name = "boringssl",
- sha256 = "0675a4f86ce5e959703425d6f9063eaadf6b61b7f3399e77a154c0e85bad46b1",
- strip_prefix = "boringssl-342e805bc1f5dfdd650e3f031686d6c939b095d9",
+ sha256 = "a8b2c40d5223ca951d463ed73dd810836dccdafd8f948db6fb4fb709b9827ab5",
+ strip_prefix = "boringssl-8872d958b7b07173bf29b8f3b8bf36a1ca8c94a3",
urls = [
- "https://github.com/google/boringssl/archive/342e805bc1f5dfdd650e3f031686d6c939b095d9.tar.gz",
+ "https://github.com/google/boringssl/archive/8872d958b7b07173bf29b8f3b8bf36a1ca8c94a3.tar.gz",
+ ],
+ patches = [
+ "@com_github_ray_project_ray//thirdparty/patches:Fixed-boringssl-issue.patch",
],
)

diff --git a/thirdparty/patches/Fixed-boringssl-issue.patch b/thirdparty/patches/Fixed-boringssl-issue.patch
new file mode 100644
index 0000000000..d99fbb17cf
--- /dev/null
+++ b/thirdparty/patches/Fixed-boringssl-issue.patch
@@ -0,0 +1,25 @@
+From d51938b5733477d3cd133c2790ac07971d0c30ee Mon Sep 17 00:00:00 2001
+From: Archana-Shinde1 <Archana-Shinde1@ibm.com>
+Date: Tue, 9 Apr 2024 09:55:26 +0000
+Subject: [PATCH] Fixed boringssl issue
+
+---
+ src/include/openssl/base.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git src/include/openssl/base.h src/include/openssl/base.h
+index a1a4309a4..8db692ea3 100644
+--- src/include/openssl/base.h
++++ src/include/openssl/base.h
+@@ -121,7 +121,7 @@ extern "C" {
+ // little-endian architectures. Functions will not produce the correct answer
+ // on other systems. Run the crypto_test binary, notably
+ // crypto/compiler_test.cc, before adding a new architecture.
+-#error "Unknown target CPU"
++#define OPENSSL_64_BIT
+ #endif
+
+ #if defined(__APPLE__)
+--
+2.40.1
+
--
2.40.1

24 changes: 24 additions & 0 deletions recipe/patches/0014-allow-builds-with-root-user.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From de6dd93b9f9d5051da551c321dc4ee734964acad Mon Sep 17 00:00:00 2001
From: Deepali Chourasia <deepch23@in.ibm.com>
Date: Fri, 28 Jul 2023 03:59:26 -0500
Subject: [PATCH] allow builds with root user

---
WORKSPACE | 1 +
1 file changed, 1 insertion(+)

diff --git a/WORKSPACE b/WORKSPACE
index eb6aeba907..e9aac6ba14 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -44,6 +44,7 @@ python_register_toolchains(
name = "python3_9",
python_version = "3.9",
register_toolchains = False,
+ ignore_root_user_error = True,
)

load("@python3_9//:defs.bzl", bk_python = "interpreter")
--
2.23.0

0 comments on commit 4b8747d

Please sign in to comment.