| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package main | 5 package main |
| 6 | 6 |
| 7 /* | 7 /* |
| 8 Generate the tasks.json file. | 8 Generate the tasks.json file. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 ) | 37 ) |
| 38 | 38 |
| 39 var ( | 39 var ( |
| 40 // "Constants" | 40 // "Constants" |
| 41 | 41 |
| 42 // Top-level list of all jobs to run at each commit. | 42 // Top-level list of all jobs to run at each commit. |
| 43 JOBS = []string{ | 43 JOBS = []string{ |
| 44 "Build-Ubuntu-GCC-x86_64-Release-GN", | 44 "Build-Ubuntu-GCC-x86_64-Release-GN", |
| 45 "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-GN", | 45 "Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-GN", |
| 46 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-GN", | 46 "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-GN", |
| 47 "Housekeeper-PerCommit-InfraTests", |
| 47 } | 48 } |
| 48 | 49 |
| 49 // UPLOAD_DIMENSIONS are the Swarming dimensions for upload tasks. | 50 // UPLOAD_DIMENSIONS are the Swarming dimensions for upload tasks. |
| 50 UPLOAD_DIMENSIONS = []string{ | 51 UPLOAD_DIMENSIONS = []string{ |
| 51 "cpu:x86-64-avx2", | 52 "cpu:x86-64-avx2", |
| 52 "gpu:none", | 53 "gpu:none", |
| 53 "os:Ubuntu", | 54 "os:Ubuntu", |
| 54 fmt.Sprintf("pool:%s", POOL_SKIA), | 55 fmt.Sprintf("pool:%s", POOL_SKIA), |
| 55 } | 56 } |
| 56 | 57 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 return name | 281 return name |
| 281 } | 282 } |
| 282 | 283 |
| 283 // housekeeper generates a Housekeeper task. Returns the name of the last task | 284 // housekeeper generates a Housekeeper task. Returns the name of the last task |
| 284 // in the generated chain of tasks, which the Job should add as a dependency. | 285 // in the generated chain of tasks, which the Job should add as a dependency. |
| 285 func housekeeper(cfg *specs.TasksCfg, name, compileTaskName string) string { | 286 func housekeeper(cfg *specs.TasksCfg, name, compileTaskName string) string { |
| 286 // TODO | 287 // TODO |
| 287 return name | 288 return name |
| 288 } | 289 } |
| 289 | 290 |
| 291 // infra generates an infra_tests task. Returns the name of the last task in the |
| 292 // generated chain of tasks, which the Job should add as a dependency. |
| 293 func infra(cfg *specs.TasksCfg, name string) string { |
| 294 cfg.Tasks[name] = &specs.TaskSpec{ |
| 295 CipdPackages: []*specs.CipdPackage{}, |
| 296 Dimensions: UPLOAD_DIMENSIONS, |
| 297 ExtraArgs: []string{ |
| 298 "--workdir", "../../..", "swarm_infra", |
| 299 "repository=skia", |
| 300 fmt.Sprintf("buildername=%s", name), |
| 301 "mastername=fake-master", |
| 302 "buildnumber=2", |
| 303 "slavename=fake-buildslave", |
| 304 "nobuildbot=True", |
| 305 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT
ED_OUTDIR), |
| 306 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
| 307 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_
STORAGE), |
| 308 fmt.Sprintf("rietveld=%s", specs.PLACEHOLDER_CODEREVIEW_
SERVER), |
| 309 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE), |
| 310 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PATCHSET), |
| 311 }, |
| 312 Isolate: "infra_skia.isolate", |
| 313 Priority: 0.8, |
| 314 } |
| 315 return name |
| 316 } |
| 317 |
| 290 // doUpload indicates whether the given Job should upload its results. | 318 // doUpload indicates whether the given Job should upload its results. |
| 291 func doUpload(name string) bool { | 319 func doUpload(name string) bool { |
| 292 skipUploadBots := []string{ | 320 skipUploadBots := []string{ |
| 293 "ASAN", | 321 "ASAN", |
| 294 "Coverage", | 322 "Coverage", |
| 295 "MSAN", | 323 "MSAN", |
| 296 "TSAN", | 324 "TSAN", |
| 297 "UBSAN", | 325 "UBSAN", |
| 298 "Valgrind", | 326 "Valgrind", |
| 299 } | 327 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 // RecreateSKPs. | 456 // RecreateSKPs. |
| 429 if strings.Contains(name, "RecreateSKPs") { | 457 if strings.Contains(name, "RecreateSKPs") { |
| 430 deps = append(deps, recreateSKPs(cfg, name)) | 458 deps = append(deps, recreateSKPs(cfg, name)) |
| 431 } | 459 } |
| 432 | 460 |
| 433 // CT bots. | 461 // CT bots. |
| 434 if strings.Contains(name, "-CT_") { | 462 if strings.Contains(name, "-CT_") { |
| 435 deps = append(deps, ctSKPs(cfg, name)) | 463 deps = append(deps, ctSKPs(cfg, name)) |
| 436 } | 464 } |
| 437 | 465 |
| 466 // Infra tests. |
| 467 if name == "Housekeeper-PerCommit-InfraTests" { |
| 468 deps = append(deps, infra(cfg, name)) |
| 469 } |
| 470 |
| 438 // Compile bots. | 471 // Compile bots. |
| 439 if parts["role"] == "Build" { | 472 if parts["role"] == "Build" { |
| 440 deps = append(deps, compile(cfg, name, parts)) | 473 deps = append(deps, compile(cfg, name, parts)) |
| 441 } | 474 } |
| 442 | 475 |
| 443 // Any remaining bots need a compile task. | 476 // Any remaining bots need a compile task. |
| 444 compileTaskName := deriveCompileTaskName(name, parts) | 477 compileTaskName := deriveCompileTaskName(name, parts) |
| 445 | 478 |
| 446 // Housekeeper. | 479 // Housekeeper. |
| 447 » if parts["role"] == "Housekeeper" { | 480 » if parts["role"] == "Housekeeper" && name != "Housekeeper-PerCommit-Infr
aTests" { |
| 448 deps = append(deps, housekeeper(cfg, name, compileTaskName)) | 481 deps = append(deps, housekeeper(cfg, name, compileTaskName)) |
| 449 } | 482 } |
| 450 | 483 |
| 451 // Common assets needed by the remaining bots. | 484 // Common assets needed by the remaining bots. |
| 452 pkgs := []*specs.CipdPackage{ | 485 pkgs := []*specs.CipdPackage{ |
| 453 getCipdPackage("skimage"), | 486 getCipdPackage("skimage"), |
| 454 getCipdPackage("skp"), | 487 getCipdPackage("skp"), |
| 455 getCipdPackage("svg"), | 488 getCipdPackage("svg"), |
| 456 } | 489 } |
| 457 | 490 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 if !ok { | 659 if !ok { |
| 627 return "", fmt.Errorf("Invalid job parts; missing %q", k
) | 660 return "", fmt.Errorf("Invalid job parts; missing %q", k
) |
| 628 } | 661 } |
| 629 rvParts = append(rvParts, v) | 662 rvParts = append(rvParts, v) |
| 630 } | 663 } |
| 631 if _, ok := parts["extra_config"]; ok { | 664 if _, ok := parts["extra_config"]; ok { |
| 632 rvParts = append(rvParts, parts["extra_config"]) | 665 rvParts = append(rvParts, parts["extra_config"]) |
| 633 } | 666 } |
| 634 return strings.Join(rvParts, s.Sep), nil | 667 return strings.Join(rvParts, s.Sep), nil |
| 635 } | 668 } |
| OLD | NEW |