This is a Linaro LITE customized fork of LAVA dockerized setup. Instructions for it are available in the wiki.
Below is the original README.
docker-compose file to setup an instance of lava-server and/or lava-dispatcher from scratch. In this setup, every service will be running in a separate container.
In order to use this docker-compose file, you need:
You can install the dependencies using:
apt install docker.io docker-compose
You just need to fetch the sources:
git clone https://git.lavasoftware.org/lava/pkg/docker-compose
cd docker-compose
In order to start the containers, run:
docker-compose build
docker-compose up
docker-compose will spawn a container for each services:
All the services will be connected to each other.
docker-compose will also create some volumes for:
Create the sql backup file:
docker exec --user postgres docker-compose_db_1 bash -c \
"pg_dump --username=lavaserver lavaserver > /tmp/lavaserver.sql"
Then retrieve it on host:
docker cp docker-compose_db_1:/tmp/lavaserver.sql .
In order to restore an instance from a backup, first delete the db container and its associated volume:
docker-compose stop
docker container rm docker-compose_db_1; docker volume rm lava-server-pgdata
Then place the .sql (or .sql.gz) file in initdb.d/ folder:
docker-compose -f docker-compose.yaml -f docker-compose-restore-backup.yaml up -d
The file docker-compose-restore-backup.yaml mounts an extra volume in postgres container, in /docker-entrypoint-initdb.d References:
All configuration is stored in .env
file. Some of the steps are required
whilst others are optional.
--encrypt
if the master instance
is using encryption for master-slave communication.sudo /usr/share/lava-dispatcher/create_certificate.py foo_slave_1
This can be done in three ways:
docker run -v $PWD:/tmp/certs --rm lavasoftware/lava-dispatcher /usr/share/lava-common/create_certificate.py --directory /tmp/certs foo_slave_1
dispatcher/certs/
of this
project. Currently the key names should be the default ones (master.key and
slave.key_secret).make lava-dispatcher
; at this point multiple containers should be
up and running and the worker should connect to the LAVA server instance of
your choosing.{% extends 'qemu.jinja2' %}
{% set mac_addr = 'DF:AD:BE:EF:33:02' %}
{% set memory = 1024 %}
You can do this via XMLRPC, lavacli or REST API (if using version 2020.01 and higher).
SOCKS_PROXY=--socks-proxy <address>:port
in the .env
configuration file
Furthermore, you will need to add a proxy settings to the .env
file for
docker resource downloads (http_proxy, ftp_proxy and https_proxy environment
variable).Note: If the master instance is behind a firewall, you will need to create a port forwarding so that ports 5555 and 5556 are open to the public.
If you're setting up a standalone dispatcher container, make sure you go through the above configuration first, it is mandatory for this step. In order to run test jobs on physical devices we will need a couple of additional setup steps:
dispatcher/power-control
directory; they
will be copied into /root/power-control
path in the container.dispatcher/ssh
directory and the public key on to the PDUdispatcher/ssh
dir; it will be copied to /root/.ssh
directory on the dispatcher
container.ser2net/ser2net.config
with the corresponding
serial port and device settingsdispatcher_ip: <docker host ip address>
In order to start the containers, run:
docker-compose build lava-dispatcher
docker-compose up lava-dispatcher
or, alternatively:
make lava-dispatcher