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 from recipe_engine import recipe_api | 6 from recipe_engine import recipe_api |
7 import shlex | 7 import shlex |
8 | 8 |
9 | 9 |
10 DEFAULT_TASK_EXPIRATION = 20*60*60 | 10 DEFAULT_TASK_EXPIRATION = 20*60*60 |
(...skipping 23 matching lines...) Expand all Loading... |
34 def setup(self, luci_go_dir, swarming_rev=None): | 34 def setup(self, luci_go_dir, swarming_rev=None): |
35 """Performs setup steps for swarming.""" | 35 """Performs setup steps for swarming.""" |
36 self.m.swarming_client.checkout(revision=swarming_rev) | 36 self.m.swarming_client.checkout(revision=swarming_rev) |
37 self.m.swarming.check_client_version(step_test_data=(0, 8, 6)) | 37 self.m.swarming.check_client_version(step_test_data=(0, 8, 6)) |
38 self.setup_go_isolate(luci_go_dir) | 38 self.setup_go_isolate(luci_go_dir) |
39 self.m.swarming.add_default_tag('allow_milo:1') | 39 self.m.swarming.add_default_tag('allow_milo:1') |
40 | 40 |
41 # TODO(rmistry): Remove once the Go binaries are moved to recipes or buildbot. | 41 # TODO(rmistry): Remove once the Go binaries are moved to recipes or buildbot. |
42 def setup_go_isolate(self, luci_go_dir): | 42 def setup_go_isolate(self, luci_go_dir): |
43 """Generates and puts in place the isolate Go binary.""" | 43 """Generates and puts in place the isolate Go binary.""" |
| 44 depot_tools_path = self.m.depot_tools.package_repo_resource() |
| 45 env = {'PATH': self.m.path.pathsep.join([ |
| 46 str(depot_tools_path), '%(PATH)s'])} |
44 self.m.step('download luci-go linux', | 47 self.m.step('download luci-go linux', |
45 ['download_from_google_storage', '--no_resume', | 48 ['download_from_google_storage', '--no_resume', |
46 '--platform=linux*', '--no_auth', '--bucket', 'chromium-luci', | 49 '--platform=linux*', '--no_auth', '--bucket', 'chromium-luci', |
47 '-d', luci_go_dir.join('linux64')]) | 50 '-d', luci_go_dir.join('linux64')], |
| 51 env=env) |
48 self.m.step('download luci-go mac', | 52 self.m.step('download luci-go mac', |
49 ['download_from_google_storage', '--no_resume', | 53 ['download_from_google_storage', '--no_resume', |
50 '--platform=darwin', '--no_auth', '--bucket', 'chromium-luci', | 54 '--platform=darwin', '--no_auth', '--bucket', 'chromium-luci', |
51 '-d', luci_go_dir.join('mac64')]) | 55 '-d', luci_go_dir.join('mac64')], |
| 56 env=env) |
52 self.m.step('download luci-go win', | 57 self.m.step('download luci-go win', |
53 ['download_from_google_storage', '--no_resume', | 58 ['download_from_google_storage', '--no_resume', |
54 '--platform=win32', '--no_auth', '--bucket', 'chromium-luci', | 59 '--platform=win32', '--no_auth', '--bucket', 'chromium-luci', |
55 '-d', luci_go_dir.join('win64')]) | 60 '-d', luci_go_dir.join('win64')], |
| 61 env=env) |
56 # Copy binaries to the expected location. | 62 # Copy binaries to the expected location. |
57 dest = self.m.path['slave_build'].join('luci-go') | 63 dest = self.m.path['slave_build'].join('luci-go') |
58 self.m.skia.rmtree(dest) | 64 self.m.skia.rmtree(dest) |
59 self.m.file.copytree('Copy Go binary', | 65 self.m.file.copytree('Copy Go binary', |
60 source=luci_go_dir, | 66 source=luci_go_dir, |
61 dest=dest) | 67 dest=dest) |
62 | 68 |
63 def isolate_and_trigger_task( | 69 def isolate_and_trigger_task( |
64 self, isolate_path, isolate_base_dir, task_name, isolate_vars, | 70 self, isolate_path, isolate_base_dir, task_name, isolate_vars, |
65 swarm_dimensions, isolate_blacklist=None, extra_isolate_hashes=None, | 71 swarm_dimensions, isolate_blacklist=None, extra_isolate_hashes=None, |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 else: | 285 else: |
280 for _, task in step_result.json.output.get('tasks', {}).iteritems(): | 286 for _, task in step_result.json.output.get('tasks', {}).iteritems(): |
281 ids.append(task['task_id']) | 287 ids.append(task['task_id']) |
282 for idx, task_id in enumerate(ids): | 288 for idx, task_id in enumerate(ids): |
283 link = MILO_LOG_LINK % task_id | 289 link = MILO_LOG_LINK % task_id |
284 k = 'view steps on Milo' | 290 k = 'view steps on Milo' |
285 if len(ids) > 1: # pragma: nocover | 291 if len(ids) > 1: # pragma: nocover |
286 k += ' (shard index %d, %d total)' % (idx, len(ids)) | 292 k += ' (shard index %d, %d total)' % (idx, len(ids)) |
287 step_result.presentation.links[k] = link | 293 step_result.presentation.links[k] = link |
288 | 294 |
OLD | NEW |