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

Side by Side Diff: scripts/master/factory/kitchen_factory.py

Issue 1869053002: kitchen_run: initial CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: fixes Created 4 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | scripts/slave/kitchen_run.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from master.factory import annotator_commands
6 from master.factory import commands
7 from master.factory.build_factory import BuildFactory
8
9
10 def KitchenFactory(active_master, repository, recipe,
11 revision='origin/master', factory_properties=None,
12 timeout=1200, max_time=2400):
13 """Returns buildbot build factory which runs recipes locally using kitchen.
14
15 |active_master| is config_bootstrap.Master's subclass from master's
16 master_site_config.py .
17
18 |repository| is the URL of repository containing recipe to run.
19
20 |recipe| is the name of the recipe to pass to kitchen_run.
21
22 |revision| is the revision to use for repo checkout (by default we use latest
23 revision).
24
25 |factory_properties| is a dictionary of default build properties.
26
27 |timeout| refers to the maximum number of seconds a build should be allowed
28 to run without output. After no output for |timeout| seconds, the build is
29 forcibly killed.
30
31 |max_time| refers to the maximum number of seconds a build should be allowed
32 to run, regardless of output. After |max_time| seconds, the build is
33 forcibly killed.
34 """
35 factory = BuildFactory(build_inherit_factory_properties=False)
36 factory.properties.update(factory_properties or {}, 'KitchenFactory')
37 cmd_obj = annotator_commands.AnnotatorCommands(
38 factory, active_master=active_master)
39
40 runner = cmd_obj.PathJoin(cmd_obj.script_dir, 'kitchen_run.py')
41 cmd = [
42 cmd_obj.python, '-u', runner,
43 '--repository', repository,
44 '--revision', revision,
45 '--recipe', recipe,
46 ]
47 cmd = cmd_obj.AddB64GzBuildProperties(cmd)
48
49 cmd_obj.AddAnnotatedScript(cmd, timeout=timeout, max_time=max_time)
50
51 return factory
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/kitchen_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698