Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 from common.skia import global_constants | |
| 6 | |
| 7 | |
| 8 DEPS = [ | |
| 9 'ct_swarming', | |
| 10 'file', | |
| 11 'gclient', | |
| 12 'path', | |
| 13 'properties', | |
| 14 'step', | |
| 15 'skia', | |
| 16 'swarming', | |
| 17 'swarming_client', | |
| 18 'time', | |
| 19 ] | |
| 20 | |
| 21 | |
| 22 CT_PAGE_TYPE = '10k' | |
| 23 CT_DM_ISOLATE = 'ct_dm.isolate' | |
| 24 | |
| 25 # Number of slaves to shard CT runs to. | |
| 26 DEFAULT_CT_NUM_SLAVES = 100 | |
| 27 | |
| 28 # The SKP repository to use. | |
| 29 DEFAULT_SKPS_CHROMIUM_BUILD = '310ea93-42bd6bf' | |
| 30 | |
| 31 | |
| 32 def RunSteps(api): | |
| 33 # Checkout Skia and Chromium. | |
| 34 gclient_cfg = api.gclient.make_config() | |
| 35 src = gclient_cfg.solutions.add() | |
| 36 src.name = 'src' | |
| 37 src.url = 'https://chromium.googlesource.com/chromium/src.git' | |
| 38 skia = gclient_cfg.solutions.add() | |
| 39 skia.name = 'skia' | |
| 40 skia.url = global_constants.SKIA_REPO | |
| 41 gclient_cfg.got_revision_mapping['skia'] = 'got_revision' | |
| 42 api.gclient.checkout(gclient_config=gclient_cfg) | |
| 43 | |
| 44 # Checkout Swarming scripts. | |
| 45 api.swarming_client.checkout() | |
| 46 # Ensure swarming_client is compatible with what recipes expect. | |
| 47 api.swarming.check_client_version() | |
| 48 | |
| 49 chromium_checkout = api.path['checkout'] | |
| 50 skia_checkout = api.path['slave_build'].join('skia') | |
| 51 # Set api.path['checkout'] to Skia not to Chromium. | |
| 52 api.path['checkout'] = skia_checkout | |
|
borenet
2015/11/24 19:34:28
This seems dangerous, but I can't think of an exam
rmistry
2015/11/24 19:58:41
Specified Skia checkout first and removed this.
W
| |
| 53 | |
| 54 # Build DM in Debug mode. | |
| 55 flavor = api.skia.get_flavor({}) | |
| 56 flavor.compile('dm') | |
|
borenet
2015/11/24 19:34:28
It's probably better to just run the compile comma
rmistry
2015/11/24 19:58:41
Compile directly from where? do you mean api.skia.
borenet
2015/11/24 20:06:40
I mean just directly run "make dm" instead of tryi
rmistry
2015/11/25 14:11:21
Oh, makes sense. Done. Much better now, I could re
| |
| 57 | |
| 58 # TODO(rmistry): Remove the following after crrev.com/1469823003 is submitted. | |
| 59 api.file.copy( | |
| 60 'copy %s' % CT_DM_ISOLATE, | |
| 61 '/repos/chromium/src/chrome/%s' % CT_DM_ISOLATE, | |
| 62 chromium_checkout.join('chrome', CT_DM_ISOLATE)) | |
| 63 for f in ['run_ct_dm.py']: | |
|
borenet
2015/11/24 19:34:28
Why is the loop needed?
rmistry
2015/11/24 19:58:41
This section is temporary and will be removed. The
borenet
2015/11/24 20:06:40
Acknowledged.
| |
| 64 api.file.copy( | |
| 65 'copy %s' % f, | |
| 66 '/repos/chromium/src/content/test/ct/%s' % f, | |
| 67 chromium_checkout.join('content', 'test', 'ct', f)) | |
| 68 | |
| 69 # Record how long the step took in swarming tasks. | |
| 70 swarming_start_time = api.time.time() | |
| 71 | |
| 72 skps_chromium_build = api.properties.get( | |
| 73 'skps_chromium_build', DEFAULT_SKPS_CHROMIUM_BUILD) | |
|
borenet
2015/11/24 19:34:28
How will this be specified?
rmistry
2015/11/24 19:58:41
Will always probably be hardcoded here, made it se
borenet
2015/11/24 20:06:40
Acknowledged.
| |
| 74 ct_num_slaves = api.properties.get('ct_num_slaves', DEFAULT_CT_NUM_SLAVES) | |
| 75 | |
| 76 for slave_num in range(1, ct_num_slaves + 1): | |
| 77 # Download SKPs. | |
| 78 api.ct_swarming.download_skps(CT_PAGE_TYPE, slave_num, skps_chromium_build) | |
| 79 | |
| 80 # Create this slave's isolated.gen.json file to use for batcharchiving. | |
| 81 isolate_dir = chromium_checkout.join('chrome') | |
| 82 isolate_path = isolate_dir.join(CT_DM_ISOLATE) | |
| 83 extra_variables = { | |
| 84 'SLAVE_NUM': str(slave_num), | |
| 85 } | |
| 86 api.ct_swarming.create_isolated_gen_json( | |
| 87 isolate_path, isolate_dir, 'linux', slave_num, extra_variables) | |
| 88 | |
| 89 # Batcharchive everything on the isolate server for efficiency. | |
| 90 api.ct_swarming.batcharchive(ct_num_slaves) | |
| 91 swarm_hashes = ( | |
| 92 api.step.active_result.presentation.properties['swarm_hashes']).values() | |
| 93 | |
| 94 # Trigger all swarming tasks. | |
| 95 tasks = api.ct_swarming.trigger_swarming_tasks( | |
| 96 swarm_hashes, task_name_prefix='ct-10k-dm', | |
| 97 dimensions={'os': 'Ubuntu', 'gpu': '10de'}) | |
| 98 | |
| 99 # Now collect all tasks. | |
| 100 api.ct_swarming.collect_swarming_tasks(tasks) | |
| 101 | |
| 102 print ('Running isolating, triggering and collecting swarming tasks took a ' | |
| 103 'total of %s seconds') % (api.time.time() - swarming_start_time) | |
| 104 | |
| 105 | |
| 106 def GenTests(api): | |
| 107 parent_got_swarming_client_revision = '12345' | |
| 108 ct_num_slaves = 5 | |
| 109 | |
| 110 yield( | |
| 111 api.test('CT_DM_10k_SKPs') + | |
| 112 api.properties( | |
| 113 buildername='CT-DM-10k-SKPs', | |
| 114 parent_got_swarming_client_revision=parent_got_swarming_client_revision, | |
| 115 ct_num_slaves=ct_num_slaves, | |
| 116 ) | |
| 117 ) | |
| 118 | |
| 119 yield( | |
| 120 api.test('CT_DM_10k_SKPs_slave3_failure') + | |
| 121 api.step_data('ct-10k-dm-3 on Ubuntu', retcode=1) + | |
| 122 api.properties( | |
| 123 buildername='CT-DM-10k-SKPs', | |
| 124 parent_got_swarming_client_revision=parent_got_swarming_client_revision, | |
| 125 ct_num_slaves=ct_num_slaves, | |
| 126 ) | |
| 127 ) | |
| OLD | NEW |