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

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 = '-'
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 class BuilderProperties:
371 """ Inserts config into builder_base_name at '%s', or if builder_base_name 372 def __init__(self, os, version, arch_width, model, gpu, role=None,
372 does not contain '%s', appends config to the end of builder_base_name, 373 extra_config=None):
373 separated by an underscore. """ 374 self.os = os
374 try: 375 self.version = version
375 return builder_base_name % config 376 self.arch_width = arch_width
376 except TypeError: 377 self.model = model
377 # If builder_base_name does not contain '%s' 378 self.gpu = gpu
378 return '%s_%s' % (builder_base_name, config) 379 self.role = role
380 self.extra_config = extra_config
379 381
380 382
381 def MakeCompileBuilderName(builder_base_name, release=False): 383 def MakeBuilderName(builder_props, is_trybot=False):
382 if release: 384 """ Construct a builder name from a set of builder properties. """
383 compile_name = 'Compile_Release' 385 if not isinstance(builder_props, BuilderProperties):
384 else: 386 raise ValueError('MakeBuilderName must be provided an instance of '
385 compile_name = 'Compile_Debug' 387 'BuilderProperties.')
386 return MakeBuilderName(builder_base_name, compile_name) 388 os_version = '_'.join((builder_props.os, builder_props.version)) \
389 if builder_props.version else builder_props.os
390 name_parts = [os_version, builder_props.model, builder_props.gpu,
391 builder_props.role, builder_props.arch_width]
392 if builder_props.extra_config:
393 name_parts.append(builder_props.extra_config)
394 if is_trybot:
395 name_parts.append(TRYBOT_NAME_SUFFIX)
396 builder_name = ''
397 for part in name_parts:
398 if not part:
399 part = 'x'
400 if BUILDER_NAME_SEP in part:
401 raise ValueError('%s is not legal in %s' % (BUILDER_NAME_SEP, part))
402 if builder_name:
403 builder_name += BUILDER_NAME_SEP + part
404 else:
405 builder_name += part
406 return builder_name
387 407
388 408
389 def MakeDebugBuilderName(builder_base_name): 409 def MakeCompileBuilderName(builder_props, release=False, **kwargs):
390 return MakeBuilderName(builder_base_name, skia_factory.CONFIG_DEBUG) 410 if release:
411 builder_props.role = 'ReleaseCompile'
412 else:
413 builder_props.role = 'DebugCompile'
414 return MakeBuilderName(builder_props, **kwargs)
391 415
392 416
393 def MakeReleaseBuilderName(builder_base_name): 417 def MakeDebugBuilderName(builder_props, **kwargs):
394 return MakeBuilderName(builder_base_name, skia_factory.CONFIG_RELEASE) 418 builder_props.role = skia_factory.CONFIG_DEBUG
419 return MakeBuilderName(builder_props, **kwargs)
395 420
396 421
397 def MakeBenchBuilderName(builder_base_name): 422 def MakeReleaseBuilderName(builder_props, **kwargs):
398 return MakeBuilderName(builder_base_name, skia_factory.CONFIG_BENCH) 423 builder_props.role = skia_factory.CONFIG_RELEASE
424 return MakeBuilderName(builder_props, **kwargs)
399 425
400 426
401 def MakeSchedulerName(builder_base_name): 427 def MakeBenchBuilderName(builder_props, **kwargs):
402 return MakeBuilderName(builder_base_name, 'Scheduler') 428 builder_props.role = skia_factory.CONFIG_BENCH
429 return MakeBuilderName(builder_props, **kwargs)
403 430
404 431
405 def _MakeBuilderSet(helper, builder_base_name, gm_image_subdir, 432 def MakeSchedulerName(builder_props, **kwargs):
433 builder_props.role = 'Scheduler'
434 return MakeBuilderName(builder_props, **kwargs)
435
436
437 def _MakeBuilderSet(helper, builder_props, gm_image_subdir,
406 perf_output_basedir=None, extra_branches=None, 438 perf_output_basedir=None, extra_branches=None,
407 factory_type=None, do_compile=True, do_debug=True, 439 factory_type=None, do_compile=True, do_debug=True,
408 do_release=True, do_bench=True, try_schedulers=None, 440 do_release=True, do_bench=True, try_schedulers=None,
409 compile_bot_warnings_as_errors=True, 441 compile_bot_warnings_as_errors=True,
410 **kwargs): 442 **kwargs):
411 """ Creates a trio of builders for a given platform: 443 """ Creates a trio of builders for a given platform:
412 1. Debug mode builder which runs all steps 444 1. Debug mode builder which runs all steps
413 2. Release mode builder which runs all steps EXCEPT benchmarks 445 2. Release mode builder which runs all steps EXCEPT benchmarks
414 3. Release mode builder which runs ONLY benchmarks. 446 3. Release mode builder which runs ONLY benchmarks.
415 """ 447 """
416 B = helper.Builder 448 B = helper.Builder
417 F = helper.Factory 449 F = helper.Factory
418 450
419 if not extra_branches: 451 if not extra_branches:
420 extra_branches = [] 452 extra_branches = []
421 subdirs_to_checkout = set(extra_branches) 453 subdirs_to_checkout = set(extra_branches)
454 is_trybot = try_schedulers is not None
422 if gm_image_subdir: 455 if gm_image_subdir:
423 gm_image_branch = 'gm-expected/%s' % gm_image_subdir 456 gm_image_branch = 'gm-expected/%s' % gm_image_subdir
424 subdirs_to_checkout.add(gm_image_branch) 457 subdirs_to_checkout.add(gm_image_branch)
425
426 if try_schedulers: 458 if try_schedulers:
427 scheduler_name = '|'.join(try_schedulers) 459 scheduler_name = '|'.join(try_schedulers)
428 builder_base_name = builder_base_name + TRYBOT_NAME_SUFFIX
429 else: 460 else:
430 scheduler_name = MakeSchedulerName(builder_base_name) 461 scheduler_name = MakeSchedulerName(builder_props)
431 branches = list(subdirs_to_checkout.union(SKIA_PRIMARY_SUBDIRS)) 462 branches = list(subdirs_to_checkout.union(SKIA_PRIMARY_SUBDIRS))
432 helper.AnyBranchScheduler(scheduler_name, branches=branches) 463 helper.AnyBranchScheduler(scheduler_name, branches=branches)
433 464
434 if do_compile: 465 if do_compile:
435 compile_debug_builder_name = MakeCompileBuilderName(builder_base_name, 466 compile_debug_builder_name = MakeCompileBuilderName(builder_props,
467 is_trybot=is_trybot,
436 release=False) 468 release=False)
437 B(compile_debug_builder_name, 'f_%s' % compile_debug_builder_name, 469 B(compile_debug_builder_name, 'f_%s' % compile_debug_builder_name,
438 # Do not add gatekeeper for trybots. 470 # Do not add gatekeeper for trybots.
439 gatekeeper='GateKeeper' if try_schedulers is None else None, 471 gatekeeper='GateKeeper' if try_schedulers is None else None,
440 scheduler=scheduler_name, override_category=CATEGORY_BUILD) 472 scheduler=scheduler_name, override_category=CATEGORY_BUILD)
441 F('f_%s' % compile_debug_builder_name, factory_type( 473 F('f_%s' % compile_debug_builder_name, factory_type(
442 builder_name=compile_debug_builder_name, 474 builder_name=compile_debug_builder_name,
443 other_subdirs=subdirs_to_checkout, 475 other_subdirs=subdirs_to_checkout,
444 configuration=skia_factory.CONFIG_DEBUG, 476 configuration=skia_factory.CONFIG_DEBUG,
445 gm_image_subdir=gm_image_subdir, 477 gm_image_subdir=gm_image_subdir,
446 do_patch_step=(try_schedulers is not None), 478 do_patch_step=is_trybot,
447 perf_output_basedir=None, 479 perf_output_basedir=None,
448 compile_warnings_as_errors=compile_bot_warnings_as_errors, 480 compile_warnings_as_errors=compile_bot_warnings_as_errors,
449 **kwargs 481 **kwargs
450 ).BuildCompileOnly()) 482 ).BuildCompileOnly())
451 compile_release_builder_name = MakeCompileBuilderName(builder_base_name, 483 compile_release_builder_name = MakeCompileBuilderName(builder_props,
484 is_trybot=is_trybot,
452 release=True) 485 release=True)
453 B(compile_release_builder_name, 'f_%s' % compile_release_builder_name, 486 B(compile_release_builder_name, 'f_%s' % compile_release_builder_name,
454 # Do not add gatekeeper for trybots. 487 # Do not add gatekeeper for trybots.
455 gatekeeper='GateKeeper' if try_schedulers is None else None, 488 gatekeeper='GateKeeper' if try_schedulers is None else None,
456 scheduler=scheduler_name, override_category=CATEGORY_BUILD) 489 scheduler=scheduler_name, override_category=CATEGORY_BUILD)
457 F('f_%s' % compile_release_builder_name, factory_type( 490 F('f_%s' % compile_release_builder_name, factory_type(
458 builder_name=compile_release_builder_name, 491 builder_name=compile_release_builder_name,
459 other_subdirs=subdirs_to_checkout, 492 other_subdirs=subdirs_to_checkout,
460 configuration=skia_factory.CONFIG_RELEASE, 493 configuration=skia_factory.CONFIG_RELEASE,
461 gm_image_subdir=gm_image_subdir, 494 gm_image_subdir=gm_image_subdir,
462 do_patch_step=(try_schedulers is not None), 495 do_patch_step=is_trybot,
463 perf_output_basedir=None, 496 perf_output_basedir=None,
464 compile_warnings_as_errors=compile_bot_warnings_as_errors, 497 compile_warnings_as_errors=compile_bot_warnings_as_errors,
465 **kwargs 498 **kwargs
466 ).BuildCompileOnly()) 499 ).BuildCompileOnly())
467 500
468 if do_debug: 501 if do_debug:
469 debug_builder_name = MakeDebugBuilderName(builder_base_name) 502 debug_builder_name = MakeDebugBuilderName(builder_props,
503 is_trybot=is_trybot)
470 B(debug_builder_name, 'f_%s' % debug_builder_name, 504 B(debug_builder_name, 'f_%s' % debug_builder_name,
471 scheduler=scheduler_name) 505 scheduler=scheduler_name)
472 F('f_%s' % debug_builder_name, factory_type( 506 F('f_%s' % debug_builder_name, factory_type(
473 builder_name=debug_builder_name, 507 builder_name=debug_builder_name,
474 other_subdirs=subdirs_to_checkout, 508 other_subdirs=subdirs_to_checkout,
475 configuration=skia_factory.CONFIG_DEBUG, 509 configuration=skia_factory.CONFIG_DEBUG,
476 gm_image_subdir=gm_image_subdir, 510 gm_image_subdir=gm_image_subdir,
477 do_patch_step=(try_schedulers is not None), 511 do_patch_step=is_trybot,
478 perf_output_basedir=None, 512 perf_output_basedir=None,
479 compile_warnings_as_errors=False, 513 compile_warnings_as_errors=False,
480 **kwargs 514 **kwargs
481 ).Build()) 515 ).Build())
482 516
483 if do_release: 517 if do_release:
484 no_perf_builder_name = MakeReleaseBuilderName(builder_base_name) 518 no_perf_builder_name = MakeReleaseBuilderName(builder_props,
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(builder_props,
535 is_trybot=is_trybot)
500 B(perf_builder_name, 'f_%s' % perf_builder_name, 536 B(perf_builder_name, 'f_%s' % perf_builder_name,
501 scheduler=scheduler_name) 537 scheduler=scheduler_name)
502 F('f_%s' % perf_builder_name, factory_type( 538 F('f_%s' % perf_builder_name, factory_type(
503 builder_name=perf_builder_name, 539 builder_name=perf_builder_name,
504 other_subdirs=subdirs_to_checkout, 540 other_subdirs=subdirs_to_checkout,
505 configuration=skia_factory.CONFIG_RELEASE, 541 configuration=skia_factory.CONFIG_RELEASE,
506 gm_image_subdir=gm_image_subdir, 542 gm_image_subdir=gm_image_subdir,
507 do_patch_step=(try_schedulers is not None), 543 do_patch_step=is_trybot,
508 perf_output_basedir=perf_output_basedir, 544 perf_output_basedir=perf_output_basedir,
509 compile_warnings_as_errors=False, 545 compile_warnings_as_errors=False,
510 **kwargs 546 **kwargs
511 ).BuildPerfOnly()) 547 ).BuildPerfOnly())
512 548
513 549
514 def _MakeBuilderAndMaybeTrybotSet(do_trybots=True, **kwargs): 550 def _MakeBuilderAndMaybeTrybotSet(do_trybots=True, **kwargs):
515 _MakeBuilderSet(try_schedulers=None, **kwargs) 551 _MakeBuilderSet(try_schedulers=None, **kwargs)
516 if do_trybots: 552 if do_trybots:
517 _MakeBuilderSet(try_schedulers=TRY_SCHEDULERS, **kwargs) 553 _MakeBuilderSet(try_schedulers=TRY_SCHEDULERS, **kwargs)
518 554
519 555
520 def MakeBuilderSet(**kwargs): 556 def MakeBuilderSet(**kwargs):
521 _MakeBuilderAndMaybeTrybotSet(factory_type=skia_factory.SkiaFactory, **kwargs) 557 _MakeBuilderAndMaybeTrybotSet(factory_type=skia_factory.SkiaFactory, **kwargs)
522 558
523 559
524 def MakeHousekeeperBuilderSet(helper, do_trybots, do_upload_results): 560 def MakeHousekeeperBuilderSet(helper, do_trybots, do_upload_results):
525 B = helper.Builder 561 B = helper.Builder
526 F = helper.Factory 562 F = helper.Factory
527 563
528 builder_factory_scheduler = [ 564 builder_factory_scheduler = [
529 # The Percommit housekeeper 565 # The Percommit housekeeper
530 ('Skia_PerCommit_House_Keeping', 566 ('PerCommit-Housekeeping',
531 housekeeping_percommit_factory.HouseKeepingPerCommitFactory, 567 housekeeping_percommit_factory.HouseKeepingPerCommitFactory,
532 'skia_rel'), 568 'skia_rel'),
533 # The Periodic housekeeper 569 # The Periodic housekeeper
534 ('Skia_Periodic_House_Keeping', 570 ('Periodic-Housekeeping',
535 housekeeping_periodic_factory.HouseKeepingPeriodicFactory, 571 housekeeping_periodic_factory.HouseKeepingPeriodicFactory,
536 'skia_periodic'), 572 'skia_periodic'),
537 ] 573 ]
538 if do_trybots: 574 if do_trybots:
539 # Add the corresponding trybot builders to the above list. 575 # Add the corresponding trybot builders to the above list.
540 builder_factory_scheduler.extend([ 576 builder_factory_scheduler.extend([
541 (builder + TRYBOT_NAME_SUFFIX, factory, TRY_SCHEDULERS_STR) 577 (builder + BUILDER_NAME_SEP + TRYBOT_NAME_SUFFIX, factory,
578 TRY_SCHEDULERS_STR)
542 for (builder, factory, _scheduler) in builder_factory_scheduler]) 579 for (builder, factory, _scheduler) in builder_factory_scheduler])
543 580
544 for (builder_name, factory, scheduler) in builder_factory_scheduler: 581 for (builder_name, factory, scheduler) in builder_factory_scheduler:
545 B(builder_name, 'f_%s' % builder_name, scheduler=scheduler) 582 B(builder_name, 'f_%s' % builder_name, scheduler=scheduler)
546 F('f_%s' % builder_name, 583 F('f_%s' % builder_name,
547 factory( 584 factory(
548 do_upload_results=do_upload_results, 585 do_upload_results=do_upload_results,
549 target_platform=skia_factory.TARGET_PLATFORM_LINUX, 586 target_platform=skia_factory.TARGET_PLATFORM_LINUX,
550 builder_name=builder_name, 587 builder_name=builder_name,
551 do_patch_step=(scheduler == TRY_SCHEDULERS_STR), 588 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). 651 # request is associated with a change but the revisions match (#5 above).
615 if req1.source.changes and not req2.source.changes: 652 if req1.source.changes and not req2.source.changes:
616 return False 653 return False
617 if not req1.source.changes and req2.source.changes: 654 if not req1.source.changes and req2.source.changes:
618 return False 655 return False
619 if not (req1.source.changes and req2.source.changes): 656 if not (req1.source.changes and req2.source.changes):
620 if req1.source.revision != req2.source.revision: 657 if req1.source.revision != req2.source.revision:
621 return False 658 return False
622 659
623 return True 660 return True
OLDNEW
« no previous file with comments | « master/master_builders_cfg.py ('k') | master/slaves.cfg » ('j') | master/slaves.cfg » ('J')

Powered by Google App Engine
This is Rietveld 408576698