-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update bazel and build dependencies rename python client bazel package and update wheel scripts add c++ and go client library support minor readme updates
- Loading branch information
Showing
17 changed files
with
222 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,31 +5,52 @@ Tensorflow Serving ARM Client | |
**EXPERIMENTAL (anything can change)** | ||
|
||
A project for cross building [tensorflow/serving](https://github.com/tensorflow/serving) | ||
grpc api clients targeting popular arm architectures from an x86_64 host. | ||
Additionally, this includes an experimental multi-arch standalone python3 client | ||
(it doesn't depend on the core tensorflow python package). | ||
standalone grpc api clients targeting popular arm architectures from an x86_64 host. | ||
Currently, client libraries can be cross-built for c++, python and go targeting | ||
`linux_amd64`, `linux_arm64` and `linux_arm`. | ||
|
||
## Python3 Client | ||
## Project Artifacts | ||
### Python3 Client Library (Wheels) | ||
|
||
### Wheels | ||
Currently, platform specific wheels are published for CPython 3.7 on | ||
`linux_amd64`, `linux_arm64` and `linux_arm`. These wheels are full self-contained | ||
grpc client libs and include the `tensorflow_serving`, (protobuf only) `tensorflow`, | ||
`grpcio` and `protobuf` py packages with corresponding extensions where applicable | ||
(no compiling or dev-tools required on the install host). | ||
|
||
A pure python3 wheel is maintained that depends on `grpcio` and `protobuf` | ||
python packages. | ||
Additionally, a pure python3 wheel is published that includes the `tensorflow_serving`, | ||
(protobuf only) `tensorflow` packages and depends on external `grpcio` and | ||
`protobuf` python packages. | ||
|
||
Currently, platform specific wheels are maintained for CPython 3.7 on | ||
`linux_amd64`, `linux_arm64` and `linux_arm`. These wheels are full | ||
self-contained grpc client libs and include the `tensorflow_serving`, | ||
`tensorflow`, `grpcio` and `protobuf`, python packages with corresponding | ||
compiled extensions where applicable. | ||
|
||
**Install with `pip`** | ||
**Install Wheels with `pip`** | ||
```sh | ||
# on linux_amd64 python 3.7 | ||
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.2.0/tensorflow_serving_arm_client-2.2.0-cp37-none-manylinux2014_x86_64.whl | ||
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.3.0/tensorflow_serving_arm_client-2.3.0-cp37-none-manylinux2014_x86_64.whl | ||
# on linux_arm64 python 3.7 | ||
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.2.0/tensorflow_serving_arm_client-2.2.0-cp37-none-manylinux2014_aarch64.whl | ||
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.3.0/tensorflow_serving_arm_client-2.3.0-cp37-none-manylinux2014_aarch64.whl | ||
# on linux_arm python 3.7 | ||
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.2.0/tensorflow_serving_arm_client-2.2.0-cp37-none-manylinux2014_armv7l.whl | ||
# pure python 3 (depends on grpcio and protobuf) | ||
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.2.0/tensorflow_serving_arm_client-2.2.0-py3-none-any.whl | ||
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.3.0/tensorflow_serving_arm_client-2.3.0-cp37-none-manylinux2014_armv7l.whl | ||
# pure python 3 (will also install grpcio and protobuf pypi packages) | ||
pip install https://github.com/emacski/tensorflow-serving-arm-client/releases/download/2.3.0/tensorflow_serving_arm_client-2.3.0-py3-none-any.whl | ||
``` | ||
|
||
**Building Wheels From Source** | ||
```sh | ||
git clone [email protected]:emacski/tensorflow-serving-arm-client.git | ||
cd tensorflow-serving-arm-client | ||
|
||
# Build Environment | ||
docker run --rm -ti \ | ||
-w /tensorflow-serving-arm-client \ | ||
-v $PWD:/tensorflow-serving-arm-client \ | ||
emacski/tensorflow-serving:latest-devel /bin/bash | ||
``` | ||
By default, wheel artifacts will be output to the workspace root | ||
```sh | ||
# pure python | ||
bazel run //py/wheel:build_pure | ||
# with extension | ||
bazel run //py/wheel:build_platform --config=linux_amd64 | ||
bazel run //py/wheel:build_platform --config=linux_arm64 | ||
bazel run //py/wheel:build_platform --config=linux_arm | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2021 Erik Maciejewski | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
load( | ||
"@com_github_emacski_bazeltools//protobuf:cc.bzl", | ||
"cc_grpc_library", | ||
"cc_proto_library", | ||
) | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_grpc_library( | ||
name = "tensorflow_serving", | ||
srcs = ["//proto/tensorflow_serving/apis:protos_grpc_all"], | ||
deps = [":tensorflow_serving_protobuf"], | ||
) | ||
|
||
cc_proto_library( | ||
name = "tensorflow_serving_protobuf", | ||
deps = ["//proto:protos_all"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Copyright 2021 Erik Maciejewski | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
load( | ||
"@com_github_emacski_bazeltools//protobuf:go.bzl", | ||
"go_grpc_library", | ||
"go_proto_library", | ||
) | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
go_grpc_library( | ||
name = "tensorflow_serving", | ||
srcs = ["//proto/tensorflow_serving/apis:protos_grpc_all"], | ||
importpath = "github.com/tensorflow-serving-arm-client/go/tensorflow_serving", | ||
deps = [":tensorflow_serving_protobuf"], | ||
) | ||
|
||
go_proto_library( | ||
name = "tensorflow_serving_protobuf", | ||
importpath = "github.com/tensorflow-serving-arm-client/go/tensorflow_serving", | ||
proto = ["//proto/tensorflow_serving:protos_all"], | ||
deps = [ | ||
":tensorflow_core_proto", | ||
":tensorflow_example_proto", | ||
":tensorflow_framework_proto", | ||
], | ||
) | ||
|
||
go_proto_library( | ||
name = "tensorflow_core_proto", | ||
importpath = "github.com/tensorflow-serving-arm-client/go/tensorflow/core", | ||
proto = ["//proto/tensorflow/core:protos_all"], | ||
deps = [":tensorflow_framework_proto"], | ||
) | ||
|
||
go_proto_library( | ||
name = "tensorflow_framework_proto", | ||
importpath = "github.com/tensorflow-serving-arm-client/go/tensorflow/core/framework", | ||
proto = ["//proto/tensorflow/core/framework:protos_all"], | ||
) | ||
|
||
go_proto_library( | ||
name = "tensorflow_example_proto", | ||
importpath = "github.com/tensorflow-serving-arm-client/go/tensorflow/core/example", | ||
proto = ["//proto/tensorflow/core/example:protos_all"], | ||
deps = [":tensorflow_framework_proto"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.