Skip to content

Setting up a local development instance

khilman edited this page Jul 26, 2018 · 6 revisions

For setting up a local development instance, you'll need to install the following services:

  • KernelCI frontend
  • KernelCI backend along with the KernelCI storange
  • KernelCI Jenkins
  • LAVA

For installing the KernelCI services on docker containers there is a solution being worked on at https://github.com/lucj/kernelci-docker/

Another solution, tested under Debian 9 (Stretch) using several VM is documented below. This setup assumes that you have several VM in the same network with DNS names. It should be possible to install all the services in the same VM using different ports for nginx. The DNS name for every VM / service are:

  • lava (for LAVA)
  • frontend (for kernelci frontend)
  • backend with a second CNAME storage (for the kernelci backend and for the storage of builds logs and files)
  • ci (for jenkins)

Installing the backend

The backend can be installed using the ansible playbook provided at https://github.com/kernelci/kernelci-backend-config.git This playbook will also install the storage service for hosting the local builds and logs. This will need to setup both services in the DNS (or in your '/etc/hosts'): api(or backend) and storage.

Installing the frontend

The frontend can be installed using the ansible playbook provided at https://github.com/kernelci/kernelci-frontend-config.git

Installing the build system.

The build system is using Jenkins. This is not worthwhile documenting at this moment (July 2018), there are plenty of moving parts because we're switching to jenkins pipelines.

Installing LAVA

The documentation on how to install LAVA (https://validation.linaro.org/static/docs/v2/installing_on_debian.html) is quite good. The following setup is for those already familiar with LAVA that are running the lava master and worker in the same virtual machine.

If you are not at all familiar with LAVA, consider using lava-docker: https://github.com/kernelci/lava-docker

  1. Install a VM with Debian 9 stretch
  2. Add the stretch-backports repository in /etc/apt/sources.list :
deb http://ftp.debian.org/debian stretch-backports main

and install:

# apt-get update
# apt-get install -t stretch-backports postgresql lava

In the moment of writing these lines (2018-07-02), this will install LAVA 2018.5

  1. A few more commands needs to be run to have your installation properly setup:
# a2dissite 000-default
# a2enmod proxy
# a2enmod proxy_http
# a2ensite lava-server.conf
# service apache2 restart

  1. The next step is to disable https, for that you need to add the following lines to /etc/lava-server/settings.conf
"CSRF_COOKIE_SECURE": false,
"SESSION_COOKIE_SECURE": false

and restart:

# service lava-server-gunicorn restart
  1. The final step is creating the lava admin user. We won't be using LDAP here and this will be a local django account:
# lava-server manage createsuperuser 

this will prompt you for the username, email and password.

And this is all! Lava should be available directly at http://lava/ if you installed a local DNS server or at http://IP_Virtual_Machine

Installing a QEMU device

How to install devices in LAVA is out of the scope of this wiki page and how to add devices is also well documented in the LAVA documentation. Some quick notes for adding a QEMU device that will allow you to run tests.

  • Qemu is already aknown device in the default LAVA installation. It's defined at /etc/lava-server/dispatcher-config/device-types/qemu.jinja2
  • Add this device type to your lava installation
# lava-server manage device-types add qemu
  • Then you need to add your first device, in the case of qemu it would be a virtual one we'll call qemu01:
# lava-server manage devices add --device-type qemu --worker <worker> qemu01

In this case, <worker> is the name of your vm. If you're unsure, ask the lavs server for the workers list with:

# lava-server manage workers list
  • Finally, you should add a simple device dictionary for this qemu device, an example:
{% extends 'qemu.jinja2' %}
{% set mac_addr = '52:54:00:12:34:59' %}
{% set memory = '1024' %}

This template must have at least the first two lines and must be saved as /etc/lava-server/dispatcher-config/devices/qemu01.jinja2.

Testing everything works

To test everything works, follow these steps

  1. Log in http://lava or http://IP
  2. Get a token from http://lava/api/tokens/
  3. Set up lava-tool in your work machine:
lava-tool auth-add https://USER@SERVER/RPC2/

This will ask for the token previously generated in the web.

  1. Download https://validation.linaro.org/static/docs/v2/examples/test-jobs/qemu-amd64-standard-stretch.yaml

  2. Submit this job:

lava-tool submit-job https://USER@lava/RPC2/ qemu-amd64-standard-stretch.yaml
  1. You should be able to see this job from the web interface.
You can’t perform that action at this time.