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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/slave/kitchen_run.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/factory/kitchen_factory.py
diff --git a/scripts/master/factory/kitchen_factory.py b/scripts/master/factory/kitchen_factory.py
new file mode 100644
index 0000000000000000000000000000000000000000..349b72eda0c293e2866d08d9f090b0493463e914
--- /dev/null
+++ b/scripts/master/factory/kitchen_factory.py
@@ -0,0 +1,51 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from master.factory import annotator_commands
+from master.factory import commands
+from master.factory.build_factory import BuildFactory
+
+
+def KitchenFactory(active_master, repository, recipe,
+ revision='origin/master', factory_properties=None,
+ timeout=1200, max_time=2400):
+ """Returns buildbot build factory which runs recipes locally using kitchen.
+
+ |active_master| is config_bootstrap.Master's subclass from master's
+ master_site_config.py .
+
+ |repository| is the URL of repository containing recipe to run.
+
+ |recipe| is the name of the recipe to pass to kitchen_run.
+
+ |revision| is the revision to use for repo checkout (by default we use latest
+ revision).
+
+ |factory_properties| is a dictionary of default build properties.
+
+ |timeout| refers to the maximum number of seconds a build should be allowed
+ to run without output. After no output for |timeout| seconds, the build is
+ forcibly killed.
+
+ |max_time| refers to the maximum number of seconds a build should be allowed
+ to run, regardless of output. After |max_time| seconds, the build is
+ forcibly killed.
+ """
+ factory = BuildFactory(build_inherit_factory_properties=False)
+ factory.properties.update(factory_properties or {}, 'KitchenFactory')
+ cmd_obj = annotator_commands.AnnotatorCommands(
+ factory, active_master=active_master)
+
+ runner = cmd_obj.PathJoin(cmd_obj.script_dir, 'kitchen_run.py')
+ cmd = [
+ cmd_obj.python, '-u', runner,
+ '--repository', repository,
+ '--revision', revision,
+ '--recipe', recipe,
+ ]
+ cmd = cmd_obj.AddB64GzBuildProperties(cmd)
+
+ cmd_obj.AddAnnotatedScript(cmd, timeout=timeout, max_time=max_time)
+
+ return factory
« 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