summaryrefslogtreecommitdiffstats
path: root/README.md
blob: c4a3cec81fae5f3db4cd447a22b4142e96d117a9 (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
105
# 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:
	dispatcher_ip: the IP where the slave could be contacted. In lava-docker it is the host IP since docker proxify TFTP from host to the slave.
	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)
s="nb">pwd -P); } elif [ -n "$BASH_VERSION" ]; then [[ $0 != "$BASH_SOURCE" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $BASH_SOURCE) && pwd -P); } fi if [ $SOURCED -ne 1 ]; then unset SOURCED unset SOURCEDIR echo "Error: this script needs to be sourced in a supported shell" >&2 echo "Please check that the current shell is bash, zsh or ksh and run this script as '. $0 <args>'" >&2 exit 56 else unset SOURCED tmpfile=$(mktemp /tmp/aglsetup.XXXXXXXX) $SOURCEDIR/.aglsetup_genconfig.bash -s $tmpfile "$@" rc=$? unset SOURCEDIR if [ $rc -eq 0 ]; then source $tmpfile rc=$? else echo "Error: configuration files generation failed. Environment is not ready." fi rm -f $tmpfile unset tmpfile return $rc fi