1*c8dee2aaSAndroid Build Coastguard WorkerSkia Infrastructure 2*c8dee2aaSAndroid Build Coastguard Worker=================== 3*c8dee2aaSAndroid Build Coastguard Worker 4*c8dee2aaSAndroid Build Coastguard WorkerThis directory contains infrastructure elements. 5*c8dee2aaSAndroid Build Coastguard Worker 6*c8dee2aaSAndroid Build Coastguard Worker 7*c8dee2aaSAndroid Build Coastguard WorkerTasks and Jobs 8*c8dee2aaSAndroid Build Coastguard Worker-------------- 9*c8dee2aaSAndroid Build Coastguard Worker 10*c8dee2aaSAndroid Build Coastguard WorkerFiles in this directory define a DAG of tasks which run at every Skia commit. A 11*c8dee2aaSAndroid Build Coastguard Workertask is a small, self-contained unit which runs via Swarming on a machine in the 12*c8dee2aaSAndroid Build Coastguard Workerpool. Tasks may be chained together, eg. one task to compile test binaries and 13*c8dee2aaSAndroid Build Coastguard Workeranother to actually run them. 14*c8dee2aaSAndroid Build Coastguard Worker 15*c8dee2aaSAndroid Build Coastguard WorkerJobs are collections of related tasks which help define sub-sections of the DAG, 16*c8dee2aaSAndroid Build Coastguard Workerfor example, to be used as try jobs. Each job is defined as an entry point into 17*c8dee2aaSAndroid Build Coastguard Workerthe DAG. 18*c8dee2aaSAndroid Build Coastguard Worker 19*c8dee2aaSAndroid Build Coastguard WorkerThe tasks.json file in this directory is the list of tasks and jobs for 20*c8dee2aaSAndroid Build Coastguard Workerthe repo. Note that tasks.json is NEVER edited by hand but generated via 21*c8dee2aaSAndroid Build Coastguard Workergen_task.go and the input files enumerated below. The 22*c8dee2aaSAndroid Build Coastguard Worker[Task Scheduler](https://skia.googlesource.com/buildbot/+/main/task_scheduler/README.md) 23*c8dee2aaSAndroid Build Coastguard Workerreads the tasks.json file at each commit to determine which jobs to run. For 24*c8dee2aaSAndroid Build Coastguard Workerconvenience, gen_tasks.go is provided to generate tasks.json and also to test it 25*c8dee2aaSAndroid Build Coastguard Workerfor correct syntax and detecting cycles and orphaned tasks. Always edit 26*c8dee2aaSAndroid Build Coastguard Workergen_tasks.go or one of the following input JSON files, rather than tasks.json 27*c8dee2aaSAndroid Build Coastguard Workeritself: 28*c8dee2aaSAndroid Build Coastguard Worker 29*c8dee2aaSAndroid Build Coastguard Worker * cfg.json - Basic configuration information for gen_tasks.go. 30*c8dee2aaSAndroid Build Coastguard Worker * jobs.json - The list of all jobs to run. Edit this to add or remove 31*c8dee2aaSAndroid Build Coastguard Worker bots. 32*c8dee2aaSAndroid Build Coastguard Worker 33*c8dee2aaSAndroid Build Coastguard WorkerWhenever gen_tasks.go, any of the above JSON files, or assets are changed, you 34*c8dee2aaSAndroid Build Coastguard Workerneed to run gen_tasks.go to regenerate tasks.json: 35*c8dee2aaSAndroid Build Coastguard Worker 36*c8dee2aaSAndroid Build Coastguard Worker $ go run infra/bots/gen_tasks.go 37*c8dee2aaSAndroid Build Coastguard Worker 38*c8dee2aaSAndroid Build Coastguard WorkerOr: 39*c8dee2aaSAndroid Build Coastguard Worker 40*c8dee2aaSAndroid Build Coastguard Worker $ make -C infra/bots train 41*c8dee2aaSAndroid Build Coastguard Worker 42*c8dee2aaSAndroid Build Coastguard WorkerThere is also a test mode which performs consistency checks and verifies that 43*c8dee2aaSAndroid Build Coastguard Workertasks.json is unchanged: 44*c8dee2aaSAndroid Build Coastguard Worker 45*c8dee2aaSAndroid Build Coastguard Worker $ go run infra/bots/gen_tasks.go --test 46*c8dee2aaSAndroid Build Coastguard Worker 47*c8dee2aaSAndroid Build Coastguard WorkerOr: 48*c8dee2aaSAndroid Build Coastguard Worker 49*c8dee2aaSAndroid Build Coastguard Worker $ make -C infra/bots test 50*c8dee2aaSAndroid Build Coastguard Worker 51*c8dee2aaSAndroid Build Coastguard Worker 52*c8dee2aaSAndroid Build Coastguard WorkerRecipes 53*c8dee2aaSAndroid Build Coastguard Worker------- 54*c8dee2aaSAndroid Build Coastguard Worker 55*c8dee2aaSAndroid Build Coastguard WorkerRecipes are the framework used by Skia's infrastructure to perform work inside 56*c8dee2aaSAndroid Build Coastguard Workerof Swarming tasks. The main elements are: 57*c8dee2aaSAndroid Build Coastguard Worker 58*c8dee2aaSAndroid Build Coastguard Worker * recipes.py - Used for running and testing recipes. 59*c8dee2aaSAndroid Build Coastguard Worker * recipes - These are the entry points for each type of task, eg. compiling 60*c8dee2aaSAndroid Build Coastguard Worker or running tests. 61*c8dee2aaSAndroid Build Coastguard Worker * recipe_modules - Shared modules which are used by recipes. 62*c8dee2aaSAndroid Build Coastguard Worker * .recipe_deps - Recipes and modules may depend on modules from other repos. 63*c8dee2aaSAndroid Build Coastguard Worker The recipes.py script automatically syncs those dependencies in this 64*c8dee2aaSAndroid Build Coastguard Worker directory. 65*c8dee2aaSAndroid Build Coastguard Worker 66*c8dee2aaSAndroid Build Coastguard Worker 67*c8dee2aaSAndroid Build Coastguard WorkerIsolate Files 68*c8dee2aaSAndroid Build Coastguard Worker------------- 69*c8dee2aaSAndroid Build Coastguard Worker 70*c8dee2aaSAndroid Build Coastguard WorkerThese files determine which parts of the repository are transferred to the bot 71*c8dee2aaSAndroid Build Coastguard Workerwhen a Swarming task is triggered. The 72*c8dee2aaSAndroid Build Coastguard Worker[Isolate tool](https://github.com/luci/luci-py/tree/main/appengine/isolate/doc) 73*c8dee2aaSAndroid Build Coastguard Workerhashes each file and will upload any new/changed files. Bots maintain a cache so 74*c8dee2aaSAndroid Build Coastguard Workerthat they can efficiently download only the files they don't have. 75*c8dee2aaSAndroid Build Coastguard Worker 76*c8dee2aaSAndroid Build Coastguard Worker 77*c8dee2aaSAndroid Build Coastguard WorkerAssets 78*c8dee2aaSAndroid Build Coastguard Worker------ 79*c8dee2aaSAndroid Build Coastguard Worker 80*c8dee2aaSAndroid Build Coastguard WorkerArtifacts used by the infrastructure are versioned here, along with scripts for 81*c8dee2aaSAndroid Build Coastguard Workerrecreating/uploading/downloading them. See the README in that directory for more 82*c8dee2aaSAndroid Build Coastguard Workerinformation. Any time an asset used by the bots changes, you need to re-run 83*c8dee2aaSAndroid Build Coastguard Workergen_tasks.go. 84*c8dee2aaSAndroid Build Coastguard Worker 85*c8dee2aaSAndroid Build Coastguard Worker 86*c8dee2aaSAndroid Build Coastguard WorkerTools 87*c8dee2aaSAndroid Build Coastguard Worker----- 88*c8dee2aaSAndroid Build Coastguard Worker 89*c8dee2aaSAndroid Build Coastguard WorkerAssorted other infrastructure-related tools, eg. isolate and CIPD binaries. 90*c8dee2aaSAndroid Build Coastguard Worker 91*c8dee2aaSAndroid Build Coastguard Worker 92*c8dee2aaSAndroid Build Coastguard WorkerCT 93*c8dee2aaSAndroid Build Coastguard Worker-- 94*c8dee2aaSAndroid Build Coastguard Worker 95*c8dee2aaSAndroid Build Coastguard WorkerHelpers for running Skia tasks in Cluster Telemetry. 96*c8dee2aaSAndroid Build Coastguard Worker 97