[Lsb-messages] /var/www/bzr/lsb/devel/puppet-lsb r227: Initial run at managing build slaves in chroots.

Jeff Licquia licquia at linuxfoundation.org
Fri Mar 9 21:53:04 UTC 2012


------------------------------------------------------------
revno: 227
committer: Jeff Licquia <licquia at linuxfoundation.org>
branch nick: puppet-lsb
timestamp: Fri 2012-03-09 16:53:04 -0500
message:
  Initial run at managing build slaves in chroots.
  
  The strategy: we copy the Puppet manifests that control slave setup
  into the chroots manually, and then run "puppet apply" to make them
  happen.  This allows us to use the same manifests to control native,
  VM, and chroot build slaves without duplication.
added:
  modules/buildbot/files/chroot/
  modules/buildbot/files/chroot/module-init.pp@
  modules/buildbot/files/chroot/module-slave.pp@
  modules/buildbot/files/chroot/module-slavepkgs.pp@
  modules/buildbot/manifests/slavechroot.pp
  modules/buildbot/templates/
  modules/buildbot/templates/buildbotpw-init-bigword.pp.erb
  modules/buildbot/templates/buildbotpw-init-smallword.pp.erb
modified:
  manifests/nodes/lfdev-s390x.pp
  modules/buildbot/manifests/slave.pp
-------------- next part --------------
=== modified file 'manifests/nodes/lfdev-s390x.pp'
--- a/manifests/nodes/lfdev-s390x.pp	2012-02-29 15:37:57 +0000
+++ b/manifests/nodes/lfdev-s390x.pp	2012-03-09 21:53:04 +0000
@@ -6,4 +6,6 @@
 
     include puppet
 
+    include buildbot::slavechroot
+
 }

=== added directory 'modules/buildbot/files/chroot'
=== added symlink 'modules/buildbot/files/chroot/module-init.pp'
=== target is '../../manifests/init.pp'
=== added symlink 'modules/buildbot/files/chroot/module-slave.pp'
=== target is '../../manifests/slave.pp'
=== added symlink 'modules/buildbot/files/chroot/module-slavepkgs.pp'
=== target is '../../manifests/slavepkgs.pp'
=== modified file 'modules/buildbot/manifests/slave.pp'
--- a/modules/buildbot/manifests/slave.pp	2012-03-06 20:43:17 +0000
+++ b/modules/buildbot/manifests/slave.pp	2012-03-09 21:53:04 +0000
@@ -6,7 +6,9 @@
     # Here, we figure out what user and password to use to log into the
     # master.  This differs per-architecture.  The buildbotpw module
     # is pulled in from puppet-secret, and just contains Puppet variables
-    # containing passwords.
+    # containing passwords.  The defaults are used by chroot build slaves,
+    # which are managed differently (see the manifest for the class
+    # buildbot::slavechroot).
 
     include buildbotpw
 
@@ -14,12 +16,14 @@
         /^i386$/   => 'lfbuild-x86',
         /^x86_64$/ => 'lfbuild-x86_64',
         /^ia64$/   => 'lfbuild-ia64',
+        default    => $buildbotpw::masteruser,
     }
 
     $masterpw = $architecture ? {
         /^i386$/   => $buildbotpw::x86password,
         /^x86_64$/ => $buildbotpw::x64password,
         /^ia64$/   => $buildbotpw::ia64password,
+        default    => $buildbotpw::masterpw,
     }
 
     # Which SDKs should we use for released and beta builds?

=== added file 'modules/buildbot/manifests/slavechroot.pp'
--- a/modules/buildbot/manifests/slavechroot.pp	1970-01-01 00:00:00 +0000
+++ b/modules/buildbot/manifests/slavechroot.pp	2012-03-09 21:53:04 +0000
@@ -0,0 +1,89 @@
+class buildbot::slavechroot inherits buildbot {
+
+    include buildbotpw
+
+    # Build slaves using this configuration do builds in chroots:
+    # one each for the 31/32-bit and 64-bit variants of that arch.
+    # For now, the chroots have to be unpacked manually.  Here, we
+    # configure the chroot paths.
+
+    $smallwordchroot = $hostname ? {
+        'etpglr3' => '/data/chroots/sles11-31bit',
+        'pmac'    => '/data/chroots/sles11-32bit',
+    }
+
+    $bigwordchroot = '/data/chroots/sles11-64bit'
+
+    # Within a chroot, we do the chroot setup by copying a
+    # Puppet config into it and using "puppet apply" to apply
+    # it.  We do this b/c the Puppet master/agent setup
+    # doesn't handle chroots well; nodes are identified
+    # by FQDN, for example.
+
+    file {
+        '/etc/puppet-chroot': ensure => directory;
+        '/etc/puppet-chroot/modules': ensure => directory;
+        '/etc/puppet-chroot/modules/buildbot': ensure => directory;
+        '/etc/puppet-chroot/modules/buildbot/manifests': ensure => directory;
+        '/etc/puppet-chroot/modules/buildbotpw': ensure => directory;
+        '/etc/puppet-chroot/modules/buildbotpw/manifests': ensure => directory;
+    }
+
+    # These module files should be exactly the same as the buildbot
+    # module manifests in regular Puppet.
+
+    file { '/etc/puppet-chroot/modules/buildbot/manifests/init.pp':
+        source => 'puppet:///modules/buildbot/chroot/module-init.pp',
+    }
+
+    file { '/etc/puppet-chroot/modules/buildbot/manifests/slavepkgs.pp':
+        source => 'puppet:///modules/buildbot/chroot/module-slavepkgs.pp',
+    }
+
+    file { '/etc/puppet-chroot/modules/buildbot/manifests/slave.pp':
+        source => 'puppet:///modules/buildbot/chroot/module-slave.pp',
+    }
+
+    # For password information, we mock up a buildbotpw module as
+    # if from puppet-secrets, but we only include the appropriate
+    # user info.
+
+    $smallworduser = $architecture ? {
+        '390x'  => 'lfbuild-s390',
+        'ppc64' => 'lfbuild-ppc32',
+    }
+
+    $smallwordpass = $architecture ? {
+        '390x'  => $buildbotpw::s390password,
+        'ppc64' => $buildbotpw::ppc32password,
+    }    
+
+    $bigworduser = $architecture ? {
+        '390x'  => 'lfbuild-s390x',
+        'ppc64' => 'lfbuild-ppc64',
+    }
+
+    $bigwordpass = $architecture ? {
+        '390x'  => $buildbotpw::s390xpassword,
+        'ppc64' => $buildbotpw::ppc64password,
+    }    
+
+    file { '/etc/puppet-chroot/modules/buildbotpw/manifests/init_smallword.pp':
+        content => template('buildbot/buildbotpw-init-smallword.pp.erb'),
+    }
+
+    file { '/etc/puppet-chroot/modules/buildbotpw/manifests/init_bigword.pp':
+        content => template('buildbot/buildbotpw-init-bigword.pp.erb'),
+    }
+
+    # Actually apply the config to the chroot.
+
+    exec { 'puppet-update-smallword-chroot':
+        command => "rsync -a /etc/puppet-chroot $smallwordchroot/tmp && ln -sf init_smallword.pp $smallwordchroot/tmp/puppet-chroot/modules/buildbotpw/manifests/init.pp && chroot $smallwordchroot puppet apply --modulepath=/tmp/puppet-chroot -e 'include buildbot::slave'",
+    }
+
+    exec { 'puppet-update-bigword-chroot':
+        command => "rsync -a /etc/puppet-chroot $bigwordchroot/tmp && ln -sf init_bigword.pp $bigwordchroot/tmp/puppet-chroot/modules/buildbotpw/manifests/init.pp && chroot $bigwordchroot puppet apply --modulepath=/tmp/puppet-chroot -e 'include buildbot::slave'",
+    }
+
+}

=== added directory 'modules/buildbot/templates'
=== added file 'modules/buildbot/templates/buildbotpw-init-bigword.pp.erb'
--- a/modules/buildbot/templates/buildbotpw-init-bigword.pp.erb	1970-01-01 00:00:00 +0000
+++ b/modules/buildbot/templates/buildbotpw-init-bigword.pp.erb	2012-03-09 21:53:04 +0000
@@ -0,0 +1,6 @@
+class buildbotpw {
+
+    $masteruser = "<%= bigworduser %>"
+    $masterpw = "<%= bigwordpass %>"
+
+}

=== added file 'modules/buildbot/templates/buildbotpw-init-smallword.pp.erb'
--- a/modules/buildbot/templates/buildbotpw-init-smallword.pp.erb	1970-01-01 00:00:00 +0000
+++ b/modules/buildbot/templates/buildbotpw-init-smallword.pp.erb	2012-03-09 21:53:04 +0000
@@ -0,0 +1,6 @@
+class buildbotpw {
+
+    $masteruser = "<%= smallworduser %>"
+    $masterpw = "<%= smallwordpass %>"
+
+}



More information about the lsb-messages mailing list