serving icon indicating copy to clipboard operation
serving copied to clipboard

grpc vs. grpc_insecure linking for model_servers (tensorflow_model_server BUILD)

Open bknl opened this issue 8 years ago • 2 comments

This probably not so much of an TensorFlow Serving issue but an gRPC/bazel issue.

I have made patches available to build model servers with secure gRPC channel enabled (see https://github.com/tensorflow/serving/issues/url and this worked fine with TensorFlow Serving 1.0 (which used a really old gRPC library).

When trying to upgrade everything for the next release of our product, the same code no longer seemed to work, but this is due to bazel generating a really weird list of gRPC libraries, when the dependency in the tensorflow_model_server BUILD file is changed from "grpc_insecure" to "grpc".

Namely, despite the change, it keeps including the "unsecure" versions of the libraries "ahead" of the "secure" versions, which leads to a mixture of TLS and non-TLS versions, which actually link fine (by getting "SslServerCredentials" from the TLS set and most of the rest from the other.

The relevant section of the "tensorflow_model_server-2.params" looks like this:

bazel-out/k8-fastbuild/bin/tensorflow_serving/apis/libprediction_service_proto.a bazel-out/k8-fastbuild/bin/external/grpc/libgrpc++_unsecure.a bazel-out/k8-fastbuild/bin/external/grpc/libgrpc++_base_unsecure.a bazel-out/k8-fastbuild/bin/external/grpc/libgrpc_unsecure.a bazel-out/k8-fastbuild/bin/external/grpc/libgrpc_lb_policy_grpclb.a bazel-out/k8-fastbuild/bin/tensorflow_serving/core/libavailability_preserving_policy.a bazel-out/k8-fastbuild/bin/external/grpc/libgrpc++.a bazel-out/k8-fastbuild/bin/external/grpc/libgrpc++_base.a bazel-out/k8-fastbuild/bin/external/grpc/libgrpc.a

Manually removing all the "unsecure" versions from the "tensorflow_model_server-2.params" and then executing the link step manually creates a working server again.

I am nowhere near bazel-savvy enough to figure out where in this whole web of dependencies the "unsecure" stuff gets dragged in.

If I should repost this elsewhere (grpc ? bazel ?) let me know

bknl avatar Dec 15 '17 18:12 bknl

I think this is resolved via the comment in #193 ?

jkinkead avatar Mar 01 '18 22:03 jkinkead

Yes, everything works now

bknl avatar Apr 18 '18 08:04 bknl