Osmocom docker containers
Go to file
Oliver Smith 61f2be7bd4 Fix git checkout for branches and commits
Replace 'git checkout -f -B $BRANCH origin/$BRANCH && \' in all
Dockerfiles that accept branch variables ($OSMO_TTCN3_BRANCH,
$OSMO_MGW_BRANCH, ...) with the following:
	git checkout $BRANCH && \
	(git symbolic-ref -q HEAD && git reset --hard origin/$BRANCH || exit 1); \

This allows using branch names and commit hashes in the $BRANCH
variables. Using commits is needed for the bisect script added in [1].

The second line ("(git symbolic...") checks if we are in detached HEAD
state after the checkout, and if we are not, pulls in all new commits
from origin/$BRANCH. Note that it ends in ';' instead of '&&', because
the command in the next line should be executed even if
"git symbolic-ref" does not exit with 0 (detached HEAD state).

Here is an example, to illustrate that the new command does the right
thing. Clone a repository and be 50 commits behind origin/master:
$ git clone "https://git.osmocom.org/osmo-mgw"
$ cd osmo-mgw
$ git reset --hard origin/master~50

With BRANCH="master":
$ git checkout master && \
  (git symbolic-ref -q HEAD && git reset --hard origin/master || exit 1); \
  echo "done"
Already on 'master'
...
done
$ git status
Your branch is up-to-date with 'origin/master'.

With BRANCH="85978d":
$ git checkout 85978d && \
  (git symbolic-ref -q HEAD && git reset --hard origin/85978d || exit 1); \
  echo "done"
Note: checking out '85978d'.
...
done
$ git status
HEAD detached at 85978dad

Related previous changes:
* [2] made it work for commit hashes, but broke using branch names other
      than master, and pulling in new commits from master
* [3] made branches other than master work again, but did not fix
      pulling in new commits from master
* [4] reverted [3] and the git checkout related part from [2]

[1] Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f
[2] Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869
[3] Change-Id: I2ff745c8d19b777d876170d5717c082ceb68a1f3
[4] Change-Id: Ie6da0f9ea96f11407e38545a6b3cf22ef9cadc25

Related: OS#4015
Change-Id: I4004980baf0b7d6096702b6f3067ccbdb369a28c
2019-05-22 11:18:56 +02:00
alpine-build Add Dockerfile for alpine:3.6 based containers with libosmocore build deps 2017-10-09 11:15:57 +08:00
alpine-lighttpd Add Dockerfile for alpine Linux with lighttpd 2017-10-15 14:37:41 +00:00
bind9 Makefile support for our production infrastructure containers 2018-06-03 16:11:26 +00:00
cgit cgit: Fix group membership to allow read of git repos 2018-08-18 17:28:54 +02:00
debian-jessie-build debian-*-build: don't download "Release" file 2019-05-07 06:31:16 +00:00
debian-jessie-buildslave Fix "'laforge/debian-jessie-build' not found" 2018-09-06 15:17:06 +02:00
debian-jessie-buildslave-st Fix "'laforge/debian-jessie-build' not found" 2018-09-06 15:17:06 +02:00
debian-jessie-osmocom Release.key of osmocom-nightly has expired; update it in all Dockerfiles 2018-02-04 17:20:04 +01:00
debian-repo-install-test debian-repo-test: blacklist soapysdr0.7 2019-02-20 18:13:15 +00:00
debian-sid-build add debian-sid-build, osmo-dev-on-debian-sid 2017-12-06 01:45:42 +01:00
debian-stretch-build debian-*-build: don't download "Release" file 2019-05-07 06:31:16 +00:00
debian-stretch-titan debian-stretch-titan: install procps 2019-05-02 18:04:18 +02:00
gerrit cosmetic: gerrit: use variables for the files to patch 2018-12-11 09:13:31 +00:00
git-daemon git-deamon: Make sure to create the git-daemon user 2018-07-21 09:38:52 +02:00
gitolite Makefile support for our production infrastructure containers 2018-06-03 16:11:26 +00:00
gr-gsm-master Revert "Simplify git checkout, allow branches and commits" 2019-05-21 17:53:11 +02:00
make Add OSMO_*_BRANCH environment variables for build args 2019-04-25 13:56:14 +02:00
nplab-m3ua-test nplab-m3ua-test: support running without jenkins 2019-04-05 08:30:28 +02:00
nplab-sua-test Switch all osmo-*-master and ttcn3-*-test from jessie to stretch 2019-03-30 09:56:36 +00:00
osmo-bsc-latest .../osmo-bsc.cfg: drop deprecated dyn_ts_allow_tch_f 2019-01-14 21:07:36 +00:00
osmo-bsc-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-bts-latest ensure well-formed config files 2018-09-26 09:27:38 +00:00
osmo-bts-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-cn-latest osmo-cn-latest: Add default osmo-msc.cfg 2019-03-28 13:22:22 +01:00
osmo-dev-on-debian-sid add debian-sid-build, osmo-dev-on-debian-sid 2017-12-06 01:45:42 +01:00
osmo-gerrit-libosmo Revert "Simplify git checkout, allow branches and commits" 2019-05-21 17:53:11 +02:00
osmo-ggsn-latest ensure well-formed config files 2018-09-26 09:27:38 +00:00
osmo-ggsn-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-hlr-latest ensure well-formed config files 2018-09-26 09:27:38 +00:00
osmo-hlr-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-hnbgw-latest Add osmo-*-latest Dockerfiles 2018-05-04 18:12:37 +02:00
osmo-hnbgw-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-mgw-latest ensure well-formed config files 2018-09-26 09:27:38 +00:00
osmo-mgw-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-msc-latest osmo-msc.cfg: remove auth policy, LU reject cause 2019-01-29 13:30:52 +01:00
osmo-msc-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-nitb-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-pcu-latest PCU: Add osmo-pcu-* + ttcn3-pcu-test containers 2019-02-20 21:45:07 +00:00
osmo-pcu-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-sgsn-latest osmo-*-latest: s/nightly/latest/g in Dockerfile 2018-10-22 11:43:43 +00:00
osmo-sgsn-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-sip-latest osmo-*-latest: s/nightly/latest/g in Dockerfile 2018-10-22 11:43:43 +00:00
osmo-sip-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmo-stp-latest osmo-*-latest: s/nightly/latest/g in Dockerfile 2018-10-22 11:43:43 +00:00
osmo-stp-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
osmocom-bb-host-master Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
patchwork Makefile support for our production infrastructure containers 2018-06-03 16:11:26 +00:00
public-inbox add "public-inbox" Dockerfile + Makefiel 2018-10-07 16:27:31 +00:00
redmine redmine: Fix openid 2018-10-07 11:15:00 +02:00
sctp-test Switch all osmo-*-master and ttcn3-*-test from jessie to stretch 2019-03-30 09:56:36 +00:00
sigtran-tests Switch all osmo-*-master and ttcn3-*-test from jessie to stretch 2019-03-30 09:56:36 +00:00
tmp add non-working yml file with service/stack description 2017-05-03 20:50:12 +02:00
ttcn3-bsc-test Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ttcn3-bsc-test-sccplite symlinks: ttcn3-bsc-test-sccplite 2018-10-26 10:19:05 +02:00
ttcn3-bscnat-test Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ttcn3-bts-test Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ttcn3-ggsn-test Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ttcn3-hlr-test Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ttcn3-mgw-test Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ttcn3-msc-test Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ttcn3-nitb-sysinfo Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ttcn3-pcu-test Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ttcn3-pcu-test-sns PCU: Differentiate between tests with classic and SNS Gb dialects 2019-03-14 21:38:44 +01:00
ttcn3-sgsn-test Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ttcn3-sip-test Fix git checkout for branches and commits 2019-05-22 11:18:56 +02:00
ubuntu-zesty-build *-build: Add libgnutls28-dev, as libosmocore requires this now 2017-11-17 10:11:30 +01:00
.gitignore gitignore: add .release 2019-04-04 10:46:14 +00:00
.gitreview add .gitreview 2018-04-12 09:20:24 +00:00
README.md Switch all osmo-*-master and ttcn3-*-test from jessie to stretch 2019-03-30 09:56:36 +00:00
Release.key Release.key of osmocom-nightly has expired; update it in all Dockerfiles 2018-02-04 17:20:04 +01:00
jenkins-common.sh jenkins-common.sh: pull upstream base images 2019-04-02 11:38:26 +02:00
osmo-bisect.sh Add script to bisect test failures with ttcn3 and docker 2019-04-26 12:07:15 +02:00

README.md

Osmocom docker playground

This repository contains some humble attempts at creating some Docker containers + related stacks around Osmocom. So far, the main focus is test automation.

Running a testsuite

All testsuite folders start with ttcn3 or nplab. Run the following to build/update all required containers and start a specific testsuite:

$ cd ttcn3-mgw-test
$ ./jenkins.sh

Environment variables:

  • IMAGE_SUFFIX: the version of the Osmocom stack to run the testsuite against. Default is master, set this to latest to test the last stable releases.
  • OSMO_TTCN3_BRANCH: osmo-ttcn3-hacks.git branch, which will be used when building a ttcn3-* docker image. Defaults to master.
  • NO_DOCKER_IMAGE_BUILD: when set to 1, it won't try to update the containers (see "caching" below)

Building containers manually

Most folders in this repository contain a Dockerfile. Build a docker container with the same name as the folder like this:

$ cd debian-stretch-build
$ make

Caching

All folders named osmo-*-latest and osmo-*-master build the latest stable or most recent commit from master of the corresponding Osmocom program's git repository. When you have built it already, running make will only do a small HTTP request to check if the sources are outdated and skip the build in case it is still up-to-date.

Dependencies

Folders that don't have a jenkins.sh usually only depend on the container that is specified in the FROM line of their Dockerfile. Testsuites depend on multiple containers, they are defined on top of each jenkins.sh:

. ../jenkins-common.sh
IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
docker_images_require \
	"debian-stretch-build" \
	"osmo-stp-$IMAGE_SUFFIX" \
	"osmo-bsc-$IMAGE_SUFFIX" \
	"osmo-bts-$IMAGE_SUFFIX" \
	"debian-stretch-titan" \
	"ttcn3-bsc-test"

Reasoning for this implementation

Before having the docker_images_require lines, there used to be a top-level Makefile for resolving dependencies between the containers. But it was prone to mistakes: when new folders in the repository were added without related targets in the Makefile, make would always assume that the targets where the always existing folders and therefore never build the containers.

In order to implement testing latest in addition to master (OS#3268), it would have been necessary to add further complexity to the Makefile. Instead it was decided to scrap the file, and just keep the short list of dependencies right above where they would be needed in the jenkins.sh.

See also