@@ -9,14 +9,55 @@ standalone grpc api clients targeting popular arm architectures from an x86_64 h
9
9
Currently, client libraries can be cross-built for c++, python and go targeting
10
10
` linux_amd64 ` , ` linux_arm64 ` and ` linux_arm ` .
11
11
12
+ ## Contents
13
+ * [ Cross-Building] ( #cross-building )
14
+ * [ Project Artifacts] ( #project-artifacts )
15
+ * [ Client Examples] ( #client-examples )
16
+
17
+ ## Cross-Building
18
+
19
+ Using the project's development docker image, all platform specific targets in this
20
+ project can be cross-built, from an x86_64 host, for the following platforms by
21
+ specifying the corresponding config group when building.
22
+
23
+ | Config Group | CLI Option |
24
+ | --------------| ----------|
25
+ | ` linux_amd64 ` | ` --config=linux_amd64 ` |
26
+ | ` linux_arm64 ` | ` --config=linux_arm64 ` |
27
+ | ` linux_arm ` | ` --config=linux_arm ` |
28
+
29
+ Docker Devel Image
30
+ ``` sh
31
+ git clone git@github.com:emacski/tensorflow-serving-arm-client.git
32
+ cd tensorflow-serving-arm-client
33
+ # devel image includes all necessary deps to build and run project targets
34
+ docker run --rm -ti \
35
+ -w /tensorflow-serving-arm-client \
36
+ -v $PWD :/tensorflow-serving-arm-client \
37
+ emacski/tensorflow-serving-arm-client:latest-devel /bin/bash
38
+ ```
39
+
40
+ Examples
41
+ ``` sh
42
+ # build platform wheel for 32-bit arm
43
+ 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
46
+ # build go client library for arm64
47
+ bazel build //go:tensorflow_serving --config=linux_arm64
48
+ ```
49
+
50
+ [ Back to Top] ( #contents )
51
+
12
52
## Project Artifacts
13
53
### Python3 Client Library (Wheels)
14
54
15
- Currently, platform specific wheels are published for CPython 3.7 on
16
- ` linux_amd64 ` , ` linux_arm64 ` and ` linux_arm ` . These wheels are full self-contained
17
- grpc client libs and include the ` tensorflow_serving ` , (protobuf only) ` tensorflow ` ,
18
- ` grpcio ` and ` protobuf ` py packages with corresponding extensions where applicable
19
- (no compiling or dev-tools required on the install host).
55
+ Platform specific wheels are published for the current version of python 3
56
+ on debian 10 (CPython 3.7) targeting ` linux_amd64 ` , ` linux_arm64 ` and ` linux_arm ` .
57
+ These wheels are full self-contained grpc client libs and include the
58
+ ` tensorflow_serving ` , (protobuf only) ` tensorflow ` , ` grpcio ` and ` protobuf ` py
59
+ packages with corresponding extensions where applicable (no compiling or dev-tools
60
+ required on the install host).
20
61
21
62
Additionally, a pure python3 wheel is published that includes the ` tensorflow_serving ` ,
22
63
(protobuf only) ` tensorflow ` packages and depends on external ` grpcio ` and
@@ -30,7 +71,7 @@ pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/do
30
71
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.1/tensorflow_serving_arm_client-2.4.1-cp37-none-manylinux2014_aarch64.whl
31
72
# on linux_arm python 3.7
32
73
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.1/tensorflow_serving_arm_client-2.4.1-cp37-none-manylinux2014_armv7l.whl
33
- # pure python 3 (will also install grpcio and protobuf pypi packages)
74
+ # pure python 3 (will require grpcio and protobuf pypi packages)
34
75
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.4.1/tensorflow_serving_arm_client-2.4.1-py3-none-any.whl
35
76
```
36
77
@@ -43,14 +84,66 @@ cd tensorflow-serving-arm-client
43
84
docker run --rm -ti \
44
85
-w /tensorflow-serving-arm-client \
45
86
-v $PWD :/tensorflow-serving-arm-client \
46
- emacski/tensorflow-serving:latest-devel /bin/bash
87
+ emacski/tensorflow-serving-arm-client :latest-devel /bin/bash
47
88
```
48
89
By default, wheel artifacts will be output to the workspace root
49
90
``` sh
50
91
# pure python
51
92
bazel run //py/wheel:build_pure
52
- # with extension
93
+ # with platform specific deps
53
94
bazel run //py/wheel:build_platform --config=linux_amd64
54
95
bazel run //py/wheel:build_platform --config=linux_arm64
55
96
bazel run //py/wheel:build_platform --config=linux_arm
56
97
```
98
+
99
+ [ Back to Top] ( #contents )
100
+
101
+ ## Client Examples
102
+
103
+ The client examples are designed to query the same model in the official tensorflow serving example
104
+ [ TensorFlow Serving with Docker] ( https://www.tensorflow.org/tfx/serving/docker ) using the predict API.
105
+
106
+ ### Model Server Example
107
+ Reference instructions for setting up [ TensorFlow Serving with Docker] ( https://www.tensorflow.org/tfx/serving/docker ) ,
108
+ substituting the ` docker run ` command for the one below:
109
+ ``` sh
110
+ # this version includes the addition of mapping the grpc port (8500) to the host
111
+ docker run -t --rm -p 8501:8501 -p 8500:8500 \
112
+ -v " $TESTDATA /saved_model_half_plus_two_cpu:/models/half_plus_two" \
113
+ -e MODEL_NAME=half_plus_two \
114
+ tensorflow/serving &
115
+ ```
116
+
117
+ ### gRPC Client Examples
118
+ ``` sh
119
+ git clone git@github.com:emacski/tensorflow-serving-arm-client.git
120
+ cd tensorflow-serving-arm-client
121
+ # devel env image includes all deps to build and run examples
122
+ docker run --rm -ti \
123
+ -w /tensorflow-serving-arm-client \
124
+ -v $PWD :/tensorflow-serving-arm-client \
125
+ emacski/tensorflow-serving-arm-client:latest-devel /bin/bash
126
+
127
+ # client examples accept exactly one command-line argument in the form of:
128
+ # <model_server_host>:<model_server_port>
129
+
130
+ # python
131
+ bazel run //py/example:half_plus_two -- host.docker.internal:8500
132
+ # or
133
+ bazel build //py/example:half_plus_two
134
+ ./bazel-bin/py/example/half_plus_two host.docker.internal:8500
135
+
136
+ # cc
137
+ bazel run //cc/example:half_plus_two -- host.docker.internal:8500
138
+ # or
139
+ bazel build //cc/example:half_plus_two
140
+ ./bazel-bin/cc/example/half_plus_two host.docker.internal:8500
141
+
142
+ # go
143
+ bazel run //go/example:half_plus_two -- host.docker.internal:8500
144
+ # or
145
+ bazel build //go/example:half_plus_two
146
+ ./bazel-bin/go/example/half_plus_two host.docker.internal:8500
147
+ ```
148
+
149
+ [ Back to Top] ( #contents )
0 commit comments