Advanced Installation Topics

The basic First Steps Installing LAVA V2 guide should be a good start for most users installing LAVA. For more advanced users, here is much more information and recommendations for administrators.

Requirements to Consider Before Installing LAVA

Laptops

Be careful with laptop installs, particularly if you are using health checks. It is all too easy for a health check to take the device offline just because the laptop was suspended or without an internet connection at the relevant moment.

Laptops also have limitations on device availability but are routinely used as development platforms and can support QEMU devices without problems.

Virtual Machines

LAVA installs inside a virtual machine (or container) have particular constraints. A QEMU device or container may suffer from being executed within the constraints of the existing virtualisation and other devices may need USB device nodes to be passed through to the VM. Depending on the VM, it is also possible that storage space for the logs may become an issue.

Workload

Consider the expected load of the master and each of the slaves:

  • The workload on the master primarily depends on:
    1. the visibility of the instance,
    2. the number of users,
    3. the average number of jobs in the queue and
    4. the total number of devices attached across all the slaves connected to this master.
  • The workload on the worker involves a range of tasks, scaling with the number of devices attached to the worker:
    1. doing a lot of synchronous I/O,
    2. decompression of large files
    3. serving large files over TFTP or HTTP and
    4. git clone operations.

ARMv7 devices can serve as a master or worker but SATA support is strongly recommended along with 2GB of RAM.

Localhost

LAVA expects to be the primary host on the master. This has improved with V2 but unless your instance is V2-only, you may experience problems or require additional configuration to use LAVA as a virtual host.

Other infrastructure

LAVA will need other services to be available, either using separate tools on the same machines or as separate hardware. This list is not exhaustive.

  • Remote power control (PDU) - the most common issue with new LAVA labs is obtaining and then configuring the remote power control. There is no single device for all use cases and a wide variety of possible solutions, depending on your needs. Take the time to research the issues and ask on the lava-users mailing list.
  • Serial console support - once more than a handful of devices are attached to a worker it becomes necessary to have a separate unit to handle the serial connectivity, turning serial ports into TCP ports. Bespoke serial console servers can be expensive, alternatives include ARMv7 boards with ser2net installed but the USB and ethernet support needs to be reliable.
  • Network switches - simple unmanaged switches will work for small LAVA labs but managed switches are essential to use VLANd support in LAVA test jobs and will also be important for medium to large LAVA labs.
  • Power supply (UPS) - the entire lab needs to be able to cope with power interruptions. Depending on the budget, this could be a small UPS capable of supporting the master and the worker for 10 minutes or it could be a combination of larger UPS units and a generator.
  • Fileserver - the master is not the place to be putting build artefacts, the worker will download those later to a temporary location when the job starts. The development builds and the files built to support the LAVA test need to happen on a suitably powerful machine to match the expectations of the CI loop and the developers.
  • Shelving and racks - quite quickly, the tangle of power cables, network cables, serial cables, devices, switches and other infrastructure will swamp a desk etc. For even a small lab of a handful of devices, a set of shelves or a wall-mounted rack is going to make things a lot easier to manage.

Architecture

_images/arch-overview.png

LAVA installations consist of two primary components - a master and a worker. The master has all the code required to run a worker and can support multiple remote workers to increase the number of devices available on any one instance.

Elements of the master

  • web interface - apache and uwsgi interfacing with django as well as providing XML-RPC access and REST API.
  • database - postgresql, local to the master with no external access.
  • dispatcher-master daemon - controls messages from the master to the worker(s) using ZMQ.

Elements of the slave

  • lava-slave daemon - receives control messages from the master and sends logs and results to the master, optionally uses authentication and encryption using ZMQ.
  • dispatcher - the lava-dispatch process, started by the lava-slave when instructed to do so by the master. This process manages all the operations on the device under test, according to the job submission and device parameters sent by the master.
  • device under test. Note that all the configuration for how the dispatcher interacts with the device is sent from the server.

Other installation notes

A note on wsgi buffers

When submitting a large amount of data to the django application, it is possible to get an HTTP 500 internal server error. This problem can be fixed by appending buffer-size = 65535 to /etc/lava-server/uwsgi.ini

Automated installation

Using debconf pre-seeding with Debian packages

Debconf can be easily automated with a text file which contains the answers for debconf questions - just keep the file up to date if the questions change. For example, to preseed a worker install:

# cat preseed.txt
lava-server   lava-worker/db-port string 5432
lava-server   lava-worker/db-user string lava-server
lava-server   lava-server/master boolean false
lava-server   lava-worker/master-instance-name string default
lava-server   lava-worker/db-server string snagglepuss.codehelp
lava-server   lava-worker/db-pass string werewolves
lava-server   lava-worker/db-name string lava-server

Insert the preseed information into the debconf database:

debconf-set-selections < preseed.txt
# debconf-show lava-server
* lava-worker/master-instance-name: default
* lava-server/master: false
* lava-worker/db-pass: werewolves
* lava-worker/db-port: 5432
* lava-worker/db-name: lava-server
* lava-worker/db-server: snagglepuss.codehelp
* lava-worker/db-user: lava-server

The strings available for seeding are in the Debian packaging for the relevant package, in the debian/<PACKAGE>.templates file.

LAVA server branding support

The icon, link, alt text, bug URL and source code URL of the LAVA link on each page can be changed in the settings /etc/lava-server/settings.conf (JSON syntax):

"BRANDING_URL": "http://www.example.org",
"BRANDING_ALT": "Example site",
"BRANDING_ICON": "https://www.example.org/logo/logo.png",
"BRANDING_HEIGHT": 26,
"BRANDING_WIDTH": 32,
"BRANDING_BUG_URL": "http://bugs.example.org/lava",
"BRANDING_SOURCE_URL": "https://github.com/example/lava-server",

If the icon is available under the django static files location, this location can be specified instead of a URL:

"BRANDING_ICON": "path/to/image.png",

There are limits to the size of the image, approximately 32x32 pixels, to avoid overlap.

The favicon is configurable via the Apache configuration:

Alias /favicon.ico /usr/share/lava-server/static/lava-server/images/linaro-sprinkles.png

LAVA Dispatcher network configuration

/etc/lava-dispatcher/lava-dispatcher.conf supports overriding the LAVA_SERVER_IP with the currently active IP address using a list of network interfaces specified in the LAVA_NETWORK_IFACE instead of a fixed IP address, e.g. for LAVA installations on laptops and other devices which change network configuration between jobs. The interfaces in the list should include the interface which a remote worker can use to serve files to all devices connected to this worker.