summaryrefslogtreecommitdiffstats
path: root/README.md
blob: c92febee77a67ec2c7e82a9d1792d3d1aacc3f9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Linaro's Automated Validation Architecture (LAVA) Docker Container
Preinstalls and preconfigures the latest LAVA server release.

## Prerequisite
The package docker-compose is necessary

## Name Conventions
Each board must be named by their device-type as "device-type-XX" where XX is a number
Each tty will have a name /dev/boardname (via the udev rules)
Each conmux config file will be named boardname.cf
Each slave must be named lab-slave-XX

## Know limitation
The current lava-docker provide support for only one slave

## Architecture
The host must have a dedicated LAN. (192.168.66.0/24)
The host must have IP set to 192.168.66.1 on this LAN.
A sample dhcpd config file is available in the dhcpd directory

## Generating files
### boards.yaml
This file describe how are setuped your boards, and how they are connected and powered.
```
lab-slave-name:
	boardlist:
		devicename:
			type: the devicetype of this device
			pdu:
				daemon: The hostname running the PDU daemon (always localhost)
				host: The host name of the PDU as named in lavapdu.conf
				port: portnumber (The port number of the PDU where the device is connected)
			uart:
				type:
				serial: The serial number in case of FTDI uart
```
Notes:
uart FTDI only need serial

Examples: see boards.yaml

### tokens.yaml
The tokens format have two section, one for user generation, the other for callback tokens
```
lava_server_users:
	- name: LAVA username
	  token: The token of this use
	  password: Password the this user (generated if not provided)
	  superuser: yes/no (default no)
	  staff: yes/no (default no)
callback_tokens:
  - filename: The filename for storing the informations below, the name should be unique along other callback tokens
    username: The LAVA user owning the token below. (This user should be created via lava_server_users:)
    token: The token for this callback
    description: The description of this token. This string could be used with LAVA-CI.
```
Example: see tokens.yaml

### Generate
```
lavalab-gen.py
```

this scripts will generate all necessary files in the following location:
```
conmux/		All files needed by conmux
tokens/		This is where the callback tokens will be generated
users/		This is where the users will be generated
devices/	All LAVA devices files (note that an extra qemu device is also created for the master)
slaves/		Contain the dispatcher_ip to give to slave node
udev-rules for host
docker-compose.yml	Generated from docker-compose.template
```

All thoses files (except for udev-rules) will be handled by docker.
The udev-rules is for generating the right /dev/xxx TTY names.

You can still hack after generated files.

## Building
To build an image locally, execute the following from the directory you cloned the repo:

```
docker-compose build
```

## Running
```
docker-compose up
```

## Process wrapper
You can use the lavalab-gen.sh wrapper which will do all the above actions

## Proxy cache
A squid docker is provided for caching all LAVA downloads (image, dtb, rootfs, etc...)
You have to uncomment a line in lava-master/Dockerfile to enable it

## Security
Note that this container provides defaults which are unsecure. If you plan on deploying this in a production enviroment please consider the following items:

  * Changing the default admin password
  * Using HTTPS
  * Re-enable CSRF cookie (disabled in lava-master/Dockerfile)