blob: bc8ad00a7d860c59b1b70ab25d6cac765b48d8cd [file] [log] [blame]
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +01001[[docker]]
2== Docker Setup
3
Pau Espin Pedrolbff90dc2020-03-11 17:49:42 +01004A sample {app-name} setup based on docker containers and maintained by the
5Osmocom community is available in Osmocom's git repository
6link:https://git.osmocom.org/docker-playground/[docker-playground.git], under
7'osmo-gsm-tester' subdirectory. In there, one can find:
Pau Espin Pedrol7e0b2dd2020-03-10 11:46:39 +01008
Pau Espin Pedrolbff90dc2020-03-11 17:49:42 +01009- A 'Dockerfile' file can be found which builds a docker image which can
10be used both to run as an osmo-gsm-tester <<install_main_unit,Main Unit>> or as
11a <<install_slave_unit,Slave Unit>>. The main difference to use it as one or the
12other is whether osmo-gsm-tester.py is run on it (Main Unit) or otherwise sshd
13(Slave Unit). A convenience script is provided in the same directory to start
14the processes just explained ('osmo-gsm-tester-{master,slave}.sh').
15
16- A 'jenkins.sh' file is provided which handles all the
17magic to start a Main Unit and a Slave Unit on the same docker private network
18so they can interact. It also takes care on running the docker containers with
19all the required permissions, mount all virtual filesystem bindings, etc.
20
21- A sample <<resources_conf,resources.conf>> file is provided which
22provides some virtual resources configured to be run on the Slave Unit.
23
24The 'jenkins.sh' script expects the <<trials, trial directory>> to be in
25'/tmp/trial', and will bind that directory to the docker Main Unit instance so
26osmo-gsm-tester uses it. Hence, one must place a the trial to be run in there
27before running the setup. There is yet no specific docker container available to
28build trials, but one can re-use an Osmocom jenkins slave container available to
29in 'docker-playground.git' in order to build them using the scripts in
30'osmo-gsm-tester.git/contrib/jenkins-build-*.sh'. Alternatively, the quick way
31is to get them from any of the Osmocom's {app-name}
32link:https://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/[jenkins jobs],
33which store them as artifacts.
34
35When running the whole setup through the 'jenkins.sh' script, standard out
36('stdout') and standard error ('stderr') outputs for each docker container are
37made available to the host running the script, under '/tmp/logs' directory.
38Results generated by {app-name}'s last run can be found as usual under the trial
39directory ('/tmp/trial/last_run').
40
41The {app-name} git revision being checked out to build and run inside the
42docker containers can be selected by setting the 'OSMO_GSM_TESTER_BRANCH'
43environment variable. For instance, to install and run branch 'mybranch' in
44'osmo-gsm-tester.git', one can use:
45----
46export OSMO_GSM_TESTER_BRANCH=mybranch
47./jenkins.sh
48----
49
50Specific command line parameters to be passed to {app-name} process inside the
51Main Unit docker container instance can be set with the 'OSMO_GSM_TESTER_OPTS'
52environment variable. For instance, to run suite '4g' with debug logging level:
53----
54export OSMO_GSM_TESTER_OPTS="-s 4g -l dbg"
55./jenkins.sh
56----