Commit Graph

49 Commits

Author SHA1 Message Date
Vadim Yanitskiy ea90e44ab0 */Dockerfile: clone from using https://
* Do not clone using deprecated git://, use https:// instead.
* Clone from the main repo (if possible).
* Use the gitiles plugin to fetch the last commit from Gerrit.

Change-Id: I204fa6e3e3ebbdb8732393b897fca35659d61ae8
2023-01-06 23:10:13 +07:00
Oliver Smith 38f7fcb265 */.release: remove
These files are in .gitignore and get generated at the end of running
'make'. Remove them to have less cluttered 'git grep' output.

Change-Id: Ie5bf05220359ac0941f62cc86ed843363548784a
2022-07-06 12:36:26 +02:00
Oliver Smith a0a991f412 make/Makefile: always use docker run --rm
Add --rm to the "docker run" line in make/Makefile, and remove it from

Related: SYS#5827
Change-Id: Iea063aa39a08397ea64d2018b433991a130e7f56
2022-02-14 07:46:23 +00:00
Vadim Yanitskiy 44393058f6 make/Makefile: allow overriding '-it' for target 'run'
Allocating a pseudo-TTY (-t, --tty) fails when 'run' is executed
inside of a Jenkins or cron script.  This change fixes
ttcn3-bts-test, which invokes 'run' to fetch the config files.

Change-Id: If22f682be4f004c5bb43e65098079a4f4fe6158d
Fixes: If15461240f3037c142c176fc7da745a1701ae3f8
2022-02-11 15:21:16 +06:00
Oliver Smith 2aee5862d8 osmo-ggsn-*: install iproute2 for kernel tests
Add the package providing "ip", as debian bullseye doesn't have it
installed by default anymore.

Fix for:
  /kernel-test/ 9: ip: not found

Related: OS#4969
Change-Id: I95560868a899169bf0cb05a02d5034d9a77b6af7
2021-12-17 10:38:51 +01:00
Oliver Smith 31daedcd2b osmo-*-master: move common code to *-build
Move common code from osmo-*-master to debian-stretch-build and
* add the OBS repository key (debian only)
* add the OBS repository with "nightly" feed (debian only, already done
  for centos8)
* install telnet
* invalidate the cache once the repository is updated

While at it, remove deprecated MAINTAINER lines.

This fixes the need to read both the repository index of debian-stretch
and centos8 and having to invalidate the cache if either of them changes
(instead of reading just the relevant index and invalidating the cache
only if the relevant one changes).

A similar change was done with osmo-*-latest in

Related: OS#5049
Change-Id: Id69f3eaf37f823bac0947366f27a25edd277a4cb
2021-03-04 14:45:51 +01:00
Oliver Smith 79e48fd3ae ttcn3-ggsn-test: add kernel test
Make it possible to run ttcn3-ggsn-test against osmo-ggsn with the GTP
kernel module. This feature is enabled by environment variables
explained in ttcn3-ggsn-test/, and can either use the
pre-built kernel from Debian, or build a kernel from source.

The kernel runs inside QEMU inside the usual osmo-ggsn-master docker

Thanks to Pau for providing the kernel config and kernel-test scripts
that this patch is based on! I ended up modifying them quite a bit to
fit the docker use case, and to build the initrd (so we can use the
stock debian kernel).

Related: OS#3208
Change-Id: I54e752048eed2a170a1cf4e0fd410de255b9de5d
2021-02-26 09:32:39 +01:00
Oliver Smith fd6f09e0c2 osmo-ggsn-master: add configure --enable-gtp-linux
Related: OS#3208
Change-Id: I8cf3de4775aa82bfdad1bf2c40aab3b50e910db3
2021-02-26 09:32:39 +01:00
Harald Welte de52a89d0d migrate from CentOS_8_Stream to CentOS_8
Change-Id: I72c8fdae14816ec0a243f3fca4b4c2a49b562845
Related: SYS#5250
2020-12-16 10:54:37 +01:00
Pau Espin 7d7a06b749 common: Introduce OSMOCOM_REPO_MIRROR param
This allows easily changing to another osmocom repo base URL if the
default one is down.

Related: OS#4862
Change-Id: I8010b08f3dabacfb3c13a44eece6c7a490e0742e
2020-12-02 14:27:02 +01:00
Harald Welte 0cb56e4bc7 osmo-*-master: Invalidate docker cache when CentOS repo changes
We currently only invalidate the cache if the Debian repository changes,
but not if the CentOS repository changes.  This leads to strange
artefacts, such as CentOS containers for osmo-bts-master using an
old libosmocore, despite a new one being available in the repo.

As Dockerfiles don't support conditional "ADD", we need to actually
add both the CentOS and the Debian repsotiry file, so any change
in either of the two will now (unneccessarily) invalidate the cache
for both Debian and CentOS builds.

Change-Id: I7b13644afb9d3be3b94184193177e003c13718d3
2020-10-16 13:13:08 +02:00
Vadim Yanitskiy e6e2b06689 make: use $(nproc) instead of hard-coded number of cores
Change-Id: Ie93b81a8a9206c47c4e4d4834fc5c03d9bf4254c
2020-07-13 02:52:10 +07:00
Oliver Smith 9913f3896b osmo-*-master: support centos8
Adjust the Dockerfiles, so 'docker_images_require osmo-mgw-master-centos8'
etc. result in a centos8 based image. centos8-build already configures the
Osmocom nightly repository, so we only need to configure it for

Related: OS#4564
Change-Id: I6579748056ce0505304378b342a698b98c77fd18
2020-05-30 09:28:34 +02:00
Harald Welte 1bccbb8a66 update OBS Release.key; the old one expired today.
Change-Id: I0dd7d7f54a3eb93ca677f3bdc5e00f62694aaa9e
2020-03-30 18:06:58 +02:00
Pau Espin a9877bf487 Update osmo-*/Dockerfile to log stdout+stderr of process to log file
This way we get VTY parsing failures as well as backtraces upon process

Related: OS#4212
Change-Id: I9493ff73ef27c7c6d32b00cf827704b3f9cbf86a
2019-11-19 18:29:00 +00:00
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 ""
$ 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'
$ 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'.
$ 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
Harald Welte 06ac6e455e Revert "Simplify git checkout, allow branches and commits"
Unfortuately this commit will check out *local* master (i.e. the
previous checkout) rather than the origin/master as it's supposed to
be. This means that ever since merging this patch, our ttcn3 tests
were running some "undefined" stale versions and not current master.

This reverts commit 26565bb729.

Change-Id: Ie6da0f9ea96f11407e38545a6b3cf22ef9cadc25
2019-05-21 17:53:11 +02:00
Oliver Smith 26565bb729 Simplify git checkout, allow branches and commits
Replace the following statements:

a) "git checkout -f -B $BRANCH origin/$BRANCH"
b) "git checkout -f -B $BRANCH $BRANCH"


c) "git checkout -f $BRANCH"

Regarding a), we don't need to specify 'origin/' for each branch, since
we are cloning the repositories in the same Dockerfile, and therefore we
know for sure that there is only one remote and branch names won't be
ambiguous. Removing the 'origin/' allows to put commit hashes into the
branch variables (like done in the new bisect script [1]).

Version b) does not work with branch names:
$ git checkout -f -B osmith/check-imei-before-lu osmith/check-imei-before-lu
fatal: Cannot update paths and switch to branch 'osmith/check-imei-before-lu' at the same time.
Did you intend to checkout 'osmith/check-imei-before-lu' which can not be resolved as commit?

New version c) works with both commits and branches, and it is shorter.

[1] Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f

Change-Id: I2ff745c8d19b777d876170d5717c082ceb68a1f3
2019-05-07 10:24:52 +02:00
Daniel Willmann b59a9ed8d4 Add OSMO_*_BRANCH environment variables for build args
Previously we could only set OSMO_TTCN3_BRANCH as environment variable
to build a test other than master.

This patch adds environment variables for all osmo-*-master images which
allow docker tests to be executed for an arbitrary commit.

The origin/ prefix from the git checkout command is removed so the
*_BRANCH variable doesn't have to contain branch names, but van also
contain arbitrary commits. This shouldn't have any adverse effect as we
only have one remote in the checkout.

Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869
2019-04-25 13:56:14 +02:00
Harald Welte 7c53c9e60d Switch all osmo-*-master and ttcn3-*-test from jessie to stretch
Jessie will be EOL in June 2019, let's make the switch to stretch
before that.

Change-Id: I37a534d07081f3d321869c86d49d03171c8da0c6
2019-03-30 09:56:36 +00:00
Harald Welte cffe1022b5 print branch name and git commit hash during docker container build
This is quite useful when looking at jenkins logs to know which exact
version was built at the time.

Change-Id: Id52c382b454e2beecf46820752aeff15b2c1a0ae
2019-03-29 16:40:40 +00:00
Harald Welte ff3dc6e45f ensure well-formed config files
Change-Id: Id687e63c418e2e955ccbb92f2420a80fc0704ea4
2018-09-26 09:27:38 +00:00
Oliver Smith 7ed7a2bdd2 Fix "'laforge/debian-jessie-build' not found"
Instead of hardcoding laforge's username in all FROM statements in the
Dockerfiles, make use of the USER variable (as passed through by the
"make/Makefile" with "docker build --build-arg USER=..."). Thanks to
fixeria for proposing this fix!

This requires running docker-ce, old versions of docker (such as the
one in the official repositories of the latest Fedora) don't support
variables in the FROM line. But docker-ce can be installed after
adding docker's 3rd party repositories.

Closes: OS#3457

Change-Id: Ic5f11c8a4e247f632cb6aea6d147e94c53e0130f
2018-09-06 15:17:06 +02:00
Harald Welte 0434f34c36 osmo-*-master: add Dockerfile ARG for git repo branch to be built
This allows the user to build any non-master branches of the related
repositories, which is helpful for local testing before pushing changes
to git.

Change-Id: I0c3349e9a60015472c96bd24fbf29aad57501a00
2018-05-23 20:00:24 +02:00
Harald Welte afe1ec8dc1 Release.key of osmocom-nightly has expired; update it in all Dockerfiles 2018-02-04 17:20:04 +01:00
Harald Welte e0e2d6e96a osmo-*: Ensure container is rebuilt if nightly repo is updated
Let's use the "ADD" trick that we use for git repositories also for
the osmocom:nightly debian package feed.  This way any change to the
package feed will result in a rebuild of the container.
2017-12-17 10:48:54 +00:00
Harald Welte 1772bc022b osmo-ggsn-master: Enable ipv6 forwarding
We want to be able to reach the external PDN from the PDP contexts,
and hence need to enable IPV6 forwarding between the tun device
and the PDN device(s).  The latter are added using "docker network
2017-10-15 14:47:28 +00:00
Harald Welte a899ae3688 osmo-ggsn-master: Introduce 'branch' build-time-argumetn to Dockerfile
We can build non-master branches thsi way.
2017-10-14 14:25:26 +00:00
Harald Welte 6202d089c3 osmo-ggsn-master: fix syntax of "make run" arguments 2017-10-14 14:24:48 +00:00
Harald Welte 54d7362cc2 osmo-ggsn-mater: switch to osmo-ggsn.git
openggsn.git is deprecated now, use master branch of osmo-ggsn.git
2017-09-06 12:30:11 +02:00
Harald Welte 33149a7162 osmo-ggsn-master: Rename config file for openggsn -> osmo-ggsn change 2017-09-05 20:25:13 +02:00
Harald Welte dcf652ccbe osmo-ggsn-mater: Add missing 'git checkout'
When rebuilding the docker image, it's important to not only git
checkout but also to git fetch before, otherwise we won't build
new code ;)
2017-09-05 20:00:45 +02:00
Harald Welte e21fe3a4fe Fix Dockerfile syntax error in apt-get command 2017-08-28 07:46:41 +02:00
Harald Welte 3c1dc34c91 apt-get: always use --no-install-recommends and apt-get clean
this helps us to avoid installing unneeded packages and removes the
package cache from the images to keep them less bloated.
2017-08-27 09:53:26 +02:00
Harald Welte fda289fd60 osmo-*: Bind to INADDR_ANY so telnet/VTY is reachable remotely
We're using this in an internal network for jenkins integration
testing, so no security concern.
2017-08-20 21:43:23 +02:00
Harald Welte 19c9c2b8b2 ggsn: Use SIGINT as this is handled in ggsn for fast termination
For some reason, it appears that if docker sends SIGTERM the default
action (kernel auto terminate) is not installed, but it expects the
program to handle it directly.  Let's tell docker to use SIGINT as
this is what ggsn always handled.
2017-08-20 12:54:01 +02:00
Harald Welte 453f690c97 ggsn/stp: Avoid calling /bin/sh but directly exec()ing the program 2017-08-20 12:53:43 +02:00
Harald Welte eaba6643d8 bumped to version 0.1.0 2017-08-20 12:07:40 +02:00
Harald Welte 78b42e1e49 fix .release file contents (wrong name / copy+paste error) 2017-08-20 12:00:54 +02:00
Harald Welte e4cbc63be8 ggsn: log to a file in /data volume 2017-08-20 08:46:00 +02:00
Harald Welte 6db9eb61a9 ggsn: Log to /data volume so log file can be reviewed in jenkins 2017-08-20 08:30:53 +02:00
Harald Welte c603362eac ggsn/ggsn-test: Don't disable ipv6 2017-08-20 08:28:58 +02:00
Harald Welte 1649a01167 Use 'patch' not 'commit' from cgit for repo change detection
the 'commit' output contains a timestamp, so every second the
result will be different.  'patch' doesn't have this.
2017-08-19 21:56:07 +02:00
Harald Welte fc8eaf2bcf Use laforge/ in all dependencies 2017-08-19 21:55:45 +02:00
Harald Welte 32f8b870cd Ensure docker cache fails if git repositories change 2017-08-19 21:09:49 +02:00
Harald Welte 4bda77175e Introduce 'make run' to run the respective container 2017-08-19 19:51:35 +02:00
Harald Welte 460247905d introduce makefile based build 2017-08-19 19:42:45 +02:00
Harald Welte fd7b5363e8 use '--rm' argumetn to 'docker run' to clean up after exit 2017-08-19 15:49:24 +02:00
Harald Welte b464ab721b Add osmo-ggsn-master and ggsn-test
This specifies two docker containers using which we can execute the
TTCN-3 tests against OpenGGSN.
2017-08-19 14:49:54 +02:00