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

Unified Diff: bin/cbuildbot.py

Issue 3165052: Add ability for cbuildbot master to synchronize with cbuildbot slaves. (Closed) Base URL: http://src.chromium.org/git/crosutils.git
Patch Set: Remove extra dep Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | bin/cbuildbot_comm.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/cbuildbot.py
diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py
index aa3a1d851b04797e1be1d97d25add04baa35aad4..5dd34f497163a4f89310e69fb0fce7bdec4eec88 100755
--- a/bin/cbuildbot.py
+++ b/bin/cbuildbot.py
@@ -7,13 +7,13 @@
"""CBuildbot is wrapper around the build process used by the pre-flight queue"""
import errno
+import re
import optparse
import os
-import re
-import shutil
import subprocess
import sys
+import cbuildbot_comm
from cbuildbot_config import config
_DEFAULT_RETRIES = 3
@@ -371,12 +371,27 @@ def main():
_UprevPackages(buildroot, revisionfile, board=buildconfig['board'])
_Build(buildroot)
if buildconfig['uprev']:
- _UprevPush(buildroot)
- _UprevCleanup(buildroot)
+ if buildconfig['master']:
+ # Master bot needs to check if the other slaves completed.
+ if cbuildbot_comm.HaveSlavesCompleted(config):
+ _UprevPush(buildroot)
+ _UprevCleanup(buildroot)
+ else:
+ # At least one of the slaves failed or we timed out.
+ _UprevCleanup(buildroot)
+ sys.stderr('CBUILDBOT - One of the slaves has failed!!!')
+ sys.exit(1)
+ else:
+ # Publish my status to the master.
+ cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_COMPLETE)
+ _UprevCleanup(buildroot)
except:
- # something went wrong, cleanup (being paranoid) for next build
+ # Something went wrong, cleanup (being paranoid) for next build.
if clobber:
RunCommand(['sudo', 'rm', '-rf', buildroot], print_cmd=False)
+ # Send failure to master bot.
+ if not buildconfig['master']:
+ cbuildbot_comm.PublishStatus(cbuildbot_comm.STATUS_BUILD_FAILED)
raise
« no previous file with comments | « no previous file | bin/cbuildbot_comm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698