Debian clients - nicholasdavidson/pybit GitHub Wiki

Package installation

Build the pybit Debian packages (see debian/README.source) and upload pybit-client and pybit-common packages to the prospective client. Install the two packages (use apt-get -f install to fix dependencies, if necessary). For Debian Squeeze, pybit-client needs python-requests which is available from squeeze-backports, so add backports to the apt sources of the client. We no longer support squeeze.

Current packages use debconf to ask about specific strings and set some Debian-based defaults.

debconf asks the user for details of:

  • The clientid string for this client (must not be empty and needs to be unique for each client using any one RabbitMQ server).
  • The location of the rabbitMQ server to receive build messages (can be omitted if not configured at this point but needs to be specified in /etc/pybit/client/client.conf and the client restarted or no builds will be started).
  • The codename of the location to upload the built packages (must not be empty as the default for dput is typically to upload to ftp-master.debian.org).

The maintainer scripts calculate default values for:

  • The native architecture of this client (dpkg-architecture -qDEB_BUILD_ARCH) e.g. i386
  • The distribution in use. (dpkg-vendor --query vendor) e.g. Debian

debconf also has some low priority questions, accessible using dpkg-reconfigure pybit-client to set:

  • Whether lvm snapshots are in use (default is true).
  • Whether to change the default buildd location of /home/buildd/pybit

Finally, there are also configuration settings in /etc/pybit/client/client.conf which provide more options. (Changes to this file will update the corresponding debconf values when dpkg-reconfigure pybit-client is run.)

{
 "pkg_format": "deb",
 "port": "5672",
 "userid": "guest",
 "password": "guest",
 "vhost": "/",
 "dput": "-U",
 "debconf": true
}

The configuration file is in JSON format and debconf adds the last line via the maintainer script.

pkg_format - used by each build client to screen out unsupported binary formats, e.g. Debian clients will check for deb and RPM clients would check for rpm.

port - If your RabbitMQ server is configured to use a non-standard port, specify that here.

userid - If the RabbitMQ server uses authentication, specify the username here.

password - If the RabbitMQ server uses authentication, specify the password here.

vhost - If the RabbitMQ server uses a specific VHost, specify that here.

dput - options passed down to dput - see dput (1). The default is to stop dput writing .upload files.

Configure the build tools

Configuring sbuild and dput

Configure the repository

If the repository does not already exist, ensure that reprepro is installed with the relevant incoming directory as specified in the dput config.

The repository needs an incoming rule, so the initial setup of the reprepro repository would require:

conf/distributions
conf/incoming

See reprepro (1) for details of these files. To generate the repository, use:

reprepro export
reprepro createsymlinks

Configure pybit-watcher

e.g. for a repository setup in /srv/repository (such that /srv/repository/conf/distributions exists) with an incoming directory which is writable by the user specified in the dput config:

{
	"configured" : true,
	"repobase": "/srv/repository",
	"path" : "/srv/repository/incoming",
	"dryrun" : false,
	"rule" : "incoming_rule_name",
	"sleeptime": 3
}

Once the watcher is configured, restart the daemon:

sudo invoke-rc.d pybit-watcher restart

Running the client

pybit-client runs as a single-instance daemon by default. The standard daemon control interface is supported:

invoke-rc.d pybit-client stop
invoke-rc.d pybit-client start
update-rc.d pybit-client disable
update-rc.d pybit-client enable

Check your preferred clients in /var/lib/pybit-client.d/

cd /var/lib/pybit-client.d/
sudo ln -fs /usr/lib/python2.7/dist-packages/pybitclient/debianclient.py .
sudo ln -fs /usr/lib/python2.7/dist-packages/pybitclient/subversion.py .

A buildd test configuration would look like:

{
 "count": 1,
 "vcs_id1": "840",
 "method_type1": "svn",
 "suite1": "jessie",
 "package1": "adduser",
 "version1": "3.114",
 "architecture1": "i386",
 "source1": "adduser",
 "uri1": "svn://svn.debian.org/adduser/trunk/",
 "pkg_format1": "deb",
 "distribution1": "debian",
 "role1": "master",
 "commands1": ""
}

Note: vcs_id refers to a real SVN revision number at the specified url which needs to also match the version number of the package that would be built at that revision. Suite then specifies the schroot to use. Ensure that the architecture matches the arch of the sbuild chroot.

⚠️ **GitHub.com Fallback** ⚠️