From 4491d6ee3a13956f3e455f9506459c82de9ed268 Mon Sep 17 00:00:00 2001 From: Advait Jain Date: Thu, 14 Jan 2021 10:52:08 -0800 Subject: [PATCH] Move the bazel builds to the TFLM docker image. Fixes #46415 PiperOrigin-RevId: 351832447 Change-Id: I287697d82f05d0a8375fdb3dd8dd2e86c83f084d --- .../lite/micro/tools/ci_build/test_x86.sh | 18 ++++++++---------- tensorflow/tools/ci_build/Dockerfile.micro | 8 +++++++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/tensorflow/lite/micro/tools/ci_build/test_x86.sh b/tensorflow/lite/micro/tools/ci_build/test_x86.sh index 05d79802dcd..b2d20086891 100755 --- a/tensorflow/lite/micro/tools/ci_build/test_x86.sh +++ b/tensorflow/lite/micro/tools/ci_build/test_x86.sh @@ -52,13 +52,11 @@ readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile build TAGS readable_run make -f tensorflow/lite/micro/tools/make/Makefile clean readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile test -if [[ ${1} != "PRESUBMIT" ]]; then - # Most of TFLM external contributors only use make. We are building a subset of - # targets with bazel as part of this script to make it easier for external - # contributors to fix these errors prior to creating a pull request. - # - # We only run the bazel command when this script is run locally (i.e. not via - # test_all.sh) to avoid duplicate work on the CI system and also avoid - # installing bazel on the TFLM Docker image. - readable_run bazel build tensorflow/lite/micro:all -fi +#if [[ ${1} == "PRESUBMIT" ]]; then +# # Most of TFLM external contributors only use make and we add the bazel builds +# # as part of the CI checks. The errors, if any, will be visible to external +# # contributors and can be reproduced by installing bazel on their local +# # machines, or using the TFLM Docker container. +# CC=clang bazel test tensorflow/lite/micro/... --test_tag_filters=-no_oss --build_tag_filters=-no_oss +# CC=clang bazel test tensorflow/lite/micro/... --test_tag_filters=-no_oss --build_tag_filters=-no_oss --copt=-DTF_LITE_STATIC_MEMORY +#fi diff --git a/tensorflow/tools/ci_build/Dockerfile.micro b/tensorflow/tools/ci_build/Dockerfile.micro index 8c99b36d696..9a2e2a4a2b8 100644 --- a/tensorflow/tools/ci_build/Dockerfile.micro +++ b/tensorflow/tools/ci_build/Dockerfile.micro @@ -10,9 +10,15 @@ RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - RUN apt-get update -RUN apt-get install -y zip xxd +RUN apt-get install -y zip xxd sudo RUN apt-get install -y clang clang-format RUN pip install six # Install Renode test dependencies RUN pip install pyyaml requests psutil robotframework==3.1 + +# Install bazel and buildifier so that the bazel presubmit checks can be run +# from the micro docker container and are consistent with the rest of the CI. +COPY install/*.sh /install/ +RUN /install/install_bazel.sh +RUN /install/install_buildifier.sh