From 9da738b3af1a0132f66ddc52727ec6c5146b6180 Mon Sep 17 00:00:00 2001 From: Advait Jain Date: Thu, 10 Sep 2020 11:20:46 -0700 Subject: [PATCH 1/5] Add bazel to the test_x86 script. --- tensorflow/lite/micro/tools/ci_build/test_x86.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tensorflow/lite/micro/tools/ci_build/test_x86.sh b/tensorflow/lite/micro/tools/ci_build/test_x86.sh index 32e13316a30..8285fd78522 100755 --- a/tensorflow/lite/micro/tools/ci_build/test_x86.sh +++ b/tensorflow/lite/micro/tools/ci_build/test_x86.sh @@ -43,3 +43,7 @@ readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile test # Also repeat for the debug build. readable_run make -f tensorflow/lite/micro/tools/make/Makefile clean readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile BUILD_TYPE=debug test + +# Most of TFLM external contributors only use make so also building with bazel +# so that bazel errors can be reproduced externally as well. +readable_run bazel build tensorflow/lite/micro:all From afa4abac447199909b1fb614a3024fd382c3d95c Mon Sep 17 00:00:00 2001 From: Advait Jain Date: Thu, 10 Sep 2020 11:34:06 -0700 Subject: [PATCH 2/5] update comment. --- tensorflow/lite/micro/tools/ci_build/test_x86.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tensorflow/lite/micro/tools/ci_build/test_x86.sh b/tensorflow/lite/micro/tools/ci_build/test_x86.sh index 8285fd78522..6c6964037b5 100755 --- a/tensorflow/lite/micro/tools/ci_build/test_x86.sh +++ b/tensorflow/lite/micro/tools/ci_build/test_x86.sh @@ -44,6 +44,7 @@ readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile test readable_run make -f tensorflow/lite/micro/tools/make/Makefile clean readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile BUILD_TYPE=debug test -# Most of TFLM external contributors only use make so also building with bazel -# so that bazel errors can be reproduced externally as well. +# Most of TFLM external contributors only use make. So, we are building +# with bazel as part of this script to make it easier for externally +# contributors to fix these errors prior to creating a pull request. readable_run bazel build tensorflow/lite/micro:all From 10b37b6d95e6a6881592989b93db7b192901644c Mon Sep 17 00:00:00 2001 From: Advait Jain Date: Thu, 10 Sep 2020 11:37:03 -0700 Subject: [PATCH 3/5] another nit update to the text. --- tensorflow/lite/micro/tools/ci_build/test_x86.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/lite/micro/tools/ci_build/test_x86.sh b/tensorflow/lite/micro/tools/ci_build/test_x86.sh index 6c6964037b5..055597da3f6 100755 --- a/tensorflow/lite/micro/tools/ci_build/test_x86.sh +++ b/tensorflow/lite/micro/tools/ci_build/test_x86.sh @@ -44,7 +44,7 @@ readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile test readable_run make -f tensorflow/lite/micro/tools/make/Makefile clean readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile BUILD_TYPE=debug test -# Most of TFLM external contributors only use make. So, we are building -# with bazel as part of this script to make it easier for externally +# 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. readable_run bazel build tensorflow/lite/micro:all From affdfe7f0e36441210cdf29ed7caae2f3d587ff7 Mon Sep 17 00:00:00 2001 From: Advait Jain Date: Thu, 10 Sep 2020 14:25:37 -0700 Subject: [PATCH 4/5] Only run bazel locally (not as part of presubmits). This is because the bazel build is already part of the presubmits and the goal here is to enable developers to catch errors sooner locally. Also, the fact that the micro test_all.sh script runs within a docker container means that initiating a bazel build on the CI system would mean downloading bazel to the docker image. --- tensorflow/lite/micro/tools/ci_build/test_all.sh | 2 +- tensorflow/lite/micro/tools/ci_build/test_x86.sh | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tensorflow/lite/micro/tools/ci_build/test_all.sh b/tensorflow/lite/micro/tools/ci_build/test_all.sh index e0cb0b325ef..945d2e63f91 100755 --- a/tensorflow/lite/micro/tools/ci_build/test_all.sh +++ b/tensorflow/lite/micro/tools/ci_build/test_all.sh @@ -35,7 +35,7 @@ make -f tensorflow/lite/micro/tools/make/Makefile \ echo "Starting to run micro tests at `date`" echo "Running x86 tests at `date`" -tensorflow/lite/micro/tools/ci_build/test_x86.sh +tensorflow/lite/micro/tools/ci_build/test_x86.sh PRESUBMIT echo "Running bluepill tests at `date`" tensorflow/lite/micro/tools/ci_build/test_bluepill.sh diff --git a/tensorflow/lite/micro/tools/ci_build/test_x86.sh b/tensorflow/lite/micro/tools/ci_build/test_x86.sh index 055597da3f6..cd8dff376c7 100755 --- a/tensorflow/lite/micro/tools/ci_build/test_x86.sh +++ b/tensorflow/lite/micro/tools/ci_build/test_x86.sh @@ -44,7 +44,15 @@ readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile test readable_run make -f tensorflow/lite/micro/tools/make/Makefile clean readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile BUILD_TYPE=debug test -# 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. -readable_run bazel build tensorflow/lite/micro:all + + +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 From 952867945ba10dda115643df33d15426cd0d5c85 Mon Sep 17 00:00:00 2001 From: Advait Jain Date: Thu, 10 Sep 2020 14:35:15 -0700 Subject: [PATCH 5/5] fix formatting --- tensorflow/lite/micro/tools/ci_build/test_x86.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/tensorflow/lite/micro/tools/ci_build/test_x86.sh b/tensorflow/lite/micro/tools/ci_build/test_x86.sh index cd8dff376c7..84d6eef3bfd 100755 --- a/tensorflow/lite/micro/tools/ci_build/test_x86.sh +++ b/tensorflow/lite/micro/tools/ci_build/test_x86.sh @@ -44,8 +44,6 @@ readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile test readable_run make -f tensorflow/lite/micro/tools/make/Makefile clean readable_run make -s -j8 -f tensorflow/lite/micro/tools/make/Makefile BUILD_TYPE=debug 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