Linaro / lite-lava-docker-compose

LITE Team LAVA docker dispatcher
MIT License
5 stars 10 forks source link

lite-lava-docker-compose

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

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.

Usage

Requirements

In order to use this docker-compose file, you need:

You can install the dependencies using:

apt install docker.io docker-compose

Installing

You just need to fetch the sources:

git clone https://git.lavasoftware.org/lava/pkg/docker-compose
cd docker-compose

Using it

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:

Backup/restore of the database

Backup

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 .

Restore

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:

Standalone dispatcher container

Configuration (simple, for QEMU purposes)

All configuration is stored in .env file. Some of the steps are required whilst others are optional.

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.

Configuration (advanced, for physical DUT purposes)

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:

Running

In order to start the containers, run:

docker-compose build lava-dispatcher
docker-compose up lava-dispatcher

or, alternatively:

make lava-dispatcher