Skip to content

Commit

Permalink
Move status_proto to public visible apis/ (it being used by public AP…
Browse files Browse the repository at this point in the history
…I protos)

PiperOrigin-RevId: 373803959
  • Loading branch information
netfs authored and tensorflow-copybara committed May 14, 2021
1 parent 124b511 commit 7f894c7
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 42 deletions.
28 changes: 24 additions & 4 deletions tensorflow_serving/apis/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,33 @@ serving_go_grpc_library(
deps = [":prediction_service_go_proto"],
)

serving_proto_library(
name = "status_proto",
srcs = ["status.proto"],
cc_api_version = 2,
deps = [
serving_tensorflow_proto_dep(
"@org_tensorflow//tensorflow/core:protos_all",
),
],
)

serving_proto_library_py(
name = "status_proto_py_pb2",
srcs = ["status.proto"],
proto_library = "status_proto",
deps = [
"@org_tensorflow//tensorflow/core:protos_all_py",
],
)

serving_proto_library(
name = "model_management_proto",
srcs = ["model_management.proto"],
cc_api_version = 2,
deps = [
":status_proto",
"//tensorflow_serving/config:model_server_config_proto",
"//tensorflow_serving/util:status_proto",
],
)

Expand All @@ -215,8 +235,8 @@ serving_proto_library_py(
srcs = ["model_management.proto"],
proto_library = "model_management_proto",
deps = [
":status_proto_py_pb2",
"//tensorflow_serving/config:model_server_config_proto_py_pb2",
"//tensorflow_serving/util:status_proto_py_pb2",
],
)

Expand All @@ -226,7 +246,7 @@ serving_proto_library(
cc_api_version = 2,
deps = [
":model_proto",
"//tensorflow_serving/util:status_proto",
":status_proto",
],
)

Expand All @@ -236,7 +256,7 @@ serving_proto_library_py(
proto_library = "get_model_status_proto",
deps = [
":model_proto_py_pb2",
"//tensorflow_serving/util:status_proto_py_pb2",
":status_proto_py_pb2",
],
)

Expand Down
6 changes: 3 additions & 3 deletions tensorflow_serving/apis/get_model_status.proto
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
syntax = "proto3";

option cc_enable_arenas = true;
package tensorflow.serving;

import "tensorflow_serving/apis/model.proto";
import "tensorflow_serving/util/status.proto";
import "tensorflow_serving/apis/status.proto";

package tensorflow.serving;
option cc_enable_arenas = true;

// GetModelStatusRequest contains a ModelSpec indicating the model for which
// to get status.
Expand Down
5 changes: 3 additions & 2 deletions tensorflow_serving/apis/model_management.proto
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
syntax = "proto3";

package tensorflow.serving;

import "tensorflow_serving/apis/status.proto";
import "tensorflow_serving/config/model_server_config.proto";
import "tensorflow_serving/util/status.proto";

package tensorflow.serving;
option cc_enable_arenas = true;

message ReloadConfigRequest {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tensorflow_serving/model_servers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ cc_library(
deps = [
":server_core",
"//tensorflow_serving/apis:get_model_status_cc_proto",
"//tensorflow_serving/apis:status_cc_proto",
"//tensorflow_serving/core:servable_state",
"//tensorflow_serving/core:servable_state_monitor",
"//tensorflow_serving/util:status_cc_proto",
"//tensorflow_serving/util:status_util",
"@com_google_absl//absl/types:optional",
"@org_tensorflow//tensorflow/core:lib",
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_serving/model_servers/get_model_status_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ limitations under the License.
#include <string>

#include "absl/types/optional.h"
#include "tensorflow_serving/apis/status.pb.h"
#include "tensorflow_serving/core/servable_state.h"
#include "tensorflow_serving/core/servable_state_monitor.h"
#include "tensorflow_serving/util/status.pb.h"
#include "tensorflow_serving/util/status_util.h"

namespace tensorflow {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ limitations under the License.
#include "tensorflow/cc/saved_model/signature_constants.h"
#include "tensorflow/core/lib/core/status_test_util.h"
#include "tensorflow_serving/apis/model.pb.h"
#include "tensorflow_serving/apis/status.pb.h"
#include "tensorflow_serving/core/availability_preserving_policy.h"
#include "tensorflow_serving/model_servers/model_platform_types.h"
#include "tensorflow_serving/model_servers/platform_config_util.h"
#include "tensorflow_serving/model_servers/server_core.h"
#include "tensorflow_serving/servables/tensorflow/saved_model_bundle_source_adapter.pb.h"
#include "tensorflow_serving/servables/tensorflow/session_bundle_config.pb.h"
#include "tensorflow_serving/test_util/test_util.h"
#include "tensorflow_serving/util/status.pb.h"

namespace tensorflow {
namespace serving {
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_serving/tools/pip_package/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ sh_binary(
"//tensorflow_serving/apis:predict_proto_py_pb2",
"//tensorflow_serving/apis:regression_proto_py_pb2",
"//tensorflow_serving/apis:session_service_proto_py_pb2",
"//tensorflow_serving/apis:status_proto_py_pb2",
"//tensorflow_serving/config:log_collector_config_proto_py_pb2",
"//tensorflow_serving/config:logging_config_proto_py_pb2",
"//tensorflow_serving/config:model_server_config_proto_py_pb2",
"//tensorflow_serving/config:file_system_storage_path_source_proto_py_pb2",
"//tensorflow_serving/util:status_proto_py_pb2",
"//tensorflow_serving/core:logging_proto_py_pb2",
],
)
5 changes: 0 additions & 5 deletions tensorflow_serving/tools/pip_package/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function main() {
mkdir -p ${TMPDIR}/tensorflow_serving/apis
mkdir -p ${TMPDIR}/tensorflow_serving/config
mkdir -p ${TMPDIR}/tensorflow_serving/core
mkdir -p ${TMPDIR}/tensorflow_serving/util

echo "Adding python files"
cp bazel-out/k8-opt/bin/tensorflow_serving/apis/*_pb2.py \
Expand All @@ -55,13 +54,9 @@ function main() {
cp bazel-out/k8-opt/bin/tensorflow_serving/core/*_pb2.py \
"${TMPDIR}/tensorflow_serving/core"

cp bazel-out/k8-opt/bin/tensorflow_serving/util/*_pb2.py \
"${TMPDIR}/tensorflow_serving/util"

touch "${TMPDIR}/tensorflow_serving/apis/__init__.py"
touch "${TMPDIR}/tensorflow_serving/config/__init__.py"
touch "${TMPDIR}/tensorflow_serving/core/__init__.py"
touch "${TMPDIR}/tensorflow_serving/util/__init__.py"
touch "${TMPDIR}/tensorflow_serving/__init__.py"

echo "Adding package setup files"
Expand Down
25 changes: 2 additions & 23 deletions tensorflow_serving/util/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Description: Tensorflow Serving utils.

load("//tensorflow_serving:serving.bzl", "serving_proto_library", "serving_proto_library_py", "serving_tensorflow_proto_dep")
load("//tensorflow_serving:serving.bzl", "serving_proto_library")

package(
default_visibility = [
Expand Down Expand Up @@ -292,7 +292,7 @@ cc_library(
srcs = ["status_util.cc"],
hdrs = ["status_util.h"],
deps = [
":status_cc_proto",
"//tensorflow_serving/apis:status_cc_proto",
"@org_tensorflow//tensorflow/core:lib",
],
)
Expand Down Expand Up @@ -354,27 +354,6 @@ serving_proto_library(
],
)

serving_proto_library(
name = "status_proto",
srcs = ["status.proto"],
cc_api_version = 2,
visibility = ["//visibility:public"],
deps = [
serving_tensorflow_proto_dep(
"@org_tensorflow//tensorflow/core:protos_all",
),
],
)

serving_proto_library_py(
name = "status_proto_py_pb2",
srcs = ["status.proto"],
proto_library = "status_proto",
deps = [
"@org_tensorflow//tensorflow/core:protos_all_py",
],
)

cc_library(
name = "oss_or_google",
hdrs = ["oss_or_google.h"],
Expand Down
2 changes: 1 addition & 1 deletion tensorflow_serving/util/status_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#define TENSORFLOW_SERVING_UTIL_STATUS_UTIL_H_

#include "tensorflow/core/lib/core/status.h"
#include "tensorflow_serving/util/status.pb.h"
#include "tensorflow_serving/apis/status.pb.h"

namespace tensorflow {
namespace serving {
Expand Down

0 comments on commit 7f894c7

Please sign in to comment.