Buildbot

Benjamin Gilbert edited this page May 26, 2016 · 11 revisions

The OpenSlide Buildbot instance performs nightly builds and test suite runs.

Setting up a buildslave

  1. Ensure the system is using a UTF-8 locale.

  2. Install build and test suite dependencies, Git, a C compiler, Make, Autoconf, Automake, Libtool, pkg-config, and DejaVu Sans.

  3. For each Python major version (2 or 3) which is supported by OpenSlide Python: install Python, Python development headers, setuptools, and Pillow or PIL.

  4. Install stunnel and configure it:

     setuid = stunnel
     setgid = stunnel
     pid = /var/lib/stunnel/stunnel.pid
    
     [openslide_buildbot]
     client = yes
     CAfile = /etc/stunnel/ca.crt
     cert = /etc/stunnel/stunnel.crt
     key = /etc/stunnel/stunnel.key
     verify = 2
     options = NO_SSLv2
     options = NO_SSLv3
     ; Only with stunnel < 4.37
     sslVersion = TLSv1
     accept  = 127.0.0.1:1999
     connect = buildbot.openslide.org:2000
    
  5. pip install buildbot-slave

  6. Create a buildbot user account. As the buildbot user:

     buildslave create-slave buildslave 127.0.0.1:1999 <buildslave-name> <buildslave-password>
    
  7. Edit ~buildslave/buildslave/info/*

  8. Add a crontab for buildslave:

     PATH=/usr/local/bin:/usr/bin:/bin
    
     @reboot buildslave start ~/buildslave
    

Additional setup for EC2 instances

  1. Install Boto ≥ 2.5.0 and Requests ≥ 1.0

  2. Ensure the VM will resize its root filesystem on boot. On Linux, cloud-init will do this.

  3. Bundle an AMI using openslide-automation/scripts/create-amis.py.

Notes for Windows EC2 instances

  • Install unzip.

  • The Buildbot user needs SeCreateSymbolicLinkPrivilege. Because of access token filtering, this implies that the user must not be an administrator.

  • Use cygrunsrv to install services for stunnel and buildbot:

cygrunsrv -I stunnel -p /usr/bin/stunnel -a /home/stunnel/stunnel/stunnel.conf -u stunnel

cygrunsrv -I buildbot -p /usr/bin/buildslave
-a "start --nodaemon /home/buildbot/buildslave/" -u buildbot -y stunnel
-e PATH=/usr/local/bin:/usr/bin:/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows

  `-e PATH=` prevents `cygrunsrv` from adding `/bin` to the beginning of the search path, which breaks CMake.

- Before creating a new AMI, ensure that `Ec2DynamicBootVolumeSize` is set to `Enabled` in `C:\Program Files\Amazon\Ec2ConfigService\Settings\config.xml`.