-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Core] Upgrade grpc from 1.46.6 to 1.57.0 (#39210)
1.46.6 has a memory leak and 1.57.0 fixes it. grpc: 1.46.6 -> 1.57.0 protobuf: v19.4 -> v23.4 absl: 2022062.1 -> 20230125.3 boringssl: b9232f9e27e5668bc0414879dcdedb2a59ea75f2 -> 342e805bc1f5dfdd650e3f031686d6c939b095d9 Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com> Co-authored-by: Yi Cheng <74173148+iycheng@users.noreply.github.com>
- Loading branch information
Showing
125 changed files
with
13,124 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/python/ray/core/generated/**/* linguist-generated=true | ||
/python/ray/serve/generated/**/* linguist-generated=true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
load("@rules_python//python:pip.bzl", "compile_pip_requirements") | ||
load("@rules_python//python:defs.bzl", "py_binary") | ||
load("@py_deps_compile_py_proto//:requirements.bzl", "requirement") | ||
|
||
compile_pip_requirements( | ||
name = "requirements_compile_py_proto", | ||
requirements_in = "requirements_compile_py_proto.in", | ||
requirements_txt = "requirements_compile_py_proto.txt", | ||
extra_args = ["--allow-unsafe"], | ||
tags = ["team:ci"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
py_binary( | ||
name = "grpc_tools_protoc", | ||
srcs = ["grpc_tools_protoc.py"], | ||
deps = [ | ||
requirement("grpcio-tools"), | ||
], | ||
exec_compatible_with = ["//:hermetic_python"], | ||
tags = ["team:ci"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
genrule( | ||
name = "compile_py_proto", | ||
srcs = [ | ||
"@io_opencensus_proto//opencensus/proto/metrics/v1:metrics.proto", | ||
"@io_opencensus_proto//opencensus/proto/resource/v1:resource.proto", | ||
"//src/ray/protobuf:core_protos", | ||
"//src/ray/protobuf:serve_protos", | ||
], | ||
cmd = """ | ||
TMP=$$(mktemp -d) | ||
mkdir -p $${TMP}/core | ||
$(location :grpc_tools_protoc) --python_out=$${TMP}/core --grpc_python_out=$${TMP}/core $(locations //src/ray/protobuf:core_protos) --proto_path=. --proto_path=$$(dirname $(locations @io_opencensus_proto//opencensus/proto/metrics/v1:metrics.proto))/../../../.. | ||
mkdir -p opencensus/proto/metrics/v1 | ||
mkdir -p opencensus/proto/resource/v1 | ||
cp $(locations @io_opencensus_proto//opencensus/proto/metrics/v1:metrics.proto) opencensus/proto/metrics/v1/metrics.proto | ||
cp $(locations @io_opencensus_proto//opencensus/proto/resource/v1:resource.proto) opencensus/proto/resource/v1/resource.proto | ||
$(location :grpc_tools_protoc) --python_out=$${TMP}/core --grpc_python_out=$${TMP}/core opencensus/proto/metrics/v1/metrics.proto opencensus/proto/resource/v1/resource.proto --proto_path=. | ||
mv $${TMP}/core/src/ray/protobuf/*.py $${TMP}/core/ | ||
mv $${TMP}/core/src/ray/protobuf/**/*.py $${TMP}/core/ | ||
mv $${TMP}/core/opencensus/proto/**/v1/*.py $${TMP}/core/ | ||
mkdir -p $${TMP}/serve | ||
$(location :grpc_tools_protoc) --python_out=$${TMP}/serve --grpc_python_out=$${TMP}/serve $(locations //src/ray/protobuf:serve_protos) --proto_path=. | ||
mv $${TMP}/serve/src/ray/protobuf/*.py $${TMP}/serve/ | ||
# NOTE(hchen): Protobuf doesn't allow specifying Python package name. So we use this `sed` | ||
# command to change the import path in the generated file. | ||
# shellcheck disable=SC2006 | ||
files=( | ||
`ls $${TMP}/*/*_pb2*.py` | ||
) | ||
sed -i -E 's/from src.ray.protobuf/from ./' "$${files[@]}" | ||
# TODO(sang): Build our own proto instead of creating a new proto for opencensus separately. | ||
# https://github.com/ray-project/ray/issues/31358 | ||
sed -i -E 's/from opencensus.proto.metrics.v1 import/from . import/' "$${files[@]}" | ||
sed -i -E 's/from opencensus.proto.resource.v1 import/from . import/' "$${files[@]}" | ||
# TODO(rickyx): Remove this experimental path rewrite once we move instance manager proto out | ||
# of experimental. | ||
autoscale_files=(`ls $${TMP}/core/instance_manager_pb2*.py`) | ||
sed -i -E 's/from ..experimental/from ./' "$${autoscale_files[@]}" | ||
# Help the generated serve files to have the correct module | ||
serve_files=(`ls $${TMP}/serve/*_pb2*.py`) | ||
sed -i -E 's/'"'"'src.ray.protobuf./'"'"'ray.serve.generated./' "$${serve_files[@]}" | ||
pushd $${TMP}/core | ||
tar -cvf compile_py_proto_core.tar *.py | ||
popd | ||
pushd $${TMP}/serve | ||
tar -cvf compile_py_proto_serve.tar *.py | ||
popd | ||
mv $${TMP}/core/compile_py_proto_core.tar $(location :compile_py_proto_core.tar) | ||
mv $${TMP}/serve/compile_py_proto_serve.tar $(location :compile_py_proto_serve.tar) | ||
rm -r $${TMP} | ||
""", | ||
tools = [ | ||
":grpc_tools_protoc", | ||
], | ||
outs = [ | ||
"compile_py_proto_core.tar", | ||
"compile_py_proto_serve.tar" | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
sh_binary( | ||
name = "install_py_proto", | ||
srcs = [ | ||
":install_py_proto.sh", | ||
], | ||
data = [ | ||
":compile_py_proto_core.tar", | ||
":compile_py_proto_serve.tar", | ||
], | ||
args = [ | ||
"$(location :compile_py_proto_core.tar)", | ||
"$(location :compile_py_proto_serve.tar)", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import subprocess | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
args = [sys.executable, "-m", "grpc_tools.protoc"] | ||
args.extend(sys.argv[1:]) | ||
subprocess.check_call(args, stdout=sys.stdout, stderr=sys.stderr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
mkdir -p "${BUILD_WORKSPACE_DIRECTORY}"/python/ray/core/generated | ||
tar -xvf "$1" -C "${BUILD_WORKSPACE_DIRECTORY}"/python/ray/core/generated | ||
|
||
mkdir -p "${BUILD_WORKSPACE_DIRECTORY}"/python/ray/serve/generated | ||
tar -xvf "$2" -C "${BUILD_WORKSPACE_DIRECTORY}"/python/ray/serve/generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This uses protoc v19 and | ||
# is compatible with python protobuf 3.19 | ||
grpcio-tools==1.46.5 | ||
setuptools |
Oops, something went wrong.