Bug 614576: Attach PulseStatus to masters. r=bhearsum
authorChris AtLee <catlee@mozilla.com>
Thu, 09 Dec 2010 13:22:37 -0500
changeset 3368 d794e3d8d80bb6a5e2de64d0177680bd83225d5b
parent 3365 8ebfd26e4a5e690df4d2763a97aa834abe4c0527
child 3369 1410cd562df6eb18f7ec02c4aab0869920b1dc5d
push id1
push userroot
push dateWed, 17 Dec 2014 00:18:48 +0000
reviewersbhearsum
bugs614576
Bug 614576: Attach PulseStatus to masters. r=bhearsum This is only enabled if passwords.py contains a 'PULSE_PASSWORD' attribute.
mozilla-tests/passwords.py.template
mozilla-tests/scheduler_master.cfg
mozilla-tests/tests_master.cfg
mozilla-tests/universal_master_sqlite.cfg
mozilla/builder_master.cfg
mozilla/master_common.py
mozilla/passwords.py.template
mozilla/scheduler_master.cfg
mozilla/universal_master_sqlite.cfg
--- a/mozilla-tests/passwords.py.template
+++ b/mozilla-tests/passwords.py.template
@@ -1,1 +1,4 @@
 BBDB_URL="sqlite:///state.sqlite"
+PULSE_USERNAME='public'
+PULSE_PASSWORD='public'
+PULSE_EXCHANGE='org.mozilla.exchange.pulse.test'
--- a/mozilla-tests/scheduler_master.cfg
+++ b/mozilla-tests/scheduler_master.cfg
@@ -1,23 +1,28 @@
+# vim: ft=python
 from copy import deepcopy
 
 # import/reload dance so that reconfigs work
 import master_common
 import master_localconfig
 import config
 import buildbotcustom.misc
 reload(master_common)
 reload(master_localconfig)
 reload(config)
 reload(buildbotcustom.misc)
 
 from master_common import BuildmasterConfig
 c = BuildmasterConfig
-c.update(master_localconfig.BuildmasterConfig)
+for key, value in master_localconfig.BuildmasterConfig.items():
+    if key in c:
+        c[key].extend(value)
+    else:
+        c[key] = value
 
 from config import BRANCHES, PLATFORMS, SUITES, BRANCH_UNITTEST_VARS
 from master_localconfig import ACTIVE_BRANCHES, ACTIVE_PLATFORMS
 
 from buildbotcustom.misc import generateTalosBranchObjects
 
 for p in ACTIVE_PLATFORMS.keys():
     ACTIVE_PLATFORMS[p] = deepcopy(PLATFORMS[p])
@@ -31,17 +36,16 @@ for branch in ACTIVE_BRANCHES:
     c['schedulers'].extend(branchObjects['schedulers'])
     c['change_source'].extend(branchObjects['change_source'])
 
 # Required for sendchange
 from buildbot.changes.pb import PBChangeSource
 c['change_source'].append(PBChangeSource())
 
 import passwords
-reload(passwords)
 from passwords import BBDB_URL
 c['db_url'] = BBDB_URL
 c['db_poll_interval'] = 60
 c['multiMaster'] = True
 
 # c is shorthand for BuildmasterConfig, so make sure they still refer to the
 # same thing
 assert c is BuildmasterConfig
--- a/mozilla-tests/tests_master.cfg
+++ b/mozilla-tests/tests_master.cfg
@@ -1,23 +1,28 @@
+# vim: ft=python
 from copy import deepcopy
 
 # import/reload dance so that reconfigs work
 import master_common
 import master_localconfig
 import config
 import buildbotcustom.misc
 reload(master_common)
 reload(master_localconfig)
 reload(config)
 reload(buildbotcustom.misc)
 
 from master_common import BuildmasterConfig
 c = BuildmasterConfig
-c.update(master_localconfig.BuildmasterConfig)
+for key, value in master_localconfig.BuildmasterConfig.items():
+    if key in c:
+        c[key].extend(value)
+    else:
+        c[key] = value
 
 from config import BRANCHES, PLATFORMS, SUITES, BRANCH_UNITTEST_VARS, SLAVES
 from master_localconfig import ACTIVE_BRANCHES, ACTIVE_PLATFORMS
 
 import BuildSlaves
 reload(BuildSlaves)
 from BuildSlaves import SlavePasswords
 from buildbot.buildslave import BuildSlave
@@ -46,17 +51,16 @@ for branch in ACTIVE_BRANCHES:
         if isinstance(s, Triggerable):
             c['schedulers'].append(s)
 
 # Required for sendchange
 from buildbot.changes.pb import PBChangeSource
 c['change_source'].append(PBChangeSource())
 
 import passwords
-reload(passwords)
 from passwords import BBDB_URL
 c['db_url'] = BBDB_URL
 c['db_poll_interval'] = 60
 c['multiMaster'] = True
 
 c['mergeRequests'] = buildbotcustom.misc.mergeRequests
 
 # c is shorthand for BuildmasterConfig, so make sure they still refer to the
--- a/mozilla-tests/universal_master_sqlite.cfg
+++ b/mozilla-tests/universal_master_sqlite.cfg
@@ -1,23 +1,28 @@
+# vim: ft=python
 from copy import deepcopy
 
 # import/reload dance so that reconfigs work
 import master_common
 import master_localconfig
 import config
 import buildbotcustom.misc
 reload(master_common)
 reload(master_localconfig)
 reload(config)
 reload(buildbotcustom.misc)
 
 from master_common import BuildmasterConfig
 c = BuildmasterConfig
-c.update(master_localconfig.BuildmasterConfig)
+for key, value in master_localconfig.BuildmasterConfig.items():
+    if key in c:
+        c[key].extend(value)
+    else:
+        c[key] = value
 
 from config import BRANCHES, PLATFORMS, SUITES, BRANCH_UNITTEST_VARS, SLAVES
 from master_localconfig import ACTIVE_BRANCHES, ACTIVE_PLATFORMS
 
 import BuildSlaves
 reload(BuildSlaves)
 from BuildSlaves import SlavePasswords
 from buildbot.buildslave import BuildSlave
--- a/mozilla/builder_master.cfg
+++ b/mozilla/builder_master.cfg
@@ -1,23 +1,28 @@
 # import/reload dance so that reconfigs work
 # buildbotcustom.misc has to be imported/reloaded prior to master_localconfig
 # so that the fastRegexes don't get reset
+# vim: ft=python
 import buildbotcustom.misc
 import master_common
 import master_localconfig
 import config
 reload(buildbotcustom.misc)
 reload(master_common)
 reload(master_localconfig)
 reload(config)
 
 from master_common import BuildmasterConfig
 c = BuildmasterConfig
-c.update(master_localconfig.BuildmasterConfig)
+for key, value in master_localconfig.BuildmasterConfig.items():
+    if key in c:
+        c[key].extend(value)
+    else:
+        c[key] = value
 
 from config import BRANCHES, PROJECTS
 from master_localconfig import ACTIVE_BRANCHES, ACTIVE_PROJECTS, SLAVES, \
          ENABLE_RELEASES, STAGING, RESERVED_SLAVES, ACTIVE_RELEASE_BRANCHES
 
 import BuildSlaves
 reload(BuildSlaves)
 from BuildSlaves import SlavePasswords
--- a/mozilla/master_common.py
+++ b/mozilla/master_common.py
@@ -35,8 +35,28 @@ def prioritizeBuilders(botmaster, builde
             priority = 2
         else:
             priority = 1
 
         return priority, req_priority, submitted_at
     builders.sort(key=sortkey)
     return builders
 c['prioritizeBuilders'] = prioritizeBuilders
+
+import passwords
+reload(passwords)
+if hasattr(passwords, 'PULSE_PASSWORD'):
+    # Send pulse messages
+    import re
+    import buildbotcustom.status.pulse
+    reload(buildbotcustom.status.pulse)
+    from buildbotcustom.status.pulse import PulseStatus
+    from mozillapulse.publishers import GenericPublisher
+    from mozillapulse.config import PulseConfiguration
+    c['status'].append(PulseStatus(
+        GenericPublisher(PulseConfiguration(
+            user=passwords.PULSE_USERNAME,
+            password=passwords.PULSE_PASSWORD,
+            ),
+            exchange=passwords.PULSE_EXCHANGE),
+        ignoreBuilders=[re.compile('.*shadow-central.*'), re.compile('fuzzer-.*')],
+        send_logs=False,
+        ))
--- a/mozilla/passwords.py.template
+++ b/mozilla/passwords.py.template
@@ -1,1 +1,4 @@
 BBDB_URL="sqlite:///state.sqlite"
+PULSE_USERNAME='public'
+PULSE_PASSWORD='public'
+PULSE_EXCHANGE='org.mozilla.exchange.pulse.test'
--- a/mozilla/scheduler_master.cfg
+++ b/mozilla/scheduler_master.cfg
@@ -1,19 +1,24 @@
 # import/reload dance so that reconfigs work
+# vim: ft=python
 import master_common
 import master_localconfig
 import config
 reload(master_common)
 reload(master_localconfig)
 reload(config)
 
 from master_common import BuildmasterConfig
 c = BuildmasterConfig
-c.update(master_localconfig.BuildmasterConfig)
+for key, value in master_localconfig.BuildmasterConfig.items():
+    if key in c:
+        c[key].extend(value)
+    else:
+        c[key] = value
 
 from config import BRANCHES, PROJECTS, SLAVES
 
 # Taking out mozilla-2.0 until official branching happens
 ACTIVE_BRANCHES = [b for b in BRANCHES.keys() if b not in ('mozilla-2.0',)]
 
 ACTIVE_PROJECTS = PROJECTS.keys()
 
--- a/mozilla/universal_master_sqlite.cfg
+++ b/mozilla/universal_master_sqlite.cfg
@@ -1,23 +1,28 @@
 # import/reload dance so that reconfigs work
 # buildbotcustom.misc has to be imported/reloaded prior to master_localconfig
 # so that the fastRegexes don't get reset
+# vim: ft=python
 import buildbotcustom.misc
 import master_common
 import master_localconfig
 import config
 reload(buildbotcustom.misc)
 reload(master_common)
 reload(master_localconfig)
 reload(config)
 
 from master_common import BuildmasterConfig
 c = BuildmasterConfig
-c.update(master_localconfig.BuildmasterConfig)
+for key, value in master_localconfig.BuildmasterConfig.items():
+    if key in c:
+        c[key].extend(value)
+    else:
+        c[key] = value
 
 from config import BRANCHES, PROJECTS
 from master_localconfig import ACTIVE_BRANCHES, ACTIVE_PROJECTS, SLAVES, \
          ENABLE_RELEASES, STAGING, RESERVED_SLAVES, ACTIVE_RELEASE_BRANCHES
 
 import BuildSlaves
 reload(BuildSlaves)
 from BuildSlaves import SlavePasswords