Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(962)

Side by Side Diff: master/skia_master_scripts/utils.py

Issue 13861012: Change builder names (Closed) Base URL: http://skia.googlecode.com/svn/buildbot/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 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 5
6 """Miscellaneous utilities needed by the Skia buildbot master.""" 6 """Miscellaneous utilities needed by the Skia buildbot master."""
7 7
8 8
9 import httplib2 9 import httplib2
10 import re 10 import re
(...skipping 16 matching lines...) Expand all
27 from skia_master_scripts import chromeos_factory 27 from skia_master_scripts import chromeos_factory
28 from skia_master_scripts import factory as skia_factory 28 from skia_master_scripts import factory as skia_factory
29 from skia_master_scripts import housekeeping_percommit_factory, \ 29 from skia_master_scripts import housekeeping_percommit_factory, \
30 housekeeping_periodic_factory 30 housekeeping_periodic_factory
31 from skia_master_scripts import ios_factory 31 from skia_master_scripts import ios_factory
32 from skia_master_scripts import nacl_factory 32 from skia_master_scripts import nacl_factory
33 33
34 import config_private 34 import config_private
35 35
36 36
37 BUILDER_NAME_SEP = '-'
borenet 2013/04/09 16:31:46 Changed from the '_' which we used before to separ
epoger 2013/04/09 17:38:36 Agreed.
37 CATEGORY_BUILD = ' Build' 38 CATEGORY_BUILD = ' Build'
38 TRYBOT_NAME_SUFFIX = '_Trybot' 39 TRYBOT_NAME_SUFFIX = 'Trybot'
39 TRY_SCHEDULER_SVN = 'skia_try_svn' 40 TRY_SCHEDULER_SVN = 'skia_try_svn'
40 TRY_SCHEDULER_RIETVELD = 'skia_try_rietveld' 41 TRY_SCHEDULER_RIETVELD = 'skia_try_rietveld'
41 TRY_SCHEDULERS = [TRY_SCHEDULER_SVN, TRY_SCHEDULER_RIETVELD] 42 TRY_SCHEDULERS = [TRY_SCHEDULER_SVN, TRY_SCHEDULER_RIETVELD]
42 TRY_SCHEDULERS_STR = '|'.join(TRY_SCHEDULERS) 43 TRY_SCHEDULERS_STR = '|'.join(TRY_SCHEDULERS)
43 44
44 45
45 def IsTrybot(builder_name): 46 def IsTrybot(builder_name):
46 return builder_name.endswith(TRYBOT_NAME_SUFFIX) 47 return builder_name.endswith(TRYBOT_NAME_SUFFIX)
47 48
48 49
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 # been defined. 361 # been defined.
361 # pylint: disable=W0601 362 # pylint: disable=W0601
362 global skia_all_subdirs 363 global skia_all_subdirs
363 try: 364 try:
364 if skia_all_subdirs: 365 if skia_all_subdirs:
365 raise Exception('skia_all_subdirs has already been defined!') 366 raise Exception('skia_all_subdirs has already been defined!')
366 except NameError: 367 except NameError:
367 skia_all_subdirs = all_subdirs 368 skia_all_subdirs = all_subdirs
368 369
369 370
370 def MakeBuilderName(builder_base_name, config): 371 def MakeBuilderName(os, version, arch_width, hardware, role, extra_config=None,
371 """ Inserts config into builder_base_name at '%s', or if builder_base_name 372 is_trybot=False):
372 does not contain '%s', appends config to the end of builder_base_name, 373 """ Construct a builder name from an OS, version, hardware, configuration, and
373 separated by an underscore. """ 374 builder role. """
374 try: 375 name_parts = [os, version, arch_width, hardware]
375 return builder_base_name % config 376 if extra_config:
376 except TypeError: 377 if BUILDER_NAME_SEP in extra_config:
377 # If builder_base_name does not contain '%s' 378 raise ValueError('%s is not legal in %s' % (BUILDER_NAME_SEP,
378 return '%s_%s' % (builder_base_name, config) 379 extra_config))
borenet 2013/04/09 16:31:46 I already removed this duplicate check.
380 name_parts.append(extra_config)
381 name_parts.append(role)
382 if is_trybot:
383 name_parts.append(TRYBOT_NAME_SUFFIX)
384 for part in name_parts:
385 if BUILDER_NAME_SEP in part:
386 raise ValueError('%s is not legal in %s' % (BUILDER_NAME_SEP, part))
387 return BUILDER_NAME_SEP.join(name_parts)
379 388
380 389
381 def MakeCompileBuilderName(builder_base_name, release=False): 390 def MakeCompileBuilderName(release=False, **kwargs):
382 if release: 391 if release:
383 compile_name = 'Compile_Release' 392 compile_name = 'ReleaseCompile'
384 else: 393 else:
385 compile_name = 'Compile_Debug' 394 compile_name = 'DebugCompile'
386 return MakeBuilderName(builder_base_name, compile_name) 395 return MakeBuilderName(role=compile_name, **kwargs)
387 396
388 397
389 def MakeDebugBuilderName(builder_base_name): 398 def MakeDebugBuilderName(**kwargs):
390 return MakeBuilderName(builder_base_name, skia_factory.CONFIG_DEBUG) 399 return MakeBuilderName(role=skia_factory.CONFIG_DEBUG, **kwargs)
391 400
392 401
393 def MakeReleaseBuilderName(builder_base_name): 402 def MakeReleaseBuilderName(**kwargs):
394 return MakeBuilderName(builder_base_name, skia_factory.CONFIG_RELEASE) 403 return MakeBuilderName(role=skia_factory.CONFIG_RELEASE, **kwargs)
395 404
396 405
397 def MakeBenchBuilderName(builder_base_name): 406 def MakeBenchBuilderName(**kwargs):
398 return MakeBuilderName(builder_base_name, skia_factory.CONFIG_BENCH) 407 return MakeBuilderName(role=skia_factory.CONFIG_BENCH, **kwargs)
399 408
400 409
401 def MakeSchedulerName(builder_base_name): 410 def MakeSchedulerName(**kwargs):
402 return MakeBuilderName(builder_base_name, 'Scheduler') 411 return MakeBuilderName(role='Scheduler', **kwargs)
403 412
404 413
405 def _MakeBuilderSet(helper, builder_base_name, gm_image_subdir, 414 def _MakeBuilderSet(helper, os, version, arch_width, hardware,
415 gm_image_subdir, extra_config=None,
borenet 2013/04/09 16:31:46 Passing these extra parameters is annoying, partic
406 perf_output_basedir=None, extra_branches=None, 416 perf_output_basedir=None, extra_branches=None,
407 factory_type=None, do_compile=True, do_debug=True, 417 factory_type=None, do_compile=True, do_debug=True,
408 do_release=True, do_bench=True, try_schedulers=None, 418 do_release=True, do_bench=True, try_schedulers=None,
409 compile_bot_warnings_as_errors=True, 419 compile_bot_warnings_as_errors=True,
410 **kwargs): 420 **kwargs):
411 """ Creates a trio of builders for a given platform: 421 """ Creates a trio of builders for a given platform:
412 1. Debug mode builder which runs all steps 422 1. Debug mode builder which runs all steps
413 2. Release mode builder which runs all steps EXCEPT benchmarks 423 2. Release mode builder which runs all steps EXCEPT benchmarks
414 3. Release mode builder which runs ONLY benchmarks. 424 3. Release mode builder which runs ONLY benchmarks.
415 """ 425 """
416 B = helper.Builder 426 B = helper.Builder
417 F = helper.Factory 427 F = helper.Factory
418 428
419 if not extra_branches: 429 if not extra_branches:
420 extra_branches = [] 430 extra_branches = []
421 subdirs_to_checkout = set(extra_branches) 431 subdirs_to_checkout = set(extra_branches)
432 is_trybot = try_schedulers is not None
422 if gm_image_subdir: 433 if gm_image_subdir:
423 gm_image_branch = 'gm-expected/%s' % gm_image_subdir 434 gm_image_branch = 'gm-expected/%s' % gm_image_subdir
424 subdirs_to_checkout.add(gm_image_branch) 435 subdirs_to_checkout.add(gm_image_branch)
425
426 if try_schedulers: 436 if try_schedulers:
427 scheduler_name = '|'.join(try_schedulers) 437 scheduler_name = '|'.join(try_schedulers)
428 builder_base_name = builder_base_name + TRYBOT_NAME_SUFFIX
429 else: 438 else:
430 scheduler_name = MakeSchedulerName(builder_base_name) 439 scheduler_name = MakeSchedulerName(os=os,
440 version=version,
441 arch_width=arch_width,
442 hardware=hardware,
443 extra_config=extra_config)
431 branches = list(subdirs_to_checkout.union(SKIA_PRIMARY_SUBDIRS)) 444 branches = list(subdirs_to_checkout.union(SKIA_PRIMARY_SUBDIRS))
432 helper.AnyBranchScheduler(scheduler_name, branches=branches) 445 helper.AnyBranchScheduler(scheduler_name, branches=branches)
433 446
434 if do_compile: 447 if do_compile:
435 compile_debug_builder_name = MakeCompileBuilderName(builder_base_name, 448 compile_debug_builder_name = MakeCompileBuilderName(
436 release=False) 449 os=os,
450 version=version,
451 arch_width=arch_width,
452 hardware=hardware,
453 extra_config=extra_config,
454 is_trybot=is_trybot,
455 release=False)
437 B(compile_debug_builder_name, 'f_%s' % compile_debug_builder_name, 456 B(compile_debug_builder_name, 'f_%s' % compile_debug_builder_name,
438 # Do not add gatekeeper for trybots. 457 # Do not add gatekeeper for trybots.
439 gatekeeper='GateKeeper' if try_schedulers is None else None, 458 gatekeeper='GateKeeper' if try_schedulers is None else None,
440 scheduler=scheduler_name, override_category=CATEGORY_BUILD) 459 scheduler=scheduler_name, override_category=CATEGORY_BUILD)
441 F('f_%s' % compile_debug_builder_name, factory_type( 460 F('f_%s' % compile_debug_builder_name, factory_type(
442 builder_name=compile_debug_builder_name, 461 builder_name=compile_debug_builder_name,
443 other_subdirs=subdirs_to_checkout, 462 other_subdirs=subdirs_to_checkout,
444 configuration=skia_factory.CONFIG_DEBUG, 463 configuration=skia_factory.CONFIG_DEBUG,
445 gm_image_subdir=gm_image_subdir, 464 gm_image_subdir=gm_image_subdir,
446 do_patch_step=(try_schedulers is not None), 465 do_patch_step=is_trybot,
447 perf_output_basedir=None, 466 perf_output_basedir=None,
448 compile_warnings_as_errors=compile_bot_warnings_as_errors, 467 compile_warnings_as_errors=compile_bot_warnings_as_errors,
449 **kwargs 468 **kwargs
450 ).BuildCompileOnly()) 469 ).BuildCompileOnly())
451 compile_release_builder_name = MakeCompileBuilderName(builder_base_name, 470 compile_release_builder_name = MakeCompileBuilderName(
452 release=True) 471 os=os,
472 version=version,
473 arch_width=arch_width,
474 hardware=hardware,
475 extra_config=extra_config,
476 is_trybot=is_trybot,
477 release=True)
453 B(compile_release_builder_name, 'f_%s' % compile_release_builder_name, 478 B(compile_release_builder_name, 'f_%s' % compile_release_builder_name,
454 # Do not add gatekeeper for trybots. 479 # Do not add gatekeeper for trybots.
455 gatekeeper='GateKeeper' if try_schedulers is None else None, 480 gatekeeper='GateKeeper' if try_schedulers is None else None,
456 scheduler=scheduler_name, override_category=CATEGORY_BUILD) 481 scheduler=scheduler_name, override_category=CATEGORY_BUILD)
457 F('f_%s' % compile_release_builder_name, factory_type( 482 F('f_%s' % compile_release_builder_name, factory_type(
458 builder_name=compile_release_builder_name, 483 builder_name=compile_release_builder_name,
459 other_subdirs=subdirs_to_checkout, 484 other_subdirs=subdirs_to_checkout,
460 configuration=skia_factory.CONFIG_RELEASE, 485 configuration=skia_factory.CONFIG_RELEASE,
461 gm_image_subdir=gm_image_subdir, 486 gm_image_subdir=gm_image_subdir,
462 do_patch_step=(try_schedulers is not None), 487 do_patch_step=is_trybot,
463 perf_output_basedir=None, 488 perf_output_basedir=None,
464 compile_warnings_as_errors=compile_bot_warnings_as_errors, 489 compile_warnings_as_errors=compile_bot_warnings_as_errors,
465 **kwargs 490 **kwargs
466 ).BuildCompileOnly()) 491 ).BuildCompileOnly())
467 492
468 if do_debug: 493 if do_debug:
469 debug_builder_name = MakeDebugBuilderName(builder_base_name) 494 debug_builder_name = MakeDebugBuilderName(os=os,
495 version=version,
496 arch_width=arch_width,
497 hardware=hardware,
498 extra_config=extra_config,
499 is_trybot=is_trybot)
470 B(debug_builder_name, 'f_%s' % debug_builder_name, 500 B(debug_builder_name, 'f_%s' % debug_builder_name,
471 scheduler=scheduler_name) 501 scheduler=scheduler_name)
472 F('f_%s' % debug_builder_name, factory_type( 502 F('f_%s' % debug_builder_name, factory_type(
473 builder_name=debug_builder_name, 503 builder_name=debug_builder_name,
474 other_subdirs=subdirs_to_checkout, 504 other_subdirs=subdirs_to_checkout,
475 configuration=skia_factory.CONFIG_DEBUG, 505 configuration=skia_factory.CONFIG_DEBUG,
476 gm_image_subdir=gm_image_subdir, 506 gm_image_subdir=gm_image_subdir,
477 do_patch_step=(try_schedulers is not None), 507 do_patch_step=is_trybot,
478 perf_output_basedir=None, 508 perf_output_basedir=None,
479 compile_warnings_as_errors=False, 509 compile_warnings_as_errors=False,
480 **kwargs 510 **kwargs
481 ).Build()) 511 ).Build())
482 512
483 if do_release: 513 if do_release:
484 no_perf_builder_name = MakeReleaseBuilderName(builder_base_name) 514 no_perf_builder_name = MakeReleaseBuilderName(os=os,
515 version=version,
516 arch_width=arch_width,
517 hardware=hardware,
518 extra_config=extra_config,
519 is_trybot=is_trybot)
485 B(no_perf_builder_name, 'f_%s' % no_perf_builder_name, 520 B(no_perf_builder_name, 'f_%s' % no_perf_builder_name,
486 scheduler=scheduler_name) 521 scheduler=scheduler_name)
487 F('f_%s' % no_perf_builder_name, factory_type( 522 F('f_%s' % no_perf_builder_name, factory_type(
488 builder_name=no_perf_builder_name, 523 builder_name=no_perf_builder_name,
489 other_subdirs=subdirs_to_checkout, 524 other_subdirs=subdirs_to_checkout,
490 configuration=skia_factory.CONFIG_RELEASE, 525 configuration=skia_factory.CONFIG_RELEASE,
491 gm_image_subdir=gm_image_subdir, 526 gm_image_subdir=gm_image_subdir,
492 do_patch_step=(try_schedulers is not None), 527 do_patch_step=is_trybot,
493 perf_output_basedir=None, 528 perf_output_basedir=None,
494 compile_warnings_as_errors=False, 529 compile_warnings_as_errors=False,
495 **kwargs 530 **kwargs
496 ).BuildNoPerf()) 531 ).BuildNoPerf())
497 532
498 if do_bench: 533 if do_bench:
499 perf_builder_name = MakeBenchBuilderName(builder_base_name) 534 perf_builder_name = MakeBenchBuilderName(os=os,
535 version=version,
536 arch_width=arch_width,
537 hardware=hardware,
538 extra_config=extra_config,
539 is_trybot=is_trybot)
500 B(perf_builder_name, 'f_%s' % perf_builder_name, 540 B(perf_builder_name, 'f_%s' % perf_builder_name,
501 scheduler=scheduler_name) 541 scheduler=scheduler_name)
502 F('f_%s' % perf_builder_name, factory_type( 542 F('f_%s' % perf_builder_name, factory_type(
503 builder_name=perf_builder_name, 543 builder_name=perf_builder_name,
504 other_subdirs=subdirs_to_checkout, 544 other_subdirs=subdirs_to_checkout,
505 configuration=skia_factory.CONFIG_RELEASE, 545 configuration=skia_factory.CONFIG_RELEASE,
506 gm_image_subdir=gm_image_subdir, 546 gm_image_subdir=gm_image_subdir,
507 do_patch_step=(try_schedulers is not None), 547 do_patch_step=is_trybot,
508 perf_output_basedir=perf_output_basedir, 548 perf_output_basedir=perf_output_basedir,
509 compile_warnings_as_errors=False, 549 compile_warnings_as_errors=False,
510 **kwargs 550 **kwargs
511 ).BuildPerfOnly()) 551 ).BuildPerfOnly())
512 552
513 553
514 def _MakeBuilderAndMaybeTrybotSet(do_trybots=True, **kwargs): 554 def _MakeBuilderAndMaybeTrybotSet(do_trybots=True, **kwargs):
515 _MakeBuilderSet(try_schedulers=None, **kwargs) 555 _MakeBuilderSet(try_schedulers=None, **kwargs)
516 if do_trybots: 556 if do_trybots:
517 _MakeBuilderSet(try_schedulers=TRY_SCHEDULERS, **kwargs) 557 _MakeBuilderSet(try_schedulers=TRY_SCHEDULERS, **kwargs)
518 558
519 559
520 def MakeBuilderSet(**kwargs): 560 def MakeBuilderSet(**kwargs):
521 _MakeBuilderAndMaybeTrybotSet(factory_type=skia_factory.SkiaFactory, **kwargs) 561 _MakeBuilderAndMaybeTrybotSet(factory_type=skia_factory.SkiaFactory, **kwargs)
522 562
523 563
524 def MakeHousekeeperBuilderSet(helper, do_trybots, do_upload_results): 564 def MakeHousekeeperBuilderSet(helper, do_trybots, do_upload_results):
525 B = helper.Builder 565 B = helper.Builder
526 F = helper.Factory 566 F = helper.Factory
527 567
528 builder_factory_scheduler = [ 568 builder_factory_scheduler = [
529 # The Percommit housekeeper 569 # The Percommit housekeeper
530 ('Skia_PerCommit_House_Keeping', 570 ('PerCommit-Housekeeping',
borenet 2013/04/09 16:31:46 I'd really like to make the housekeepers conform t
531 housekeeping_percommit_factory.HouseKeepingPerCommitFactory, 571 housekeeping_percommit_factory.HouseKeepingPerCommitFactory,
532 'skia_rel'), 572 'skia_rel'),
533 # The Periodic housekeeper 573 # The Periodic housekeeper
534 ('Skia_Periodic_House_Keeping', 574 ('Periodic-Housekeeping',
535 housekeeping_periodic_factory.HouseKeepingPeriodicFactory, 575 housekeeping_periodic_factory.HouseKeepingPeriodicFactory,
536 'skia_periodic'), 576 'skia_periodic'),
537 ] 577 ]
538 if do_trybots: 578 if do_trybots:
539 # Add the corresponding trybot builders to the above list. 579 # Add the corresponding trybot builders to the above list.
540 builder_factory_scheduler.extend([ 580 builder_factory_scheduler.extend([
541 (builder + TRYBOT_NAME_SUFFIX, factory, TRY_SCHEDULERS_STR) 581 (builder + BUILDER_NAME_SEP + TRYBOT_NAME_SUFFIX, factory,
582 TRY_SCHEDULERS_STR)
542 for (builder, factory, _scheduler) in builder_factory_scheduler]) 583 for (builder, factory, _scheduler) in builder_factory_scheduler])
543 584
544 for (builder_name, factory, scheduler) in builder_factory_scheduler: 585 for (builder_name, factory, scheduler) in builder_factory_scheduler:
545 B(builder_name, 'f_%s' % builder_name, scheduler=scheduler) 586 B(builder_name, 'f_%s' % builder_name, scheduler=scheduler)
546 F('f_%s' % builder_name, 587 F('f_%s' % builder_name,
547 factory( 588 factory(
548 do_upload_results=do_upload_results, 589 do_upload_results=do_upload_results,
549 target_platform=skia_factory.TARGET_PLATFORM_LINUX, 590 target_platform=skia_factory.TARGET_PLATFORM_LINUX,
550 builder_name=builder_name, 591 builder_name=builder_name,
551 do_patch_step=(scheduler == TRY_SCHEDULERS_STR), 592 do_patch_step=(scheduler == TRY_SCHEDULERS_STR),
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 # request is associated with a change but the revisions match (#5 above). 655 # request is associated with a change but the revisions match (#5 above).
615 if req1.source.changes and not req2.source.changes: 656 if req1.source.changes and not req2.source.changes:
616 return False 657 return False
617 if not req1.source.changes and req2.source.changes: 658 if not req1.source.changes and req2.source.changes:
618 return False 659 return False
619 if not (req1.source.changes and req2.source.changes): 660 if not (req1.source.changes and req2.source.changes):
620 if req1.source.revision != req2.source.revision: 661 if req1.source.revision != req2.source.revision:
621 return False 662 return False
622 663
623 return True 664 return True
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698