Skip to content

Commit 567d623

Browse files
committed
initial commit
0 parents  commit 567d623

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2303
-0
lines changed

.bazelrc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# upstream tensorflow/serving version
2+
build --embed_label=2.2.0
3+
4+
common --experimental_repo_remote_exec
5+
6+
build --verbose_failures
7+
# enable proper toolchain resolution for cc rules
8+
build --incompatible_enable_cc_toolchain_resolution
9+
10+
build -c opt
11+
build --copt=-O3
12+
13+
# disable diagnostics warning outputs for release builds
14+
build:release --copt=-w
15+
build:release --output_filter=DONT_MATCH_ANYTHING
16+
17+
# grpc build options
18+
build --define=grpc_no_ares=true
19+
build --define=use_fast_cpp_protos=true
20+
build --define=allow_oversize_protos=true
21+
22+
# build with shared gnu libstdc++ instead of static libc++
23+
build:gnulibcpp --@com_github_emacski_bazeltools//toolchain/cpp/clang:use_libcpp="libstdc++"
24+
build:gnulibcpp --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0
25+
26+
build:linux_amd64 --platforms=//:linux_amd64
27+
28+
build:linux_arm64 --platforms=//:linux_arm64
29+
# for boringssl
30+
build:linux_arm64 --crosstool_top=@com_github_emacski_bazeltools//toolchain/cpp/clang:toolchain
31+
build:linux_arm64 --cpu=aarch64
32+
33+
build:linux_arm --platforms=//:linux_arm
34+
# for boringssl
35+
build:linux_arm --crosstool_top=@com_github_emacski_bazeltools//toolchain/cpp/clang:toolchain
36+
build:linux_arm --cpu=arm
37+
38+
try-import %workspace%/.bazelrc.user

.github/workflows/build.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
tags-ignore:
7+
- '**'
8+
env:
9+
DOCKER_BUILDKIT: 1
10+
jobs:
11+
build:
12+
runs-on: ubuntu-18.04
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Install Dependencies
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y qemu-user qemu-user-static
19+
- name: Bazel Build Image
20+
run: |
21+
docker build \
22+
--cache-from emacski/tensorflow-serving-arm-client:latest-devel \
23+
--build-arg BUILDKIT_INLINE_CACHE=1 \
24+
-t emacski/tensorflow-serving-arm-client:latest-devel \
25+
-f tools/docker/Dockerfile .
26+
- name: Bazel Build Cache
27+
id: bazel-cache
28+
uses: actions/cache@v2
29+
with:
30+
path: ~/.cache/bazel
31+
key: bazel-cache
32+
- name: Bazel Build
33+
run: |
34+
docker run --rm -v ${HOME}/.cache/bazel:/root/.cache/bazel --entrypoint chown emacski/tensorflow-serving-arm-client:latest-devel -R root:root /root/.cache/bazel
35+
tools/ci/bazel.sh run --spawn_strategy=local --config=release //python/wheel:build_pure
36+
tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_amd64 //python/wheel:build_platform
37+
tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_arm64 //python/wheel:build_platform
38+
tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_arm //python/wheel:build_platform
39+
sudo chown -R $(whoami):$(whoami) ${HOME}/.cache/bazel

.github/workflows/release.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- '**'
6+
branches-ignore:
7+
- '**'
8+
env:
9+
DOCKER_BUILDKIT: 1
10+
jobs:
11+
build:
12+
runs-on: ubuntu-18.04
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Install Dependencies
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y qemu-user qemu-user-static
19+
- name: Bazel Build Image
20+
run: |
21+
docker build \
22+
--cache-from emacski/tensorflow-serving-arm-client:latest-devel \
23+
--build-arg BUILDKIT_INLINE_CACHE=1 \
24+
-t emacski/tensorflow-serving-arm-client:latest-devel \
25+
-f tools/docker/Dockerfile .
26+
- name: Bazel Build Cache
27+
id: bazel-cache
28+
uses: actions/cache@v2
29+
with:
30+
path: ~/.cache/bazel
31+
key: bazel-cache
32+
- name: Bazel Build
33+
run: |
34+
docker run --rm -v ${HOME}/.cache/bazel:/root/.cache/bazel --entrypoint chown emacski/tensorflow-serving-arm-client:latest-devel -R root:root /root/.cache/bazel
35+
tools/ci/bazel.sh run --spawn_strategy=local --config=release //python/wheel:build_pure
36+
tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_amd64 //python/wheel:build_platform
37+
tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_arm64 //python/wheel:build_platform
38+
tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_arm //python/wheel:build_platform
39+
sudo chown -R $(whoami):$(whoami) ${HOME}/.cache/bazel
40+
- name: Create Release
41+
id: create_release
42+
uses: actions/create-release@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
tag_name: ${{ github.ref }}
47+
release_name: ${{ github.ref }}
48+
draft: false
49+
prerelease: false
50+
- name: Get Tag Name
51+
shell: bash
52+
run: echo "##[set-output name=name;]$(echo ${GITHUB_REF##*/})"
53+
id: get_tag
54+
- name: Upload Release Asset (pure)
55+
id: upload-release-asset-pure
56+
uses: actions/upload-release-asset@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ steps.create_release.outputs.upload_url }}
61+
asset_path: ./tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-py3-none-any.whl
62+
asset_name: tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-py3-none-any.whl
63+
asset_content_type: application/octet-stream
64+
- name: Upload Release Asset (cp37_linux_amd64)
65+
id: upload-release-cp37-linux-amd64
66+
uses: actions/upload-release-asset@v1
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
upload_url: ${{ steps.create_release.outputs.upload_url }}
71+
asset_path: ./tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_x86_64.whl
72+
asset_name: tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_x86_64.whl
73+
asset_content_type: application/octet-stream
74+
- name: Upload Release Asset (cp37_linux_arm64)
75+
id: upload-release-assets-cp37-linux-arm64
76+
uses: actions/upload-release-asset@v1
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
with:
80+
upload_url: ${{ steps.create_release.outputs.upload_url }}
81+
asset_path: ./tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_aarch64.whl
82+
asset_name: tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_aarch64.whl
83+
asset_content_type: application/octet-stream
84+
- name: Upload Release Asset (cp37_linux_arm)
85+
id: upload-release-assets-cp37-linux-arm
86+
uses: actions/upload-release-asset@v1
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
with:
90+
upload_url: ${{ steps.create_release.outputs.upload_url }}
91+
asset_path: ./tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_armv7l.whl
92+
asset_name: tensorflow_serving_arm_client-${{ steps.get_tag.outputs.name }}-cp37-none-manylinux2014_armv7l.whl
93+
asset_content_type: application/octet-stream
94+
- name: Publish Build Image
95+
env:
96+
REGISTRY_USER: ${{ secrets.DockerHubUser }}
97+
REGISTRY_PASS: ${{ secrets.DockerHubToken }}
98+
run: |
99+
echo "$REGISTRY_PASS" | docker login -u "$REGISTRY_USER" --password-stdin || true
100+
docker push emacski/tensorflow-serving-arm-client:latest-devel

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
__pycache__
2+
.pytest_cache
3+
*.pyc
4+
bazel-*
5+
.bazelrc.user

BUILD

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
load("@rules_python//python:defs.bzl", "py_library")
16+
17+
package(default_visibility = ["//visibility:public"])
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+
)
42+
43+
# python client
44+
45+
py_library(
46+
name = "python",
47+
imports = ["python"],
48+
srcs_version = "PY3",
49+
deps = ["//python:grpc"],
50+
)

0 commit comments

Comments
 (0)