Skip to content

Commit 6f2a883

Browse files
committed
consolidate bazel platform targets
update main.cc with latest from tensorflow/serving minor readme updates minor updates to .bazelrc to suppress noisy build warning output
1 parent d5aed7c commit 6f2a883

File tree

6 files changed

+64
-64
lines changed

6 files changed

+64
-64
lines changed

Diff for: .bazelrc

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ build --copt=-O3
1414
build --cxxopt=-std=c++14
1515
build --host_cxxopt=-std=c++14
1616

17+
# disable diagnostics warning outputs for release builds
18+
build:release --copt=-w
19+
build:release --output_filter=DONT_MATCH_ANYTHING
20+
1721
# build with shared gnu libstdc++ instead of static libc++
1822
build:gnulibcpp --//tools/cpp/clang:use_libcpp="libstdc++"
1923
build:gnulibcpp --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0
@@ -26,7 +30,7 @@ import %workspace%/third_party/tensorflow/.bazelrc
2630

2731
# linux_amd64 base config group. use this config when cross-building
2832
# for custom amd64 targets (i.e. ones not defined here)
29-
build:linux_amd64 --platforms=//platforms:linux_amd64
33+
build:linux_amd64 --platforms=//:linux_amd64
3034

3135
build:linux_amd64_avx_sse4.2 --config=linux_amd64
3236
build:linux_amd64_avx_sse4.2 --copt=-mavx
@@ -48,7 +52,7 @@ build:common_arm --copt=-fomit-frame-pointer
4852
# for custom 64 bit arm targets (i.e. ones not defined here)
4953
build:linux_arm64 --config=common_arm
5054
build:linux_arm64 --cpu=aarch64
51-
build:linux_arm64 --platforms=//platforms:linux_arm64
55+
build:linux_arm64 --platforms=//:linux_arm64
5256
build:linux_arm64 --copt=-march=armv8-a
5357

5458
build:linux_arm64_armv8-a --config=linux_arm64
@@ -64,7 +68,7 @@ build:linux_arm64_armv8.2-a --define=tag_suffix=linux_arm64_armv8.2-a
6468
# custom 32 bit arm targets (i.e. ones not defined here)
6569
build:linux_arm --config=common_arm
6670
build:linux_arm --cpu=arm
67-
build:linux_arm --platforms=//platforms:linux_arm
71+
build:linux_arm --platforms=//:linux_arm
6872
build:linux_arm --copt=-march=armv7-a
6973

7074
build:linux_arm_armv7-a_neon_vfpv4 --config=linux_arm

Diff for: BUILD

+41-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,41 @@
1-
# only serves to make the workspace root a bazel package as rules_docker, or one
2-
# of it's dependencies, needs to reference WORKSPACE by label (//:WORKSPACE)
1+
# Copyright 2020 Erik Maciejewski
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# this build file serves to make the workspace root a bazel package so that
16+
# WORKSPACE can be referenceby label (//:WORKSPACE) regardless if any build
17+
# targets are defined here
18+
19+
platform(
20+
name = "linux_amd64",
21+
constraint_values = [
22+
"@platforms//os:linux",
23+
"@platforms//cpu:x86_64",
24+
],
25+
)
26+
27+
platform(
28+
name = "linux_arm64",
29+
constraint_values = [
30+
"@platforms//os:linux",
31+
"@platforms//cpu:aarch64",
32+
],
33+
)
34+
35+
platform(
36+
name = "linux_arm",
37+
constraint_values = [
38+
"@platforms//os:linux",
39+
"@platforms//cpu:arm",
40+
],
41+
)

Diff for: README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ On many consumer / developer 64-bit and 32-bit arm platforms you can simply:
3737
```sh
3838
docker pull emacski/tensorflow-serving:latest
3939
# or
40-
docker pull emacski/tensorflow-serving:2.2.0
40+
docker pull emacski/tensorflow-serving:2.3.0
4141
```
4242

4343
Refer to [TensorFlow Serving with Docker](https://www.tensorflow.org/tfx/serving/docker)
@@ -58,7 +58,7 @@ for configuration and setting up a model for serving.
5858
Example
5959
```bash
6060
# on beaglebone black
61-
docker pull emacski/tensorflow-serving:2.2.0-linux_arm_armv7-a_neon_vfpv3
61+
docker pull emacski/tensorflow-serving:2.3.0-linux_arm_armv7-a_neon_vfpv3
6262
```
6363

6464
### Aliases
@@ -77,7 +77,7 @@ docker pull emacski/tensorflow-serving:2.2.0-linux_arm_armv7-a_neon_vfpv3
7777
Examples
7878
```bash
7979
# on Raspberry PI 3 B+
80-
docker pull emacski/tensorflow-serving:2.2.0-linux_arm64
80+
docker pull emacski/tensorflow-serving:2.3.0-linux_arm64
8181
# or
8282
docker pull emacski/tensorflow-serving:latest-linux_arm64
8383
```
@@ -113,9 +113,9 @@ docker pull emacski/tensorflow-serving:latest
113113
Example
114114
```sh
115115
# on Raspberry PI 3 B+
116-
docker pull emacski/tensorflow-serving:2.2.0
117-
# the actual image used is emacski/tensorflow-serving:2.2.0-linux_arm64
118-
# itself actually being emacski/tensorflow-serving:2.2.0-linux_arm64_armv8-a
116+
docker pull emacski/tensorflow-serving:2.3.0
117+
# the actual image used is emacski/tensorflow-serving:2.3.0-linux_arm64
118+
# itself actually being emacski/tensorflow-serving:2.3.0-linux_arm64_armv8-a
119119
```
120120

121121
### Debug Images
@@ -130,9 +130,9 @@ suffix (if one is required) in the image tag.
130130

131131
```sh
132132
# multi-arch
133-
docker pull emacski/tensorflow-serving:2.2.0-debug
133+
docker pull emacski/tensorflow-serving:2.3.0-debug
134134
# specific image
135-
docker pull emacski/tensorflow-serving:2.2.0-debug-linux_arm64_armv8-a
135+
docker pull emacski/tensorflow-serving:2.3.0-debug-linux_arm64_armv8-a
136136
# specific alias
137137
docker pull emacski/tensorflow-serving:latest-debug-linux_arm64
138138
```

Diff for: platforms/BUILD

-45
This file was deleted.

Diff for: tensorflow_model_server/main.cc

+7-5
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,13 @@ int main(int argc, char** argv) {
192192
&options.remove_unused_fields_from_bundle_metagraph,
193193
"Removes unused fields from MetaGraphDef proto message to save "
194194
"memory."),
195-
tensorflow::Flag("use_tflite_model", &options.use_tflite_model,
196-
"EXPERIMENTAL; CAN BE REMOVED ANYTIME! Load and use "
197-
"TensorFlow Lite model from `model.tflite` file in "
198-
"SavedModel directory instead of the TensorFlow model "
199-
"from `saved_model.pb` file.")};
195+
tensorflow::Flag("prefer_tflite_model", &options.prefer_tflite_model,
196+
"EXPERIMENTAL; CAN BE REMOVED ANYTIME! "
197+
"Prefer TensorFlow Lite model from `model.tflite` file "
198+
"in SavedModel directory, instead of the TensorFlow "
199+
"model from `saved_model.pb` file. "
200+
"If no TensorFlow Lite model found, fallback to "
201+
"TensorFlow model.")};
200202

201203
const auto& usage = tensorflow::Flags::Usage(argv[0], flag_list);
202204
if (!tensorflow::Flags::Parse(&argc, argv, flag_list)) {

Diff for: third_party/tensorflow/hwloc.BUILD.bazel.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- if_false = _INCLUDE_PRIVATE_HWLOC_AUTOIGEN_CONFIG_H_LINUX_SUBS,
2121
- ),
2222
+ substitutions = select({
23-
+ "@//platforms:is_linux_arm": _INCLUDE_PRIVATE_HWLOC_AUTOIGEN_CONFIG_H_LINUX_ARMV7_SUBS,
23+
+ "@//tensorflow_model_server:linux_arm": _INCLUDE_PRIVATE_HWLOC_AUTOIGEN_CONFIG_H_LINUX_ARMV7_SUBS,
2424
+ "//conditions:default": _INCLUDE_PRIVATE_HWLOC_AUTOIGEN_CONFIG_H_LINUX_SUBS,
2525
+ }),
2626
)

0 commit comments

Comments
 (0)