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