Skip to content

Commit

Permalink
base: added versioning and reduced size
Browse files Browse the repository at this point in the history
  • Loading branch information
samsends committed Jan 13, 2019
1 parent 49c5c3f commit 46d85ea
Show file tree
Hide file tree
Showing 16 changed files with 1,283 additions and 183 deletions.
1 change: 1 addition & 0 deletions go/protos/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func generateProtos() error {
"tensor.proto",
"transport.proto",
"type.proto",
"version.proto",
}
cmd := exec.Command("protoc", args...)
err = cmd.Run()
Expand Down
24 changes: 6 additions & 18 deletions go/protos/tensor.proto
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
// Proto Syntax:
syntax = "proto3";
/////////////////////////////////////////////////////
// Package Name
/////////////////////////////////////////////////////
// Package Name:
package ttp;
/////////////////////////////////////////////////////
// Imports
/////////////////////////////////////////////////////
// Imports:
import "type.proto";
import "gogo/protobuf/gogoproto/gogo.proto";
/////////////////////////////////////////////////////
// Proto Options
/////////////////////////////////////////////////////
option cc_enable_arenas = true;
option java_outer_classname = "TensorProtos";
option java_multiple_files = true;
option java_package = "com.tensortask.ttp";
/////////////////////////////////////////////////////
// GoGo Proto Options (Golang optimizations)
/////////////////////////////////////////////////////
// GoGo Proto Options (Golang optimizations):
option (gogoproto.equal_all) = true;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.gostring_all) = true;
Expand All @@ -28,7 +16,8 @@ option (gogoproto.unmarshaler_all) = true;
option (gogoproto.verbose_equal_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
/////////////////////////////////////////////////////
// Description:
//
// Tensor is a generalized placeholder for Tensors.
//
// Data type: TF supported data types
Expand All @@ -41,7 +30,6 @@ option (gogoproto.testgen_all) = true;
//
// Metadata: any additional keyed values (e.g. dimension labels).
// Metadata is use-case specific.
/////////////////////////////////////////////////////

message Tensor {
Type Type = 1;
Expand Down
26 changes: 8 additions & 18 deletions go/protos/transport.proto
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
// Proto Syntax:
syntax = "proto3";
/////////////////////////////////////////////////////
// Package Name
/////////////////////////////////////////////////////
// Package Name:
package ttp;
/////////////////////////////////////////////////////
// Imports
/////////////////////////////////////////////////////
// Imports:
import "tensor.proto";
import "version.proto";
import "gogo/protobuf/gogoproto/gogo.proto";
/////////////////////////////////////////////////////
// Proto Options
/////////////////////////////////////////////////////
option cc_enable_arenas = true;
option java_outer_classname = "TransportProtos";
option java_multiple_files = true;
option java_package = "com.tensortask.ttp";
/////////////////////////////////////////////////////
// GoGo Proto Options (Golang optimizations)
/////////////////////////////////////////////////////
// GoGo Proto Options (Golang optimizations):
option (gogoproto.equal_all) = true;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.gostring_all) = true;
Expand All @@ -28,7 +17,8 @@ option (gogoproto.unmarshaler_all) = true;
option (gogoproto.verbose_equal_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
/////////////////////////////////////////////////////
// Description:
//
// Transport is a group of tensors to be sent over the
// wire.
//
Expand All @@ -41,10 +31,10 @@ option (gogoproto.testgen_all) = true;
//
// Metadata is any other additional use-case specific
// information. This could be a UUID or encryption nonce.
/////////////////////////////////////////////////////

message Transport {
string Target = 1;
map<string, Tensor> Tensors = 2;
map<string, bytes> MetaData = 3;
Version Version = 4;
}
27 changes: 7 additions & 20 deletions go/protos/type.proto
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
// Proto Syntax:
syntax = "proto3";
/////////////////////////////////////////////////////
// Package Name
/////////////////////////////////////////////////////
// Package Name:
package ttp;
/////////////////////////////////////////////////////
// Imports
/////////////////////////////////////////////////////
// Imports:
import "gogo/protobuf/gogoproto/gogo.proto";
/////////////////////////////////////////////////////
// Proto Options
/////////////////////////////////////////////////////
option cc_enable_arenas = true;
option java_outer_classname = "TypeEnum";
option java_multiple_files = true;
option java_package = "com.tensortask.ttp";
/////////////////////////////////////////////////////
// GoGo Proto Options (Golang optimizations)
/////////////////////////////////////////////////////
// GoGo Proto Options (Golang optimizations):
option (gogoproto.equal_all) = true;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.gostring_all) = true;
Expand All @@ -27,11 +15,10 @@ option (gogoproto.unmarshaler_all) = true;
option (gogoproto.verbose_equal_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
/////////////////////////////////////////////////////
// Description:
// Type is an enum selector which allows ONE data type
// to be used.
// Currently supports all TensorFlow data types.
/////////////////////////////////////////////////////
// to be used. Currently supports all TensorFlow data types.


enum Type {
// Not a legal value for DataType. Used to indicate a DataType field
Expand Down
45 changes: 45 additions & 0 deletions go/protos/version.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Proto Syntax:
syntax = "proto3";
// Package Name:
package ttp;
// Imports:
import "gogo/protobuf/gogoproto/gogo.proto";
// GoGo Proto Options (Golang optimizations):
option (gogoproto.equal_all) = true;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.gostring_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.stringer_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.verbose_equal_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
// Description:
//
// Version specifies the version of the underlying
// TTP transport. In addition to TTP versioning,
// version allows application specific versioning
// to reduce errors from missing metadata fields.

message Version {
// TTP is the version of the underlying
// Tensor Transport Protocol (Buffer).
int32 TTP = 1;

// ApplicationID identifies a specific application
// that is built on TTP.
string ApplicationID = 2;

// The version of the application that produced
// this data.
int32 ProducerVersion = 3;

// Any consumer below this version is NOT allowed
// to consume this data.
int32 ConsumerVersion = 4;

// Specific consumer versions which are disallowed
// (e.g. due to bugs).
repeated int32 BlacklistVersions = 5;
};
73 changes: 41 additions & 32 deletions go/tensor.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions go/tensorpb_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 46d85ea

Please sign in to comment.