Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 for the Skia RecreateSKPs Bot.""" | 6 """Recipe for the Skia RecreateSKPs Bot.""" |
| 7 | 7 |
| 8 | 8 |
| 9 DEPS = [ | 9 DEPS = [ |
| 10 'build/file', | 10 'build/file', |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 api.step('GN', | 103 api.step('GN', |
| 104 [gn, 'gen', out_dir], | 104 [gn, 'gen', out_dir], |
| 105 env={'CPPFLAGS': '-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1', | 105 env={'CPPFLAGS': '-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1', |
| 106 'GYP_GENERATORS': 'ninja'}, | 106 'GYP_GENERATORS': 'ninja'}, |
| 107 cwd=src_dir) | 107 cwd=src_dir) |
| 108 # Build Chrome. | 108 # Build Chrome. |
| 109 api.step('Build Chrome', | 109 api.step('Build Chrome', |
| 110 ['ninja', '-C', out_dir, 'chrome'], | 110 ['ninja', '-C', out_dir, 'chrome'], |
| 111 cwd=src_dir) | 111 cwd=src_dir) |
| 112 | 112 |
| 113 # Download boto file (needed by recreate_skps.py) to tmp dir. | |
| 114 boto_file = api.path['slave_build'].join('tmp', '.boto') | |
| 115 api.python.inline( | |
| 116 'download boto file', | |
| 117 """ | |
| 118 import os | |
| 119 import urllib2 | |
| 120 | |
| 121 BOTO_URL = 'http://metadata/computeMetadata/v1/project/attributes/boto-file' | |
| 122 | |
| 123 dest_path = '%s' | |
| 124 dest_dir = os.path.dirname(dest_path) | |
| 125 if not os.path.exists(dest_dir): | |
| 126 os.makedirs(dest_dir) | |
| 127 | |
| 128 req = urllib2.Request(BOTO_URL, headers={'Metadata-Flavor': 'Google'}) | |
| 129 contents = urllib2.urlopen(req).read() | |
| 130 | |
| 131 with open(dest_path, 'w') as f: | |
| 132 f.write(contents) | |
| 133 """ % boto_file) | |
| 134 | |
| 135 # Clean up the output dir. | 113 # Clean up the output dir. |
| 136 output_dir = api.path['slave_build'].join('skp_output') | 114 output_dir = api.path['slave_build'].join('skp_output') |
| 137 if api.path.exists(output_dir): | 115 if api.path.exists(output_dir): |
| 138 api.file.rmtree('skp_output', output_dir) | 116 api.file.rmtree('skp_output', output_dir) |
| 139 api.file.makedirs('skp_output', output_dir) | 117 api.file.makedirs('skp_output', output_dir) |
| 140 | 118 |
| 141 # Capture the SKPs. | 119 # Capture the SKPs. |
| 142 path_var= api.path.pathsep.join([str(api.path['depot_tools']), '%(PATH)s']) | 120 path_var= api.path.pathsep.join([str(api.path['depot_tools']), '%(PATH)s']) |
| 143 env = { | 121 env = { |
| 144 'CHROME_HEADLESS': '1', | 122 'CHROME_HEADLESS': '1', |
| 145 'PATH': path_var, | 123 'PATH': path_var, |
| 146 } | 124 } |
| 147 boto_env = { | |
| 148 'AWS_CREDENTIAL_FILE': boto_file, | |
| 149 'BOTO_CONFIG': boto_file, | |
| 150 } | |
| 151 recreate_skps_env = {} | 125 recreate_skps_env = {} |
|
rmistry
2016/10/10 17:09:29
Delete these 2 lines and set env=env on line 137.
borenet
2016/10/10 17:17:47
Done.
| |
| 152 recreate_skps_env.update(env) | 126 recreate_skps_env.update(env) |
| 153 recreate_skps_env.update(boto_env) | |
| 154 asset_dir = api.vars.infrabots_dir.join('assets', 'skp') | 127 asset_dir = api.vars.infrabots_dir.join('assets', 'skp') |
| 155 cmd = ['python', asset_dir.join('create.py'), | 128 cmd = ['python', asset_dir.join('create.py'), |
| 156 '--chrome_src_path', src_dir, | 129 '--chrome_src_path', src_dir, |
| 157 '--browser_executable', src_dir.join('out', 'Release', 'chrome'), | 130 '--browser_executable', src_dir.join('out', 'Release', 'chrome'), |
| 158 '--target_dir', output_dir] | 131 '--target_dir', output_dir] |
| 159 if 'Canary' not in api.properties['buildername']: | 132 if 'Canary' not in api.properties['buildername']: |
| 160 cmd.append('--upload_to_partner_bucket') | 133 cmd.append('--upload_to_partner_bucket') |
| 161 api.step('Recreate SKPs', | 134 api.step('Recreate SKPs', |
| 162 cmd=cmd, | 135 cmd=cmd, |
| 163 cwd=api.vars.skia_dir, | 136 cwd=api.vars.skia_dir, |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 184 api.properties(buildername=builder, | 157 api.properties(buildername=builder, |
| 185 mastername=mastername, | 158 mastername=mastername, |
| 186 slavename=slavename, | 159 slavename=slavename, |
| 187 revision='abc123', | 160 revision='abc123', |
| 188 buildnumber=2, | 161 buildnumber=2, |
| 189 path_config='kitchen', | 162 path_config='kitchen', |
| 190 swarm_out_dir='[SWARM_OUT_DIR]') + | 163 swarm_out_dir='[SWARM_OUT_DIR]') + |
| 191 api.path.exists(api.path['slave_build'].join('skp_output')) | 164 api.path.exists(api.path['slave_build'].join('skp_output')) |
| 192 ) | 165 ) |
| 193 yield test | 166 yield test |
| OLD | NEW |