Osmocom docker containers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Oliver Smith 266cb2165c common/pipework: deduplicate 8 months ago
alpine-build introduce 'REGISTRY' argument to all Dockerfiles 2 years ago
alpine-lighttpd make/Makefile: always use docker run --rm 8 months ago
arm-none-eabi-gcc-4.8.2 arm-none-eabi-gcc-4.8.2: install missing packages 1 year ago
bind9 Makefile support for our production infrastructure containers 4 years ago
centos7-build Add centos7 containers 10 months ago
centos7-obs-latest Add centos7 containers 10 months ago
centos8-build treewide: use almalinux instead of centos8 8 months ago
centos8-obs-latest treewide: use almalinux instead of centos8 8 months ago
centos8-repo-install-test treewide: use almalinux instead of centos8 8 months ago
cgit cgit: Increase fastcgi timeout from default 60s to 120s 2 years ago
common common/pipework: deduplicate 8 months ago
debian-bullseye-build debian-{bullseye,buster,jessie}-build: install 'equivs' package 8 months ago
debian-bullseye-obs-latest debian-bullseye-obs-latest: new image 10 months ago
debian-bullseye-titan common/pipework: deduplicate 8 months ago
debian-buster-build debian-{bullseye,buster,jessie}-build: install 'equivs' package 8 months ago
debian-buster-erlang debian-{buster,stretch}-*: Explicitly specify DISTRO variables 10 months ago
debian-buster-jenkins debian-{buster,stretch}-*: Explicitly specify DISTRO variables 10 months ago
debian-buster-simtrace2 make: add OSMOCOM_REPO_PATH 1 year ago
debian-jessie-build debian-{bullseye,buster,jessie}-build: install 'equivs' package 8 months ago
debian-jessie-buildslave Don't run "dpkg --add-architecture i386" on ARM 1 year ago
debian-jessie-buildslave-st Fix "'laforge/debian-jessie-build' not found" 4 years ago
debian-jessie-osmocom make: add OSMOCOM_REPO_PATH 1 year ago
debian-sid-build Make respawn.sh a common part of *-build/-obs images 2 years ago
debian-stretch-build debian-{buster,stretch}-*: Explicitly specify DISTRO variables 10 months ago
debian-stretch-build-dist debian-{buster,stretch}-*: Explicitly specify DISTRO variables 10 months ago
debian-stretch-jenkins debian-stretch-jenkins: install libelf-dev 8 months ago
debian-stretch-obs-latest debian-{buster,stretch}-*: Explicitly specify DISTRO variables 10 months ago
debian9-repo-install-test rename {debian => debian9}-repo-install-test 2 years ago
debian10-obs-submit debian10-obs-submit: new container 1 year ago
debian10-repo-install-test debian10-repo-install-test: new container 2 years ago
fpga-build fpga-build: don't write path to /etc/environment 2 years ago
gerrit gerrit: Upgrade to 3.4.3 8 months ago
git-daemon git-deamon: Make sure to create the git-daemon user 4 years ago
gitolite Makefile support for our production infrastructure containers 4 years ago
gr-gsm-master make/Makefile: always use docker run --rm 8 months ago
make make/Makefile: always use docker run --rm 8 months ago
nplab-m3ua-test make/Makefile: always use docker run --rm 8 months ago
nplab-sua-test make/Makefile: always use docker run --rm 8 months ago
open5gs-latest make/Makefile: always use docker run --rm 8 months ago
open5gs-master open5gs-master: ensure consistent install paths with '-latest' 8 months ago
openbts-umts make/Makefile: always use docker run --rm 8 months ago
osmo-bsc-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-bsc-master make/Makefile: always use docker run --rm 8 months ago
osmo-bts-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-bts-master make/Makefile: always use docker run --rm 8 months ago
osmo-cbc-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-cbc-master osmo-*-master: move common code to *-build 2 years ago
osmo-cn-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-dev-on-debian-sid add debian-sid-build, osmo-dev-on-debian-sid 5 years ago
osmo-gbproxy-latest common/pipework: deduplicate 8 months ago
osmo-gbproxy-master common/pipework: deduplicate 8 months ago
osmo-gerrit-libosmo make/Makefile: allow overriding '-it' for target 'run' 8 months ago
osmo-ggsn-latest make/Makefile: always use docker run --rm 8 months ago
osmo-ggsn-master make/Makefile: always use docker run --rm 8 months ago
osmo-gsm-tester make/Makefile: always use docker run --rm 8 months ago
osmo-hlr-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-hlr-master make/Makefile: always use docker run --rm 8 months ago
osmo-hnbgw-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-hnbgw-master make/Makefile: always use docker run --rm 8 months ago
osmo-hnodeb-master make/Makefile: always use docker run --rm 8 months ago
osmo-mgw-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-mgw-master make/Makefile: always use docker run --rm 8 months ago
osmo-msc-latest Revert "osmo-msc-latest: centos8: add libdbi-dbd-sqlite" 10 months ago
osmo-msc-master make/Makefile: always use docker run --rm 8 months ago
osmo-nitb-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-nitb-master make/Makefile: always use docker run --rm 8 months ago
osmo-ns-master common/pipework: deduplicate 8 months ago
osmo-pcap-latest osmo-pcap-latest: fix install path for centos 10 months ago
osmo-pcap-master osmo-pcap-master: doesn't need libosmo-netif 10 months ago
osmo-pcu-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-pcu-master make/Makefile: always use docker run --rm 8 months ago
osmo-ran make/Makefile: always use docker run --rm 8 months ago
osmo-remsim-latest make/Makefile: always use docker run --rm 8 months ago
osmo-remsim-master make/Makefile: always use docker run --rm 8 months ago
osmo-sgsn-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-sgsn-master make/Makefile: always use docker run --rm 8 months ago
osmo-sip-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-sip-master osmo-*-master: move common code to *-build 2 years ago
osmo-smlc-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-smlc-master make/Makefile: always use docker run --rm 8 months ago
osmo-stp-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 1 year ago
osmo-stp-master make/Makefile: always use docker run --rm 8 months ago
osmo-uecups-master osmo-uecups-master: install iputils-ping for ttcn3-pgw-test 8 months ago
osmocom-bb-host-master Revert "osmocom-bb-host-master: install python-enum as fake_trx dependency" 10 months ago
patchwork Makefile support for our production infrastructure containers 4 years ago
public-inbox add "public-inbox" Dockerfile + Makefiel 4 years ago
redmine redmine: process changelogs every 10 minutes 10 months ago
scripts scripts/kernel-test/run-qemu.sh: update qemu args 10 months ago
sctp-test make/Makefile: always use docker run --rm 8 months ago
sigtran-tests make/Makefile: always use docker run --rm 8 months ago
systemd make/Makefile: always use docker run --rm 8 months ago
tmp add non-working yml file with service/stack description 5 years ago
ttcn3-bsc-test make/Makefile: always use docker run --rm 8 months ago
ttcn3-bsc-test-sccplite symlinks: ttcn3-bsc-test-sccplite 4 years ago
ttcn3-bsc-test-vamos make/Makefile: always use docker run --rm 8 months ago
ttcn3-bscnat-test titan: move from debian-stetch-titan to debian-bullseye-titan 10 months ago
ttcn3-bts-test make/Makefile: always use docker run --rm 8 months ago
ttcn3-cbc-test make/Makefile: always use docker run --rm 8 months ago
ttcn3-fr-test titan: move from debian-stetch-titan to debian-bullseye-titan 10 months ago
ttcn3-gbproxy-test titan: move from debian-stetch-titan to debian-bullseye-titan 10 months ago
ttcn3-gbproxy-test-fr ttcn3: write Osmocom repository to configs 10 months ago
ttcn3-ggsn-test ttcn3-ggsn-tests-ogs: Configuration fixes for IPv6 tests 8 months ago
ttcn3-ggsn-test-ogs Add ttcn3-ggsn-ogs testsuite 8 months ago
ttcn3-hlr-test titan: move from debian-stetch-titan to debian-bullseye-titan 10 months ago
ttcn3-hnodeb-test make/Makefile: always use docker run --rm 8 months ago
ttcn3-mgw-test titan: move from debian-stetch-titan to debian-bullseye-titan 10 months ago
ttcn3-msc-test make/Makefile: always use docker run --rm 8 months ago
ttcn3-nitb-sysinfo make/Makefile: always use docker run --rm 8 months ago
ttcn3-ns-test titan: move from debian-stetch-titan to debian-bullseye-titan 10 months ago
ttcn3-ns-test-fr Add ttcn3-ns-test-fr container 2 years ago
ttcn3-ns-test-sgsn-sns ttcn3-ns-test-sgsn-sns: add test run for ns sgsn role with sns 1 year ago
ttcn3-ns-test-sns Add ttcn3-ns-test-sns container 2 years ago
ttcn3-pcap-client-test make/Makefile: always use docker run --rm 8 months ago
ttcn3-pcu-test make/Makefile: always use docker run --rm 8 months ago
ttcn3-pcu-test-sns PCU: Differentiate between tests with classic and SNS Gb dialects 4 years ago
ttcn3-pgw-test ttcn3-pgw-test: configure the 'ogstun' device for open5gs-upfd 8 months ago
ttcn3-remsim-test titan: move from debian-stetch-titan to debian-bullseye-titan 10 months ago
ttcn3-sccp-test make/Makefile: always use docker run --rm 8 months ago
ttcn3-sgsn-test make/Makefile: always use docker run --rm 8 months ago
ttcn3-sip-test titan: move from debian-stetch-titan to debian-bullseye-titan 10 months ago
ttcn3-smlc-test make/Makefile: always use docker run --rm 8 months ago
ttcn3-stp-test make/Makefile: always use docker run --rm 8 months ago
ubuntu-zesty-build introduce 'REGISTRY' argument to all Dockerfiles 2 years ago
.gitignore ttcn3-bts-test: use osmo-config-merge to generate config files 8 months ago
.gitreview add .gitreview 5 years ago
README.md jenkins-common.sh: support 2021q1 feed 1 year ago
jenkins-common.sh make/Makefile: generalize passing additional build arguments 8 months ago
osmo-bisect.sh Use osmo-hnbgw from osmo-hnbgw.git instead of osmo-iuh.git 9 months ago

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 from the "master" branch 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.
  • OSMO_BSC_BRANCH, OSMO_MSC_BRANCH, ...: branch of the appropriate Osmocom project. Defaults to master.
  • NO_DOCKER_IMAGE_BUILD: when set to 1, it won't try to update the containers (see "caching" below)

More examples

latest (debian):

$ export IMAGE_SUFFIX="latest"
$ cd ttcn3-mgw-test
$ ./jenkins.sh

latest-centos8:

$ export IMAGE_SUFFIX="latest-centos8"
$ cd ttcn3-mgw-test
$ ./jenkins.sh

2021q1-centos8:

export OSMOCOM_REPO_TESTSUITE_MIRROR="http://download.opensuse.org"
export OSMOCOM_REPO_MIRROR="https://downloads.osmocom.org"
export OSMOCOM_REPO_PATH="osmo-maintained"
export OSMOCOM_REPO_VERSION="2021q1"
export IMAGE_SUFFIX="2021q1-centos8"
$ cd ttcn3-mgw-test
$ ./jenkins.sh

Kernel test

OsmoGGSN can be configured to either run completely in userspace, or to use the GTP-U kernel module. To test the kernel module, OsmoGGSN and the kernel module will run with a Linux kernel (either the pre-built one from Debian, or a custom built one) in QEMU inside docker. As of writing, ttcn3-ggsn-test is the only testsuite where it makes sense to test kernel modules. But the same environment variables could be used for other testsuites in the future.

Environment variables:

  • KERNEL_TEST: set to 1 to run the SUT in QEMU
  • KERNEL_TEST_KVM: set to 0 to disable KVM acceleration
  • KERNEL_BUILD: set to 1 to build the kernel instead of using the pre-built one
  • KERNEL_REMOTE_NAME: git remote name (to add multiple git repositories in the same local linux clone, default: net-next)
  • KERNEL_URL: git remote url (default: net-next.git on kernel.org)
  • KERNEL_BRANCH branch to checkout (default: master)

The OBS repository mirror consists of ${OSMOCOM_REPO_MIRROR}/${OSMOCOM_REPO_PATH}/${OSMOCOM_REPO_VERSION}, e.g. https://download.opensuse.org/repositories/network:/osmocom:/latest/.

Creating kernel config fragments

For the kernel tests, we are storing kernel config fragments in the git repository instead of full kernel configs. Generate them as follows:

$ cd _cache/linux
$ cp custom.config .config
$ make olddefconfig
$ cp .config custom-updated.config
$ make defconfig  # config to which to diff
$ scripts/diffconfig -m .config custom-updated.config > fragment.config

Verify that it was done right:

$ make defconfig
$ scripts/kconfig/merge_config.sh -m .config fragment.config
$ make olddefconfig
$ diff .config custom-updated.config  # should be the same

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 \
	"osmo-stp-$IMAGE_SUFFIX" \
	"osmo-bsc-$IMAGE_SUFFIX" \
	"osmo-bts-$IMAGE_SUFFIX" \
	"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.

Obtaining gdb backtrace from crash

If for instance TTCN3 test is producing a crash on a program running in docker, eg. osmo-msc, it is desirable to get a full crash report. This section describes how to do so.

First, open osmo-$program/Dockerfile and add lines to install gdb plus $program dependency debug packages. For instance:

+RUN    apt-get install -y --no-install-recommends \
+               gdb \
+               libosmocore-dbg libosmo-abis-dbg libosmo-netif-dbg libosmo-sigtran-dbg osmo-msc-dbg && \
+               apt-get clean

In same Dockerfile file, modify configure to build with debug symbols enabled and other interesting options, such as --enable-sanitize:

-       ./configure --enable-smpp --enable-iu && \
+       export CPPFLAGS="-g -O0 -fno-omit-frame-pointer" && \
+       export CFLAGS="-g -O0 -fno-omit-frame-pointer" && \
+       export CXXFLAGS="-g -O0 -fno-omit-frame-pointer" && \
+       ./configure --enable-smpp --enable-iu --enable-sanitize && \

Finally open the script you use to run the program (for instance ttcn3-$program-master/jenkins.sh), and modify it to launch the process using gdb, and to print a full backtrace when control returns to gdb (when the process crashes):

-/bin/sh -c "osmo-msc -c /data/osmo-msc.cfg >>/data/osmo-msc.log 2>&1"
+/bin/sh -c "gdb -ex 'run' -ex 'bt full' --arg osmo-msc -c /data/osmo-msc.cfg >>/data/osmo-msc.log 2>&1"

See also