Skip to content

Commit afeb4a0

Browse files
committed
change target label names for client libs
update readme to reflect label name changes
1 parent 8355607 commit afeb4a0

File tree

9 files changed

+66
-32
lines changed

9 files changed

+66
-32
lines changed

README.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Currently, client libraries can be cross-built for c++, python and go targeting
1313
* [Cross-Building](#cross-building)
1414
* [Project Artifacts](#project-artifacts)
1515
* [Client Examples](#client-examples)
16+
* [Generating Sources](#generating-sources)
1617

1718
## Cross-Building
1819

@@ -39,12 +40,12 @@ docker run --rm -ti \
3940

4041
Examples
4142
```sh
43+
# build python client library for amd64
44+
bazel build //py:grpc --config=linux_amd64
4245
# build platform wheel for 32-bit arm
4346
bazel run //py/wheel:build_platform --config=linux_arm
44-
# build go client library for amd64
45-
bazel build //py:tensorflow_serving --config=linux_amd64
4647
# build go client library for arm64
47-
bazel build //go:tensorflow_serving --config=linux_arm64
48+
bazel build //go:grpc --config=linux_arm64
4849
```
4950

5051
[Back to Top](#contents)
@@ -147,3 +148,34 @@ bazel build //go/example:half_plus_two
147148
```
148149

149150
[Back to Top](#contents)
151+
152+
## Generating Sources
153+
154+
Docker Devel Image
155+
```sh
156+
git clone git@github.com:emacski/tensorflow-serving-arm-client.git
157+
cd tensorflow-serving-arm-client
158+
# devel image includes all necessary deps to build and run project targets
159+
docker run --rm -ti \
160+
-w /tensorflow-serving-arm-client \
161+
-v $PWD:/tensorflow-serving-arm-client \
162+
emacski/tensorflow-serving-arm-client:latest-devel /bin/bash
163+
```
164+
165+
Examples
166+
```sh
167+
# py
168+
bazel build //py:grpc_codegen
169+
bazel build //py:protobuf_codegen
170+
# cc
171+
bazel build //cc:grpc_codegen
172+
bazel build //cc:protobuf_codegen
173+
# go
174+
bazel build //go:grpc_codegen
175+
bazel build //go:protobuf_codegen
176+
bazel build //go:tensorflow_core_protobuf_codegen
177+
bazel build //go:tensorflow_example_protobuf_codegen
178+
bazel build //go:tensorflow_framework_protobuf_codegen
179+
```
180+
181+
[Back to Top](#contents)

cc/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ load(
2121
package(default_visibility = ["//visibility:public"])
2222

2323
cc_grpc_library(
24-
name = "tensorflow_serving",
24+
name = "grpc",
2525
srcs = ["//proto/tensorflow_serving/apis:protos_grpc_all"],
26-
deps = [":tensorflow_serving_protobuf"],
26+
deps = [":protobuf"],
2727
)
2828

2929
cc_proto_library(
30-
name = "tensorflow_serving_protobuf",
30+
name = "protobuf",
3131
deps = ["//proto:protos_all"],
3232
)

cc/example/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ cc_library(
2323
name = "half_plus_two_library",
2424
srcs = ["half_plus_two.cc"],
2525
deps = [
26-
"@com_github_emacski_tensorflowservingarmclient//cc:tensorflow_serving",
26+
"@com_github_emacski_tensorflowservingarmclient//cc:grpc",
2727
],
2828
)

go/BUILD

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
1514
load(
1615
"@com_github_emacski_bazeltools//protobuf:go.bzl",
1716
"go_grpc_library",
@@ -21,39 +20,39 @@ load(
2120
package(default_visibility = ["//visibility:public"])
2221

2322
go_grpc_library(
24-
name = "tensorflow_serving",
23+
name = "grpc",
2524
srcs = ["//proto/tensorflow_serving/apis:protos_grpc_all"],
2625
importpath = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow_serving",
27-
deps = [":tensorflow_serving_protobuf"],
26+
deps = [":protobuf"],
2827
)
2928

3029
go_proto_library(
31-
name = "tensorflow_serving_protobuf",
30+
name = "protobuf",
3231
importpath = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow_serving",
3332
proto = ["//proto/tensorflow_serving:protos_all"],
3433
deps = [
35-
":tensorflow_core",
36-
":tensorflow_example",
37-
":tensorflow_framework",
34+
":tensorflow_core_protobuf",
35+
":tensorflow_example_protobuf",
36+
":tensorflow_framework_protobuf",
3837
],
3938
)
4039

4140
go_proto_library(
42-
name = "tensorflow_core",
41+
name = "tensorflow_core_protobuf",
4342
importpath = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow/core",
4443
proto = ["//proto/tensorflow/core:protos_all"],
45-
deps = [":tensorflow_framework"],
44+
deps = [":tensorflow_framework_protobuf"],
4645
)
4746

4847
go_proto_library(
49-
name = "tensorflow_framework",
50-
importpath = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow/core/framework",
51-
proto = ["//proto/tensorflow/core/framework:protos_all"],
48+
name = "tensorflow_example_protobuf",
49+
importpath = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow/core/example",
50+
proto = ["//proto/tensorflow/core/example:protos_all"],
51+
deps = [":tensorflow_framework_protobuf"],
5252
)
5353

5454
go_proto_library(
55-
name = "tensorflow_example",
56-
importpath = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow/core/example",
57-
proto = ["//proto/tensorflow/core/example:protos_all"],
58-
deps = [":tensorflow_framework"],
55+
name = "tensorflow_framework_protobuf",
56+
importpath = "github.com/emacski/tensorflow-serving-arm-client/go/tensorflow/core/framework",
57+
proto = ["//proto/tensorflow/core/framework:protos_all"],
5958
)

go/example/BUILD

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ go_binary(
2222
go_library(
2323
name = "half_plus_two_library",
2424
srcs = ["half_plus_two.go"],
25-
importpath = "github.com/emacski/tensorflow-serving-arm-client/go/examples",
25+
importpath = "github.com/emacski/tensorflow-serving-arm-client/go/example",
2626
deps = [
2727
"@org_golang_google_grpc//:go_default_library",
28-
"@com_github_emacski_tensorflowservingarmclient//go:tensorflow_serving",
29-
"@com_github_emacski_tensorflowservingarmclient//go:tensorflow_framework",
28+
"@com_github_emacski_tensorflowservingarmclient//go:grpc",
29+
"@com_github_emacski_tensorflowservingarmclient//go:tensorflow_framework_protobuf",
30+
# only required for output formatting
31+
"@org_golang_google_protobuf//encoding/prototext:go_default_library",
3032
],
3133
)

go/example/half_plus_two.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/emacski/tensorflow-serving-arm-client/go/tensorflow/core/framework"
2424
"github.com/emacski/tensorflow-serving-arm-client/go/tensorflow_serving"
2525
"google.golang.org/grpc"
26+
"google.golang.org/protobuf/encoding/prototext"
2627
)
2728

2829
func main() {
@@ -67,6 +68,6 @@ func main() {
6768
os.Exit(1)
6869
}
6970

70-
fmt.Printf("%s", res.String())
71+
fmt.Printf("%s", prototext.Format(res))
7172
os.Exit(0)
7273
}

py/BUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ load(
2121
package(default_visibility = ["//visibility:public"])
2222

2323
py_grpc_library(
24-
name = "tensorflow_serving",
24+
name = "grpc",
2525
srcs = ["//proto/tensorflow_serving/apis:protos_grpc_all"],
2626
srcs_version = "PY3",
27-
deps = [":tensorflow_serving_protobuf"],
27+
deps = [":protobuf"],
2828
)
2929

3030
py_proto_library(
31-
name = "tensorflow_serving_protobuf",
31+
name = "protobuf",
3232
srcs_version = "PY3",
3333
deps = ["//proto:protos_all"],
3434
)

py/example/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ py_binary(
1919
main = "half_plus_two.py",
2020
srcs = ["half_plus_two.py"],
2121
deps = [
22-
"@com_github_emacski_tensorflowservingarmclient//py:tensorflow_serving",
22+
"@com_github_emacski_tensorflowservingarmclient//py:grpc",
2323
],
2424
)

py/wheel/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ genrule(
3030
"bazel_build.py",
3131
],
3232
data = [":stable-status.txt"],
33-
deps = ["//py:tensorflow_serving"],
33+
deps = ["@com_github_emacski_tensorflowservingarmclient//py:grpc"],
3434
) for whl_type in ("pure", "platform")]
3535

3636
sh_binary(

0 commit comments

Comments
 (0)