Skip to content

Commit

Permalink
Merge commit for internal changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kirilg committed Feb 2, 2018
2 parents 03df9f3 + 63595f8 commit d52ab12
Show file tree
Hide file tree
Showing 55 changed files with 2,148 additions and 110 deletions.
22 changes: 16 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
workspace(name = "tf_serving")

local_repository(
# To update TensorFlow to a new revision.
# 1. Update the 'git_commit' args below to include the new git hash.
# 2. Get the sha256 hash of the archive with a command such as...
# curl -L https://github.com/tensorflow/tensorflow/archive/<git hash>.tar.gz | sha256sum
# and update the 'sha256' arg with the result.
# 3. Request the new archive to be mirrored on mirror.bazel.build for more
# reliable downloads.
load("//tensorflow_serving:repo.bzl", "tensorflow_http_archive")

tensorflow_http_archive(
name = "org_tensorflow",
path = "tensorflow",
sha256 = "21d6ac553adcfc9d089925f6d6793fee6a67264a0ce717bc998636662df4ca7e",
git_commit = "bc69c4ceed6544c109be5693eb40ddcf3a4eb95d",
)

# TensorFlow depends on "io_bazel_rules_closure" so we need this here.
# Needs to be kept in sync with the same target in TensorFlow's WORKSPACE file.
http_archive(
name = "io_bazel_rules_closure",
sha256 = "110fe68753413777944b473c25eed6368c4a0487cee23a7bac1b13cc49d3e257",
strip_prefix = "rules_closure-4af89ef1db659eb41f110df189b67d4cf14073e1",
sha256 = "dbe0da2cca88194d13dc5a7125a25dd7b80e1daec7839f33223de654d7a1bcc8",
strip_prefix = "rules_closure-ba3e07cb88be04a2d4af7009caa0ff3671a79d06",
urls = [
"http://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/4af89ef1db659eb41f110df189b67d4cf14073e1.tar.gz",
"https://github.com/bazelbuild/rules_closure/archive/4af89ef1db659eb41f110df189b67d4cf14073e1.tar.gz", # 2017-08-28
"https://mirror.bazel.build/github.com/bazelbuild/rules_closure/archive/ba3e07cb88be04a2d4af7009caa0ff3671a79d06.tar.gz",
"https://github.com/bazelbuild/rules_closure/archive/ba3e07cb88be04a2d4af7009caa0ff3671a79d06.tar.gz", # 2017-10-31
],
)

Expand Down
51 changes: 51 additions & 0 deletions tensorflow_serving/apis/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,57 @@ serving_go_grpc_library(
deps = [":prediction_service_go_proto"],
)

serving_proto_library(
name = "get_model_status_proto",
srcs = ["get_model_status.proto"],
cc_api_version = 2,
go_api_version = 2,
java_api_version = 2,
deps = [
":model_proto",
"//tensorflow_serving/util:status_proto",
],
)

serving_proto_library_py(
name = "get_model_status_proto_py_pb2",
srcs = ["get_model_status.proto"],
proto_library = "get_model_status_proto",
deps = [
":model_proto_py_pb2",
"//tensorflow_serving/util:status_proto_py_pb2",
],
)

serving_proto_library(
name = "model_service_proto",
srcs = ["model_service.proto"],
has_services = 1,
cc_api_version = 2,
cc_grpc_version = 1,
go_api_version = 2,
java_api_version = 2,
deps = [
":get_model_status_proto",
],
)

py_library(
name = "model_service_proto_py_pb2",
srcs = [
"model_service_pb2.py",
"model_service_pb2_grpc.py",
],
srcs_version = "PY2AND3",
deps = [":get_model_status_proto_py_pb2"],
)

serving_go_grpc_library(
name = "model_service_grpc",
srcs = [":model_service_proto"],
deps = [":model_service_go_proto"],
)

serving_proto_library(
name = "classification_proto",
srcs = ["classification.proto"],
Expand Down
6 changes: 5 additions & 1 deletion tensorflow_serving/apis/classification.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@ message ClassificationResult {
// RPC Interfaces

message ClassificationRequest {
// Model Specification.
// Model Specification. If version is not specified, will use the latest
// (numerical) version.
ModelSpec model_spec = 1;

// Input data.
tensorflow.serving.Input input = 2;
}

message ClassificationResponse {
// Effective Model Specification used for classification.
ModelSpec model_spec = 2;

// Result of the classification.
ClassificationResult result = 1;
}
1 change: 1 addition & 0 deletions tensorflow_serving/apis/get_model_metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ message SignatureDefMap {

message GetModelMetadataRequest {
// Model Specification indicating which model we are querying for metadata.
// If version is not specified, will use the latest (numerical) version.
ModelSpec model_spec = 1;
// Metadata fields to get. Currently supported: "signature_def".
repeated string metadata_field = 2;
Expand Down
67 changes: 67 additions & 0 deletions tensorflow_serving/apis/get_model_status.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
syntax = "proto3";

option cc_enable_arenas = true;

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

package tensorflow.serving;

// GetModelStatusRequest contains a ModelSpec indicating the model for which
// to get status.
message GetModelStatusRequest {
// Model Specification. If version is not specified, information about all
// versions of the model will be returned. If a version is specified, the
// status of only that version will be returned.
ModelSpec model_spec = 1;
}

// Version number, state, and status for a single version of a model.
message ModelVersionStatus {
// Model version.
int64 version = 1;

// States that map to ManagerState enum in
// tensorflow_serving/core/servable_state.h
enum State {
// Default value.
UNKNOWN = 0;

// The manager is tracking this servable, but has not initiated any action
// pertaining to it.
START = 10;

// The manager has decided to load this servable. In particular, checks
// around resource availability and other aspects have passed, and the
// manager is about to invoke the loader's Load() method.
LOADING = 20;

// The manager has successfully loaded this servable and made it available
// for serving (i.e. GetServableHandle(id) will succeed). To avoid races,
// this state is not reported until *after* the servable is made
// available.
AVAILABLE = 30;

// The manager has decided to make this servable unavailable, and unload
// it. To avoid races, this state is reported *before* the servable is
// made unavailable.
UNLOADING = 40;

// This servable has reached the end of its journey in the manager. Either
// it loaded and ultimately unloaded successfully, or it hit an error at
// some point in its lifecycle.
END = 50;
}

// Model state.
State state = 2;

// Model status.
StatusProto status = 3;
}

// Response for ModelStatusRequest on successful run.
message GetModelStatusResponse {
// Version number and status information for applicable model version(s).
repeated ModelVersionStatus model_version_status = 1;
}
2 changes: 2 additions & 0 deletions tensorflow_serving/apis/inference.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ package tensorflow.serving;

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

// Signature's method_name. Should be one of the method names defined in
Expand Down
5 changes: 1 addition & 4 deletions tensorflow_serving/apis/model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ message ModelSpec {
// Required servable name.
string name = 1;

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

// A named signature to evaluate. If unspecified, the default signature will
Expand Down
17 changes: 17 additions & 0 deletions tensorflow_serving/apis/model_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";

option cc_enable_arenas = true;

import "tensorflow_serving/apis/get_model_status.proto";

package tensorflow.serving;

// ModelService provides access to information about model versions
// that have been handled by the model server.
service ModelService {
// Gets status of model. If the ModelSpec in the request does not specify
// version, information about all versions of the model will be returned. If
// the ModelSpec in the request does specify a version, the status of only
// that version will be returned.
rpc GetModelStatus(GetModelStatusRequest) returns (GetModelStatusResponse);
}
Loading

0 comments on commit d52ab12

Please sign in to comment.