blob: 8485c3bd11f440c6eaa9a84dea34b86fa39437d7 [file] [log] [blame] [view]
Ben Pastene91a694702019-10-23 17:04:231# Using LED
2
3LED is an infrastructure tool used to manually trigger builds on any builder
4running on LUCI. It's designed to help debug build failures or experiment with
5new builder changes. This doc describes how to use it with Chromium's builders.
6
7[TOC]
8
mark a. foltz89670afb2023-08-20 18:14:079*** note
10**Note for Googlers:** Ensure that `depot_tools` appears in front of your system paths
11in your `$PATH`, so that you are invoking the `led` in `depot_tools`.
12***
13
Ben Pastene91a694702019-10-23 17:04:2314## When to use it
15
16Use cases include, but are not limited to, the following:
17* **Testing a recipe change**: Much of the code in the following repos
18define 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
20repos 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
22trybot) is exhibitting frequent or strange failures that can't be reproduced
23locally, LED can be used to retrigger any given build for debugging.
24
25## When *not* to use it
26
27Certain types of changes to a trybot (this includes all builders on the CQ)
28can be sufficiently tested without the use of LED. This includes changes to a
29trybot'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
34those files. Instead, change the waterfall builders they mirror. This mapping is
35configured in tools/build's [trybots.py][6].)
36
37Simply edit the needed files in a local chromium/src checkout, upload the change
38to Gerrit, then select the affected trybot(s) via the "select tryjobs" menu.
39
40## How to use it
41
42Provided that a local depot_tools checkout is present on $PATH, LED can be
43used by simply invoking `led` on the command line. A common use-case for LED is
44to modify the build steps of any given builder. The process for doing this is
45outlined below. (However, LED can be used for many other purposes. See the full
46list of features via `led help`.)
47
481. Select a builder whose builds you'd like to reproduce. (Example:
Julia Hansbrough4b4411812023-02-23 19:18:5049[ToTLinux][7])
Ben Pastene91a694702019-10-23 17:04:23502. Record its full builder name, along with its bucket. (The bucket name is
51present in the URL of the builder page, and is very likely "chromium/ci".)
523. Checkout the [tools/build][3] repo (if not already present) and navigate to
53the [chromium][8] and/or [chromium_tests][9] recipe modules. These, along with
54the other recipe_modules located in tools/build, are how the majority of a
55Chromium builder's recipe is defined.
564. Make the desired recipe change. (Consider running local recipe unittests
57before proceeding by running `recipes.py test train` via the [recipes.py][10]
58script.
595. Launch a build with the given recipe change. This can be done with a single
60chained LED invocation, eg:
Julia Hansbrough4b4411812023-02-23 19:18:5061`led get-builder chromium/ci:ToTLinux | led edit-recipe-bundle | led launch`
Ben Pastene91a694702019-10-23 17:04:23626. The LED invocation above will print out a link to the build that was
63launched. Repeat steps 4 & 5 until the triggered builds behave as expected
64with the new recipe change.
65
66## Questions? Feedback?
67
68If you're in need of further assistance, if you're not sure about
69one or more steps, or if you found this documentation lacking, please
70reach 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 Pastene47834a322021-03-19 18:13:2577[6]: https://chromium.googlesource.com/chromium/tools/build/+/HEAD/recipes/recipe_modules/chromium_tests/trybots.py
Julia Hansbrough4b4411812023-02-23 19:18:5078[7]: https://ci.chromium.org/p/chromium/builders/ci/ToTLinux
Ben Pastene47834a322021-03-19 18:13:2579[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 Pastene91a694702019-10-23 17:04:2382[11]: https://g.co/bugatrooper