Commit graph

27 commits

Author SHA1 Message Date
Ramy Medhat
bc06176350 Set download_tmp_dir explicitly to be a directory under the output directory.
This directory is where outputs are download first before being moved
to their final destination to ensure atomicity.

Change-Id: Ic224bf21c07566de00d292d02f1c0f7f727dcb08
2023-10-10 22:33:46 +00:00
Cole Faust
0428f71b30 Remove "dumping rbe metrics" message
The issue where RBE was taking a long time has been fixed, so this
message isn't that important anymore, and it was overriding the last
ephemeral status message that soong output.

Test: Presubmits
Change-Id: I019f351a3307176ec7b4786d4387fde9061ba08b
2023-05-03 18:21:05 -07:00
Ramy Medhat
c8f6cc24f9 Enable reclient cache directory.
The cache directory stores files that should persist between builds.
Currently it will contain reproxy.creds, which caches the authentication
mechanism and token used to make subsequent builds faster.

Test: m nothing build takes 7s
Change-Id: Iaaa20b92630405918e5e91e09eca6c798b8fc872
2023-04-03 09:56:10 -04:00
Cole Faust
64955b32bf Add status messages for RBE and product config
RBE adds a lot of time to m nothing builds,
so add status messages for it so that it's not misattributed
to some other part of the build.

Bug: 269644490
Test: m nothing
Change-Id: Ifff11bfc88f43b559526f3e3d3022c1388e42156
2023-02-16 21:06:19 +00:00
Paul Crowley
e7e9e09128 Merge "Fix go link given when stubby is absent." 2022-12-15 18:42:59 +00:00
Paul Crowley
4965dc0cc3 Fix go link given when stubby is absent.
The link here named a heading that has been changed, and so no longer works.
Instead use a dedicated go link for this purpose.

Test: none
Change-Id: Icea2fe330d8c777593802d561afd5aa0f76c9ed0
2022-11-29 13:08:06 -08:00
andusyu
838086f57a Fail the build before calling bootstrap if LOAS credentials are missing.
The build currently waits for bootstrap to return an error before
failing. This means if the user does not have LOAS credentials, they
will need to wait for boostrap to attempt to start reproxy (~10s) and
the gcert timeout time (5-10s), which will take ~20s to return an error and fail the build.

Test: - Ran m with no gcert and build failed in 2s
      - Ran RBE_use_google_prod_creds=false RBE_use_external_auth_token=false RBE_use_application_default_credentials=true m with no gcert and reproxy started

Bug: b/251425073
Change-Id: Id7fe3d6095f083643aaf0ab8f32a34b7961c61e8
2022-10-13 23:19:50 +00:00
David Srbecky
2285cfff3d Export default RBE_platform
Export it so that we have one source of truth,
which can be used by the called tools.

Test: Use the exported value in ART build.
Change-Id: Iaa45b1780ffae11e09790e193ca2bd01e2b732a8
2022-07-12 22:59:06 +01:00
Kousik Kumar
7bc781949a Add a broad warning about missing LOAS creds
This is to generally warn Google devs about lack of LOAS creds.

Given the switch to RBE, lack of LOAS creds will start resulting in build
failures, so adding a warning message ahead of time to all builds. Will
convert this to a build failure after a week.
We need LOAS creds to be able to even fetch the CDPush config file to
determine whether to use RBE in a build a not, which is why I'm making
this a broad error message across builds.

Test: ran "m nothing" build with / without gcert and with / without
"stubby" in $PATH and confirmed appropriate error message.
Bug: b/235985591

Change-Id: I15cbaf372b0a7b79f868a06c7d5ede19b49ae687
2022-06-29 17:48:52 +00:00
Kousik Kumar
4c180ad7de Cleanup RBE logs directory
RBE logs directory is currently messy:
1. We use RBE_output_dir variable to specify where rbe_metrics.txt /
   rbe_metrics.pb file should go to.
2. We use proxy_log_dir to specify where *.rpl / *.rpi (detailed per
   action info log file) should go to.
3. We use RBE_log_dir to specify where reproxy.* / bootstrap.* log files
   should go to.

Ideally, all RBE related logs should go to one single directory. In this
CL, I'm creating a temporary log directory under out/soong/.temp/rbe/
where all RBE related log files per build would go to. The log dir
prefix is also being set to the same prefix as the socket address file.

Test: Ran a sample build with `m libc` and ensured that logs are getting
cleared across rebuilds and that `rbe_metrics.pb` file is properly
generated and being copied to the right location (i.e., from
out/soong/.temp/rbe/<rand> to out/ dir)

Bug: b/233382420
Change-Id: I46bd38d50419cb9e54e8202d24222979e47ff5ca
2022-06-08 11:50:33 -04:00
Kousik Kumar
2c8115521a Revert "Add a warning message about missing gcert at the end of the build"
This reverts commit b018b83664.

Reason for revert: Builds will start failing now since the gcert change is about to go in.

Change-Id: I81d36ce6bf4f7a9bc120b34d411f2cb4ec64e5eb
2022-05-04 20:06:00 +00:00
Kousik Kumar
b018b83664 Add a warning message about missing gcert at the end of the build
Now that we are ready to rollout gcert, adding a warning that builds
will fail if gcert doesn't exist. Doing this only for builds with
ANDROID_BUILD_ENVIRONMENT_CONFIG=googler.

Test: Ran a build without gcert and USE_RBE=true and it printed the
warning.
Bug: b/229743321

Change-Id: I616a4a534ab277873ac7e19baecb78620f07854c
2022-04-27 15:16:41 -04:00
Kousik Kumar
35faaef43e Pass along local resource fraction to reproxy
Reproxy should be respecting the -j value set by the user and not be
doing excessive local executions assuming the whole machine is available
to it. The local_resource_fraction flag is a way to ensure reproxy
consumes CPU only upto the -j value specified by the user.

Test:
1. Ran with `USE_RBE=true m -j 10 nothing` and local_resource_fraction
was set to 0.14 on a 72-core workstation.
2. Ran with `USE_RBE=true m nothing` and local_resource_fraction was set
to 1.0 on a 72-core machine.

Bug: b/207296459
Change-Id: I118bc10109f5a55df7a6c1ecd79499320055f2ed
2022-01-13 02:13:10 -05:00
Peter Collingbourne
f4d9bd2c4d Don't print RBE stats if ANDROID_QUIET_BUILD is set.
Change-Id: I3823f44fb25f90955f0b42326032fea30683b069
2021-04-20 21:03:02 -07:00
Kousik Kumar
2081052592 Print the output from RBE bootstrap shutdown
The output from bootstrap would contain the a one-line summary of RBE
download / upload stats.

Bug: b/183007125
Change-Id: I90082a8433504e40bbf92992c3c8d1d656c49429
2021-03-21 22:39:04 -04:00
Kousik Kumar
1e4d5f3e67 Add FAILED: prefix to RBE Fatal error message
This error message it currently being
logged to stdout which goes to build.log file . We want it to be logged to
build_error.log file instead so that downstream systems that need to run
based on the error message will continue to work.

Test: Tested by running `m toybox` and ensuring that FAILED: prefix is
at the beginning of the line.

Bug: b/177221705
Change-Id: Ie0c9acee2739acf149384e33804b5fca3273c24f
2021-01-26 14:34:30 -05:00
Rupert Shuttleworth
3c9f5ac787 Allow Bazel to write to an external DIST_DIR (outside of OUT_DIR).
Also get Bazel to write real files there (not symlinks) so that the DIST_DIR can be independent.

Test: Manually using e.g. DIST_DIR=/tmp/foo USE_BAZEL=1 m dist
Change-Id: I39d5219500864c9ecc85f356a028e9b5bf2607f4
2020-12-11 01:17:58 +00:00
Kousik Kumar
a0a44a84be Add warning about out-directory usage with RBE builds
Prints the following warning messsage:
WARNING:
Setting OUT_DIR to a path other than out may result in slow RBE builds.
See http://go/android_rbe_out_dir for a workaround.

Bug: b/169676232
Change-Id: Id1ad06c4dc672c24373642e0b624833eb6a0dbcf
2020-10-08 02:50:24 -04:00
Kousik Kumar
ec47864ca0 Deprecate USE_GOMA and replace with FORCE_USE_GOMA
Bug: b/163361527
Test: Ran builds with USE_GOMA / FORCE_USE_GOMA flags
Change-Id: I67b229fbf52e913b0c4f5e7932021132ddc0598f
2020-09-21 15:35:57 -04:00
Ramy Medhat
81b3a83401 Fallback to /tmp when socket address is longer than max length.
Test: Temporary change of base name to cover handled cases.
Change-Id: I1f6953752e7861ccbe7180351386ed65ab5fc259
2020-08-28 23:53:02 -04:00
Ramy Medhat
f668917c25 Add Goma deprecation PSA to soong.
Test: build with Goma
Change-Id: Ie7e146285afd40bc0a1dc17a0b898960f57a118b
2020-08-18 17:29:48 -04:00
Ramy Medhat
8c56bc2726 Add a default value for the RBE_log_dir variable.
Test: built simple target.
Change-Id: Id93dd80119037b594e5f8c370f4ac2fbc12a5144
2020-08-14 14:17:33 -04:00
Ramy Medhat
a958d35247 Do not generate a random socket address for RBE if NOSTART_RBE is set.
Test: A build with NOSTART_RBE=1
Change-Id: I5872632442c754b597901b7729eed597ee45859f
2020-08-13 22:53:42 -04:00
Ramy Medhat
0fc67eb5e9 Add reasonable defaults to RBE configuration parameters.
Test: simple one action build
Change-Id: Ic66ad2b89866a67008950035bc3b559dae4e3a3e
2020-08-12 12:30:05 -04:00
Ramy Medhat
ca1e44cb4b Generate RBE socket address randomly for each invocation of soong.
Test: started soong multiple times and saw different socket files in
out/soong/.temp

Change-Id: Ib0087dd3867bdbf584c6868196070840cff291aa
2020-07-16 12:18:37 -04:00
Patrice Arruda
62f1bf2378 Add RBE metrics dump in Soong UI.
From aosp/1329396, the RBE metrics protobuf file is part of the
metrics uploading process. The RBE metrics protobuf file is
generated by running the bootstrap shutdown command. A new function
named DumpRBEMetrics was written in order to generate the RBE metrics
protobuf file before sending to the uploading process.

Bug: b/140638454
Test: * Unit test cases
      * Ran RBE build on my local host and verified the
        metrics protobuf file is created.
      * Ran non-RBE build after RBE build and verified that
        the previous metrics protobuf file was deleted.

Change-Id: I4b8068905cb67c4b8c2d94793917b98974fed707
2020-07-09 21:06:22 +00:00
Ramy Medhat
bbf2567cc1 Add USE_RBE support to soong.
Test: Built aosp_arm-user with and without USE_RBE. USE_RBE uses
a proxy script in place of rewrapper.

Change-Id: I5bf008a940513872d70b5b215bd6209f759826ae
2019-07-17 18:46:47 +00:00