Sophie

Sophie

distrib > Mageia > 5 > x86_64 > by-pkgid > 0ff0b352b8be7ca33938fc0b4d8bf825 > files > 132

buildbot-doc-0.8.9-5.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Buildslaves &mdash; Buildbot 0.8.9 documentation</title>
    
    <link rel="stylesheet" href="../_static/agogo.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '0.8.9',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../_static/buildbot.ico"/>
    <link rel="top" title="Buildbot 0.8.9 documentation" href="../index.html" />
    <link rel="up" title="Configuration" href="configuration.html" />
    <link rel="next" title="Builder Configuration" href="cfg-builders.html" />
    <link rel="prev" title="Schedulers" href="cfg-schedulers.html" /> 
  </head>
  <body>
    <div class="header-wrapper">
      <div class="header">
          <p class="logo"><a href="../index.html">
            <img class="logo" src="../_static/header-text-transparent.png" alt="Logo"/>
          </a></p>
        <div class="headertitle"><a
          href="../index.html">Buildbot 0.8.9 documentation</a></div>
        <div class="rel">
          <a href="cfg-schedulers.html" title="Schedulers"
             accesskey="P">previous</a> |
          <a href="cfg-builders.html" title="Builder Configuration"
             accesskey="N">next</a> |
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a>
        </div>
       </div>
    </div>

    <div class="content-wrapper">
      <div class="content">
        <div class="document">
            
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <span class="target" id="buildslaves"></span><div class="section" id="cfg-slaves">
<span id="id1"></span><h1>Buildslaves<a class="headerlink" href="#cfg-slaves" title="Permalink to this headline">¶</a></h1>
<p>The <a class="reference internal" href="#cfg-slaves" title="slaves"><tt class="xref bb bb-cfg docutils literal"><span class="pre">slaves</span></tt></a> configuration key specifies a list of known buildslaves.
In the common case, each buildslave is defined by an instance of the
<tt class="xref py py-class docutils literal"><span class="pre">BuildSlave</span></tt> class.  It represents a standard, manually started machine
that will try to connect to the buildbot master as a slave.  Buildbot also
supports &quot;on-demand&quot;, or latent, buildslaves, which allow buildbot to
dynamically start and stop buildslave instances.</p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#defining-buildslaves" id="id6">Defining Buildslaves</a></li>
<li><a class="reference internal" href="#buildslave-options" id="id7">BuildSlave Options</a></li>
<li><a class="reference internal" href="#latent-buildslaves" id="id8">Latent Buildslaves</a></li>
</ul>
</div>
<div class="section" id="defining-buildslaves">
<h2><a class="toc-backref" href="#id6">Defining Buildslaves</a><a class="headerlink" href="#defining-buildslaves" title="Permalink to this headline">¶</a></h2>
<p>A <tt class="xref py py-class docutils literal"><span class="pre">BuildSlave</span></tt> instance is created with a <tt class="docutils literal"><span class="pre">slavename</span></tt> and a
<tt class="docutils literal"><span class="pre">slavepassword</span></tt>. These are the same two values that need to be provided to
the buildslave administrator when they create the buildslave.</p>
<p>The slavename must be unique, of course. The password exists to
prevent evildoers from interfering with the buildbot by inserting
their own (broken) buildslaves into the system and thus displacing the
real ones.</p>
<p>Buildslaves with an unrecognized slavename or a non-matching password will be
rejected when they attempt to connect, and a message describing the problem
will be written to the log file (see <a class="reference internal" href="installation.html#logfiles"><em>Logfiles</em></a>).</p>
<p>A configuration for two slaves would look like:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave</span> <span class="kn">import</span> <span class="n">BuildSlave</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
    <span class="n">BuildSlave</span><span class="p">(</span><span class="s">&#39;bot-solaris&#39;</span><span class="p">,</span> <span class="s">&#39;solarispasswd&#39;</span><span class="p">),</span>
    <span class="n">BuildSlave</span><span class="p">(</span><span class="s">&#39;bot-bsd&#39;</span><span class="p">,</span> <span class="s">&#39;bsdpasswd&#39;</span><span class="p">),</span>
<span class="p">]</span>
</pre></div>
</div>
</div>
<div class="section" id="buildslave-options">
<h2><a class="toc-backref" href="#id7">BuildSlave Options</a><a class="headerlink" href="#buildslave-options" title="Permalink to this headline">¶</a></h2>
<p id="index-0"><tt class="xref py py-class docutils literal"><span class="pre">BuildSlave</span></tt> objects can also be created with an optional
<tt class="docutils literal"><span class="pre">properties</span></tt> argument, a dictionary specifying properties that
will be available to any builds performed on this slave.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
    <span class="n">BuildSlave</span><span class="p">(</span><span class="s">&#39;bot-solaris&#39;</span><span class="p">,</span> <span class="s">&#39;solarispasswd&#39;</span><span class="p">,</span>
                <span class="n">properties</span><span class="o">=</span><span class="p">{</span> <span class="s">&#39;os&#39;</span><span class="p">:</span><span class="s">&#39;solaris&#39;</span> <span class="p">}),</span>
<span class="p">]</span>
</pre></div>
</div>
<p id="index-1">The <tt class="xref py py-class docutils literal"><span class="pre">BuildSlave</span></tt> constructor can also take an optional
<tt class="docutils literal"><span class="pre">max_builds</span></tt> parameter to limit the number of builds that it
will execute simultaneously:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
    <span class="n">BuildSlave</span><span class="p">(</span><span class="s">&quot;bot-linux&quot;</span><span class="p">,</span> <span class="s">&quot;linuxpassword&quot;</span><span class="p">,</span> <span class="n">max_builds</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="p">]</span>
</pre></div>
</div>
<div class="section" id="master-slave-tcp-keepalive">
<h3>Master-Slave TCP Keepalive<a class="headerlink" href="#master-slave-tcp-keepalive" title="Permalink to this headline">¶</a></h3>
<p>By default, the buildmaster sends a simple, non-blocking message to each slave
every hour.  These keepalives ensure that traffic is flowing over the
underlying TCP connection, allowing the system's network stack to detect any
problems before a build is started.</p>
<p>The interval can be modified by specifying the interval in seconds using the
<tt class="docutils literal"><span class="pre">keepalive_interval</span></tt> parameter of BuildSlave:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
    <span class="n">BuildSlave</span><span class="p">(</span><span class="s">&#39;bot-linux&#39;</span><span class="p">,</span> <span class="s">&#39;linuxpasswd&#39;</span><span class="p">,</span>
                <span class="n">keepalive_interval</span><span class="o">=</span><span class="mi">3600</span><span class="p">),</span>
<span class="p">]</span>
</pre></div>
</div>
<p>The interval can be set to <tt class="docutils literal"><span class="pre">None</span></tt> to disable this functionality
altogether.</p>
</div>
<div class="section" id="when-buildslaves-go-missing">
<span id="id2"></span><h3>When Buildslaves Go Missing<a class="headerlink" href="#when-buildslaves-go-missing" title="Permalink to this headline">¶</a></h3>
<p>Sometimes, the buildslaves go away. One very common reason for this is
when the buildslave process is started once (manually) and left
running, but then later the machine reboots and the process is not
automatically restarted.</p>
<p>If you'd like to have the administrator of the buildslave (or other
people) be notified by email when the buildslave has been missing for
too long, just add the <tt class="docutils literal"><span class="pre">notify_on_missing=</span></tt> argument to the
<tt class="xref py py-class docutils literal"><span class="pre">BuildSlave</span></tt> definition.  This value can be a single email
address, or a list of addresses:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
    <span class="n">BuildSlave</span><span class="p">(</span><span class="s">&#39;bot-solaris&#39;</span><span class="p">,</span> <span class="s">&#39;solarispasswd&#39;</span><span class="p">,</span>
                <span class="n">notify_on_missing</span><span class="o">=</span><span class="s">&quot;bob@example.com&quot;</span><span class="p">),</span>
<span class="p">]</span>
</pre></div>
</div>
<p>By default, this will send email when the buildslave has been
disconnected for more than one hour. Only one email per
connection-loss event will be sent. To change the timeout, use
<tt class="docutils literal"><span class="pre">missing_timeout=</span></tt> and give it a number of seconds (the default
is 3600).</p>
<p>You can have the buildmaster send email to multiple recipients: just
provide a list of addresses instead of a single one:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
    <span class="n">BuildSlave</span><span class="p">(</span><span class="s">&#39;bot-solaris&#39;</span><span class="p">,</span> <span class="s">&#39;solarispasswd&#39;</span><span class="p">,</span>
                <span class="n">notify_on_missing</span><span class="o">=</span><span class="p">[</span><span class="s">&quot;bob@example.com&quot;</span><span class="p">,</span>
                                    <span class="s">&quot;alice@example.org&quot;</span><span class="p">],</span>
                <span class="n">missing_timeout</span><span class="o">=</span><span class="mi">300</span><span class="p">,</span> <span class="c"># notify after 5 minutes</span>
    <span class="p">),</span>
<span class="p">]</span>
</pre></div>
</div>
<p>The email sent this way will use a <tt class="xref py py-class docutils literal"><span class="pre">MailNotifier</span></tt> (see
<a class="reference internal" href="cfg-statustargets.html#status-MailNotifier" title="MailNotifier"><tt class="xref bb bb-status docutils literal"><span class="pre">MailNotifier</span></tt></a>) status target, if one is configured. This provides a
way for you to control the <em>from</em> address of the email, as well as the
relayhost (aka <em>smarthost</em>) to use as an SMTP server. If no
<tt class="xref py py-class docutils literal"><span class="pre">MailNotifier</span></tt> is configured on this buildmaster, the buildslave-missing
emails will be sent using a default configuration.</p>
<p>Note that if you want to have a <tt class="xref py py-class docutils literal"><span class="pre">MailNotifier</span></tt> for buildslave-missing
emails but not for regular build emails, just create one with
<tt class="docutils literal"><span class="pre">builders=[]</span></tt>, as follows:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.status</span> <span class="kn">import</span> <span class="n">mail</span>
<span class="n">m</span> <span class="o">=</span> <span class="n">mail</span><span class="o">.</span><span class="n">MailNotifier</span><span class="p">(</span><span class="n">fromaddr</span><span class="o">=</span><span class="s">&quot;buildbot@localhost&quot;</span><span class="p">,</span> <span class="n">builders</span><span class="o">=</span><span class="p">[],</span>
                      <span class="n">relayhost</span><span class="o">=</span><span class="s">&quot;smtp.example.org&quot;</span><span class="p">)</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;status&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">m</span><span class="p">)</span>

<span class="kn">from</span> <span class="nn">buildbot.buildslave</span> <span class="kn">import</span> <span class="n">BuildSlave</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
        <span class="n">BuildSlave</span><span class="p">(</span><span class="s">&#39;bot-solaris&#39;</span><span class="p">,</span> <span class="s">&#39;solarispasswd&#39;</span><span class="p">,</span>
                    <span class="n">notify_on_missing</span><span class="o">=</span><span class="s">&quot;bob@example.com&quot;</span><span class="p">),</span>
<span class="p">]</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="latent-buildslaves">
<span id="index-2"></span><span id="id3"></span><h2><a class="toc-backref" href="#id8">Latent Buildslaves</a><a class="headerlink" href="#latent-buildslaves" title="Permalink to this headline">¶</a></h2>
<p>The standard buildbot model has slaves started manually.  The previous section
described how to configure the master for this approach.</p>
<p>Another approach is to let the buildbot master start slaves when builds are
ready, on-demand.  Thanks to services such as Amazon Web Services' Elastic
Compute Cloud (&quot;AWS EC2&quot;), this is relatively easy to set up, and can be
very useful for some situations.</p>
<p>The buildslaves that are started on-demand are called &quot;latent&quot; buildslaves.
As of this writing, buildbot ships with an abstract base class for building
latent buildslaves, and a concrete implementation for AWS EC2 and for libvirt.</p>
<div class="section" id="common-options">
<h3>Common Options<a class="headerlink" href="#common-options" title="Permalink to this headline">¶</a></h3>
<p>The following options are available for all latent buildslaves.</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">build_wait_timeout</span></tt></dt>
<dd>This option allows you to specify how long a latent slave should wait after
a build for another build before it shuts down. It defaults to 10 minutes.
If this is set to 0 then the slave will be shut down immediately. If it is
less than 0 it will never automatically shutdown.</dd>
</dl>
</div>
<div class="section" id="amazon-web-services-elastic-compute-cloud-aws-ec2">
<span id="index-3"></span><h3>Amazon Web Services Elastic Compute Cloud (&quot;AWS EC2&quot;)<a class="headerlink" href="#amazon-web-services-elastic-compute-cloud-aws-ec2" title="Permalink to this headline">¶</a></h3>
<p><a class="reference external" href="http://aws.amazon.com/ec2/">EC2</a> is a web service that allows you to
start virtual machines in an Amazon data center. Please see their website for
details, including costs. Using the AWS EC2 latent buildslaves involves getting
an EC2 account with AWS and setting up payment; customizing one or more EC2
machine images (&quot;AMIs&quot;) on your desired operating system(s) and publishing
them (privately if needed); and configuring the buildbot master to know how to
start your customized images for &quot;substantiating&quot; your latent slaves.</p>
<div class="section" id="get-an-aws-ec2-account">
<h4>Get an AWS EC2 Account<a class="headerlink" href="#get-an-aws-ec2-account" title="Permalink to this headline">¶</a></h4>
<p>To start off, to use the AWS EC2 latent buildslave, you need to get an AWS
developer account and sign up for EC2. Although Amazon often changes this
process, these instructions should help you get started:</p>
<blockquote>
<div><ol class="arabic simple">
<li>Go to <a class="reference external" href="http://aws.amazon.com/">http://aws.amazon.com/</a> and click to &quot;Sign Up Now&quot; for an AWS account.</li>
<li>Once you are logged into your account, you need to sign up for EC2.
Instructions for how to do this have changed over time because Amazon changes
their website, so the best advice is to hunt for it. After signing up for EC2,
it may say it wants you to upload an x.509 cert. You will need this to create
images (see below) but it is not technically necessary for the buildbot master
configuration.</li>
<li>You must enter a valid credit card before you will be able to use EC2. Do that
under 'Payment Method'.</li>
<li>Make sure you're signed up for EC2 by going to 'Your Account'-&gt;'Account
Activity' and verifying EC2 is listed.</li>
</ol>
</div></blockquote>
</div>
<div class="section" id="create-an-ami">
<h4>Create an AMI<a class="headerlink" href="#create-an-ami" title="Permalink to this headline">¶</a></h4>
<p>Now you need to create an AMI and configure the master.  You may need to
run through this cycle a few times to get it working, but these instructions
should get you started.</p>
<p>Creating an AMI is out of the scope of this document.  The
<a class="reference external" href="http://docs.amazonwebservices.com/AWSEC2/latest/GettingStartedGuide/">EC2 Getting Started Guide</a>
is a good resource for this task.  Here are a few additional hints.</p>
<blockquote>
<div><ul class="simple">
<li>When an instance of the image starts, it needs to automatically start a
buildbot slave that connects to your master (to create a buildbot slave,
<a class="reference internal" href="installation.html#creating-a-buildslave"><em>Creating a buildslave</em></a>; to make a daemon,
<a class="reference internal" href="installation.html#launching-the-daemons"><em>Launching the daemons</em></a>).</li>
<li>You may want to make an instance of the buildbot slave, configure it as a
standard buildslave in the master (i.e., not as a latent slave), and test and
debug it that way before you turn it into an AMI and convert to a latent
slave in the master.</li>
</ul>
</div></blockquote>
</div>
<div class="section" id="configure-the-master-with-an-ec2latentbuildslave">
<h4>Configure the Master with an EC2LatentBuildSlave<a class="headerlink" href="#configure-the-master-with-an-ec2latentbuildslave" title="Permalink to this headline">¶</a></h4>
<p>Now let's assume you have an AMI that should work with the
EC2LatentBuildSlave.  It's now time to set up your buildbot master
configuration.</p>
<p>You will need some information from your AWS account: the <cite>Access Key Id</cite> and
the <cite>Secret Access Key</cite>.  If you've built the AMI yourself, you probably
already are familiar with these values.  If you have not, and someone has
given you access to an AMI, these hints may help you find the necessary
values:</p>
<blockquote>
<div><ul class="simple">
<li>While logged into your AWS account, find the &quot;Access Identifiers&quot; link (either
on the left, or via &quot;Your Account&quot; -&gt; &quot;Access Identifiers&quot;.</li>
<li>On the page, you'll see alphanumeric values for &quot;Your Access Key Id:&quot; and
&quot;Your Secret Access Key:&quot;. Make a note of these. Later on, we'll call the
first one your <tt class="docutils literal"><span class="pre">identifier</span></tt> and the second one your <tt class="docutils literal"><span class="pre">secret_identifier</span></tt>.</li>
</ul>
</div></blockquote>
<p>When creating an EC2LatentBuildSlave in the buildbot master configuration,
the first three arguments are required.  The name and password are the first
two arguments, and work the same as with normal buildslaves.  The next
argument specifies the type of the EC2 virtual machine (available options as
of this writing include <tt class="docutils literal"><span class="pre">m1.small</span></tt>, <tt class="docutils literal"><span class="pre">m1.large</span></tt>, <tt class="docutils literal"><span class="pre">m1.xlarge</span></tt>, <tt class="docutils literal"><span class="pre">c1.medium</span></tt>,
and <tt class="docutils literal"><span class="pre">c1.xlarge</span></tt>; see the EC2 documentation for descriptions of these
machines).</p>
<p>Here is the simplest example of configuring an EC2 latent buildslave. It
specifies all necessary remaining values explicitly in the instantiation.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.ec2</span> <span class="kn">import</span> <span class="n">EC2LatentBuildSlave</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">EC2LatentBuildSlave</span><span class="p">(</span><span class="s">&#39;bot1&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span> <span class="s">&#39;m1.large&#39;</span><span class="p">,</span>
                                   <span class="n">ami</span><span class="o">=</span><span class="s">&#39;ami-12345&#39;</span><span class="p">,</span>
                                   <span class="n">identifier</span><span class="o">=</span><span class="s">&#39;publickey&#39;</span><span class="p">,</span>
                                   <span class="n">secret_identifier</span><span class="o">=</span><span class="s">&#39;privatekey&#39;</span>
                                   <span class="p">)]</span>
</pre></div>
</div>
<p>The <tt class="docutils literal"><span class="pre">ami</span></tt> argument specifies the AMI that the master should start.  The
<tt class="docutils literal"><span class="pre">identifier</span></tt> argument specifies the AWS <cite>Access Key Id</cite>, and the
<tt class="docutils literal"><span class="pre">secret_identifier</span></tt> specifies the AWS <cite>Secret Access Key.</cite> Both the AMI and
the account information can be specified in alternate ways.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Whoever has your <tt class="docutils literal"><span class="pre">identifier</span></tt> and <tt class="docutils literal"><span class="pre">secret_identifier</span></tt> values can request
AWS work charged to your account, so these values need to be carefully
protected. Another way to specify these access keys is to put them in a
separate file. You can then make the access privileges stricter for this
separate file, and potentially let more people read your main configuration
file.</p>
</div>
<p>By default, you can make an <tt class="file docutils literal"><span class="pre">.ec2</span></tt> directory in the home folder of the user
running the buildbot master. In that directory, create a file called <tt class="file docutils literal"><span class="pre">aws_id</span></tt>.
The first line of that file should be your access key id; the second line
should be your secret access key id. Then you can instantiate the build slave
as follows.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.ec2</span> <span class="kn">import</span> <span class="n">EC2LatentBuildSlave</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">EC2LatentBuildSlave</span><span class="p">(</span><span class="s">&#39;bot1&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span> <span class="s">&#39;m1.large&#39;</span><span class="p">,</span>
                                   <span class="n">ami</span><span class="o">=</span><span class="s">&#39;ami-12345&#39;</span><span class="p">)]</span>
</pre></div>
</div>
<p>If you want to put the key information in another file, use the
<tt class="docutils literal"><span class="pre">aws_id_file_path</span></tt> initialization argument.</p>
<p>Previous examples used a particular AMI.  If the Buildbot master will be
deployed in a process-controlled environment, it may be convenient to
specify the AMI more flexibly.  Rather than specifying an individual AMI,
specify one or two AMI filters.</p>
<p>In all cases, the AMI that sorts last by its location (the S3 bucket and
manifest name) will be preferred.</p>
<p>One available filter is to specify the acceptable AMI owners, by AWS account
number (the 12 digit number, usually rendered in AWS with hyphens like
&quot;1234-5678-9012&quot;, should be entered as in integer).</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.ec2</span> <span class="kn">import</span> <span class="n">EC2LatentBuildSlave</span>
<span class="n">bot1</span> <span class="o">=</span> <span class="n">EC2LatentBuildSlave</span><span class="p">(</span><span class="s">&#39;bot1&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span> <span class="s">&#39;m1.large&#39;</span><span class="p">,</span>
                           <span class="n">valid_ami_owners</span><span class="o">=</span><span class="p">[</span><span class="mi">11111111111</span><span class="p">,</span>
                                             <span class="mi">22222222222</span><span class="p">],</span>
                           <span class="n">identifier</span><span class="o">=</span><span class="s">&#39;publickey&#39;</span><span class="p">,</span>
                           <span class="n">secret_identifier</span><span class="o">=</span><span class="s">&#39;privatekey&#39;</span>
                           <span class="p">)</span>
</pre></div>
</div>
<p>The other available filter is to provide a regular expression string that
will be matched against each AMI's location (the S3 bucket and manifest name).</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.ec2</span> <span class="kn">import</span> <span class="n">EC2LatentBuildSlave</span>
<span class="n">bot1</span> <span class="o">=</span> <span class="n">EC2LatentBuildSlave</span><span class="p">(</span>
    <span class="s">&#39;bot1&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span> <span class="s">&#39;m1.large&#39;</span><span class="p">,</span>
    <span class="n">valid_ami_location_regex</span><span class="o">=</span><span class="s">r&#39;buildbot\-.*/image.manifest.xml&#39;</span><span class="p">,</span>
    <span class="n">identifier</span><span class="o">=</span><span class="s">&#39;publickey&#39;</span><span class="p">,</span> <span class="n">secret_identifier</span><span class="o">=</span><span class="s">&#39;privatekey&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>The regular expression can specify a group, which will be preferred for the
sorting.  Only the first group is used; subsequent groups are ignored.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.ec2</span> <span class="kn">import</span> <span class="n">EC2LatentBuildSlave</span>
<span class="n">bot1</span> <span class="o">=</span> <span class="n">EC2LatentBuildSlave</span><span class="p">(</span>
    <span class="s">&#39;bot1&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span> <span class="s">&#39;m1.large&#39;</span><span class="p">,</span>
    <span class="n">valid_ami_location_regex</span><span class="o">=</span><span class="s">r&#39;buildbot\-.*\-(.*)/image.manifest.xml&#39;</span><span class="p">,</span>
    <span class="n">identifier</span><span class="o">=</span><span class="s">&#39;publickey&#39;</span><span class="p">,</span> <span class="n">secret_identifier</span><span class="o">=</span><span class="s">&#39;privatekey&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>If the group can be cast to an integer, it will be.  This allows 10 to sort
after 1, for instance.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.ec2</span> <span class="kn">import</span> <span class="n">EC2LatentBuildSlave</span>
<span class="n">bot1</span> <span class="o">=</span> <span class="n">EC2LatentBuildSlave</span><span class="p">(</span>
    <span class="s">&#39;bot1&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span> <span class="s">&#39;m1.large&#39;</span><span class="p">,</span>
    <span class="n">valid_ami_location_regex</span><span class="o">=</span><span class="s">r&#39;buildbot\-.*\-(\d+)/image.manifest.xml&#39;</span><span class="p">,</span>
    <span class="n">identifier</span><span class="o">=</span><span class="s">&#39;publickey&#39;</span><span class="p">,</span> <span class="n">secret_identifier</span><span class="o">=</span><span class="s">&#39;privatekey&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>In addition to using the password as a handshake between the master and the
slave, you may want to use a firewall to assert that only machines from a
specific IP can connect as slaves.  This is possible with AWS EC2 by using
the Elastic IP feature.  To configure, generate a Elastic IP in AWS, and then
specify it in your configuration using the <tt class="docutils literal"><span class="pre">elastic_ip</span></tt> argument.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.ec2</span> <span class="kn">import</span> <span class="n">EC2LatentBuildSlave</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">EC2LatentBuildSlave</span><span class="p">(</span><span class="s">&#39;bot1&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span> <span class="s">&#39;m1.large&#39;</span><span class="p">,</span>
                                   <span class="s">&#39;ami-12345&#39;</span><span class="p">,</span>
                                   <span class="n">identifier</span><span class="o">=</span><span class="s">&#39;publickey&#39;</span><span class="p">,</span>
                                   <span class="n">secret_identifier</span><span class="o">=</span><span class="s">&#39;privatekey&#39;</span><span class="p">,</span>
                                   <span class="n">elastic_ip</span><span class="o">=</span><span class="s">&#39;208.77.188.166&#39;</span>
                                   <span class="p">)]</span>
</pre></div>
</div>
<p>One other way to configure a slave is by settings AWS tags. They can for example be used to
have a more restrictive security <a class="reference external" href="http://aws.amazon.com/iam/">IAM</a> policy. To get Buildbot to tag the latent slave
specify the tag keys and values in your configuration using the <tt class="docutils literal"><span class="pre">tags</span></tt> argument.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.ec2</span> <span class="kn">import</span> <span class="n">EC2LatentBuildSlave</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">EC2LatentBuildSlave</span><span class="p">(</span><span class="s">&#39;bot1&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span> <span class="s">&#39;m1.large&#39;</span><span class="p">,</span>
                                   <span class="s">&#39;ami-12345&#39;</span><span class="p">,</span>
                                   <span class="n">identifier</span><span class="o">=</span><span class="s">&#39;publickey&#39;</span><span class="p">,</span>
                                   <span class="n">secret_identifier</span><span class="o">=</span><span class="s">&#39;privatekey&#39;</span><span class="p">,</span>
                                   <span class="n">tags</span><span class="o">=</span><span class="p">{</span><span class="s">&#39;SomeTag&#39;</span><span class="p">:</span> <span class="s">&#39;foo&#39;</span><span class="p">}</span>
                                   <span class="p">)]</span>
</pre></div>
</div>
<p>The <tt class="xref py py-class docutils literal"><span class="pre">EC2LatentBuildSlave</span></tt> supports all other configuration from the standard
<tt class="xref py py-class docutils literal"><span class="pre">BuildSlave</span></tt>.  The <tt class="docutils literal"><span class="pre">missing_timeout</span></tt> and <tt class="docutils literal"><span class="pre">notify_on_missing</span></tt> specify how long
to wait for an EC2 instance to attach before considering the attempt to have
failed, and email addresses to alert, respectively.  <tt class="docutils literal"><span class="pre">missing_timeout</span></tt>
defaults to 20 minutes.</p>
<p><tt class="docutils literal"><span class="pre">volumes</span></tt> expects a list of (volume_id, mount_point) tuples to attempt attaching when
your instance has been created.</p>
<p><tt class="docutils literal"><span class="pre">keypair_name</span></tt> and <tt class="docutils literal"><span class="pre">security_name</span></tt> allow you to specify different names for
these AWS EC2 values.  They both default to <tt class="docutils literal"><span class="pre">latent_buildbot_slave</span></tt>.</p>
</div>
<div class="section" id="spot-instances">
<h4>Spot instances<a class="headerlink" href="#spot-instances" title="Permalink to this headline">¶</a></h4>
<p>If you would prefer to use spot instances for running your builds, you can accomplish that
by passing in a True value to the <tt class="docutils literal"><span class="pre">spot_instance</span></tt> parameter to the EC2LatentBuildSlave
constructor. Additionally, you may want to specify <tt class="docutils literal"><span class="pre">max_spot_price</span></tt> and <tt class="docutils literal"><span class="pre">price_multiplier</span></tt>
in order to limit your builds' budget consumption.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.ec2</span> <span class="kn">import</span> <span class="n">EC2LatentBuildSlave</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">EC2LatentBuildSlave</span><span class="p">(</span><span class="s">&#39;bot1&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span> <span class="s">&#39;m1.large&#39;</span><span class="p">,</span>
                                   <span class="s">&#39;ami-12345&#39;</span><span class="p">,</span> <span class="n">region</span><span class="o">=</span><span class="s">&#39;us-west-2&#39;</span><span class="p">,</span>
                                   <span class="n">identifier</span><span class="o">=</span><span class="s">&#39;publickey&#39;</span><span class="p">,</span>
                                   <span class="n">secret_identifier</span><span class="o">=</span><span class="s">&#39;privatekey&#39;</span><span class="p">,</span>
                                   <span class="n">elastic_ip</span><span class="o">=</span><span class="s">&#39;208.77.188.166&#39;</span><span class="p">,</span>
                                   <span class="n">placement</span><span class="o">=</span><span class="s">&#39;b&#39;</span><span class="p">,</span> <span class="n">spot_instance</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
                                   <span class="n">max_spot_price</span><span class="o">=</span><span class="mf">0.09</span><span class="p">,</span>
                                   <span class="n">price_multiplier</span><span class="o">=</span><span class="mf">1.15</span>
                                   <span class="p">)]</span>
</pre></div>
</div>
<p>This example would attempt to create a m1.large spot instance in the us-west-2b region
costing no more than $0.09/hour. The spot prices for that region in the last 24 hours
will be averaged and multiplied by the <tt class="docutils literal"><span class="pre">price_multiplier</span></tt> parameter, then a spot request
will be sent to Amazon with the above details. If the spot request is rejected, an error
message will be logged with the final status.</p>
</div>
</div>
<div class="section" id="libvirt">
<span id="index-4"></span><h3>Libvirt<a class="headerlink" href="#libvirt" title="Permalink to this headline">¶</a></h3>
<p><a class="reference external" href="http://www.libvirt.org/">libvirt</a> is a virtualization API for interacting
with the virtualization capabilities of recent versions of Linux and other OSes.
It is LGPL and comes with a stable C API, and Python bindings.</p>
<p>This means we know have an API which when tied to buildbot allows us to have slaves
that run under Xen, QEMU, KVM, LXC, OpenVZ, User Mode Linux, VirtualBox and VMWare.</p>
<p>The libvirt code in Buildbot was developed against libvirt 0.7.5 on Ubuntu Lucid. It
is used with KVM to test Python code on Karmic VM's, but obviously isn't limited to that.
Each build is run on a new VM, images are temporary and thrown away after each build.</p>
<div class="section" id="setting-up-libvirt">
<h4>Setting up libvirt<a class="headerlink" href="#setting-up-libvirt" title="Permalink to this headline">¶</a></h4>
<p>We won't show you how to set up libvirt as it is quite different on each platform,
but there are a few things you should keep in mind.</p>
<blockquote>
<div><ul class="simple">
<li>If you are running on Ubuntu, your master should run Lucid. Libvirt and apparmor are
buggy on Karmic.</li>
<li>If you are using the system libvirt, your buildbot master user will need to be in the
libvirtd group.</li>
<li>If you are using KVM, your buildbot master user will need to be in the KVM group.</li>
<li>You need to think carefully about your virtual network <em>first</em>. Will NAT be enough?
What IP will my VM's need to connect to for connecting to the master?</li>
</ul>
</div></blockquote>
</div>
<div class="section" id="configuring-your-base-image">
<h4>Configuring your base image<a class="headerlink" href="#configuring-your-base-image" title="Permalink to this headline">¶</a></h4>
<p>You need to create a base image for your builds that has everything needed to build
your software. You need to configure the base image with a buildbot slave that is configured
to connect to the master on boot.</p>
<p>Because this image may need updating a lot, we strongly suggest scripting its creation.</p>
<p>If you want to have multiple slaves using the same base image it can be annoying to duplicate
the image just to change the buildbot credentials. One option is to use libvirt's DHCP
server to allocate an identity to the slave: DHCP sets a hostname, and the slave takes its
identity from that.</p>
<p>Doing all this is really beyond the scope of the manual, but there is a <tt class="file docutils literal"><span class="pre">vmbuilder</span></tt> script
and a <tt class="file docutils literal"><span class="pre">network.xml</span></tt> file to create such a DHCP server in
<tt class="file docutils literal"><span class="pre">contrib/</span></tt> (<a class="reference internal" href="installation.html#contrib-scripts"><em>Contrib Scripts</em></a>)
that should get you started:</p>
<div class="highlight-bash"><div class="highlight"><pre>sudo apt-get install ubuntu-vm-builder
sudo contrib/libvirt/vmbuilder
</pre></div>
</div>
<p>Should create an <tt class="file docutils literal"><span class="pre">ubuntu/</span></tt> folder with a suitable image in it.</p>
<div class="highlight-none"><div class="highlight"><pre>virsh net-define contrib/libvirt/network.xml
virsh net-start buildbot-network
</pre></div>
</div>
<p>Should set up a KVM compatible libvirt network for your buildbot VM's to run on.</p>
</div>
<div class="section" id="configuring-your-master">
<h4>Configuring your Master<a class="headerlink" href="#configuring-your-master" title="Permalink to this headline">¶</a></h4>
<p>If you want to add a simple on demand VM to your setup, you only need the following. We
set the username to <tt class="docutils literal"><span class="pre">minion1</span></tt>, the password to <tt class="docutils literal"><span class="pre">sekrit</span></tt>. The base image is called <tt class="docutils literal"><span class="pre">base_image</span></tt>
and a copy of it will be made for the duration of the VM's life. That copy will be thrown
away every time a build is complete.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.libvirt</span> <span class="kn">import</span> <span class="n">LibVirtSlave</span><span class="p">,</span> <span class="n">Connection</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">LibVirtSlave</span><span class="p">(</span><span class="s">&#39;minion1&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span> <span class="n">Connection</span><span class="p">(</span><span class="s">&quot;qemu:///session&quot;</span><span class="p">),</span>
                            <span class="s">&#39;/home/buildbot/images/minion1&#39;</span><span class="p">,</span> <span class="s">&#39;/home/buildbot/images/base_image&#39;</span><span class="p">)]</span>
</pre></div>
</div>
<p>You can use virt-manager to define <tt class="docutils literal"><span class="pre">minion1</span></tt> with the correct hardware. If you don't, buildbot
won't be able to find a VM to start.</p>
<p><tt class="xref py py-class docutils literal"><span class="pre">LibVirtSlave</span></tt> accepts the following arguments:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">name</span></tt></dt>
<dd>Both a buildbot username and the name of the virtual machine.</dd>
<dt><tt class="docutils literal"><span class="pre">password</span></tt></dt>
<dd>A password for the buildbot to login to the master with.</dd>
<dt><tt class="docutils literal"><span class="pre">connection</span></tt></dt>
<dd><tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt> instance wrapping connection to libvirt.</dd>
<dt><tt class="docutils literal"><span class="pre">hd_image</span></tt></dt>
<dd>The path to a libvirt disk image, normally in qcow2 format when using KVM.</dd>
<dt><tt class="docutils literal"><span class="pre">base_image</span></tt></dt>
<dd>If given a base image, buildbot will clone it every time it starts a VM.
This means you always have a clean environment to do your build in.</dd>
<dt><tt class="docutils literal"><span class="pre">xml</span></tt></dt>
<dd>If a VM isn't predefined in virt-manager, then you can instead provide XML
like that used with <tt class="docutils literal"><span class="pre">virsh</span> <span class="pre">define</span></tt>. The VM will be created
automatically when needed, and destroyed when not needed any longer.</dd>
</dl>
</div>
</div>
<div class="section" id="openstack">
<h3>OpenStack<a class="headerlink" href="#openstack" title="Permalink to this headline">¶</a></h3>
<p><a class="reference external" href="http://openstack.org/">OpenStack</a> is a series of interconnected components
that facilitates managing compute, storage, and network resources in a
data center. It is available under the Apache License and has a REST interface
along with a Python client.</p>
<div class="section" id="get-an-account-in-an-openstack-cloud">
<h4>Get an Account in an OpenStack cloud<a class="headerlink" href="#get-an-account-in-an-openstack-cloud" title="Permalink to this headline">¶</a></h4>
<p>Setting up OpenStack is outside the domain of this document. There are four
account details necessary for the Buildbot master to interact with your
OpenStack cloud: username, password, a tenant name, and the auth URL to use.</p>
</div>
<div class="section" id="create-an-image">
<h4>Create an Image<a class="headerlink" href="#create-an-image" title="Permalink to this headline">¶</a></h4>
<p>OpenStack supports a large number of image formats. OpenStack maintains a short
list of prebuilt images; if the desired image is not listed, The
<a class="reference external" href="http://docs.openstack.org/trunk/openstack-compute/admin/content/index.html">OpenStack Compute Administration Manual</a>
is a good resource for creating new images. You need to configure the image with
a buildbot slave to connect to the master on boot.</p>
</div>
<div class="section" id="configure-the-master-with-an-openstacklatentbuildslave">
<h4>Configure the Master with an OpenStackLatentBuildSlave<a class="headerlink" href="#configure-the-master-with-an-openstacklatentbuildslave" title="Permalink to this headline">¶</a></h4>
<p>With the configured image in hand, it is time to configure the buildbot master
to create OpenStack instances of it. You will need the aforementioned account
details. These are the same details set in either environment variables or
passed as options to an OpenStack client.</p>
<p><tt class="xref py py-class docutils literal"><span class="pre">OpenStackLatentBuildSlave</span></tt> accepts the following arguments:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">name</span></tt></dt>
<dd>The buildslave name.</dd>
<dt><tt class="docutils literal"><span class="pre">password</span></tt></dt>
<dd>A password for the buildslave to login to the master with.</dd>
<dt><tt class="docutils literal"><span class="pre">flavor</span></tt></dt>
<dd>The flavor ID to use for the instance.</dd>
<dt><tt class="docutils literal"><span class="pre">image</span></tt></dt>
<dd>A string containing the image UUID to use for the instance. A callable may
instead be passed. It will be passed the list of available images and must
return the image to use.</dd>
</dl>
<p><tt class="docutils literal"><span class="pre">os_username</span></tt></p>
<p><tt class="docutils literal"><span class="pre">os_password</span></tt></p>
<p><tt class="docutils literal"><span class="pre">os_tenant_name</span></tt></p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">os_auth_url</span></tt></dt>
<dd>The OpenStack authentication needed to create and delete instances. These
are the same as the environment variables with uppercase names of the
arguments.</dd>
<dt><tt class="docutils literal"><span class="pre">meta</span></tt></dt>
<dd>A dictionary of string key-value pairs to pass to the instance. These will
be available under the <tt class="docutils literal"><span class="pre">metadata</span></tt> key from the metadata service.</dd>
</dl>
<p>Here is the simplest example of configuring an OpenStack latent buildslave.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.openstack</span> <span class="kn">import</span> <span class="n">OpenStackLatentBuildSlave</span>
<span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">OpenStackLatentBuildSlave</span><span class="p">(</span><span class="s">&#39;bot2&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span>
                <span class="n">flavor</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">image</span><span class="o">=</span><span class="s">&#39;8ac9d4a4-5e03-48b0-acde-77a0345a9ab1&#39;</span><span class="p">,</span>
                <span class="n">os_username</span><span class="o">=</span><span class="s">&#39;user&#39;</span><span class="p">,</span> <span class="n">os_password</span><span class="o">=</span><span class="s">&#39;password&#39;</span><span class="p">,</span>
                <span class="n">os_tenant_name</span><span class="o">=</span><span class="s">&#39;tenant&#39;</span><span class="p">,</span>
                <span class="n">os_auth_url</span><span class="o">=</span><span class="s">&#39;http://127.0.0.1:35357/v2.0&#39;</span><span class="p">)]</span>
</pre></div>
</div>
<p>The <tt class="docutils literal"><span class="pre">image</span></tt> argument also supports being given a callable. The callable will
be passed the list of available images and must return the image to use. The
invocation happens in a separate thread to prevent blocking the build master
when interacting with OpenStack.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">buildbot.buildslave.openstack</span> <span class="kn">import</span> <span class="n">OpenStackLatentBuildSlave</span>

<span class="k">def</span> <span class="nf">find_image</span><span class="p">(</span><span class="n">images</span><span class="p">):</span>
    <span class="c"># Sort oldest to newest.</span>
    <span class="n">cmp_fn</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">x</span><span class="p">,</span><span class="n">y</span><span class="p">:</span> <span class="nb">cmp</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">created</span><span class="p">,</span> <span class="n">y</span><span class="o">.</span><span class="n">created</span><span class="p">)</span>
    <span class="n">candidate_images</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">images</span><span class="p">,</span> <span class="nb">cmp</span><span class="o">=</span><span class="n">cmp_fn</span><span class="p">)</span>
    <span class="c"># Return the oldest candiate image.</span>
    <span class="k">return</span> <span class="n">candidate_images</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>

<span class="n">c</span><span class="p">[</span><span class="s">&#39;slaves&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">OpenStackLatentBuildSlave</span><span class="p">(</span><span class="s">&#39;bot2&#39;</span><span class="p">,</span> <span class="s">&#39;sekrit&#39;</span><span class="p">,</span>
                <span class="n">flavor</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">image</span><span class="o">=</span><span class="n">find_image</span><span class="p">,</span>
                <span class="n">os_username</span><span class="o">=</span><span class="s">&#39;user&#39;</span><span class="p">,</span> <span class="n">os_password</span><span class="o">=</span><span class="s">&#39;password&#39;</span><span class="p">,</span>
                <span class="n">os_tenant_name</span><span class="o">=</span><span class="s">&#39;tenant&#39;</span><span class="p">,</span>
                <span class="n">os_auth_url</span><span class="o">=</span><span class="s">&#39;http://127.0.0.1:35357/v2.0&#39;</span><span class="p">)]</span>
</pre></div>
</div>
<p><tt class="xref py py-class docutils literal"><span class="pre">OpenStackLatentBuildSlave</span></tt> supports all other configuration from the
standard <tt class="xref py py-class docutils literal"><span class="pre">BuildSlave</span></tt>. The <tt class="docutils literal"><span class="pre">missing_timeout</span></tt> and <tt class="docutils literal"><span class="pre">notify_on_missing</span></tt>
specify how long to wait for an OpenStack instance to attach before considering
the attempt to have failed and email addresses to alert, respectively.
<tt class="docutils literal"><span class="pre">missing_timeout</span></tt> defaults to 20 minutes.</p>
</div>
</div>
<div class="section" id="dangers-with-latent-buildslaves">
<h3>Dangers with Latent Buildslaves<a class="headerlink" href="#dangers-with-latent-buildslaves" title="Permalink to this headline">¶</a></h3>
<p>Any latent build slave that interacts with a for-fee service, such as the
EC2LatentBuildSlave, brings significant risks. As already identified, the
configuration will need access to account information that, if obtained by a
criminal, can be used to charge services to your account. Also, bugs in the
buildbot software may lead to unnecessary charges. In particular, if the
master neglects to shut down an instance for some reason, a virtual machine
may be running unnecessarily, charging against your account. Manual and/or
automatic (e.g. nagios with a plugin using a library like boto)
double-checking may be appropriate.</p>
<p>A comparatively trivial note is that currently if two instances try to attach
to the same latent buildslave, it is likely that the system will become
confused.  This should not occur, unless, for instance, you configure a normal
build slave to connect with the authentication of a latent buildbot.  If this
situation does occurs, stop all attached instances and restart the master.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
        </div>
        <div class="sidebar">
<h3>Table Of Contents</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">Buildbot Tutorial</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Buildbot Manual</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="introduction.html">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="concepts.html">Concepts</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="configuration.html">Configuration</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="cfg-intro.html">Configuring Buildbot</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-global.html">Global Configuration</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-changesources.html">Change Sources</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-schedulers.html">Schedulers</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="">Buildslaves</a><ul class="simple">
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="cfg-builders.html">Builder Configuration</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-buildfactories.html">Build Factories</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-properties.html">Properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-buildsteps.html">Build Steps</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-interlocks.html">Interlocks</a></li>
<li class="toctree-l3"><a class="reference internal" href="cfg-statustargets.html">Status Targets</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="customization.html">Customization</a></li>
<li class="toctree-l2"><a class="reference internal" href="new-style-steps.html">New-Style Build Steps</a></li>
<li class="toctree-l2"><a class="reference internal" href="cmdline.html">Command-line Tool</a></li>
<li class="toctree-l2"><a class="reference internal" href="resources.html">Resources</a></li>
<li class="toctree-l2"><a class="reference internal" href="optimization.html">Optimization</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../developer/index.html">Buildbot Development</a></li>
<li class="toctree-l1"><a class="reference internal" href="../relnotes/index.html">Release Notes for Buildbot 0.8.9</a></li>
</ul>

          <h3 style="margin-top: 1.5em;">Search</h3>
          <form class="search" action="../search.html" method="get">
            <input type="text" name="q" />
            <input type="submit" value="Go" />
            <input type="hidden" name="check_keywords" value="yes" />
            <input type="hidden" name="area" value="default" />
          </form>
          <p class="searchtip" style="font-size: 90%">
            Enter search terms or a module, class or function name.
          </p>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

    <div class="footer-wrapper">
      <div class="footer">
        <div class="left">
          <a href="cfg-schedulers.html" title="Schedulers"
             >previous</a> |
          <a href="cfg-builders.html" title="Builder Configuration"
             >next</a> |
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |
          <a href="../genindex.html" title="General Index"
             >index</a>
            <br/>
            <a href="../_sources/manual/cfg-buildslaves.txt"
               rel="nofollow">Show Source</a>
        </div>

        <div class="right">
          
    <div class="footer">
        &copy; Copyright Buildbot Team Members.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
    </div>
        </div>
        <div class="clearer"></div>
      </div>
    </div>

  </body>
</html>