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 | 5 |
6 # Recipe module for Skia Swarming trigger. | 6 # Recipe module for Skia Swarming trigger. |
7 | 7 |
8 | 8 |
9 import json | 9 import json |
10 | 10 |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 api.gsutil.upload( | 554 api.gsutil.upload( |
555 name='upload line-by-line coverage data', | 555 name='upload line-by-line coverage data', |
556 source=dst_lbl_file, | 556 source=dst_lbl_file, |
557 bucket='skia-infra', | 557 bucket='skia-infra', |
558 dest='/'.join(('coverage-json-v1', gs_json_path, | 558 dest='/'.join(('coverage-json-v1', gs_json_path, |
559 dst_lbl_file_basename)), | 559 dst_lbl_file_basename)), |
560 env={'AWS_CREDENTIAL_FILE': None, 'BOTO_CONFIG': None}, | 560 env={'AWS_CREDENTIAL_FILE': None, 'BOTO_CONFIG': None}, |
561 ) | 561 ) |
562 | 562 |
563 | 563 |
564 def cipd_pkg(api, infrabots_dir, asset_name): | |
565 """Find and return the CIPD package info for the given asset.""" | |
566 version_file = infrabots_dir.join('assets', asset_name, 'VERSION') | |
567 version = api.skia._readfile(version_file, | |
568 name='read %s VERSION' % asset_name, | |
569 test_data='0').rstrip() | |
570 version = 'version:%s' % version | |
571 return (asset_name, 'skia/bots/%s' % asset_name, version) | |
572 | |
573 | |
574 def RunSteps(api): | 564 def RunSteps(api): |
575 got_revision = checkout_steps(api) | 565 got_revision = checkout_steps(api) |
576 api.skia_swarming.setup( | 566 api.skia_swarming.setup( |
577 api.path['checkout'].join('infra', 'bots', 'tools', 'luci-go'), | 567 api.path['checkout'].join('infra', 'bots', 'tools', 'luci-go'), |
578 swarming_rev='') | 568 swarming_rev='') |
579 | 569 |
580 # Run gsutil.py to ensure that it's installed. | 570 # Run gsutil.py to ensure that it's installed. |
581 api.gsutil(['help']) | 571 api.gsutil(['help']) |
582 | 572 |
583 recipes_hash = isolate_recipes(api) | 573 recipes_hash = isolate_recipes(api) |
584 extra_hashes = [recipes_hash] | 574 extra_hashes = [recipes_hash] |
585 | 575 |
586 # Get ready to compile. | 576 # Get ready to compile. |
587 compile_cipd_deps = [] | 577 compile_cipd_deps = [] |
588 extra_compile_hashes = [recipes_hash] | 578 extra_compile_hashes = [recipes_hash] |
589 | 579 |
590 infrabots_dir = api.path['checkout'].join('infra', 'bots') | 580 infrabots_dir = api.path['checkout'].join('infra', 'bots') |
591 if 'Infra' in api.properties['buildername']: | 581 if 'Infra' in api.properties['buildername']: |
592 return infra_swarm(api, got_revision, infrabots_dir, extra_hashes) | 582 return infra_swarm(api, got_revision, infrabots_dir, extra_hashes) |
593 | 583 |
594 builder_spec = api.skia.get_builder_spec(api.path['checkout'], | 584 builder_spec = api.skia.get_builder_spec(api.path['checkout'], |
595 api.properties['buildername']) | 585 api.properties['buildername']) |
596 builder_cfg = builder_spec['builder_cfg'] | 586 builder_cfg = builder_spec['builder_cfg'] |
597 | 587 |
598 # Android bots require an SDK. | 588 # Android bots require an SDK. |
599 if 'Android' in api.properties['buildername']: | 589 if 'Android' in api.properties['buildername']: |
600 android_sdk_version_file = infrabots_dir.join( | 590 android_sdk_version_file = infrabots_dir.join( |
601 'assets', 'android_sdk', 'VERSION') | 591 'assets', 'android_sdk', 'VERSION') |
602 if api.path.exists(android_sdk_version_file): | 592 if api.path.exists(android_sdk_version_file): |
603 compile_cipd_deps.append(cipd_pkg(api, infrabots_dir, 'android_sdk')) | 593 android_sdk_version = api.skia._readfile(android_sdk_version_file, |
| 594 name='read android_sdk VERSION', |
| 595 test_data='0').rstrip() |
| 596 android_sdk_version = 'version:%s' % android_sdk_version |
| 597 pkg = ('android_sdk', 'skia/bots/android_sdk', android_sdk_version) |
| 598 compile_cipd_deps.append(pkg) |
604 else: | 599 else: |
605 # TODO(borenet): Remove this legacy method after 7/1/2016. | 600 # TODO(borenet): Remove this legacy method after 7/1/2016. |
606 test_data = 'a27a70d73b85191b9e671ff2a44547c3f7cc15ee' | 601 test_data = 'a27a70d73b85191b9e671ff2a44547c3f7cc15ee' |
607 hash_file = infrabots_dir.join('android_sdk_hash') | 602 hash_file = infrabots_dir.join('android_sdk_hash') |
608 # try/except as a temporary measure to prevent breakages for backfills | 603 # try/except as a temporary measure to prevent breakages for backfills |
609 # and branches. | 604 # and branches. |
610 try: | 605 try: |
611 h = api.skia._readfile(hash_file, | 606 h = api.skia._readfile(hash_file, |
612 name='Read android_sdk_hash', | 607 name='Read android_sdk_hash', |
613 test_data=test_data).rstrip() | 608 test_data=test_data).rstrip() |
(...skipping 21 matching lines...) Expand all Loading... |
635 cipd_packages = [] | 630 cipd_packages = [] |
636 | 631 |
637 do_test_steps = builder_spec['do_test_steps'] | 632 do_test_steps = builder_spec['do_test_steps'] |
638 do_perf_steps = builder_spec['do_perf_steps'] | 633 do_perf_steps = builder_spec['do_perf_steps'] |
639 | 634 |
640 if not (do_test_steps or do_perf_steps): | 635 if not (do_test_steps or do_perf_steps): |
641 return | 636 return |
642 | 637 |
643 api.skia.download_skps(api.path['slave_build'].join('tmp'), | 638 api.skia.download_skps(api.path['slave_build'].join('tmp'), |
644 api.path['slave_build'].join('skps')) | 639 api.path['slave_build'].join('skps')) |
645 if api.path.exists(api.path['slave_build'].join('skia', 'SK_IMAGE_VERSION')): | 640 api.skia.download_images(api.path['slave_build'].join('tmp'), |
646 # TODO(borenet): Remove this once enough time has passed. | 641 api.path['slave_build'].join('images')) |
647 api.skia.download_images(api.path['slave_build'].join('tmp'), | |
648 api.path['slave_build'].join('images')) | |
649 else: | |
650 cipd_packages.append(cipd_pkg(api, infrabots_dir, 'skimage')) | |
651 | 642 |
652 test_task = None | 643 test_task = None |
653 perf_task = None | 644 perf_task = None |
654 if do_test_steps: | 645 if do_test_steps: |
655 test_task = test_steps_trigger(api, builder_spec, got_revision, | 646 test_task = test_steps_trigger(api, builder_spec, got_revision, |
656 infrabots_dir, extra_hashes, cipd_packages) | 647 infrabots_dir, extra_hashes, cipd_packages) |
657 if do_perf_steps: | 648 if do_perf_steps: |
658 perf_task = perf_steps_trigger(api, builder_spec, got_revision, | 649 perf_task = perf_steps_trigger(api, builder_spec, got_revision, |
659 infrabots_dir, extra_hashes, cipd_packages) | 650 infrabots_dir, extra_hashes, cipd_packages) |
660 is_trybot = builder_cfg['is_trybot'] | 651 is_trybot = builder_cfg['is_trybot'] |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 test = test_for_bot(api, builder, master, slave, 'Missing_android_sdk_hash', | 748 test = test_for_bot(api, builder, master, slave, 'Missing_android_sdk_hash', |
758 legacy_android_sdk=True) | 749 legacy_android_sdk=True) |
759 test += api.step_data('Read android_sdk_hash', retcode=1) | 750 test += api.step_data('Read android_sdk_hash', retcode=1) |
760 yield test | 751 yield test |
761 | 752 |
762 builder = 'Build-Win-MSVC-x86_64-Release-Vulkan' | 753 builder = 'Build-Win-MSVC-x86_64-Release-Vulkan' |
763 master = 'client.skia.compile' | 754 master = 'client.skia.compile' |
764 test = test_for_bot(api, builder, master, slave, 'legacy_win_toolchain', | 755 test = test_for_bot(api, builder, master, slave, 'legacy_win_toolchain', |
765 legacy_win_toolchain=True) | 756 legacy_win_toolchain=True) |
766 yield test | 757 yield test |
767 | |
768 builder = 'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug' | |
769 master = 'client.skia' | |
770 test = test_for_bot(api, builder, master, slave, 'legacy_skimage_version') | |
771 test += api.path.exists( | |
772 api.path['slave_build'].join('skia', 'SK_IMAGE_VERSION')) | |
773 test += api.step_data('Get downloaded SK_IMAGE_VERSION', retcode=1) | |
774 yield test | |
OLD | NEW |