Project

General

Profile

LDV Tools in Docker » History » Version 7

Alexey Khoroshilov, 05/15/2015 09:31 PM

1 1 Ilja Zakharov
h1. LDV Tools in Docker
2 2 Ilja Zakharov
3 3 Alexey Khoroshilov
h2. Actual Images
4
5 6 Vadim Mutilin
At the moment the only image available is "LDV Tools 0.8":http://linuxtesting.org/downloads/ldv-docker-0.8.tar.gz.
6
MD5: 40accf5d0ab7321a3a40014013c03de4
7 3 Alexey Khoroshilov
8 2 Ilja Zakharov
h2. Description
9
10
This file describes steps to deploy ldv-tools software verification system
11
from master branch of ldv-tools repository with help of docker. More details
12
about system usage are available in corresponding tutorials stored in the
13
ldv-tools repo.
14
15
This package should contain english and russian tutorials and two docker images:
16
17
* debianldv.tar - image with ldv installed ldv console tools and web interface;
18
* mysql.tar - image with a mysql-server, database for verification results and
19
              script for its initialization.
20
21
h2. Deployment
22
23 4 Ilja Zakharov
# Install Docker on your machine according to official "tutorial":http://docs.docker.com/installation/. Provided below version may help if your docker version does not support these images. Images were built with Docker having following version:
24 2 Ilja Zakharov
<pre>
25
$ sudo docker version
26
Client version: 1.5.0
27
Client API version: 1.17
28
Go version (client): go1.4.1
29
Git commit (client): a8a31ef
30
OS/Arch (client): linux/amd64
31
Server version: 1.5.0
32
Server API version: 1.17
33
Go version (server): go1.4.1
34
Git commit (server): a8a31ef
35
</pre>
36
# Load your images to Docker on the host machine:
37
<pre>
38
$ sudo docker load -i debianldv.tar
39
$ sudo docker load -i mysql.tar
40
</pre>
41
After loading you will have two available images on your host:
42
<pre>
43
$ sudo docker images
44 5 Vadim Mutilin
ldv-tools/debianldv           latest              ff073a36d5be        23 hours ago        2.716 GB
45
ldv-tools/mysql               latest              4607ef975bea        3 days ago          260.8 MB
46 2 Ilja Zakharov
</pre>
47
48
h2. Run containers
49
50
Warning! Before running containers make sure that nobody uses ports listed
51
below:
52
53
* 3306 - usually it is claimed by mysql-server;
54
* 8999 - largely nobody uses it.
55
56
h3. Run container with mysql-server.
57
58 5 Vadim Mutilin
# Run ldv-tools/mysql container in a daemon mode on your host machine:
59 2 Ilja Zakharov
<pre>
60 5 Vadim Mutilin
$ sudo docker run -p 3306:3306 -d ldv-tools/mysql
61 2 Ilja Zakharov
</pre>
62
# Now you can connect from your host to the mysql-server in a container. Verification results will be stored in the database "ldvbase" which can be managed by user "ldvuser" with no password:
63
<pre>
64
$ mysql -u ldvuser --protocol=TCP
65
</pre>
66
# Next it is required to access database from other container, so it is necessary to obtain mysql container''s IP address first. Perform on host:
67
<pre>
68
$ sudo docker ps
69
</pre>
70
Remember the ID of mysql container and run command to get its IP address:
71
<pre>
72 7 Alexey Khoroshilov
$ sudo docker inspect --format=''{{.NetworkSettings.IPAddress}}'' <MYSQL cont. ID>
73 2 Ilja Zakharov
</pre>
74
# There is no any other required actions to perform with the container, just keep it alive. The other instructions are concerned with the main ldv image and its container.
75
76
h3. Run container with ldv-tools
77
78
# Prepare host directory with Linux sources to share with the container in a read and write mode (you can choose your own path instead of /host/work):
79
<pre>
80
$ mkdir /host/work
81
$ cp linux-3.17-rc1.tar.xz /host/work
82
$ cd /host/work
83
</pre>
84
# Run container with ldv-tools (option "--privileged=true is required for control croups mounting, since docker restricts it inside a container by default):
85
<pre>
86 5 Vadim Mutilin
$ sudo docker run -i -t -v "/host/work:/work:rw" --privileged=true -p 8999:8999 ldv-tools/debianldv /bin/bash
87 2 Ilja Zakharov
</pre>
88
# Run inside a container command:
89
<pre>
90
# recursive_cg_mounter
91
</pre>
92
# You may need to start apache2 inside a container explicitly:
93
<pre>
94
# service apache2 start
95
</pre>
96
97
h2. Run verification
98
99
# Now you can perform verification inside ldv container in an interactive mode. Results will be stored in finished/ dir in a pax archive. The most frequent problem is that host systems have disabled swap accounting. You can use LDV without swap account at your own risk. More information is available in ldv-tools repository in the files INSTALL, TUTORIAL, README and others. Repository is not included in the containers to save disk space. Set LDV_WORK_WITHOUT_SWAP_ACCOUNT environment variable for that. There is an example:
100
<pre>
101
# RCV_MEMLIMIT=5Gb RCV_TIMELIMIT=100 ldv-manager envs=linux-3.17-rc1.tar.xz  kernel_driver=1 "drivers=drivers/net/usb/cdc-phonet.ko" "rule_models=32_7a"
102
</pre>
103
104
h2. Explore results
105
106
# Upload results from debianldv container to container with mysql (remember that this IP address we already obtained few steps above):
107
<pre>
108
# LDVDB=ldvbase LDVDBHOST=<MYSQL container IP> LDVUSER=ldvuser ldv-upload-2 finished/yours.pax
109
</pre>
110
# Now you can analyze your results in a browser from your host machine or even connecting from a remote host. Just type the address:
111
<pre>
112
http://localhost:8999/stats/index/profilename/default/name/ldvbase/user/ldvuser/host/<MYSQL container IP>/
113
</pre>
114
# To share your results use host name or host IP instead of localhost.
115
116
h2. Finish work
117
118
# To terminate containers use just "exit" in a container running interactive mode and commands "sudo docker ps" and "sudo docker kill <id>" for containers started in a daemon mode.
119
# Do not forget to dump your mysql base from corresponding container if you are planning its further usage, since information in destroyed containers is flushed.