OLD | NEW |
| (Empty) |
1 # -*- python -*- | |
2 # ex: set syntax=python: | |
3 | |
4 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
5 # Use of this source code is governed by a BSD-style license that can be | |
6 # found in the LICENSE file. | |
7 | |
8 # This is the buildmaster config file for the 'nacl' bot. It must | |
9 # be installed as 'master.cfg' in your buildmaster's base directory | |
10 # (although the filename can be changed with the --basedir option to | |
11 # 'mktap buildbot master'). | |
12 | |
13 # It has one job: define a dictionary named BuildmasterConfig. This | |
14 # dictionary has a variety of keys to control different aspects of the | |
15 # buildmaster. They are documented in docs/config.xhtml . | |
16 | |
17 | |
18 from buildbot import locks | |
19 from buildbot.changes import svnpoller | |
20 from buildbot.scheduler import Dependent | |
21 from buildbot.scheduler import Scheduler | |
22 | |
23 # Reload all the python files under master and common | |
24 import master | |
25 reload(master) | |
26 import common | |
27 reload(common) | |
28 | |
29 # These modules come from scripts/master, which must be in the PYTHONPATH. | |
30 import build_utils | |
31 import chromium_step | |
32 import master_utils | |
33 from master.factory import nacl_sdk_factory | |
34 import slaves_list | |
35 | |
36 # These modules come from scripts/common, which must be in the PYTHONPATH. | |
37 import chromium_config as config | |
38 import chromium_utils | |
39 | |
40 ActiveMaster = config.Master.NativeClientSDK | |
41 | |
42 TREE_GATE_KEEPER = ActiveMaster.is_production_host | |
43 GOOD_REVISIONS = False | |
44 | |
45 # This is the dictionary that the buildmaster pays attention to. We also use | |
46 # a shorter alias to save typing. | |
47 c = BuildmasterConfig = {} | |
48 | |
49 | |
50 ####### CHANGESOURCES | |
51 | |
52 # the 'change_source' list tells the buildmaster how it should find out about | |
53 # source code changes. Any class which implements IChangeSource can be added | |
54 # to this list: there are several in buildbot/changes/*.py to choose from. | |
55 def NativeClientSDKTreeFileSplitter(path): | |
56 """split_file for the 'src' project in the trunk.""" | |
57 | |
58 projects = ['src'] | |
59 for p in projects: | |
60 if path.startswith(p + '/'): | |
61 return (p, path[len(p)+1:]) | |
62 return None | |
63 | |
64 # Polls config.Master.nacl_trunk_url for changes | |
65 trunk_poller = svnpoller.SVNPoller(svnurl=config.Master.nacl_sdk_trunk_url, | |
66 split_file=NativeClientSDKTreeFileSplitter, | |
67 pollinterval=10) | |
68 | |
69 c['change_source'] = [trunk_poller] | |
70 | |
71 | |
72 ####### BUILDERS | |
73 | |
74 # buildbot/process/factory.py provides several BuildFactory classes you can | |
75 # start with, which implement build processes for common targets (GNU | |
76 # autoconf projects, CPAN perl modules, etc). The factory.BuildFactory is the | |
77 # base class, and is configured with a series of BuildSteps. When the build | |
78 # is run, the appropriate buildslave is told to execute each Step in turn. | |
79 | |
80 # the first BuildStep is typically responsible for obtaining a copy of the | |
81 # sources. There are source-obtaining Steps in buildbot/process/step.py for | |
82 # CVS, SVN, and others. | |
83 | |
84 | |
85 # ---------------------------------------------------------------------------- | |
86 # FACTORIES | |
87 | |
88 m_win = nacl_sdk_factory.NativeClientSDKFactory( | |
89 'native_client_sdk', 'wincyg') | |
90 m_linux = nacl_sdk_factory.NativeClientSDKFactory( | |
91 'native_client_sdk', 'linux2') | |
92 m_mac = nacl_sdk_factory.NativeClientSDKFactory( | |
93 'native_client_sdk', 'darwin') | |
94 | |
95 # Some shortcut to simplify the code below. | |
96 F_WIN = m_win.NativeClientSDKFactory | |
97 F_LINUX = m_linux.NativeClientSDKFactory | |
98 F_MAC = m_mac.NativeClientSDKFactory | |
99 | |
100 | |
101 # The identifier of the factory is the build configuration. If two factories | |
102 # are using the same build configuration, they should have the same identifier. | |
103 | |
104 # BuilderTesters using a custom build configuration. | |
105 factories = [] | |
106 # SDKs | |
107 archive_dst_base = 'nacl_archive/sdk' | |
108 archive_dst = '%(got_revision)s/' | |
109 archive_dst_latest = 'latest/' | |
110 factories.append(['windows-sdk', '1SDK', F_WIN( | |
111 'windows-sdk', clobber=True, | |
112 factory_properties={ | |
113 'archive_build': True, | |
114 'archive_src': 'nacl-sdk.exe', | |
115 'archive_dst_base': archive_dst_base, | |
116 'archive_dst': archive_dst + 'naclsdk_win.exe', | |
117 'archive_dst_latest': archive_dst_latest + 'naclsdk_win.exe', | |
118 })]) | |
119 factories.append(['mac-sdk', '1SDK', F_MAC( | |
120 'mac-sdk', clobber=True, | |
121 factory_properties={ | |
122 'archive_build': True, | |
123 'archive_src': 'nacl-sdk.tgz', | |
124 'archive_dst_base': archive_dst_base, | |
125 'archive_dst': archive_dst + 'naclsdk_mac.tgz', | |
126 'archive_dst_latest': archive_dst_latest + 'naclsdk_mac.tgz', | |
127 })]) | |
128 factories.append(['linux-sdk', '1SDK', F_LINUX( | |
129 'linux-sdk', clobber=True, | |
130 factory_properties={ | |
131 'archive_build': True, | |
132 'archive_src': 'nacl-sdk.tgz', | |
133 'archive_dst_base': archive_dst_base, | |
134 'archive_dst': archive_dst + 'naclsdk_linux.tgz', | |
135 'archive_dst_latest': archive_dst_latest + 'naclsdk_linux.tgz', | |
136 })]) | |
137 | |
138 | |
139 ####### SCHEDULERS | |
140 ## configure the Schedulers | |
141 # Main scheduler for all changes in trunk. | |
142 s_nacl = Scheduler( | |
143 name='nacl', | |
144 branch='src', | |
145 treeStableTimer=60, | |
146 builderNames=[f[0] for f in factories], | |
147 ) | |
148 c['schedulers'] = [s_nacl] | |
149 | |
150 | |
151 # ---------------------------------------------------------------------------- | |
152 # BUILDER DEFINITIONS | |
153 | |
154 # The 'builders' list defines the Builders. Each one is configured with a | |
155 # dictionary, using the following keys: | |
156 # name (required): the name used to describe this bilder | |
157 # slavename (required): which slave to use, must appear in c['slaves'] | |
158 # builddir (required): which subdirectory to run the builder in | |
159 # factory (required): a BuildFactory to define how the build is run | |
160 # periodicBuildTime (optional): if set, force a build every N seconds | |
161 # category (optional): it is not used in the normal 'buildbot' meaning. It is | |
162 # used by gatekeeper to determine which steps it should | |
163 # look for to close the tree. | |
164 # | |
165 | |
166 c['builders'] = [] | |
167 slaves = slaves_list.SlavesList('slaves.cfg', 'NativeClientSDK') | |
168 for f in factories: | |
169 c['builders'].append({ | |
170 'name': f[0], | |
171 'slavenames': slaves.GetSlavesName(builder=f[0]), | |
172 'builddir': f[0], | |
173 'factory': f[2], | |
174 'category': '%s|full' % f[1], | |
175 # Don't enable auto_reboot for people testing locally. | |
176 'auto_reboot': ActiveMaster.is_production_host, | |
177 }) | |
178 | |
179 | |
180 ####### BUILDSLAVES | |
181 | |
182 # The 'slaves' list defines the set of allowable buildslaves. List all the | |
183 # slaves registered to a builder. Remove dupes. | |
184 c['slaves'] = master_utils.AutoSetupSlaves(c['builders'], | |
185 config.Master.GetBotPassword()) | |
186 | |
187 # Make sure everything works together. | |
188 master_utils.VerifySetup(c, slaves) | |
189 | |
190 | |
191 ####### STATUS TARGETS | |
192 | |
193 # Adds common status and tools to this master. | |
194 master_utils.AutoSetupMaster(c, ActiveMaster) | |
195 | |
196 # Add more. | |
197 | |
198 if TREE_GATE_KEEPER: | |
199 import gatekeeper | |
200 # This is the list of the builder categories and the corresponding critical | |
201 # steps. If one critical step fails, gatekeeper will close the tree | |
202 # automatically. | |
203 categories_steps = { | |
204 '': ['update scripts', 'update'], | |
205 'full': ['clobber', 'clobber_packages', 'precompile', 'compile', | |
206 'scons_compile', 'gyp_compile', 'build_packages', | |
207 'cooking_tarball', 'selenium', | |
208 'small_tests', 'medium_tests', 'large_tests', | |
209 'hand_tests', 'smoke_tests', | |
210 'backup_plugin', 'install_plugin', 'start_vncserver', | |
211 'stop_vncserver', 'restore_plugin'], | |
212 'experimental': [], | |
213 } | |
214 exclusions = { } | |
215 forgiving_steps = ['update scripts', 'update', 'svnkill', 'taskkill', | |
216 'archived build'] | |
217 c['status'].append(gatekeeper.GateKeeper( | |
218 fromaddr=ActiveMaster.from_address, | |
219 categories_steps=categories_steps, | |
220 exclusions=exclusions, | |
221 relayhost=config.Master.smtp, | |
222 subject='buildbot %(result)s in %(projectName)s on %(builder)s, ' | |
223 'revision %(revision)s', | |
224 extraRecipients=ActiveMaster.tree_closing_notification_recipients, | |
225 tree_status_url=ActiveMaster.tree_status_url, | |
226 lookup=master_utils.FilterDomain(), | |
227 forgiving_steps=forgiving_steps)) | |
228 | |
229 if GOOD_REVISIONS: | |
230 import goodrevisions | |
231 # This is the list of builders with their respective list of critical steps | |
232 # that all need to succeed to mark a revision as successful. A single failure | |
233 # in any of the steps of any of the builders will mark the revision as failed. | |
234 all_steps = [ | |
235 'update', | |
236 'compile', | |
237 'small_tests', | |
238 'medium_tests', | |
239 'large_tests', | |
240 ] | |
241 c['status'].append(goodrevisions.GoodRevisions( | |
242 good_revision_steps={'': all_steps}, | |
243 store_revisions_url=ActiveMaster.store_revisions_url)) | |
244 | |
245 | |
246 ####### PROJECT IDENTITY | |
247 | |
248 # Buildbot master url: | |
249 c['buildbotURL'] = 'http://buildbot.jail.google.com/buildbot/nacl-sdk/' | |
OLD | NEW |