Skip to content

Merge main -> google - #2623

Merged
copybara-service[bot] merged 17 commits into
iree-org:googlefrom
rsuderman:main-to-google
Jul 22, 2020
Merged

copybara-service[bot] merged 17 commits into
iree-org:googlefrom
rsuderman:main-to-google

Conversation

@rsuderman

Copy link
Copy Markdown
Collaborator

benvanik and others added 16 commits July 20, 2020 18:17
This mimics iree_flatbuffer_cc_library but using flatcc.
As the docs state this is only valid for lists initialized with
iree_vm_list_initialize.
This script simulates running Kokoro on your local machine.
Just sets up some env variables and a tmpdir.

Was useful for iree-org#2565
* Adds a script to install deps and get configure args for all installed python versions.
* Makes iree_py_test() multipy aware so that it runs a test for every version.
* With this, extensions build for all python versions via the dockcross-manylinux2014 images. (tests are failing on an unrelated lld problem).
This gets the CMake Python tests closer to running/passing on Windows. There was no regression in iree-org#2590, the old `iree_py_test.cmake` also had this issue.

`ctest -L bindings/python -V` output before:

```
353: Test command: D:\dev\projects\iree\build_tools\cmake\run_test.sh "C:/Users/Scott/scoop/shims/python3.exe" "D:/dev/projects/iree/bindings/python/pyiree/compiler/compiler_test.py"
353: Environment variables:
353:  PYTHONPATH=D:/dev/projects/iree-build-py/bindings/python:
353:  TEST_TMPDIR=bindings_python_pyiree_compiler_compiler_test_DEFAULT_test_tmpdir
353: Test timeout computed to be: 10000000
Process not started
 D:/dev/projects/iree/build_tools/cmake/run_test.sh
[unknown error]
5/5 Test iree-org#353: bindings/python/pyiree/compiler:compiler_test__DEFAULT ...***Not Run   0.00 sec
```

`ctest -L bindings/python -V` output after:

```
353: Test command: D:\dev\projects\iree\build_tools\cmake\run_test.bat "C:/Users/Scott/scoop/shims/python3.exe" "D:/dev/projects/iree/bindings/python/pyiree/compiler/compiler_test.py"
353: Environment variables:
353:  PYTHONPATH=D:/dev/projects/iree-build-py/bindings/python:
353:  TEST_TMPDIR=bindings_python_pyiree_compiler_compiler_test_DEFAULT_test_tmpdir
353: Test timeout computed to be: 10000000
353: Running test:
353: C:/Users/Scott/scoop/shims/python3.exe D:/dev/projects/iree/bindings/python/pyiree/compiler/compiler_test.py
353: Traceback (most recent call last):
353:   File "D:/dev/projects/iree/bindings/python/pyiree/compiler/compiler_test.py", line 17, in <module>
353:     from pyiree import compiler
353: ModuleNotFoundError: No module named 'pyiree'
5/5 Test iree-org#353: bindings/python/pyiree/compiler:compiler_test__DEFAULT ...***Failed    0.44 sec
```
Enables running our Docker builds as an arbitrary non-root user.

This allows usage of `docker run` without weird things like all the
files created being owned by root. It also includes updates to make
it possible to run the docker scripts locally provided the relevant
env variables are set.

This includes simplification of the Bazel installation to just use
apt. I tried to get rid of the necessity for the scary-looking
`APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE`, but I couldn't find any
alternatives. The warning message it prints doesn't even make
sense as a warning.

Reworks the update script to allow updating multiple images at
once including updating *all* images.

Also institutes some general Docker best practices like
[apt-get cache busting](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get)
and
[layer minimization](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers)
(although note on the latter that it looks like we might want to
investigate multi-stage builds).

Part of iree-org#2565

Tested:
Set build scripts to use the "latest" tag and ran all the presubmits,
including manually triggering the linux_x86-turing_cmake, which is
not enabled by default yet. See status for
[`d44f343` (iree-org#2583)](iree-org@d44f343)

iree-org#2566 makes our Docker scripts
actually run without root and use these images (including manually
triggering builds that aren't running by default yet):
- [linux_bazel_core](https://source.cloud.google.com/results/invocations/74af7fb4-1032-42ac-953a-314bf314c503)
- [linux_bazel_bindings](https://source.cloud.google.com/results/invocations/f4da9656-5940-4481-9df3-be6a41a64356)
- [linux_bazel_integrations](https://source.cloud.google.com/results/invocations/248d516a-6da6-45b4-84ef-bd7c9942ce3c)
- [linux_cmake](https://source.cloud.google.com/results/invocations/d3cc69c0-4de7-40ce-84b4-6201bb350b38)
- [android_arm64_cmake](https://source.cloud.google.com/results/invocations/1b07091e-533c-4edc-8385-f378f9084128/targets)
- [linux_x86-turing_cmake](https://source.cloud.google.com/results/invocations/d73d847b-f56d-41a3-ad49-f2b9368685bd)
This avoids everything having root permissions, created files being
owned by root, and other nastiness. This is made slightly more
complicated by Google linux machine's...creative... setup for user
management. All these scripts can be run locally provided the appropriate
env variables are set, which can be done with the script provided in
iree-org#2588.

This was the root cause for iree-org#2565.
The image we're using for the GPU builds doesn't have passwordless sudo
so we couldn't delete the Kokoro artifacts directory.

Fixes iree-org#2565
This moves the entire `kokoro` directory under `build_tools` and
restructures the directories to consistently indicate features
of the build. Some previous discussion in
iree-org#2357

The structure is
`kokoro_cluster/build_system/os/target_architecture[/iree_component]`.
Subsequent PRs will move build scripts into these directories and make
docker image and build status badges follow the same naming conventions.

The old Kokoro directory structure with configs is preserved to allow
the existing job configs to still find the build configs they point at.
Once PRs are rebased past this commit on main, I will update the job
configs to point at the new locations and then delete the old directory.
* If not linking against libraries (as on Linux for deployment), build in MODULE mode.
* Include numpy in the python deps to install.
This also fixes convolution issue, because there is a pass to extract
padding attributes from convolution op, which hits pad op issue as well.

With this approach, it is easy to add support for interior padding. A E2E
test case for interior padding is added. 

Fixes iree-org#2531
Fixes iree-org#2530
Fixes iree-org#2345
@copybara-service
copybara-service Bot merged commit 1629b84 into iree-org:google Jul 22, 2020
@rsuderman rsuderman mentioned this pull request Jul 22, 2020
rsuderman added a commit that referenced this pull request Jul 22, 2020
1629b84 Merge pull request #2623 from rsuderman:main-to-google
ad2d973 Merge branch 'google' into main-to-google
ab3ea3b Synchronize submodules
bbfe1be Integrate LLVM at llvm/llvm-project@5623da5
92b0c5b Synchronize submodules
2b6b605 Integrate LLVM at llvm/llvm-project@82dbb1b
a750dc5 Synchronize submodules
7a53ab7 Integrate LLVM at llvm/llvm-project@b258920
3d7c8aa Using llvm file utils instead of iree::file_io for LLVMAOTLinker
61a2fdd Integrate LLVM at llvm/llvm-project@8a268be
24d9dd8 Integrate TF at tensorflow/tensorflow@dca2939
6cbc838 Merge pull request #2606 from rsuderman:main-to-google
e1feab1 Synchronize submodules
5c611ea Some formatting fixes
03a3754 Integrate LLVM at llvm/llvm-project@61dd481
9a14928 Integrate LLVM at llvm/llvm-project@becaa68
ccb96b9 Integrate LLVM at llvm/llvm-project@30371df
64115d6 Synchronize submodules
0b5edca Integrate LLVM at llvm/llvm-project@fc24d1e Updates LLVM usage to match [..
bc52b62 Synchronize submodules
d51e2eb Integrate LLVM at llvm/llvm-project@78f543e
d9fb171 Synchronize submodules
b2b13eb Integrate LLVM at llvm/llvm-project@f959585
@GMNGeoffrey

Copy link
Copy Markdown
Member

So for some reason in this PR, the executable bit for some files was not set, even though it was set in the PRs it came from. It looks like your merge commit unset them, @rsuderman. Any idea how that happened?

ad2d973 (#2623)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants