Update the TFLM CI docs based on the new way to build a docker image.

This commit is contained in:
Advait Jain 2021-01-15 13:51:21 -08:00
parent 102e1f9855
commit 83cc821a93

View File

@ -1,3 +1,5 @@
<!-- mdformat off(b/169948621#comment2) -->
<!-- <!--
Semi-automated TOC generation with instructions from Semi-automated TOC generation with instructions from
https://github.com/ekalinin/github-markdown-toc#auto-insert-and-update-toc https://github.com/ekalinin/github-markdown-toc#auto-insert-and-update-toc
@ -314,24 +316,35 @@ that can be expanded and improved as necessary.
[![TfLite Micro Build](docs/images/tflm_continuous_integration_1.png)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/tflite-micro.html) [![TfLite Micro Build](docs/images/tflm_continuous_integration_1.png)](https://storage.googleapis.com/tensorflow-kokoro-build-badges/tflite-micro.html)
* Most of the tests that are run as part of the CI are with the * Tests that are run as part of the CI are with the
[micro/tools/ci_build/test_all.sh](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/tools/ci_build/test_all.sh) [micro/tools/ci_build/test_all.sh](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/micro/tools/ci_build/test_all.sh)
script. script when run with the `GITHUB_PRESUBMIT` command line parameter:
```
* There are a few additional tests that use bazel that are not tensorflow/lite/micro/tools/ci_build/test_all.sh GITHUB_PRESUBMIT
captured by the `test_all.sh` script. ```
* If an error is not reproducible on your development machine, you can * If an error is not reproducible on your development machine, you can
recreate the docker container that is used on the CI servers with the recreate the docker container that is used on the CI servers.
following commands (run from the root of the tensorflow github repo):
* First, create a build a TFLM docker image with:
``` ```
mkdir /tmp/tflm-docker tensorflow/tools/ci_build/ci_build.sh micro bash
docker build -f tensorflow/tools/ci_build/Dockerfile.micro -t tflm /tmp/tflm-docker ```
docker run -v `pwd`:/tensorflow -it tflm bash The second parameter to the ci_build.sh script is not important. It can
be any command.
* Next, mount the tensorflow repo on your machine to the docker container.
Please be careful (or make a separate clone of tensorflow) since any
changes docker container will also be reflected in the directory in the
host machine.
```
docker run -v `pwd`:/tensorflow -it tf_ci.micro bash
``` ```
The `docker run` command is mounting the tensorflow repository on your * Within the docker container, you can now run the TFLM test script, or
machine to the docker containter. As a result, any changes made within the any other command that you would like to test. For example, the following
docker container will also be reflected in the directory in the host commands will run all of the TFLM checks:
machine. ```
# cd tensorflow
# tensorflow/lite/micro/tools/ci_build/test_all.sh GITHUB_PRESUBMIT
```