Switch from grpc++_unsecure to grpc++

Fixes #13590

PiperOrigin-RevId: 200246854
This commit is contained in:
Brennan Saeta 2018-06-12 11:12:53 -07:00 committed by TensorFlower Gardener
parent ffe3d1b4db
commit ba9422a8ad
11 changed files with 57 additions and 43 deletions

View File

@ -42,7 +42,7 @@ tf_cc_binary(
"//tensorflow/compiler/xla/service:cpu_plugin",
"//tensorflow/core:framework_internal",
"//tensorflow/core:lib",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -61,7 +61,7 @@ tf_cc_test(
"//tensorflow/core:lib",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -74,6 +74,6 @@ cc_library(
"//tensorflow/compiler/xla/service",
"//tensorflow/compiler/xla/service:platform_util",
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)

View File

@ -18,7 +18,16 @@ cmake_policy(SET CMP0022 NEW)
# Options
option(tensorflow_VERBOSE "Enable for verbose output" OFF)
if(WIN32)
# BoringSSL is disabled for windows as it currently doesn't build with
# MSBuild. (Ninja is required.)
option(tensorflow_ENABLE_SSL_SUPPORT "Enable boringssl support" OFF)
else()
# BoringSSL is enabled for gRPC.
option(tensorflow_ENABLE_SSL_SUPPORT "Enable boringssl support" ON)
endif()
option(tensorflow_ENABLE_GRPC_SUPPORT "Enable gRPC support" ON)
option(tensorflow_ENABLE_HDFS_SUPPORT "Enable HDFS support" OFF)
option(tensorflow_ENABLE_JEMALLOC_SUPPORT "Enable jemalloc support" OFF)

View File

@ -20,6 +20,10 @@ set(GRPC_BUILD ${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc)
set(GRPC_TAG d184fa229d75d336aedea0041bd59cb93e7e267f)
if(WIN32)
# We use unsecure gRPC because boringssl does not build on windows
set(grpc_TARGET grpc++_unsecure)
set(grpc_DEPENDS protobuf zlib)
set(grpc_SSL_PROVIDER NONE)
if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
set(grpc_STATIC_LIBRARIES
${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/Release/grpc++_unsecure.lib
@ -32,9 +36,12 @@ if(WIN32)
${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/gpr.lib)
endif()
else()
set(grpc_TARGET grpc++)
set(grpc_DEPENDS boringssl protobuf zlib)
set(grpc_SSL_PROVIDER module)
set(grpc_STATIC_LIBRARIES
${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/libgrpc++_unsecure.a
${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/libgrpc_unsecure.a
${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/libgrpc++.a
${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/libgrpc.a
${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/libaddress_sorting.a
${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/third_party/cares/cares/lib/libcares.a
${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/libgpr.a)
@ -44,13 +51,13 @@ add_definitions(-DGRPC_ARES=0)
ExternalProject_Add(grpc
PREFIX grpc
DEPENDS protobuf zlib
DEPENDS ${grpc_DEPENDS}
GIT_REPOSITORY ${GRPC_URL}
GIT_TAG ${GRPC_TAG}
DOWNLOAD_DIR "${DOWNLOAD_LOCATION}"
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS ${grpc_STATIC_LIBRARIES}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release --target grpc++_unsecure
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release --target ${grpc_TARGET}
COMMAND ${CMAKE_COMMAND} --build . --config Release --target grpc_cpp_plugin
INSTALL_COMMAND ""
CMAKE_CACHE_ARGS
@ -59,7 +66,7 @@ ExternalProject_Add(grpc
-DPROTOBUF_INCLUDE_DIRS:STRING=${PROTOBUF_INCLUDE_DIRS}
-DPROTOBUF_LIBRARIES:STRING=${protobuf_STATIC_LIBRARIES}
-DZLIB_ROOT:STRING=${ZLIB_INSTALL}
-DgRPC_SSL_PROVIDER:STRING=NONE
-DgRPC_SSL_PROVIDER:STRING=${grpc_SSL_PROVIDER}
)
# grpc/src/core/ext/census/tracing.c depends on the existence of openssl/rand.h.

View File

@ -53,7 +53,7 @@ tf_cc_binary(
"//tensorflow/core:lib",
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
"//tensorflow/core/platform/cloud:gcs_file_system",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)

View File

@ -58,7 +58,7 @@ cc_library(
"//tensorflow/core/distributed_runtime/rpc:async_service_interface",
"//tensorflow/core/distributed_runtime/rpc:grpc_call",
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
alwayslink = 1,
)
@ -69,7 +69,7 @@ cc_library(
hdrs = ["grpc_verbs_service_impl.h"],
deps = [
":verbs_service_proto_cc",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)

View File

@ -42,7 +42,7 @@ load(
# Check that tensorflow/core:tensorflow does not depend on grpc.
check_deps(
name = "core_tensorflow_check_deps",
disallowed_deps = ["@grpc//:grpc++_unsecure"],
disallowed_deps = ["@grpc//:grpc++"],
deps = ["//tensorflow/core:tensorflow"],
)
@ -150,7 +150,7 @@ tf_cuda_library(
"//tensorflow/core:lib_internal",
"//tensorflow/core:proto_text",
"//tensorflow/core:protos_all_cc",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
alwayslink = 1,
)
@ -170,7 +170,7 @@ tf_cuda_library(
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:protos_all_cc",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
alwayslink = 1,
)

View File

@ -649,7 +649,7 @@ tf_cuda_cc_test(
"//tensorflow/core/kernels:dense_update_ops",
"//tensorflow/core/kernels:identity_op",
"//tensorflow/core/kernels:variable_ops",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -682,7 +682,7 @@ tf_cuda_cc_test(
"//tensorflow/core/distributed_runtime/rpc:grpc_testlib",
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
"//tensorflow/core/distributed_runtime/rpc:grpc_worker_cache",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)

View File

@ -65,8 +65,8 @@ cc_library(
"//tensorflow/core/distributed_runtime:worker_env",
"//tensorflow/core/distributed_runtime/eager:remote_tensor_handle",
"//tensorflow/core/distributed_runtime/rpc:rpc_rendezvous_mgr",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc_unsecure",
"@grpc",
"@grpc//:grpc++",
],
)

View File

@ -41,8 +41,8 @@ cc_library(
srcs = ["grpc_util.cc"],
hdrs = ["grpc_util.h"],
deps = [
"@grpc//:grpc_unsecure",
"@grpc//:grpc++_unsecure",
"@grpc",
"@grpc//:grpc++",
"//tensorflow/core:lib",
# Required to be able to overload TensorResponse parsing.
"//tensorflow/core/distributed_runtime:tensor_coding",
@ -56,7 +56,7 @@ cc_library(
deps = [
":grpc_util",
"//tensorflow/core:lib",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -70,7 +70,7 @@ cc_library(
"//tensorflow/core:lib",
"//tensorflow/core/distributed_runtime:call_options",
"//tensorflow/core/distributed_runtime:tensor_coding",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -90,7 +90,7 @@ cc_library(
"//tensorflow/core/distributed_runtime:tensor_coding",
"//tensorflow/core/distributed_runtime:worker_cache_logger",
"//tensorflow/core/distributed_runtime:worker_interface",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -103,7 +103,7 @@ cc_library(
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -118,7 +118,7 @@ cc_library(
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core:worker_proto_cc",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -129,7 +129,7 @@ cc_library(
deps = [
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -180,7 +180,7 @@ tf_cuda_library(
"//tensorflow/core/distributed_runtime:worker_cache",
"//tensorflow/core/distributed_runtime:worker_env",
"//tensorflow/core/distributed_runtime:worker_session",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -192,7 +192,7 @@ cc_library(
":grpc_util",
"//tensorflow/core:worker_proto_cc",
"//tensorflow/core/distributed_runtime:tensor_coding",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -225,7 +225,7 @@ cc_library(
"//tensorflow/core:lib_internal",
"//tensorflow/core:master_proto_cc",
"//tensorflow/core/distributed_runtime:master",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
alwayslink = 1,
)
@ -236,7 +236,7 @@ cc_library(
hdrs = ["grpc_master_service_impl.h"],
deps = [
"//tensorflow/core:master_proto_cc",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -285,8 +285,8 @@ cc_library(
"//tensorflow/core/distributed_runtime:server_lib",
"//tensorflow/core/distributed_runtime:session_mgr",
"//tensorflow/core/distributed_runtime:worker_env",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc_unsecure",
"@grpc",
"@grpc//:grpc++",
],
alwayslink = 1,
)
@ -313,7 +313,7 @@ tf_cc_binary(
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/distributed_runtime:server_lib",
"//tensorflow/core/kernels:data_flow",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -338,7 +338,7 @@ tf_cc_binary(
"//tensorflow/core/kernels:matmul_op",
"//tensorflow/core/kernels:reduction_ops",
"//tensorflow/core/kernels:variable_ops",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -432,7 +432,7 @@ tf_cc_test(
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
"//tensorflow/core:worker_proto_cc",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -445,8 +445,8 @@ tf_cc_test(
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:worker_proto_cc",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc_unsecure",
"@grpc",
"@grpc//:grpc++",
],
)

View File

@ -12,7 +12,7 @@ cc_library(
hdrs = ["grpc_eager_service.h"],
deps = [
"//tensorflow/core:eager_service_proto_cc",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -29,7 +29,7 @@ cc_library(
"//tensorflow/core/distributed_runtime/rpc:grpc_state",
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
"//tensorflow/core/distributed_runtime/rpc/eager:grpc_eager_service",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)
@ -48,7 +48,7 @@ cc_library(
"//tensorflow/core/distributed_runtime/rpc:grpc_util",
"//tensorflow/core/distributed_runtime/rpc:grpc_worker_cache",
"//tensorflow/core/distributed_runtime/rpc:grpc_worker_service",
"@grpc//:grpc++_unsecure",
"@grpc//:grpc++",
],
)

View File

@ -778,11 +778,9 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
actual = "@grpc//:grpc_python_plugin",
)
# gRPC has three empty C++ functions which it wants the user to define
# at build time. https://github.com/grpc/grpc/issues/13590
native.bind(
name = "grpc_lib",
actual = "@grpc//:grpc++_unsecure",
actual = "@grpc//:grpc++",
)
# Needed by gRPC