Permalink
Browse files

merge default -> production

--HG--
branch : production-0.8
  • Loading branch information...
2 parents 3adc968 + eb64714 commit 4a7a3dbbf7d9946cb9b17e3bd827aba5b253b6cf @escapewindow escapewindow committed Jul 10, 2012
Showing with 3 additions and 1,390 deletions.
  1. +0 −31 bin/l10n-stage/README
  2. +0 −24 bin/l10n-stage/botmaster
  3. +0 −251 bin/l10n-stage/create-buildbot
  4. +0 −142 bin/l10n-stage/create-stage
  5. +3 −112 misc.py
  6. +0 −393 process/factory.py
  7. +0 −437 process/mobiletestfactory.py
View
@@ -1,31 +0,0 @@
-The scripts
-
-create-stage,
-create-buildbot, and
-botmaster
-
-provide help in setting up and running a testing environment for how we
-schedule l10n builds.
-
-Use create-stage to create the required repos as well as one en-US and
-four l10n dummy repositories. Those will already have an initial push in
-the pushlog database. The repositories are in the repos directory.
-
-Clones to work on these and to then push changes are in the workdir directory
-tree. When pushing, you need to make sure that mozhghooks in
-repos/hghooks is in your PYTHONPATH.
-
-create-buildbot sets up a master and a number of slaves for each of the
-three platforms. The master is set up to have en-US dep builds, nightlies,
-and l10n builds, with build properties depending on whether it's an en-US
-change-triggered build, l10n triggered or nightly.
-
-Last but not least, botmaster offers start and stop commands to start and
-stop the master and all slaves.
-
-All commands take the staging dir as argument.
-
-After creating the hg repositories, you want to set up a
-hg serve -p 8080 --webdir-conf webdir.conf
-in the staging dir, that will offer the repositories on the localhost.
-Make sure to map the port here with what you specify in create-buildbot.
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-
-from optparse import OptionParser
-import os
-import subprocess
-
-if __name__ == "__main__":
- p = OptionParser()
- (options, args) = p.parse_args()
-
- dest = args[1]
- command = args[0]
-
- for d in sorted(os.listdir(dest)):
- dir = os.path.join(dest, d)
- pid = os.path.join(dir, 'twistd.pid')
- if command == 'start':
- if os.path.isfile(pid):
- subprocess.call(['buildbot', 'restart', dir])
- else:
- subprocess.call(['buildbot', 'start', dir])
- if command == 'stop':
- if os.path.isfile(pid):
- subprocess.call(['buildbot', 'stop', dir])
@@ -1,251 +0,0 @@
-#!/usr/bin/env python
-
-from optparse import OptionParser
-import os
-import subprocess
-
-master_cfg = '''c = BuildmasterConfig = {}
-from buildbot.buildslave import BuildSlave
-from buildbot import locks, manhole, scheduler
-from buildbot.process import factory
-from buildbot.steps.dummy import Dummy
-from buildbot.status import html
-
-from twisted.internet import reactor
-
-from buildbotcustom.l10n import Scheduler, NightlyL10n
-from buildbotcustom.changes.hgpoller import HgAllLocalesPoller, HgPoller
-
-from twisted.web.client import HTTPClientFactory
-HTTPClientFactory.noisy = False
-
-c['slaves'] = [
-%(slaves)s
- ]
-
-c['slavePortnum'] = %(port)s
-
-hga = HgAllLocalesPoller('http://localhost:%(hg_port)s/',
- 'l10n', pollInterval = 60)
-hga.parallelRequests = 1
-c['change_source'] = [
- hga,
- HgPoller('http://localhost:%(hg_port)s/', 'mozilla',
- pollInterval = 90)
-]
-
-c['schedulers'] = [
- Scheduler('l10n', 'l10nbuilds.ini'),
- NightlyL10n('l10n nightly',
- ['Firefox test linux', 'Firefox test mac',
- 'Firefox test win'],
- 'hg',
- repo='http://localhost:%(hg_port)s/',
- branch='mozilla',
- localesFile='browser/locales/all-locales',
- minute=5),
- scheduler.Scheduler('enUS dep', 'mozilla', 30,
- ['Linux mozilla build',
- 'OS X 10.5.2 mozilla build',
- 'WINNT 5.2 mozilla build']),
- scheduler.Nightly('enUS nightly',
- ['Linux mozilla nightly',
- 'OS X 10.5.2 mozilla nightly',
- 'WINNT 5.2 mozilla nightly'])
-]
-
-bigSlaveLock = locks.SlaveLock("bigSlaveLock")
-
-f = factory.BuildFactory()
-class L10nReporter(Dummy):
- def start(self):
- p = self.step_status.build.getProperties()
- desc = [p['locale']]
- if p.has_key('tree'):
- desc += [p['tree'], p['app']]
- self.desc = desc
- if p.has_key('compareOnly'):
- desc.append('compareOnly')
- if p.has_key('nightly'):
- desc.append('nightly')
- desc.append('building')
- desc.append('on %%s' %% p['slavename'])
- self.step_status.setText(desc)
- self.desc = desc[:]
- timeout = self.timeout
- if 'win' in p['buildername'].lower():
- timeout *= 3
- if 'mac' in p['buildername'].lower():
- timeout *= 2
- self.timer = reactor.callLater(timeout, self.done)
- def done(self):
- self.desc[-2] = 'built'
- self.step_status.setText(self.desc)
- Dummy.done(self)
-
-f.addStep(L10nReporter(timeout=2, name='l10nstep'))
-
-enBuild = factory.BuildFactory()
-class EnBuildStep(Dummy):
- def start(self):
- p = self.step_status.build.getProperties()
- desc = ['en-US', 'building',
- 'on %%s' %% p['slavename']]
- self.desc = desc[:]
- self.step_status.setText(desc)
- timeout = self.timeout
- if 'win' in p['buildername'].lower():
- timeout *= 3
- if 'os x' in p['buildername'].lower():
- timeout *= 2
- self.timer = reactor.callLater(timeout, self.done)
- def done(self):
- self.desc[1] = 'built'
- self.step_status.setText(self.desc)
- Dummy.done(self)
-
-enBuild.addStep(EnBuildStep(timeout=15, name='enstep'))
-
-enNightly = factory.BuildFactory()
-enNightly.addStep(EnBuildStep(timeout=15, name='enstep'))
-
-c['builders'] = [
- {'name': 'Firefox test linux',
- 'slavenames': [%(slaves_linux)s],
- 'builddir': 'fx_test_linux',
- 'factory': f,
- 'category': 'l10n',
- 'locks': [bigSlaveLock]},
- {'name': 'Linux mozilla build',
- 'slavenames': [%(slaves_linux)s],
- 'builddir': 'fx_en_linux',
- 'factory': enBuild,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- {'name': 'Linux mozilla nightly',
- 'slavenames': [%(slaves_linux)s],
- 'builddir': 'fx_en_nightly_linux',
- 'factory': enNightly,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- {'name': 'Firefox test mac',
- 'slavenames': [%(slaves_mac)s],
- 'builddir': 'fx_test_mac',
- 'factory': f,
- 'category': 'l10n',
- 'locks': [bigSlaveLock]},
- {'name': 'OS X 10.5.2 mozilla build',
- 'slavenames': [%(slaves_mac)s],
- 'builddir': 'fx_en_mac',
- 'factory': enBuild,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- {'name': 'OS X 10.5.2 mozilla nightly',
- 'slavenames': [%(slaves_mac)s],
- 'builddir': 'fx_en_nightly_mac',
- 'factory': enNightly,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- {'name': 'Firefox test win',
- 'slavenames': [%(slaves_win)s],
- 'builddir': 'fx_test_win',
- 'factory': f,
- 'category': 'l10n',
- 'locks': [bigSlaveLock]},
- {'name': 'WINNT 5.2 mozilla build',
- 'slavenames': [%(slaves_win)s],
- 'builddir': 'fx_en_win',
- 'factory': enBuild,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- {'name': 'WINNT 5.2 mozilla nightly',
- 'slavenames': [%(slaves_win)s],
- 'builddir': 'fx_en_nightly_win',
- 'factory': enNightly,
- 'category': 'mozilla',
- 'locks': [bigSlaveLock]},
- ]
-
-c['manhole'] = manhole.TelnetManhole(%(telnet_port)s, "%(telnet_user)s",
- "%(telnet_pass)s")
-
-c['status'] = []
-
-c['status'].append(html.WebStatus(http_port=%(http_port)s,
- allowForce=True))
-c['buildbotURL'] = 'http://localhost:%(http_port)s/'
-c['projectName'] = 'l10n testbed'
-'''
-
-l10nini = '''[fx]
-app = browser
-type = hg
-locales = all
-mozilla = mozilla
-l10n = l10n
-repo = http://localhost:%(hgport)s/
-l10n.ini = browser/locales/l10n.ini
-builders = Firefox\ test\ linux Firefox\ test\ mac Firefox\ test\ win
-'''
-
-def createMaster(dest, opts):
- if os.path.isdir(dest):
- raise RuntimeError("Upgrading not supported")
- os.makedirs(dest)
- rv = subprocess.call(['buildbot', 'create-master', 'master'],
- cwd=dest)
- if rv:
- raise RuntimeError('creation of master failed')
- l_s = ['"sl%d"' % i for i in xrange(opts.slaves)]
- m_s = ['"sm%d"' % i for i in xrange(opts.slaves)]
- w_s = ['"sw%d"' % i for i in xrange(opts.slaves)]
- def formatSlave(s):
- return ' BuildSlave(%s, "pwd"),\n' % s
- open(os.path.join(dest, 'master', 'master.cfg'),
- 'w').write(master_cfg % {
- 'slaves': ''.join(map(formatSlave, l_s + m_s + w_s)),
- 'slaves_linux': ','.join(l_s),
- 'slaves_mac': ','.join(m_s),
- 'slaves_win': ','.join(w_s),
- 'port': options.port,
- 'http_port': options.http_port,
- 'hg_port': options.hg_port,
- 'telnet_port': options.telnet_port,
- 'telnet_user': options.telnet_user,
- 'telnet_pass': options.telnet_pass,
- })
- open(os.path.join(dest, 'master', 'l10nbuilds.ini'),
- 'w').write(l10nini % {'hgport': opts.hg_port})
-
-def createSlave(dest, name, opts):
- if os.path.isdir(os.path.join(dest, name)):
- return
- rv = subprocess.call(['buildbot', 'create-slave', name,
- 'localhost:%s' % opts.port,
- name, 'pwd'],
- cwd=dest)
- if rv:
- raise RuntimeError('creation of master failed')
-
-
-if __name__ == "__main__":
- p = OptionParser()
- p.add_option('-v', dest='verbose', action='store_true')
- p.add_option('-p', '--port', default='9876')
- p.add_option('-q', '--http-port', dest='http_port',
- default='8010')
- p.add_option('-g', '--hg-port', dest='hg_port',
- default='8000')
- p.add_option('-n', '--slaves', type='int', default=3)
- p.add_option('--telnet-port', dest='telnet_port', default='9875')
- p.add_option('--telnet-user', dest='telnet_user', default='god')
- p.add_option('--telnet-pass', dest='telnet_pass', default='knows')
- (options, args) = p.parse_args()
-
- dest = args[0]
-
- createMaster(dest, options)
- for i in xrange(options.slaves):
- createSlave(dest, "sl%d" % i, options)
- createSlave(dest, "sm%d" % i, options)
- createSlave(dest, "sw%d" % i, options)
Oops, something went wrong.

0 comments on commit 4a7a3db

Please sign in to comment.