CPAN Smoker

Here is an overview of the setup I use to run several virtual CPAN smokers.

libvirt

I have 1 dedicated server which runs the VMs using libvirt and KVM. To manage the VMs (create new ones, start/stop, etc.) I use virt-manager and connect to the libvirtd through a ssh tunnel.

                    +--------------+
                    | virt-manager |
                    +--------------+
                           |qemu+ssh
                           v
/--------------------------------------------------------\
|                       libvirt                          |
+--------------------------------------------------------+
|                         KVM                            |
+--------------------------------------------------------+
|/---------\ /--------------\ /-----------\ /-----------\|
|| OpenBSD | | DragonFlyBSD | | Windows 7 | | Windows 8 ||
|\---------/ \--------------/ \-----------/ \-----------/|
\--------------------------------------------------------/

Because the VMs don't provide any services they are behind a NAT and not reachable from outside.

Smoker setup

metabase-relayd

The host runs a metabase-relayd. All CPAN test reports are send to this server and then relayed to cpantesters.org.

Install metabase-relayd:

% cpan metabase-relayd

Create the config file in ~/.metabase/relayd

address=192.168.122.1,127.0.0.1
idfile=/home/cpan/.metabase/id.json
port=8090
multiple=1
submissions=10
offline=0
url=http://metabase.cpantesters.org/api/v1/

If you don't have an idfile, you might want to create one:

% metabase-profile

Start the relay server:

% metabase-relayd

bootstrapping the smoker

First thing to do if you plan to run a smoker on a Windows machine is to install Perl. I use StrawberryPerl. All other OSs should have Perl already installed. But you'll need some additional Modules. Here is a list of the Modules I install before starting:

This list is mostly from wiki.cpantesters.org but might be a little outdated. Just try to install often used modules, so they won't be build every time a tested module depends on it.

Create the CPAN::Reporter config in ~/.cpanreporter/config.ini

edit_report=default:ask/no pass/na:no
email_from=Your Name <your@email.address>
send_report=default:ask/yes pass/na:yes
transport=Socket host 192.168.122.1 port 8090

This will send all test reports using Test::Reporter::Transport::Socket to the metabase-relayd we set up earlier. Now activate the sending of test reports:

% cpan
cpan> o conf init test_report
cpan> o conf commit
cpan> bye

Now everything is in place and if your metabase-relayd is up and running you can test your first module:

cpan> force test Acme::rafl::Everywhere

If all goes well you should see your test after a few minutes in the logtail and you can start smoking:

% perl -MCPAN::Reporter::Smoker -e start

I run this from within a screen session.

distroprefs

There are some modules which prompt for input, hang or crash on some platforms. You can disable the smoke testing of those modules or give them the right input using distroprefs. These are basically just yaml files which include rules for every module which needs special attention.

Search github for distroprefs and clone one of the repos to the disk of your smoker so you have a starting point. Then configure the prefs dir in cpan:

cpan> o conf init prefs_dir
cpan> o conf commit
April 14, 2013 | cpan, perl, kvm, libvirt
about | blog | archives