| 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 os |    9 import os | 
|   10 import json |   10 import json | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
|   41       'Build-Ubuntu-GCC-x86_64-Debug', |   41       'Build-Ubuntu-GCC-x86_64-Debug', | 
|   42       'Build-Ubuntu-GCC-x86_64-Debug-GN', |   42       'Build-Ubuntu-GCC-x86_64-Debug-GN', | 
|   43       'Build-Ubuntu-GCC-x86_64-Release-RemoteRun', |   43       'Build-Ubuntu-GCC-x86_64-Release-RemoteRun', | 
|   44       'Build-Ubuntu-GCC-x86_64-Release-Trybot', |   44       'Build-Ubuntu-GCC-x86_64-Release-Trybot', | 
|   45       'Build-Win-MSVC-x86_64-Release', |   45       'Build-Win-MSVC-x86_64-Release', | 
|   46       'Build-Win-MSVC-x86_64-Release-Vulkan', |   46       'Build-Win-MSVC-x86_64-Release-Vulkan', | 
|   47       'Housekeeper-PerCommit', |   47       'Housekeeper-PerCommit', | 
|   48       'Housekeeper-Nightly-RecreateSKPs_Canary', |   48       'Housekeeper-Nightly-RecreateSKPs_Canary', | 
|   49       'Infra-PerCommit', |   49       'Infra-PerCommit', | 
|   50       'Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Trybot', |   50       'Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Trybot', | 
 |   51       'Perf-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-CT_BENCH_1k_SKPs', | 
|   51       'Test-Android-GCC-Nexus7v2-GPU-Tegra3-Arm7-Release', |   52       'Test-Android-GCC-Nexus7v2-GPU-Tegra3-Arm7-Release', | 
|   52       'Test-Android-GCC-NVIDIA_Shield-GPU-TegraX1-Arm64-Debug-Vulkan', |   53       'Test-Android-GCC-NVIDIA_Shield-GPU-TegraX1-Arm64-Debug-Vulkan', | 
|   53       'Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release', |   54       'Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release', | 
|   54       'Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release', |   55       'Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release', | 
|   55       'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug', |   56       'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug', | 
|   56       'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN', |   57       'Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN', | 
|   57       'Test-Win8-MSVC-ShuttleA-GPU-HD7770-x86_64-Release', |   58       'Test-Win8-MSVC-ShuttleA-GPU-HD7770-x86_64-Release', | 
|   58       'Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Release', |   59       'Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Release', | 
|   59     ], |   60     ], | 
|   60   }, |   61   }, | 
| (...skipping 29 matching lines...) Expand all  Loading... | 
|   90         is_trybot=api.builder_name_schema.IsTrybot(builder_name)) |   91         is_trybot=api.builder_name_schema.IsTrybot(builder_name)) | 
|   91   return builder_name |   92   return builder_name | 
|   92  |   93  | 
|   93  |   94  | 
|   94 def swarm_dimensions(builder_cfg): |   95 def swarm_dimensions(builder_cfg): | 
|   95   """Return a dict of keys and values to be used as Swarming bot dimensions.""" |   96   """Return a dict of keys and values to be used as Swarming bot dimensions.""" | 
|   96   dimensions = { |   97   dimensions = { | 
|   97     'pool': 'Skia', |   98     'pool': 'Skia', | 
|   98   } |   99   } | 
|   99   dimensions['os'] = builder_cfg.get('os', 'Ubuntu') |  100   dimensions['os'] = builder_cfg.get('os', 'Ubuntu') | 
 |  101   if builder_cfg.get('extra_config', '').startswith('CT_'): | 
 |  102     dimensions['pool'] = 'SkiaCT' | 
 |  103     return dimensions  # Do not need any more dimensions for CT builders. | 
|  100   if 'Win' in builder_cfg.get('os', ''): |  104   if 'Win' in builder_cfg.get('os', ''): | 
|  101     dimensions['os'] = 'Windows' |  105     dimensions['os'] = 'Windows' | 
|  102   if builder_cfg['role'] in ('Test', 'Perf'): |  106   if builder_cfg['role'] in ('Test', 'Perf'): | 
|  103     if 'Android' in builder_cfg['os']: |  107     if 'Android' in builder_cfg['os']: | 
|  104       # For Android, the device type is a better dimension than CPU or GPU. |  108       # For Android, the device type is a better dimension than CPU or GPU. | 
|  105       dimensions['device_type'] = { |  109       dimensions['device_type'] = { | 
|  106         'AndroidOne':    'sprout', |  110         'AndroidOne':    'sprout', | 
|  107         'GalaxyS3':      'm0',  #'smdk4x12', Detected incorrectly by swarming? |  111         'GalaxyS3':      'm0',  #'smdk4x12', Detected incorrectly by swarming? | 
|  108         'GalaxyS4':      None,  # TODO(borenet,kjlubick) |  112         'GalaxyS4':      None,  # TODO(borenet,kjlubick) | 
|  109         'NVIDIA_Shield': 'foster', |  113         'NVIDIA_Shield': 'foster', | 
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  281       api.properties['buildnumber'], |  285       api.properties['buildnumber'], | 
|  282       builder_cfg, |  286       builder_cfg, | 
|  283       got_revision, |  287       got_revision, | 
|  284       infrabots_dir, |  288       infrabots_dir, | 
|  285       idempotent=False, |  289       idempotent=False, | 
|  286       store_output=False, |  290       store_output=False, | 
|  287       extra_isolate_hashes=extra_isolate_hashes) |  291       extra_isolate_hashes=extra_isolate_hashes) | 
|  288   return api.swarming.collect_swarming_task(task) |  292   return api.swarming.collect_swarming_task(task) | 
|  289  |  293  | 
|  290  |  294  | 
 |  295 def ct_skps_swarm(api, builder_cfg, got_revision, infrabots_dir, | 
 |  296                   extra_isolate_hashes): | 
 |  297   task = trigger_task( | 
 |  298       api, | 
 |  299       'ct_skps', | 
 |  300       api.properties['buildername'], | 
 |  301       api.properties['mastername'], | 
 |  302       api.properties['slavename'], | 
 |  303       api.properties['buildnumber'], | 
 |  304       builder_cfg, | 
 |  305       got_revision, | 
 |  306       infrabots_dir, | 
 |  307       idempotent=False, | 
 |  308       store_output=False, | 
 |  309       extra_isolate_hashes=extra_isolate_hashes) | 
 |  310   return api.swarming.collect_swarming_task(task) | 
 |  311  | 
 |  312  | 
|  291 def infra_swarm(api, got_revision, infrabots_dir, extra_isolate_hashes): |  313 def infra_swarm(api, got_revision, infrabots_dir, extra_isolate_hashes): | 
|  292   # Fake the builder cfg. |  314   # Fake the builder cfg. | 
|  293   builder_cfg = { |  315   builder_cfg = { | 
|  294     'role': 'Infra', |  316     'role': 'Infra', | 
|  295     'is_trybot': api.builder_name_schema.IsTrybot( |  317     'is_trybot': api.builder_name_schema.IsTrybot( | 
|  296          api.properties['buildername']) |  318          api.properties['buildername']) | 
|  297   } |  319   } | 
|  298   task = trigger_task( |  320   task = trigger_task( | 
|  299       api, |  321       api, | 
|  300       'infra', |  322       'infra', | 
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  620     return infra_swarm(api, got_revision, infrabots_dir, extra_hashes) |  642     return infra_swarm(api, got_revision, infrabots_dir, extra_hashes) | 
|  621  |  643  | 
|  622   builder_cfg = api.builder_name_schema.DictForBuilderName( |  644   builder_cfg = api.builder_name_schema.DictForBuilderName( | 
|  623       api.properties['buildername']) |  645       api.properties['buildername']) | 
|  624  |  646  | 
|  625   if 'RecreateSKPs' in api.properties['buildername']: |  647   if 'RecreateSKPs' in api.properties['buildername']: | 
|  626     recreate_skps_swarm(api, builder_cfg, got_revision, infrabots_dir, |  648     recreate_skps_swarm(api, builder_cfg, got_revision, infrabots_dir, | 
|  627                         extra_hashes) |  649                         extra_hashes) | 
|  628     return |  650     return | 
|  629  |  651  | 
 |  652   if '-CT_' in api.properties['buildername']: | 
 |  653     ct_skps_swarm(api, builder_cfg, got_revision, infrabots_dir, extra_hashes) | 
 |  654     return | 
 |  655  | 
|  630   # Compile. |  656   # Compile. | 
|  631   do_compile_steps = True |  657   do_compile_steps = True | 
|  632   if 'Coverage' in api.properties['buildername']: |  658   if 'Coverage' in api.properties['buildername']: | 
|  633     do_compile_steps = False |  659     do_compile_steps = False | 
|  634   if do_compile_steps: |  660   if do_compile_steps: | 
|  635     extra_hashes.append(compile_steps_swarm( |  661     extra_hashes.append(compile_steps_swarm( | 
|  636         api, builder_cfg, got_revision, infrabots_dir)) |  662         api, builder_cfg, got_revision, infrabots_dir)) | 
|  637  |  663  | 
|  638   if builder_cfg['role'] == 'Housekeeper': |  664   if builder_cfg['role'] == 'Housekeeper': | 
|  639     housekeeper_swarm(api, builder_cfg, got_revision, infrabots_dir, |  665     housekeeper_swarm(api, builder_cfg, got_revision, infrabots_dir, | 
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  699     test += api.properties(issue=500, |  725     test += api.properties(issue=500, | 
|  700                            patchset=1, |  726                            patchset=1, | 
|  701                            rietveld='https://codereview.chromium.org') |  727                            rietveld='https://codereview.chromium.org') | 
|  702   if 'Android' in builder: |  728   if 'Android' in builder: | 
|  703     paths.append(api.path['slave_build'].join( |  729     paths.append(api.path['slave_build'].join( | 
|  704         'skia', 'infra', 'bots', 'assets', 'android_sdk', 'VERSION')) |  730         'skia', 'infra', 'bots', 'assets', 'android_sdk', 'VERSION')) | 
|  705   if 'Test' in builder and 'Coverage' not in builder: |  731   if 'Test' in builder and 'Coverage' not in builder: | 
|  706     test += api.step_data( |  732     test += api.step_data( | 
|  707         'upload new .isolated file for test_skia', |  733         'upload new .isolated file for test_skia', | 
|  708         stdout=api.raw_io.output('def456 XYZ.isolated')) |  734         stdout=api.raw_io.output('def456 XYZ.isolated')) | 
|  709   if 'Perf' in builder: |  735   if 'Perf' in builder and '-CT_' not in builder: | 
|  710     test += api.step_data( |  736     test += api.step_data( | 
|  711         'upload new .isolated file for perf_skia', |  737         'upload new .isolated file for perf_skia', | 
|  712         stdout=api.raw_io.output('def456 XYZ.isolated')) |  738         stdout=api.raw_io.output('def456 XYZ.isolated')) | 
|  713   if 'Housekeeper' in builder and 'RecreateSKPs' not in builder: |  739   if 'Housekeeper' in builder and 'RecreateSKPs' not in builder: | 
|  714     test += api.step_data( |  740     test += api.step_data( | 
|  715         'upload new .isolated file for housekeeper_skia', |  741         'upload new .isolated file for housekeeper_skia', | 
|  716         stdout=api.raw_io.output('def456 XYZ.isolated')) |  742         stdout=api.raw_io.output('def456 XYZ.isolated')) | 
|  717   if 'Win' in builder: |  743   if 'Win' in builder: | 
|  718     paths.append(api.path['slave_build'].join( |  744     paths.append(api.path['slave_build'].join( | 
|  719         'skia', 'infra', 'bots', 'assets', 'win_toolchain', 'VERSION')) |  745         'skia', 'infra', 'bots', 'assets', 'win_toolchain', 'VERSION')) | 
|  720     paths.append(api.path['slave_build'].join( |  746     paths.append(api.path['slave_build'].join( | 
|  721         'skia', 'infra', 'bots', 'assets', 'win_vulkan_sdk', 'VERSION')) |  747         'skia', 'infra', 'bots', 'assets', 'win_vulkan_sdk', 'VERSION')) | 
|  722   paths.append(api.path['slave_build'].join( |  748   paths.append(api.path['slave_build'].join( | 
|  723       'skia', 'infra', 'bots', 'assets', 'skimage', 'VERSION')) |  749       'skia', 'infra', 'bots', 'assets', 'skimage', 'VERSION')) | 
|  724   paths.append(api.path['slave_build'].join( |  750   paths.append(api.path['slave_build'].join( | 
|  725       'skia', 'infra', 'bots', 'assets', 'skp', 'VERSION')) |  751       'skia', 'infra', 'bots', 'assets', 'skp', 'VERSION')) | 
|  726  |  752  | 
|  727   test += api.path.exists(*paths) |  753   test += api.path.exists(*paths) | 
|  728  |  754  | 
|  729   return test |  755   return test | 
|  730  |  756  | 
|  731  |  757  | 
|  732 def GenTests(api): |  758 def GenTests(api): | 
|  733   for mastername, slaves in TEST_BUILDERS.iteritems(): |  759   for mastername, slaves in TEST_BUILDERS.iteritems(): | 
|  734     for slavename, builders_by_slave in slaves.iteritems(): |  760     for slavename, builders_by_slave in slaves.iteritems(): | 
|  735       for builder in builders_by_slave: |  761       for builder in builders_by_slave: | 
|  736         yield test_for_bot(api, builder, mastername, slavename) |  762         yield test_for_bot(api, builder, mastername, slavename) | 
| OLD | NEW |