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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 "--workdir", "../../..", "swarm_compile", | 248 "--workdir", "../../..", "swarm_compile", |
249 "repository=skia", | 249 "repository=skia", |
250 fmt.Sprintf("buildername=%s", name), | 250 fmt.Sprintf("buildername=%s", name), |
251 "mastername=fake-master", | 251 "mastername=fake-master", |
252 "buildnumber=2", | 252 "buildnumber=2", |
253 "slavename=fake-buildslave", | 253 "slavename=fake-buildslave", |
254 "nobuildbot=True", | 254 "nobuildbot=True", |
255 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT
ED_OUTDIR), | 255 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT
ED_OUTDIR), |
256 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), | 256 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
257 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_
STORAGE), | 257 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_
STORAGE), |
258 » » » fmt.Sprintf("%s=%s", specs.PLACEHOLDER_PATCH_STORAGE, sp
ecs.PLACEHOLDER_CODEREVIEW_SERVER), | 258 » » » fmt.Sprintf("rietveld=%s", specs.PLACEHOLDER_CODEREVIEW_
SERVER), |
259 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE), | 259 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE), |
260 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PATCHSET), | 260 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PATCHSET), |
261 }, | 261 }, |
262 Isolate: "compile_skia.isolate", | 262 Isolate: "compile_skia.isolate", |
263 Priority: 0.8, | 263 Priority: 0.8, |
264 } | 264 } |
265 return name | 265 return name |
266 } | 266 } |
267 | 267 |
268 // recreateSKPs generates a RecreateSKPs task. Returns the name of the last | 268 // recreateSKPs generates a RecreateSKPs task. Returns the name of the last |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 "--workdir", "../../..", "swarm_test", | 316 "--workdir", "../../..", "swarm_test", |
317 "repository=skia", | 317 "repository=skia", |
318 fmt.Sprintf("buildername=%s", name), | 318 fmt.Sprintf("buildername=%s", name), |
319 "mastername=fake-master", | 319 "mastername=fake-master", |
320 "buildnumber=2", | 320 "buildnumber=2", |
321 "slavename=fake-buildslave", | 321 "slavename=fake-buildslave", |
322 "nobuildbot=True", | 322 "nobuildbot=True", |
323 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT
ED_OUTDIR), | 323 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT
ED_OUTDIR), |
324 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), | 324 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
325 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_
STORAGE), | 325 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_
STORAGE), |
326 » » » fmt.Sprintf("%s=%s", specs.PLACEHOLDER_PATCH_STORAGE, sp
ecs.PLACEHOLDER_CODEREVIEW_SERVER), | 326 » » » fmt.Sprintf("rietveld=%s", specs.PLACEHOLDER_CODEREVIEW_
SERVER), |
327 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE), | 327 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE), |
328 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PATCHSET), | 328 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PATCHSET), |
329 }, | 329 }, |
330 Isolate: "test_skia.isolate", | 330 Isolate: "test_skia.isolate", |
331 Priority: 0.8, | 331 Priority: 0.8, |
332 } | 332 } |
333 // Upload results if necessary. | 333 // Upload results if necessary. |
334 if doUpload(name) { | 334 if doUpload(name) { |
335 uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema
.Sep, name) | 335 uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema
.Sep, name) |
336 cfg.Tasks[uploadName] = &specs.TaskSpec{ | 336 cfg.Tasks[uploadName] = &specs.TaskSpec{ |
337 Dependencies: []string{name}, | 337 Dependencies: []string{name}, |
338 Dimensions: UPLOAD_DIMENSIONS, | 338 Dimensions: UPLOAD_DIMENSIONS, |
339 ExtraArgs: []string{ | 339 ExtraArgs: []string{ |
340 "--workdir", "../../..", "upload_dm_results", | 340 "--workdir", "../../..", "upload_dm_results", |
341 "repository=skia", | 341 "repository=skia", |
342 fmt.Sprintf("buildername=%s", name), | 342 fmt.Sprintf("buildername=%s", name), |
343 "mastername=fake-master", | 343 "mastername=fake-master", |
344 "buildnumber=2", | 344 "buildnumber=2", |
345 "slavename=fake-buildslave", | 345 "slavename=fake-buildslave", |
346 "nobuildbot=True", | 346 "nobuildbot=True", |
347 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDE
R_ISOLATED_OUTDIR), | 347 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDE
R_ISOLATED_OUTDIR), |
348 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REV
ISION), | 348 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REV
ISION), |
349 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDE
R_PATCH_STORAGE), | 349 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDE
R_PATCH_STORAGE), |
350 » » » » fmt.Sprintf("%s=%s", specs.PLACEHOLDER_PATCH_STO
RAGE, specs.PLACEHOLDER_CODEREVIEW_SERVER), | 350 » » » » fmt.Sprintf("rietveld=%s", specs.PLACEHOLDER_COD
EREVIEW_SERVER), |
351 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE)
, | 351 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE)
, |
352 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PAT
CHSET), | 352 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PAT
CHSET), |
353 }, | 353 }, |
354 Isolate: "upload_dm_results.isolate", | 354 Isolate: "upload_dm_results.isolate", |
355 Priority: 0.8, | 355 Priority: 0.8, |
356 } | 356 } |
357 return uploadName | 357 return uploadName |
358 } | 358 } |
359 return name | 359 return name |
360 } | 360 } |
361 | 361 |
362 // perf generates a Perf task. Returns the name of the last task in the | 362 // perf generates a Perf task. Returns the name of the last task in the |
363 // generated chain of tasks, which the Job should add as a dependency. | 363 // generated chain of tasks, which the Job should add as a dependency. |
364 func perf(cfg *specs.TasksCfg, name string, parts map[string]string, compileTask
Name string, pkgs []*specs.CipdPackage) string { | 364 func perf(cfg *specs.TasksCfg, name string, parts map[string]string, compileTask
Name string, pkgs []*specs.CipdPackage) string { |
365 cfg.Tasks[name] = &specs.TaskSpec{ | 365 cfg.Tasks[name] = &specs.TaskSpec{ |
366 CipdPackages: pkgs, | 366 CipdPackages: pkgs, |
367 Dependencies: []string{compileTaskName}, | 367 Dependencies: []string{compileTaskName}, |
368 Dimensions: swarmDimensions(parts), | 368 Dimensions: swarmDimensions(parts), |
369 ExtraArgs: []string{ | 369 ExtraArgs: []string{ |
370 "--workdir", "../../..", "swarm_perf", | 370 "--workdir", "../../..", "swarm_perf", |
371 "repository=skia", | 371 "repository=skia", |
372 fmt.Sprintf("buildername=%s", name), | 372 fmt.Sprintf("buildername=%s", name), |
373 "mastername=fake-master", | 373 "mastername=fake-master", |
374 "buildnumber=2", | 374 "buildnumber=2", |
375 "slavename=fake-buildslave", | 375 "slavename=fake-buildslave", |
376 "nobuildbot=True", | 376 "nobuildbot=True", |
377 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT
ED_OUTDIR), | 377 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT
ED_OUTDIR), |
378 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), | 378 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), |
379 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_
STORAGE), | 379 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_
STORAGE), |
380 » » » fmt.Sprintf("%s=%s", specs.PLACEHOLDER_PATCH_STORAGE, sp
ecs.PLACEHOLDER_CODEREVIEW_SERVER), | 380 » » » fmt.Sprintf("rietveld=%s", specs.PLACEHOLDER_CODEREVIEW_
SERVER), |
381 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE), | 381 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE), |
382 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PATCHSET), | 382 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PATCHSET), |
383 }, | 383 }, |
384 Isolate: "perf_skia.isolate", | 384 Isolate: "perf_skia.isolate", |
385 Priority: 0.8, | 385 Priority: 0.8, |
386 } | 386 } |
387 // Upload results if necessary. | 387 // Upload results if necessary. |
388 if strings.Contains(name, "Release") && doUpload(name) { | 388 if strings.Contains(name, "Release") && doUpload(name) { |
389 uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema
.Sep, name) | 389 uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema
.Sep, name) |
390 cfg.Tasks[uploadName] = &specs.TaskSpec{ | 390 cfg.Tasks[uploadName] = &specs.TaskSpec{ |
391 Dependencies: []string{name}, | 391 Dependencies: []string{name}, |
392 Dimensions: UPLOAD_DIMENSIONS, | 392 Dimensions: UPLOAD_DIMENSIONS, |
393 ExtraArgs: []string{ | 393 ExtraArgs: []string{ |
394 "--workdir", "../../..", "upload_nano_results", | 394 "--workdir", "../../..", "upload_nano_results", |
395 "repository=skia", | 395 "repository=skia", |
396 fmt.Sprintf("buildername=%s", name), | 396 fmt.Sprintf("buildername=%s", name), |
397 "mastername=fake-master", | 397 "mastername=fake-master", |
398 "buildnumber=2", | 398 "buildnumber=2", |
399 "slavename=fake-buildslave", | 399 "slavename=fake-buildslave", |
400 "nobuildbot=True", | 400 "nobuildbot=True", |
401 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDE
R_ISOLATED_OUTDIR), | 401 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDE
R_ISOLATED_OUTDIR), |
402 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REV
ISION), | 402 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REV
ISION), |
403 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDE
R_PATCH_STORAGE), | 403 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDE
R_PATCH_STORAGE), |
404 » » » » fmt.Sprintf("%s=%s", specs.PLACEHOLDER_PATCH_STO
RAGE, specs.PLACEHOLDER_CODEREVIEW_SERVER), | 404 » » » » fmt.Sprintf("rietveld=%s", specs.PLACEHOLDER_COD
EREVIEW_SERVER), |
405 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE)
, | 405 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE)
, |
406 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PAT
CHSET), | 406 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PAT
CHSET), |
407 }, | 407 }, |
408 Isolate: "upload_nano_results.isolate", | 408 Isolate: "upload_nano_results.isolate", |
409 Priority: 0.8, | 409 Priority: 0.8, |
410 } | 410 } |
411 return uploadName | 411 return uploadName |
412 } | 412 } |
413 return name | 413 return name |
414 } | 414 } |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 if !ok { | 626 if !ok { |
627 return "", fmt.Errorf("Invalid job parts; missing %q", k
) | 627 return "", fmt.Errorf("Invalid job parts; missing %q", k
) |
628 } | 628 } |
629 rvParts = append(rvParts, v) | 629 rvParts = append(rvParts, v) |
630 } | 630 } |
631 if _, ok := parts["extra_config"]; ok { | 631 if _, ok := parts["extra_config"]; ok { |
632 rvParts = append(rvParts, parts["extra_config"]) | 632 rvParts = append(rvParts, parts["extra_config"]) |
633 } | 633 } |
634 return strings.Join(rvParts, s.Sep), nil | 634 return strings.Join(rvParts, s.Sep), nil |
635 } | 635 } |
OLD | NEW |