Ben Pastene | 91a69470 | 2019-10-23 17:04:23 | [diff] [blame] | 1 | # Using LED |
| 2 | |
| 3 | LED is an infrastructure tool used to manually trigger builds on any builder |
| 4 | running on LUCI. It's designed to help debug build failures or experiment with |
| 5 | new builder changes. This doc describes how to use it with Chromium's builders. |
| 6 | |
| 7 | [TOC] |
| 8 | |
mark a. foltz | 89670afb | 2023-08-20 18:14:07 | [diff] [blame] | 9 | *** note |
| 10 | **Note for Googlers:** Ensure that `depot_tools` appears in front of your system paths |
| 11 | in your `$PATH`, so that you are invoking the `led` in `depot_tools`. |
| 12 | *** |
| 13 | |
Ben Pastene | 91a69470 | 2019-10-23 17:04:23 | [diff] [blame] | 14 | ## When to use it |
| 15 | |
| 16 | Use cases include, but are not limited to, the following: |
| 17 | * **Testing a recipe change**: Much of the code in the following repos |
| 18 | define what and how a builder runs (also known as the builder's "recipe"): |
| 19 | [recipes-py][1], [depot_tools][2], and [tools/build][3]. Changes to these |
| 20 | repos can first be tested out on any builder prior to submitting via LED. |
| 21 | * **Debugging a waterfall failure**: If a waterfall builder (that is, *not* a |
| 22 | trybot) is exhibitting frequent or strange failures that can't be reproduced |
| 23 | locally, LED can be used to retrigger any given build for debugging. |
| 24 | |
| 25 | ## When *not* to use it |
| 26 | |
| 27 | Certain types of changes to a trybot (this includes all builders on the CQ) |
| 28 | can be sufficiently tested without the use of LED. This includes changes to a |
| 29 | trybot's: |
| 30 | * **GN args**: A trybot's build args are configured via |
| 31 | [mb_config.pyl][4]. |
| 32 | * **tests**: The list of tests a trybot runs are set via the \*.pyl files in |
| 33 | [//testing/buildbot/][5]. (Some trybots may not be present in |
| 34 | those files. Instead, change the waterfall builders they mirror. This mapping is |
| 35 | configured in tools/build's [trybots.py][6].) |
| 36 | |
| 37 | Simply edit the needed files in a local chromium/src checkout, upload the change |
| 38 | to Gerrit, then select the affected trybot(s) via the "select tryjobs" menu. |
| 39 | |
| 40 | ## How to use it |
| 41 | |
| 42 | Provided that a local depot_tools checkout is present on $PATH, LED can be |
| 43 | used by simply invoking `led` on the command line. A common use-case for LED is |
| 44 | to modify the build steps of any given builder. The process for doing this is |
| 45 | outlined below. (However, LED can be used for many other purposes. See the full |
| 46 | list of features via `led help`.) |
| 47 | |
| 48 | 1. Select a builder whose builds you'd like to reproduce. (Example: |
Julia Hansbrough | 4b441181 | 2023-02-23 19:18:50 | [diff] [blame] | 49 | [ToTLinux][7]) |
Ben Pastene | 91a69470 | 2019-10-23 17:04:23 | [diff] [blame] | 50 | 2. Record its full builder name, along with its bucket. (The bucket name is |
| 51 | present in the URL of the builder page, and is very likely "chromium/ci".) |
| 52 | 3. Checkout the [tools/build][3] repo (if not already present) and navigate to |
| 53 | the [chromium][8] and/or [chromium_tests][9] recipe modules. These, along with |
| 54 | the other recipe_modules located in tools/build, are how the majority of a |
| 55 | Chromium builder's recipe is defined. |
| 56 | 4. Make the desired recipe change. (Consider running local recipe unittests |
| 57 | before proceeding by running `recipes.py test train` via the [recipes.py][10] |
| 58 | script. |
| 59 | 5. Launch a build with the given recipe change. This can be done with a single |
| 60 | chained LED invocation, eg: |
Julia Hansbrough | 4b441181 | 2023-02-23 19:18:50 | [diff] [blame] | 61 | `led get-builder chromium/ci:ToTLinux | led edit-recipe-bundle | led launch` |
Ben Pastene | 91a69470 | 2019-10-23 17:04:23 | [diff] [blame] | 62 | 6. The LED invocation above will print out a link to the build that was |
| 63 | launched. Repeat steps 4 & 5 until the triggered builds behave as expected |
| 64 | with the new recipe change. |
| 65 | |
| 66 | ## Questions? Feedback? |
| 67 | |
| 68 | If you're in need of further assistance, if you're not sure about |
| 69 | one or more steps, or if you found this documentation lacking, please |
| 70 | reach out to infra-dev@chromium.org or [file a bug][11]! |
| 71 | |
| 72 | [1]: https://chromium.googlesource.com/infra/luci/recipes-py/ |
| 73 | [2]: https://chromium.googlesource.com/chromium/tools/depot_tools/ |
| 74 | [3]: https://chromium.googlesource.com/chromium/tools/build/ |
| 75 | [4]: /tools/mb/mb_config.pyl |
| 76 | [5]: /testing/buildbot/ |
Ben Pastene | 47834a32 | 2021-03-19 18:13:25 | [diff] [blame] | 77 | [6]: https://chromium.googlesource.com/chromium/tools/build/+/HEAD/recipes/recipe_modules/chromium_tests/trybots.py |
Julia Hansbrough | 4b441181 | 2023-02-23 19:18:50 | [diff] [blame] | 78 | [7]: https://ci.chromium.org/p/chromium/builders/ci/ToTLinux |
Ben Pastene | 47834a32 | 2021-03-19 18:13:25 | [diff] [blame] | 79 | [8]: https://chromium.googlesource.com/chromium/tools/build/+/HEAD/recipes/recipe_modules/chromium/api.py |
| 80 | [9]: https://chromium.googlesource.com/chromium/tools/build/+/HEAD/recipes/recipe_modules/chromium_tests/api.py |
| 81 | [10]: https://chromium.googlesource.com/chromium/tools/build/+/HEAD/recipes/recipes.py |
Ben Pastene | 91a69470 | 2019-10-23 17:04:23 | [diff] [blame] | 82 | [11]: https://g.co/bugatrooper |