Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Side by Side Diff: scripts/slave/recipe_modules/perf_try/build_state.py

Issue 2061893003: Build delegation for perf tryjobs (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Refine request build procedures Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 """
RobertoCN 2016/06/24 18:46:37 Nit: add copy right header.
Ziqi Xiong 2016/06/27 18:47:54 Done.
2 Most code in this class are copied or adapted from revision_state in
RobertoCN 2016/06/24 18:46:37 This docstring looks more like a comment. Replace
Ziqi Xiong 2016/06/27 18:47:54 Done.
3 auto_bisect module. Future refactoring is needed.
4 """
5
6 import json
7 import uuid
8
9 class BuildState(object):
10
11 SUCCESS, WARNINGS, FAILURE, SKIPPED, EXCEPTION = range(5)
12
13 def __init__(self, api, commit_hash, with_patch):
14 super(BuildState, self).__init__()
15 self.api = api
16 self.commit_hash = str(commit_hash)
17 self._patch_hash = with_patch * str(uuid.uuid4())
18 self.build_id = None
19 if with_patch:
20 self.bucket = 'chrome-perf-tryjob'
21 else:
22 self.bucket = 'chrome-perf'
23 self.build_file_path = self._get_build_file_path()
24
25 def _get_build_file_path(self):
26 revision_suffix = '%s.zip' % (self.commit_hash + self._patch_hash)
27 return self._get_platform_gs_prefix() + revision_suffix
28
29 def _get_platform_gs_prefix(self):
30 bot_name = self.api.m.properties.get('buildername', '')
31 if 'win' in bot_name:
32 if any(b in bot_name for b in ['x64', 'gpu']):
33 return 'gs://%s/Win x64 Builder/full-build-win32_' % self.bucket
34 return 'gs://%s/Win Builder/full-build-win32_' % self.bucket
35 if 'android' in bot_name:
36 if 'nexus9' in bot_name:
37 return 'gs://%s/android_perf_rel_arm64/full-build-linux_' % self.bucket
38 return 'gs://%s/android_perf_rel/full-build-linux_' % self.bucket
39 if 'mac' in bot_name:
40 return 'gs://%s/Mac Builder/full-build-mac_' % self.bucket
41 return 'gs://%s/Linux Builder/full-build-linux' % self.bucket
42
43 def is_completed(self):
44 result = self.api.m.buildbucket.get_build(self.build_id)
45 return result.stdout['status'] == 'COMPLETED'
46
47 def is_build_archived(self):
48 result = self.api.m.buildbucket.get_build(self.build_id)
49 return result.stdout['result'] == 'SUCCESS'
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698