Index: scripts/slave/recipes/skia/swarm_trigger.py |
diff --git a/scripts/slave/recipes/skia/swarm_trigger.py b/scripts/slave/recipes/skia/swarm_trigger.py |
index 1b2cd94130ece961a8d6decfb78932c595841204..98ff77c16a2435209f0b610bad989d57fb3b219c 100644 |
--- a/scripts/slave/recipes/skia/swarm_trigger.py |
+++ b/scripts/slave/recipes/skia/swarm_trigger.py |
@@ -514,6 +514,27 @@ def upload_coverage_results(api, task, got_revision, is_trybot): |
) |
+def download_asset(api, infrabots_dir, recipes_hash, asset): |
+ """Trigger a swarming task to download and isolate the given asset.""" |
+ return api.skia_swarming.isolate_and_trigger_task( |
+ infrabots_dir.join('download_asset.isolate'), |
+ api.path['slave_build'], |
+ 'download_%s' % asset, |
+ {'ASSET': asset, 'GSUTIL': '../../depot_tools/gsutil.py'}, |
rmistry
2016/06/15 13:51:31
Instead of hardcoding gsutil.py would api.path['de
borenet
2016/06/15 19:53:23
No, the path module will resolve to an absolute pa
rmistry
2016/06/15 20:11:00
That would translate to /b/depot_tools ?
borenet
2016/06/15 20:25:09
Yeah, I think so. Because the Swarming task runs
|
+ {'pool': 'Skia', 'os': 'Ubuntu'}, |
+ extra_isolate_hashes=[recipes_hash], |
+ idempotent=True, |
+ isolate_blacklist=['.git', 'out', '*.pyc'], |
+ store_output=False, |
+ ) |
+ |
+ |
+def collect_hashes(api, tasks): |
+ """Collect the isolated hash for each swarming task.""" |
+ return [ |
+ api.skia_swarming.collect_swarming_task_isolate_hash(t) for t in tasks] |
+ |
+ |
def RunSteps(api): |
got_revision = checkout_steps(api) |
builder_spec = api.skia.get_builder_spec(api.path['checkout'], |
@@ -531,41 +552,51 @@ def RunSteps(api): |
recipes_hash = isolate_recipes(api) |
extra_hashes = [recipes_hash] |
+ # Get ready to compile. |
+ compile_deps = [] |
+ extra_compile_hashes = [recipes_hash] |
+ |
# Android bots require an SDK. |
if 'Android' in api.properties['buildername']: |
- test_data = 'a27a70d73b85191b9e671ff2a44547c3f7cc15ee' |
- hash_file = infrabots_dir.join('android_sdk_hash') |
- # try/except as a temporary measure to prevent breakages for backfills |
- # and branches. |
- try: |
- h = api.skia._readfile(hash_file, |
- name='Read android_sdk_hash', |
- test_data=test_data).rstrip() |
- except api.step.StepFailure: |
- # Just fall back on the original hash. |
- h = 'a27a70d73b85191b9e671ff2a44547c3f7cc15ee' |
- extra_hashes.append(h) |
- |
+ if api.path.exists(infrabots_dir.join('assets', 'android_sdk')): |
+ compile_deps.append(download_asset( |
+ api, infrabots_dir, recipes_hash, 'android_sdk')) |
+ else: |
+ # TODO(borenet): Remove this legacy method after 7/1/2016. |
+ test_data = 'a27a70d73b85191b9e671ff2a44547c3f7cc15ee' |
+ hash_file = infrabots_dir.join('android_sdk_hash') |
+ # try/except as a temporary measure to prevent breakages for backfills |
+ # and branches. |
+ try: |
+ h = api.skia._readfile(hash_file, |
+ name='Read android_sdk_hash', |
+ test_data=test_data).rstrip() |
+ except api.step.StepFailure: |
+ # Just fall back on the original hash. |
+ h = 'a27a70d73b85191b9e671ff2a44547c3f7cc15ee' |
+ extra_hashes.append(h) |
+ extra_compile_hashes.append(h) |
+ |
+ extra_compile_hashes.extend(collect_hashes(api, compile_deps)) |
+ |
+ # Compile. |
do_compile_steps = builder_spec.get('do_compile_steps', True) |
- compile_hash = None |
if do_compile_steps: |
- compile_hash = compile_steps_swarm(api, builder_spec, got_revision, |
- infrabots_dir, extra_hashes) |
+ extra_hashes.append(compile_steps_swarm( |
+ api, builder_spec, got_revision, infrabots_dir, extra_compile_hashes)) |
if builder_cfg['role'] == 'Housekeeper': |
housekeeper_swarm(api, builder_spec, got_revision, infrabots_dir, |
extra_hashes) |
return |
+ # Get ready to test/perf. |
do_test_steps = builder_spec['do_test_steps'] |
do_perf_steps = builder_spec['do_perf_steps'] |
if not (do_test_steps or do_perf_steps): |
return |
- if compile_hash: |
- extra_hashes.append(compile_hash) |
- |
api.skia.download_skps(api.path['slave_build'].join('tmp'), |
api.path['slave_build'].join('skps'), |
False) |
@@ -590,7 +621,8 @@ def RunSteps(api): |
got_revision, is_trybot) |
-def test_for_bot(api, builder, mastername, slavename, testname=None): |
+def test_for_bot(api, builder, mastername, slavename, testname=None, |
+ legacy_android_sdk=False): |
"""Generate a test for the given bot.""" |
testname = testname or builder |
test = ( |
@@ -609,6 +641,13 @@ def test_for_bot(api, builder, mastername, slavename, testname=None): |
test += api.properties(issue=500, |
patchset=1, |
rietveld='https://codereview.chromium.org') |
+ if 'Android' in builder: |
+ if not legacy_android_sdk: |
+ test += api.path.exists(api.path['slave_build'].join( |
+ 'skia', 'infra', 'bots', 'assets', 'android_sdk')) |
+ test += api.step_data( |
+ 'upload new .isolated file for download_android_sdk', |
+ stdout=api.raw_io.output('def456 XYZ.isolated')) |
if 'Coverage' not in builder: |
test += api.step_data( |
'upload new .isolated file for compile_skia', |
@@ -659,6 +698,13 @@ def GenTests(api): |
builder = 'Build-Ubuntu-GCC-Arm7-Release-Android_Vulkan' |
master = 'client.skia.compile' |
slave = 'skiabot-linux-compile-000' |
- test = test_for_bot(api, builder, master, slave, 'Missing_android_sdk_hash') |
+ test = test_for_bot(api, builder, master, slave, 'legacy_android_sdk', |
+ legacy_android_sdk=True) |
+ test += api.step_data('Read android_sdk_hash', |
+ stdout=api.raw_io.output('<android_sdk_hash>')) |
+ yield test |
+ |
+ test = test_for_bot(api, builder, master, slave, 'Missing_android_sdk_hash', |
+ legacy_android_sdk=True) |
test += api.step_data('Read android_sdk_hash', retcode=1) |
yield test |