From a021aa028894c41d5306e2e71ad9e8e9fb7237b2 Mon Sep 17 00:00:00 2001 From: Erik Maciejewski Date: Fri, 19 Mar 2021 12:43:18 -0700 Subject: [PATCH] client updates and additions update bazel and build dependencies rename python client bazel package and update wheel scripts add c++ and go client library support minor readme updates --- .bazelrc | 8 +-- .github/workflows/build.yml | 8 +-- .github/workflows/release.yml | 8 +-- BUILD | 11 ---- README.md | 59 +++++++++++------ WORKSPACE | 91 +++++++++++++++----------- cc/BUILD | 32 +++++++++ go/BUILD | 59 +++++++++++++++++ {python => py}/BUILD | 16 ++--- {python => py}/wheel/BUILD | 2 +- {python => py}/wheel/bazel_build.py | 0 {python => py}/wheel/build_whl.sh | 16 ++--- {python => py}/wheel/setup_platform.py | 0 {python => py}/wheel/setup_pure.py | 0 third_party/grpc/BUILD | 0 third_party/grpc/cython_library.patch | 11 ++++ tools/docker/Dockerfile | 9 +-- 17 files changed, 222 insertions(+), 108 deletions(-) create mode 100644 cc/BUILD create mode 100644 go/BUILD rename {python => py}/BUILD (83%) rename {python => py}/wheel/BUILD (97%) rename {python => py}/wheel/bazel_build.py (100%) rename {python => py}/wheel/build_whl.sh (66%) rename {python => py}/wheel/setup_platform.py (100%) rename {python => py}/wheel/setup_pure.py (100%) create mode 100644 third_party/grpc/BUILD create mode 100644 third_party/grpc/cython_library.patch diff --git a/.bazelrc b/.bazelrc index 086e974..f3d7652 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,7 +1,5 @@ # upstream tensorflow/serving version -build --embed_label=2.2.0 - -common --experimental_repo_remote_exec +build --embed_label=2.3.0 build --verbose_failures # enable proper toolchain resolution for cc rules @@ -14,10 +12,10 @@ build --copt=-O3 build:release --copt=-w build:release --output_filter=DONT_MATCH_ANYTHING -# grpc build options -build --define=grpc_no_ares=true +# protobuf / grpc build options build --define=use_fast_cpp_protos=true build --define=allow_oversize_protos=true +build --define=grpc_no_ares=true # build with shared gnu libstdc++ instead of static libc++ build:gnulibcpp --@com_github_emacski_bazeltools//toolchain/cpp/clang:use_libcpp="libstdc++" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2586de8..547bd73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,8 +32,8 @@ jobs: - name: Bazel Build run: | 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 - tools/ci/bazel.sh run --spawn_strategy=local --config=release //python/wheel:build_pure - tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_amd64 //python/wheel:build_platform - tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_arm64 //python/wheel:build_platform - tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_arm //python/wheel:build_platform + tools/ci/bazel.sh run //py/wheel:build_pure --config=release + tools/ci/bazel.sh run //py/wheel:build_platform --config=linux_amd64 --config=release + tools/ci/bazel.sh run //py/wheel:build_platform --config=linux_arm64 --config=release + tools/ci/bazel.sh run //py/wheel:build_platform --config=linux_arm --config=release sudo chown -R $(whoami):$(whoami) ${HOME}/.cache/bazel diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f01ded1..2e24aef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,10 +32,10 @@ jobs: - name: Bazel Build run: | 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 - tools/ci/bazel.sh run --spawn_strategy=local --config=release //python/wheel:build_pure - tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_amd64 //python/wheel:build_platform - tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_arm64 //python/wheel:build_platform - tools/ci/bazel.sh run --spawn_strategy=local --config=release --config=linux_arm //python/wheel:build_platform + tools/ci/bazel.sh run //py/wheel:build_pure --config=release + tools/ci/bazel.sh run //py/wheel:build_platform --config=linux_amd64 --config=release + tools/ci/bazel.sh run //py/wheel:build_platform --config=linux_arm64 --config=release + tools/ci/bazel.sh run //py/wheel:build_platform --config=linux_arm --config=release sudo chown -R $(whoami):$(whoami) ${HOME}/.cache/bazel - name: Create Release id: create_release diff --git a/BUILD b/BUILD index 964fa7f..0f69542 100644 --- a/BUILD +++ b/BUILD @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_python//python:defs.bzl", "py_library") - package(default_visibility = ["//visibility:public"]) platform( @@ -39,12 +37,3 @@ platform( "@platforms//cpu:arm", ], ) - -# python client - -py_library( - name = "python", - imports = ["python"], - srcs_version = "PY3", - deps = ["//python:grpc"], -) diff --git a/README.md b/README.md index 883e269..5933133 100644 --- a/README.md +++ b/README.md @@ -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 git@github.com: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 ``` diff --git a/WORKSPACE b/WORKSPACE index c76d8f4..2477d25 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -18,13 +18,15 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "com_github_emacski_bazeltools", - sha256 = "6f3c9b725b2222ea16e6eabfb8f2a9ec267567f0c05c9c4f36cbd641cd02ff39", - strip_prefix = "bazel-tools-74b14ec277cbc79c328142c561d1edd69e05d3b4", - urls = ["https://github.com/emacski/bazel-tools/archive/74b14ec277cbc79c328142c561d1edd69e05d3b4.tar.gz"], + sha256 = "ac040d00f7f00c9947d61c7b8970a877d907c92e088966c24a0eaeeba5551b19", + strip_prefix = "bazel-tools-250e4a98908fa0c6631ebccdeae930a60fd4c0d5", + urls = ["https://github.com/emacski/bazel-tools/archive/250e4a98908fa0c6631ebccdeae930a60fd4c0d5.tar.gz"], ) register_toolchains("@com_github_emacski_bazeltools//toolchain/cpp/clang:all") +# python client deps + http_archive( name = "rules_python", sha256 = "afe33d4a8091452cb785108f237c7f3dcef56345952aad124954a96d89c4aab6", @@ -40,63 +42,72 @@ load("@rules_python//python:pip.bzl", "pip_repositories") pip_repositories() -# tensorflow 2.2.0 -# https://github.com/tensorflow/tensorflow +# go client deps + http_archive( - name = "org_tensorflow", - sha256 = "b3d7829fac84e3a26264d84057367730b6b85b495a0fce15929568f4b55dc144", - strip_prefix = "tensorflow-2b96f3662bd776e277f86997659e61046b56c315", + name = "io_bazel_rules_go", + sha256 = "7904dbecbaffd068651916dce77ff3437679f9d20e1a7956bff43826e7645fcc", urls = [ - "https://github.com/tensorflow/tensorflow/archive/2b96f3662bd776e277f86997659e61046b56c315.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.25.1/rules_go-v0.25.1.tar.gz", + "https://github.com/bazelbuild/rules_go/releases/download/v0.25.1/rules_go-v0.25.1.tar.gz", ], ) -# see tensorflow/serving/WORKSPACE and tensorflow/tensorflow/WORKSPACE http_archive( - name = "io_bazel_rules_closure", - sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9", - strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149", + name = "bazel_gazelle", + sha256 = "222e49f034ca7a1d1231422cdb67066b885819885c356673cb1f72f748a3c9d4", urls = [ - "https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz", + "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz", ], ) -# see tensorflow/serving/WORKSPACE and tensorflow/tensorflow/WORKSPACE -http_archive( - name = "bazel_skylib", - sha256 = "1dde365491125a3db70731e25658dfdd3bc5dbdfd11b840b3e987ecf043c7ca0", - urls = [ - "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/bazel-skylib/releases/download/0.9.0/bazel_skylib-0.9.0.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/0.9.0/bazel_skylib-0.9.0.tar.gz", - ], +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") + +go_rules_dependencies() + +go_register_toolchains(version = "1.16") + +load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") + +gazelle_dependencies() + +go_repository( + name = "org_golang_google_grpc", + commit = "f74f0337644653eba7923908a4d7f79a4f3a267b", # 1.36.0 + importpath = "google.golang.org/grpc", ) -# see tensorflow/serving/WORKSPACE -http_archive( - name = "rules_pkg", - sha256 = "f8bf72e76a15d045f786ef0eba92e073a50bbdbd807d237a43a759d36b1b1e2c", - strip_prefix = "rules_pkg-0.2.5/pkg", - urls = ["https://github.com/bazelbuild/rules_pkg/archive/0.2.5.tar.gz"], +go_repository( + name = "org_golang_x_net", + importpath = "golang.org/x/net", + sum = "h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=", + version = "v0.0.0-20190311183353-d8887717615a", ) -# https://github.com/tensorflow/serving -http_archive( - name = "tf_serving", - sha256 = "946c1a58d677686e6b986634b51f4bc19486230c7fc2ab669c8492b0662ad4cc", - strip_prefix = "serving-d22fc192c7ad7b48d9a81346224aff637b8988f1", - urls = [ - "https://github.com/tensorflow/serving/archive/d22fc192c7ad7b48d9a81346224aff637b8988f1.tar.gz", - ], +go_repository( + name = "org_golang_x_text", + importpath = "golang.org/x/text", + sum = "h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=", + version = "v0.3.0", ) -load("@tf_serving//tensorflow_serving:workspace.bzl", "tf_serving_workspace") +# protobuf / grpc deps -tf_serving_workspace() +http_archive( + name = "com_github_grpc_grpc", + patches = [ + "@com_github_emacski_tensorflowservingarmclient//third_party/grpc:cython_library.patch", + ], + sha256 = "bb6de0544adddd54662ba1c314eff974e84c955c39204a4a2b733ccd990354b7", + strip_prefix = "grpc-1.36.3", + urls = ["https://github.com/grpc/grpc/archive/v1.36.3.tar.gz"], +) load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") grpc_deps() -load("@upb//bazel:repository_defs.bzl", "bazel_version_repository") +load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps") -bazel_version_repository(name = "bazel_version") +grpc_extra_deps() diff --git a/cc/BUILD b/cc/BUILD new file mode 100644 index 0000000..80fed3d --- /dev/null +++ b/cc/BUILD @@ -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"], +) diff --git a/go/BUILD b/go/BUILD new file mode 100644 index 0000000..4525751 --- /dev/null +++ b/go/BUILD @@ -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"], +) diff --git a/python/BUILD b/py/BUILD similarity index 83% rename from python/BUILD rename to py/BUILD index bbfea8e..2a4a53a 100644 --- a/python/BUILD +++ b/py/BUILD @@ -13,22 +13,22 @@ # limitations under the License. load( - "@com_github_emacski_bazeltools//protobuf:python_rules.bzl", + "@com_github_emacski_bazeltools//protobuf:py.bzl", "py_grpc_library", "py_proto_library", ) package(default_visibility = ["//visibility:public"]) -py_proto_library( - name = "protobuf", +py_grpc_library( + name = "tensorflow_serving", + srcs = ["//proto/tensorflow_serving/apis:protos_grpc_all"], srcs_version = "PY3", - deps = ["//proto:protos_all"], + deps = [":tensorflow_serving_protobuf"], ) -py_grpc_library( - name = "grpc", - srcs = ["//proto/tensorflow_serving/apis:protos_grpc_all"], +py_proto_library( + name = "tensorflow_serving_protobuf", srcs_version = "PY3", - deps = [":protobuf"], + deps = ["//proto:protos_all"], ) diff --git a/python/wheel/BUILD b/py/wheel/BUILD similarity index 97% rename from python/wheel/BUILD rename to py/wheel/BUILD index 6c57318..0e8fda6 100644 --- a/python/wheel/BUILD +++ b/py/wheel/BUILD @@ -30,7 +30,7 @@ genrule( "bazel_build.py", ], data = [":stable-status.txt"], - deps = ["//:python"], + deps = ["//py:tensorflow_serving"], ) for whl_type in ("pure", "platform")] sh_binary( diff --git a/python/wheel/bazel_build.py b/py/wheel/bazel_build.py similarity index 100% rename from python/wheel/bazel_build.py rename to py/wheel/bazel_build.py diff --git a/python/wheel/build_whl.sh b/py/wheel/build_whl.sh similarity index 66% rename from python/wheel/build_whl.sh rename to py/wheel/build_whl.sh index fb3f9d1..9fe3846 100755 --- a/python/wheel/build_whl.sh +++ b/py/wheel/build_whl.sh @@ -18,13 +18,13 @@ PLAT="$1" OUT_DIR="$2" TMP_DIR="$(mktemp -d)" RUNFILES=${BASH_SOURCE[0]}.runfiles -RUNFILES=${RUNFILES}/com_github_emacski_tensorflowservingarmclient +SOURCEFILES=${RUNFILES}/com_github_emacski_tensorflowservingarmclient -cp python/wheel/setup_*.py ${TMP_DIR}/setup.py -cp python/wheel/bazel_build.py ${TMP_DIR}/bazel_build.py -cp python/wheel/stable-status.txt ${TMP_DIR}/stable-status.txt -cp -r ${RUNFILES}/python/tensorflow_serving ${TMP_DIR} -cp -r ${RUNFILES}/python/tensorflow ${TMP_DIR} +cp py/wheel/setup_*.py ${TMP_DIR}/setup.py +cp py/wheel/bazel_build.py ${TMP_DIR}/bazel_build.py +cp py/wheel/stable-status.txt ${TMP_DIR}/stable-status.txt +cp -r ${SOURCEFILES}/py/tensorflow_serving ${TMP_DIR} +cp -r ${SOURCEFILES}/py/tensorflow ${TMP_DIR} if [ $PLAT = "pure" ]; then pushd ${TMP_DIR} @@ -32,8 +32,8 @@ if [ $PLAT = "pure" ]; then popd else # include grpcio and protobuf - cp -r ${RUNFILES}/external/com_google_protobuf/python/google ${TMP_DIR} - cp -r ${RUNFILES}/external/com_github_grpc_grpc/src/python/grpcio/grpc ${TMP_DIR} + cp -r ${SOURCEFILES}/external/com_google_protobuf/python/google ${TMP_DIR} + cp -r ${SOURCEFILES}/external/com_github_grpc_grpc/src/python/grpcio/grpc ${TMP_DIR} pushd ${TMP_DIR} python3 setup.py bdist_wheel --python-tag=cp37 --plat-name=${PLAT} >/dev/null popd diff --git a/python/wheel/setup_platform.py b/py/wheel/setup_platform.py similarity index 100% rename from python/wheel/setup_platform.py rename to py/wheel/setup_platform.py diff --git a/python/wheel/setup_pure.py b/py/wheel/setup_pure.py similarity index 100% rename from python/wheel/setup_pure.py rename to py/wheel/setup_pure.py diff --git a/third_party/grpc/BUILD b/third_party/grpc/BUILD new file mode 100644 index 0000000..e69de29 diff --git a/third_party/grpc/cython_library.patch b/third_party/grpc/cython_library.patch new file mode 100644 index 0000000..d238356 --- /dev/null +++ b/third_party/grpc/cython_library.patch @@ -0,0 +1,11 @@ +--- bazel/cython_library.bzl 2021-03-16 02:51:29.077261654 +0000 ++++ bazel/cython_library_new.bzl 2021-03-16 02:52:29.670069481 +0000 +@@ -47,7 +47,7 @@ + # Optionally use PYTHON_BIN_PATH on Linux platforms so that python 3 + # works. Windows has issues with cython_binary so skip PYTHON_BIN_PATH. + cmd = +- "PYTHONHASHSEED=0 $(location @cython//:cython_binary) --cplus $(SRCS) --output-file $(OUTS)", ++ "PYTHONHASHSEED=0 $(location @cython//:cython_binary) -X language_level=2 --cplus $(SRCS) --output-file $(OUTS)", + tools = ["@cython//:cython_binary"] + pxd_srcs, + ) + diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index da5c888..f3ea2fc 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -48,13 +48,6 @@ RUN dpkg --add-architecture arm64 && \ mkdir /usr/arm-linux-gnueabihf/include/arm-linux-gnueabihf && \ mv /usr/include/aarch64-linux-gnu/python3.7m /usr/aarch64-linux-gnu/include/aarch64-linux-gnu/ && \ mv /usr/include/arm-linux-gnueabihf/python3.7m /usr/arm-linux-gnueabihf/include/arm-linux-gnueabihf/ -# install docker -ENV INSTALL_DOCKER_VERSION=19.03.12 -RUN curl -L https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce-cli_${INSTALL_DOCKER_VERSION}~3-0~ubuntu-bionic_amd64.deb \ - -o docker-ce-cli_${INSTALL_DOCKER_VERSION}~3-0~ubuntu-bionic_amd64.deb && \ - dpkg -i docker-ce-cli_${INSTALL_DOCKER_VERSION}~3-0~ubuntu-bionic_amd64.deb && \ - rm -f docker-ce-cli_${INSTALL_DOCKER_VERSION}~3-0~ubuntu-bionic_amd64.deb -ENV DOCKER_CLI_EXPERIMENTAL=enabled # install bazel RUN apt-get update && \ apt-get install -y \ @@ -62,7 +55,7 @@ RUN apt-get update && \ make patch zlib1g-dev git && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -ENV INSTALL_BAZEL_VERSION=3.4.1 +ENV INSTALL_BAZEL_VERSION=4.0.0 RUN curl -L https://github.com/bazelbuild/bazel/releases/download/${INSTALL_BAZEL_VERSION}/bazel-${INSTALL_BAZEL_VERSION}-installer-linux-x86_64.sh \ -o bazel-${INSTALL_BAZEL_VERSION}-installer-linux-x86_64.sh && \ chmod +x bazel-${INSTALL_BAZEL_VERSION}-installer-linux-x86_64.sh && \