Skip to content

Commit adff374

Browse files
authored
Merge pull request tensorflow#752 from kirilg/branch_184135564
Branch 184135564
2 parents 03df9f3 + d52ab12 commit adff374

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2148
-110
lines changed

WORKSPACE

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
workspace(name = "tf_serving")
22

3-
local_repository(
3+
# To update TensorFlow to a new revision.
4+
# 1. Update the 'git_commit' args below to include the new git hash.
5+
# 2. Get the sha256 hash of the archive with a command such as...
6+
# curl -L https://github.com/tensorflow/tensorflow/archive/<git hash>.tar.gz | sha256sum
7+
# and update the 'sha256' arg with the result.
8+
# 3. Request the new archive to be mirrored on mirror.bazel.build for more
9+
# reliable downloads.
10+
load("//tensorflow_serving:repo.bzl", "tensorflow_http_archive")
11+
12+
tensorflow_http_archive(
413
name = "org_tensorflow",
5-
path = "tensorflow",
14+
sha256 = "21d6ac553adcfc9d089925f6d6793fee6a67264a0ce717bc998636662df4ca7e",
15+
git_commit = "bc69c4ceed6544c109be5693eb40ddcf3a4eb95d",
616
)
717

818
# TensorFlow depends on "io_bazel_rules_closure" so we need this here.
919
# Needs to be kept in sync with the same target in TensorFlow's WORKSPACE file.
1020
http_archive(
1121
name = "io_bazel_rules_closure",
12-
sha256 = "110fe68753413777944b473c25eed6368c4a0487cee23a7bac1b13cc49d3e257",
13-
strip_prefix = "rules_closure-4af89ef1db659eb41f110df189b67d4cf14073e1",
22+
sha256 = "dbe0da2cca88194d13dc5a7125a25dd7b80e1daec7839f33223de654d7a1bcc8",
23+
strip_prefix = "rules_closure-ba3e07cb88be04a2d4af7009caa0ff3671a79d06",
1424
urls = [
15-
"http://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/4af89ef1db659eb41f110df189b67d4cf14073e1.tar.gz",
16-
"https://github.com/bazelbuild/rules_closure/archive/4af89ef1db659eb41f110df189b67d4cf14073e1.tar.gz", # 2017-08-28
25+
"https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/ba3e07cb88be04a2d4af7009caa0ff3671a79d06.tar.gz",
26+
"https://github.com/bazelbuild/rules_closure/archive/ba3e07cb88be04a2d4af7009caa0ff3671a79d06.tar.gz", # 2017-10-31
1727
],
1828
)
1929

tensorflow_serving/apis/BUILD

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,57 @@ serving_go_grpc_library(
156156
deps = [":prediction_service_go_proto"],
157157
)
158158

159+
serving_proto_library(
160+
name = "get_model_status_proto",
161+
srcs = ["get_model_status.proto"],
162+
cc_api_version = 2,
163+
go_api_version = 2,
164+
java_api_version = 2,
165+
deps = [
166+
":model_proto",
167+
"//tensorflow_serving/util:status_proto",
168+
],
169+
)
170+
171+
serving_proto_library_py(
172+
name = "get_model_status_proto_py_pb2",
173+
srcs = ["get_model_status.proto"],
174+
proto_library = "get_model_status_proto",
175+
deps = [
176+
":model_proto_py_pb2",
177+
"//tensorflow_serving/util:status_proto_py_pb2",
178+
],
179+
)
180+
181+
serving_proto_library(
182+
name = "model_service_proto",
183+
srcs = ["model_service.proto"],
184+
has_services = 1,
185+
cc_api_version = 2,
186+
cc_grpc_version = 1,
187+
go_api_version = 2,
188+
java_api_version = 2,
189+
deps = [
190+
":get_model_status_proto",
191+
],
192+
)
193+
194+
py_library(
195+
name = "model_service_proto_py_pb2",
196+
srcs = [
197+
"model_service_pb2.py",
198+
"model_service_pb2_grpc.py",
199+
],
200+
srcs_version = "PY2AND3",
201+
deps = [":get_model_status_proto_py_pb2"],
202+
)
203+
204+
serving_go_grpc_library(
205+
name = "model_service_grpc",
206+
srcs = [":model_service_proto"],
207+
deps = [":model_service_go_proto"],
208+
)
209+
159210
serving_proto_library(
160211
name = "classification_proto",
161212
srcs = ["classification.proto"],

tensorflow_serving/apis/classification.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@ message ClassificationResult {
3030
// RPC Interfaces
3131

3232
message ClassificationRequest {
33-
// Model Specification.
33+
// Model Specification. If version is not specified, will use the latest
34+
// (numerical) version.
3435
ModelSpec model_spec = 1;
3536

3637
// Input data.
3738
tensorflow.serving.Input input = 2;
3839
}
3940

4041
message ClassificationResponse {
42+
// Effective Model Specification used for classification.
43+
ModelSpec model_spec = 2;
44+
4145
// Result of the classification.
4246
ClassificationResult result = 1;
4347
}

tensorflow_serving/apis/get_model_metadata.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ message SignatureDefMap {
1414

1515
message GetModelMetadataRequest {
1616
// Model Specification indicating which model we are querying for metadata.
17+
// If version is not specified, will use the latest (numerical) version.
1718
ModelSpec model_spec = 1;
1819
// Metadata fields to get. Currently supported: "signature_def".
1920
repeated string metadata_field = 2;
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
syntax = "proto3";
2+
3+
option cc_enable_arenas = true;
4+
5+
import "tensorflow_serving/apis/model.proto";
6+
import "tensorflow_serving/util/status.proto";
7+
8+
package tensorflow.serving;
9+
10+
// GetModelStatusRequest contains a ModelSpec indicating the model for which
11+
// to get status.
12+
message GetModelStatusRequest {
13+
// Model Specification. If version is not specified, information about all
14+
// versions of the model will be returned. If a version is specified, the
15+
// status of only that version will be returned.
16+
ModelSpec model_spec = 1;
17+
}
18+
19+
// Version number, state, and status for a single version of a model.
20+
message ModelVersionStatus {
21+
// Model version.
22+
int64 version = 1;
23+
24+
// States that map to ManagerState enum in
25+
// tensorflow_serving/core/servable_state.h
26+
enum State {
27+
// Default value.
28+
UNKNOWN = 0;
29+
30+
// The manager is tracking this servable, but has not initiated any action
31+
// pertaining to it.
32+
START = 10;
33+
34+
// The manager has decided to load this servable. In particular, checks
35+
// around resource availability and other aspects have passed, and the
36+
// manager is about to invoke the loader's Load() method.
37+
LOADING = 20;
38+
39+
// The manager has successfully loaded this servable and made it available
40+
// for serving (i.e. GetServableHandle(id) will succeed). To avoid races,
41+
// this state is not reported until *after* the servable is made
42+
// available.
43+
AVAILABLE = 30;
44+
45+
// The manager has decided to make this servable unavailable, and unload
46+
// it. To avoid races, this state is reported *before* the servable is
47+
// made unavailable.
48+
UNLOADING = 40;
49+
50+
// This servable has reached the end of its journey in the manager. Either
51+
// it loaded and ultimately unloaded successfully, or it hit an error at
52+
// some point in its lifecycle.
53+
END = 50;
54+
}
55+
56+
// Model state.
57+
State state = 2;
58+
59+
// Model status.
60+
StatusProto status = 3;
61+
}
62+
63+
// Response for ModelStatusRequest on successful run.
64+
message GetModelStatusResponse {
65+
// Version number and status information for applicable model version(s).
66+
repeated ModelVersionStatus model_version_status = 1;
67+
}

tensorflow_serving/apis/inference.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ package tensorflow.serving;
2121

2222
// Inference request such as classification, regression, etc...
2323
message InferenceTask {
24+
// Model Specification. If version is not specified, will use the latest
25+
// (numerical) version.
2426
ModelSpec model_spec = 1;
2527

2628
// Signature's method_name. Should be one of the method names defined in

tensorflow_serving/apis/model.proto

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ message ModelSpec {
1010
// Required servable name.
1111
string name = 1;
1212

13-
// Optional version. If unspecified, will use the latest (numerical) version.
14-
// Typically not needed unless coordinating across multiple models that were
15-
// co-trained and/or have inter-dependencies on the versions used at inference
16-
// time.
13+
// Optional version.
1714
google.protobuf.Int64Value version = 2;
1815

1916
// A named signature to evaluate. If unspecified, the default signature will
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
syntax = "proto3";
2+
3+
option cc_enable_arenas = true;
4+
5+
import "tensorflow_serving/apis/get_model_status.proto";
6+
7+
package tensorflow.serving;
8+
9+
// ModelService provides access to information about model versions
10+
// that have been handled by the model server.
11+
service ModelService {
12+
// Gets status of model. If the ModelSpec in the request does not specify
13+
// version, information about all versions of the model will be returned. If
14+
// the ModelSpec in the request does specify a version, the status of only
15+
// that version will be returned.
16+
rpc GetModelStatus(GetModelStatusRequest) returns (GetModelStatusResponse);
17+
}

0 commit comments

Comments
 (0)