pybit-client 1 November 2012 pybit-client
pybit-client buildd client script to perform build jobs using pybit queues.
`pybit-client` options

## DESCRIPTION

pybit-client receives messages from the controller to create a specific package build using the specified version control system. The client feeds status messages back to the controller.

## Usage

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

## Daemon Configuration

Certain values are set using debconf at package installation but values can also be set in `/etc/pybit/client/client.conf` and the relevant debconf settings can be updated using dpkg-reconfigure pybit-client. The configuration file is in JSON format.

clientid - The clientid string for this client (must not be empty and needs to be unique for each client using any one RabbitMQ server).

host_arch - The native architecture of this client, e.g. i386.

    dpkg-architecture -qDEB_BUILD_ARCH

use_lvm - Whether lvm snapshots are in use (default is true).

distribution - The distribution in use. e.g. Debian.

    dpkg-vendor --query vendor

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

buildroot - The buildd location on the client filesystem. Default: `/home/buildd/pybit`

host - The location of the RabbitMQ server which sends the build messages. This can be omitted during initial setup and testing but needs to be specified and the client restarted or no builds will be started.

port - Override the standard port of 5672 for the RabbitMQ server.

suites - NEW in 0.4.1 JSON list of the suites which this client can support - names must match the Distribution: specified in the changelog of relevant packages and must also match an alias for a configured schroot chroot.

     "suites": [ "unstable" ],

     "suites": [ "unstable", "squeeze-backports" ],

The suite field used in 0.4.0 has been removed - clients will not start unless at least one suite is specified in the suites list. See also `/usr/share/pybitclient/client.conf`

userid - If the RabbitMQ server uses authentication, override the default username of guest.

password - If the RabbitMQ server uses authentication, override the default password of guest.

vhost - If the RabbitMQ server uses a specific VHost, override the default of /.

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

dput_dest - 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).

poll_time - frequency with which this client checks the queues for new messages. Measured in seconds. Default: 60 seconds.

debsignkey - keyID to be used to sign the .changes files from this buildd. If empty or omitted, changes files will never be signed. The specified key MUST NOT use a passphrase. The key must be usable by the user running `pybit-client` - check with

    gpg --list-secret-keys

dry_run - initially, clients are setup in dry run mode which means that commands are echoed to the terminal instead of being executed, to allow testing of new setups. To enable builds on the client, edit `/etc/pybit/client/client.conf` to change the value for dry_run to false.

## schroot configuration

The detailed process of creating chroots suitable for schroot is covered in the sbuild documentation (schroot.conf (5)) and amounts to using a tool like debootstrap to create a Debian build environment in a subdirectory (which may or may not be also the mountpoint of an LVM snapshot) and then configuring that chroot to have the relevant apt sources and pre-installed packages (e.g. build-essential and dpkg-dev).

Note: when creating a chroot for schroot, remember to use the `--variant=buildd` option to `debootstrap` and install `fakeroot` inside the chroot.

### Install pbuilder

The pybit debianclient uses `/usr/lib/pbuilder/pbuilder-satisfydepends-classic` for the dependency resolution test, so the pbuilder package needs to be installed inside each build chroot.

### Naming the chroots

The pybit client will expect to be able to use a chroot (or an alias for a chroot) which matches the suite specified in the build request. If using version control hooks, this suite is likely to come from the Distribution field of the output of dpkg-parsechangelog. Ensure that any client has a suitable chroot listed in the output of schroot -l.

`pybit-client` only listens to queues which match the listed suites in `/etc/pybit/client/client.conf`.

The syntax for the suites configuration value changed in version 0.4.1 to support multiple suites within a JSON list:

     "suites": [ "unstable", "squeeze-backports" ],

Clients running 0.4.0 need to have the configuration file updated for 0.4.1 or the client will fail to start as it will be unable to bind to the necessary queues.

### Testing the chroots

There is a test script (`/usr/share/pybitclient/buildd-test.py`) which can be used alongside a test schroot to run through the buildd commands and then do the upload. (What happens to that upload is dependent on the next step, it just sits in an incoming directory initially.)

### Configuring the upload handler

Set up dput by editing `/etc/pybit/client/dput.cf` to provide a usable upload configuration. The format of this file is the same as ~/.dput.cf and is passed to dput using the -c option internally. See dput.cf (5)

## OPTIONS

`-h`, `--help`

  show this help message and exit

`--conf_file`=CONF_FILE

  Configuration file from which settings can be read. Defaults to `configs/client.conf` from the current working directory or falls back to `/etc/pybit/client/client.conf`.

`--arch`=ARCH

  Architecture to use, defaults to i386

`-d`

  Run this client as a daemon - default option used by `/etc/init.d/pybit-client`.

`--distribution`=PYBIT_CLIENT_DIST

  Distribution to use, defaults to Debian

`--pkg_format`=PYBIT_CLIENT_FORMAT

  Package type to use, defaults to deb

`--suite`=PYBIT_CLIENT_SUITE

  Suite to use, defaults to development

`--host`=PYBIT_CLIENT_HOST

  host to connect to, defaults to localhost.

`--vhost`=PYBIT_CLIENT_VHOST

  vhost to connect to, defaults to localhost.

`--userid`=PYBIT_CLIENT_USERID

  user id to use for AMQP server, defaults to guest.

`--port`=PYBIT_CLIENT_PORT

  port to use for AMQP server, defaults to 5672

`--password`=PYBIT_CLIENT_PASSWORD

  password to use for AMQP server, defaults to guest

`--insist`=PYBIT_CLIENT_INSIST

  insist to use for AMQP server, defaults to 5672

`--clientid`=PYBIT_CLIENT_INSIST

  id to use for build-client control queue, defaults to 1 but is unique per amqp server.

## Setting up the pybit server to work with clients

The clients are only one part of pybit. pybit-web provides the server which will provide jobs for the clients. See pybit-web (1).

## Author

This manual page was written by Neil Williams codehelp@debian.org