Debian Codegraph @

infra/bots/README.md

raw
1 Skia Infrastructure
2 ===================
3
4 This directory contains infrastructure elements.
5
6
7 Tasks and Jobs
8 --------------
9
10 Files in this directory define a DAG of tasks which run at every Skia commit. A
11 task is a small, self-contained unit which runs via Swarming on a machine in the
12 pool. Tasks may be chained together, eg. one task to compile test binaries and
13 another to actually run them.
14
15 Jobs are collections of related tasks which help define sub-sections of the DAG,
16 for example, to be used as try jobs. Each job is defined as an entry point into
17 the DAG.
18
19 The tasks.json file in this directory is the list of tasks and jobs for
20 the repo. Note that tasks.json is NEVER edited by hand but generated via
21 gen_task.go and the input files enumerated below. The
22 [Task Scheduler](https://skia.googlesource.com/buildbot/+/main/task_scheduler/README.md)
23 reads the tasks.json file at each commit to determine which jobs to run. For
24 convenience, gen_tasks.go is provided to generate tasks.json and also to test it
25 for correct syntax and detecting cycles and orphaned tasks. Always edit
26 gen_tasks.go or one of the following input JSON files, rather than tasks.json
27 itself:
28
29 * cfg.json - Basic configuration information for gen_tasks.go.
30 * jobs.json - The list of all jobs to run. Edit this to add or remove
31 bots.
32
33 Whenever gen_tasks.go, any of the above JSON files, or assets are changed, you
34 need to run gen_tasks.go to regenerate tasks.json:
35
36 $ go run infra/bots/gen_tasks.go
37
38 Or:
39
40 $ make -C infra/bots train
41
42 There is also a test mode which performs consistency checks and verifies that
43 tasks.json is unchanged:
44
45 $ go run infra/bots/gen_tasks.go --test
46
47 Or:
48
49 $ make -C infra/bots test
50
51
52 Upon adding a new job, you may want to test whether it runs successfully
53 before landing the change. However, the resultant Gerrit CL that gets created
54 from the code change that adds the new job will not automatically run it. It
55 also will not yet be available in Gerrit's UI in the list of available tryjobs.
56
57 In order to trigger it to run before landing the change, you can use the
58 SK CLI tool. See the [SK CLI Tool docs](https://chromium.googlesource.com/skia/+/HEAD/site/docs/dev/tools/sk.md) for more information.
59
60 If you haven't yet fetched it from your skia directory, you can do so by
61 running the following command.
62
63 $ ./bin/fetch-sk
64
65 To kick off jobs, you must be logged in to luci-auth.
66
67 $ luci-auth login
68
69 You can then use `sk try` to initiate jobs with this change:
70
71 $ ./bin/sk try [name of job]
72
73 For example, if you wanted to run
74 "Test-Mac14-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All", that command would be
75
76 $ ./bin/sk try Test-Mac14-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All
77
78 This change's Gerrit review page UI should now display the job's status.
79
80 Recipes
81 -------
82
83 Recipes are the framework used by Skia's infrastructure to perform work inside
84 of Swarming tasks. The main elements are:
85
86 * recipes.py - Used for running and testing recipes.
87 * recipes - These are the entry points for each type of task, eg. compiling
88 or running tests.
89 * recipe_modules - Shared modules which are used by recipes.
90 * .recipe_deps - Recipes and modules may depend on modules from other repos.
91 The recipes.py script automatically syncs those dependencies in this
92 directory.
93
94
95 Isolate Files
96 -------------
97
98 These files determine which parts of the repository are transferred to the bot
99 when a Swarming task is triggered. The
100 [Isolate tool](https://github.com/luci/luci-py/tree/main/appengine/isolate/doc)
101 hashes each file and will upload any new/changed files. Bots maintain a cache so
102 that they can efficiently download only the files they don't have.
103
104
105 Assets
106 ------
107
108 Artifacts used by the infrastructure are versioned here, along with scripts for
109 recreating/uploading/downloading them. See the README in that directory for more
110 information. Any time an asset used by the bots changes, you need to re-run
111 gen_tasks.go.
112
113
114 Tools
115 -----
116
117 Assorted other infrastructure-related tools, eg. isolate and CIPD binaries.
118
119
120 CT
121 --
122
123 Helpers for running Skia tasks in Cluster Telemetry.
124