Kousik Kumar | 4faa2a5 | 2020-03-05 14:08:09 -0800 | [diff] [blame] | 1 | source build/envsetup.sh |
| 2 | |
| 3 | # This function prefixes the given command with appropriate variables needed |
| 4 | # for the build to be executed with RBE. |
| 5 | function use_rbe() { |
| 6 | local RBE_LOG_DIR="/tmp" |
| 7 | local RBE_BINARIES_DIR="prebuilts/remoteexecution-client/latest/" |
| 8 | local DOCKER_IMAGE="gcr.io/androidbuild-re-dockerimage/android-build-remoteexec-image@sha256:582efb38f0c229ea39952fff9e132ccbe183e14869b39888010dacf56b360d62" |
| 9 | |
| 10 | # Do not set an invocation-ID and let reproxy auto-generate one. |
| 11 | USE_RBE="true" \ |
| 12 | FLAG_server_address="unix:///tmp/reproxy_$RANDOM.sock" \ |
| 13 | FLAG_exec_root="$(gettop)" \ |
| 14 | FLAG_platform="container-image=docker://${DOCKER_IMAGE}" \ |
| 15 | RBE_use_application_default_credentials="true" \ |
| 16 | RBE_log_dir="${RBE_LOG_DIR}" \ |
| 17 | RBE_reproxy_wait_seconds="20" \ |
| 18 | RBE_output_dir="${RBE_LOG_DIR}" \ |
| 19 | RBE_log_path="text://${RBE_LOG_DIR}/reproxy_log.txt" \ |
| 20 | RBE_CXX_EXEC_STRATEGY="remote_local_fallback" \ |
| 21 | RBE_cpp_dependency_scanner_plugin="${RBE_BINARIES_DIR}/dependency_scanner_go_plugin.so" \ |
| 22 | RBE_DIR=${RBE_BINARIES_DIR} \ |
| 23 | RBE_re_proxy="${RBE_BINARIES_DIR}/reproxy" \ |
| 24 | $@ |
| 25 | } |