aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2018-04-15 17:26:29 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-04-16 01:45:17 -0700
commitc371d6b62a44e661fe24eb84d1e9463bdf6b6bf4 (patch)
treee2487a49f46de041b46836b17acde1614899feaf
parent9ae89a98a143ef9f28b69c8553e72e826ced2e9c (diff)
downloadtoolchain-utils-c371d6b62a44e661fe24eb84d1e9463bdf6b6bf4.tar.gz
[toolchain-utils] Add info to rotating builder logs.
Due to recent changes in the tryjob launching system, the current rotating builder logs are empty. This CL causes the command and resulting buildbucket_id to be printed, and therefore go into the logs, so the sheriffs have some way of finding out what boards were built and what the buildbucket ids were for the builds. Also fix some format errors (forced by commit hook). BUG=chromium:833195 TEST=Tested for the last two nights on chrotomation2. Change-Id: Ic8e18baf1bc3f39af574d673962e43e830356210 Reviewed-on: https://chromium-review.googlesource.com/1013227 Commit-Ready: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
-rw-r--r--cros_utils/buildbot_utils.py34
1 files changed, 20 insertions, 14 deletions
diff --git a/cros_utils/buildbot_utils.py b/cros_utils/buildbot_utils.py
index 893864b7..7b8f1008 100644
--- a/cros_utils/buildbot_utils.py
+++ b/cros_utils/buildbot_utils.py
@@ -17,6 +17,7 @@ from cros_utils import logger
INITIAL_SLEEP_TIME = 7200 # 2 hours; wait time before polling buildbot.
SLEEP_TIME = 600 # 10 minutes; time between polling of buildbot.
TIME_OUT = 28800 # Decide the build is dead or will never finish
+
# after this time (8 hours).
@@ -46,8 +47,8 @@ def PeekTrybotImage(chromeos_root, buildbucket_id):
and url looks like:
gs://chromeos-image-archive/trybot-elm-release-tryjob/R67-10468.0.0-b20789
"""
- command = ('cros buildresult --report json --buildbucket-id %s' %
- buildbucket_id)
+ command = (
+ 'cros buildresult --report json --buildbucket-id %s' % buildbucket_id)
rc, out, _ = RunCommandInPath(chromeos_root, command)
# Current implementation of cros buildresult returns fail when a job is still
@@ -76,8 +77,12 @@ def ParseTryjobBuildbucketId(msg):
return None
-def SubmitTryjob(chromeos_root, buildbot_name, patch_list, build_tag,
- tryjob_flags=None, build_toolchain=False):
+def SubmitTryjob(chromeos_root,
+ buildbot_name,
+ patch_list,
+ build_tag,
+ tryjob_flags=None,
+ build_toolchain=False):
"""Calls `cros tryjob ...`
Args:
@@ -110,22 +115,23 @@ def SubmitTryjob(chromeos_root, buildbot_name, patch_list, build_tag,
description = build_tag
command = ('cros tryjob --yes --json --nochromesdk --remote-description %s'
' %s %s %s' % (description, tryjob_flags, patch_arg, build))
+ print('CMD: %s' % command)
_, out, _ = RunCommandInPath(chromeos_root, command)
buildbucket_id = ParseTryjobBuildbucketId(out)
+ print('buildbucket_id: %s' % repr(buildbucket_id))
if not buildbucket_id:
logger.GetLogger().LogFatal('Error occurred while launching trybot job: '
'%s' % command)
return buildbucket_id
-def GetTrybotImage(
- chromeos_root,
- buildbot_name,
- patch_list,
- build_tag,
- tryjob_flags=None,
- build_toolchain=False,
- async=False):
+def GetTrybotImage(chromeos_root,
+ buildbot_name,
+ patch_list,
+ build_tag,
+ tryjob_flags=None,
+ build_toolchain=False,
+ async=False):
"""Launch buildbot and get resulting trybot artifact name.
This function launches a buildbot with the appropriate flags to
@@ -225,8 +231,8 @@ def WaitForImage(chromeos_root, build):
time.sleep(SLEEP_TIME)
elapsed_time += SLEEP_TIME
- logger.GetLogger().LogOutput('Image %s not found, waited for %d hours' %
- (build, (TIME_OUT / 3600)))
+ logger.GetLogger().LogOutput(
+ 'Image %s not found, waited for %d hours' % (build, (TIME_OUT / 3600)))
raise BuildbotTimeout('Timeout while waiting for image %s' % build)