Commit Graph

30 Commits

Author SHA1 Message Date
Oliver Smith dd9eafdb0c make: add OSMOCOM_REPO_TESTSUITE_MIRROR
Make it possible to set a different mirror for debian-stretch-titan than
for all other containers. 2021q1 doesn't have the eclipse-titan package
and it doesn't make sense to build it there.

I've thought about adding OSMOCOM_REPO_TESTSUITE_PATH and
OSMOCOM_REPO_TESTSUITE_VERSION too, but we don't have any use for these
right now. Let's add them later if we should need them.

Related: SYS#5370.
Change-Id: I7187473c2188a864b60b03789eff62e0a527404a
2021-05-04 09:30:48 +02:00
Oliver Smith 910dacf686 make: add OSMOCOM_REPO_PATH
Allow to change the path between OSMOCOM_REPO_MIRROR and
OSMOCOM_REPO_VERSION. While at it, tweak related comments (comment above
the variable as usually, replace "repo" wording with "feed" for the
latest/nightly variable as we usually refer to it as feed), and mention
OSMOCOM_REPO_* in README.md.

In order to be able to use a different mirror for testsuite and systems
under test, the testsuite related Dockerfiles (osmocom-bb-host-master,
debian-stretch-titan) are not using OSMOCOM_REPO_PATH. We could add a
OSMOCOM_REPO_TESTSUITE_PATH on demand, as mentioned in the next commit.

Related: SYS#5370
Change-Id: I8010a4d49d4620a5c47c2ff4f909a9aeeaad7b73
2021-05-04 09:30:48 +02:00
Oliver Smith d3359e2bce make: add UID as --build-arg
Allow to give the user running inside docker the same UID as the user
outside.

Change-Id: I4b3689a626c50c9ac38eca6b5449b8ec0344c3de
2021-04-29 13:09:05 +00:00
Vadim Yanitskiy 085656ac45 Make respawn.sh a common part of *-build/-obs images
Maintaining several versions of the same file in different folders
is a bad idea, because at some point their content gets out of sync.
This is exactly what happened to 'respawn.sh': sleep()ing was only
implemented in 'osmo-bts-master/respawn.sh', other versions of this
file would simply ignore '$SLEEP_BEFORE_RESPAWN'.

The easiest solution would be to have all common files in a single
directory, however Docker does not allow to ADD files from outside
of the build context.  In other words, all files must be in the
same directory as the Dockerfile itself.

Modify 'make/Makefile' in order to copy the contents of common
directory to the current build context ('pre-build' target) and
remove it after building ('post-build' target).

Change-Id: I3ec86c8610b3b43d39ea8e3da444861d317ced4e
2021-03-10 18:46:29 +01:00
Vadim Yanitskiy 44fbe564bb make/Makefile: use git to get the project's root directory
Change-Id: I87a425515692e62df7b593a3c2a5b88a765d217d
2021-03-10 18:46:29 +01:00
Daniel Willmann ba06957cf4 Add osmo-gbproxy-* container for osmo-gbproxy
Uses the new repo split off of osmo-sgsn

Related: OS#4992
Change-Id: I1e7ede4d1da54e3bcb286213b34401bd9dcf7cc1
2021-02-04 16:48:23 +01:00
Pau Espin d3bd2c2ba9 Introduce osmo-ran docker image set up
See osmo-ran/README.md in this commit for a description.

Related: SYS#4889
Change-Id: If5d22e9fa818310cbb4adc34bd7aceb4416ec969
2020-12-18 11:45:33 +00: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
Pau Espin 78ae9377a7 common: Automatize UPSTREAM_DISTRO name based on image name
Similar to what is already done with DISTRO, which points to given image
of ours based on name. This time we do the same with upstream images,
such as debian:stretch or centos:centos8.

This way, for instance calling docker_images_require
"osmo-bsc-latest-centos8" would try to build the
osmo-bsc-latest/Dockerfile file starting from a centos8 image.

Change-Id: I33cb21aa024396974559fd98f9f3c64e2c351eda
2020-12-01 11:46:20 +00:00
Harald Welte 027826fdba introduce 'REGISTRY' argument to all Dockerfiles
This is initialized to docker.io, keeping the default behaviour
if not specified.  However, it allows us to specify a private
registry later on.

Related: OS#4839
Change-Id: I32d4ee6256033c809108c1b86cb6b6c58d880f49
2020-11-02 17:02:26 +01:00
Pau Espin d1dcc58323 Makefile: Support overriding LIBOSMOCORE_BRANCH
gr-gsm-master is using it but it cannot be overriden. Similarly iy can
be helpful to do so in temporarliy modified images when testing
libosmocore features.

Change-Id: Ia9f26f3513da339d2255a0f6b2277682fe15bdf2
2020-06-30 18:23:04 +02:00
Oliver Smith 2a628add9c make/Makefile: add DISTRO argument
Prepare for distro-specific osmo-* images. While at it, put each
--build-arg on a separate line for readability.

Related: OS#4564
Change-Id: I1bf1c46295035a073e440faea3696ce53e7d7985
2020-05-30 09:14:41 +02:00
Pau Espin c9fa2a8808 Introduce osmo-gsm-tester docker setup
This set up allows running a typical osmo-gsm-tester set up with a main
unit (ogt-master) attached to one (or more) slaves where resources are
located and processes are run.

As an example, current config allows running an iperf3 test over an srsLTE
stack using the ZeroMQ backend.

Change-Id: Iac7c0b613048ce332642d3957c55cc7c53b56d42
2020-03-01 19:23:00 +00:00
Pau Espin d6ac128cf8 make: Fix OSMO_BB_BRANCH not being passed correctly
Change-Id: Ia289f8e71e8bb6c59b1caa7a23981a1f08a2f49e
2019-11-05 13:02:24 +01:00
Pau Espin 6a994afdf9 Fix trailing whitespace
Change-Id: Ib51a84560bad521d0adf4bb883c10418c51468a2
2019-10-23 17:58:05 +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
Oliver Smith 052fe1bb8a make/Makefile: fix recursive 'PULL' error
Don't abort with the following error, when running 'make' without
setting the PULL environment variable:

 ../make/Makefile:20: *** Recursive variable 'PULL' references itself (eventually). Stop.

This fixes a regression from Change-Id
I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6.

Related: OS#3869
Change-Id: I4b4772e9ed6e07ab00943154265c9cbdea22a2f5
2019-04-04 08:16:44 +02:00
Oliver Smith a8be3ff52f jenkins-common.sh: pull upstream base images
Prevent building docker images on top of outdated Debian images, where
the package download feeds have been disabled. Use 'docker build --pull'
instead of 'docker build', whenever the "FROM" line in the Dockerfile
does not contain '$USER' (meaning this is an upstream image).

Checking the FROM line is necessary, as downloading '$USER' images will
fail (we never upload those).

Related: OS#3869
Change-Id: I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6
2019-04-02 11:38:26 +02:00
Oliver Smith ee386a6731 make/Makefile: allow overriding OSMO_TTCN3_BRANCH
Set the OSMO_TTCN3_BRANCH build argument from ttcn3-*/Dockerfile from
the environment variable of the same name, so it can be changed when
building the images with 'make' or './jenkins.sh'.

Dockerfiles that do not have a OSMO_TCCN3_BRANCH build arg produce a
warning. But this is also the case with Dockerfiles that don't have an
USER build arg, and avoiding the warning would only be possible with a
much more complex patch.

Change-Id: If2c312ff9206d1613fc19f41bd088c9aad523684
2019-03-04 13:13:37 +01:00
Harald Welte 4648003d0f Makefile: Fix default naming of images
This got broken in Change-Id If2e3cc7693ce5e7c1c95d2f81e302c72bb4230be

Change-Id: I97f9eb3f203301ebc2315ff38216d5b4502eb3d2
2018-06-03 17:17:58 +00:00
Harald Welte c400005f38 Makefile: get rid of entire git tagging logic
Change-Id: Idaa55b636031afd214853ccfcf6c9e3b097050b1
2018-06-03 15:54:34 +00:00
Harald Welte 9e631757be Makefile: Don't use "-dirty" logic when tagging docker images
Change-Id: Ie44144f25fd5f801ceeed904f6d19521b333ed0d
2018-06-03 15:54:34 +00:00
Harald Welte 9b94c793be Makefile: Only push a tag if there is a .release file
Change-Id: I73b2ed5794c75d09b166bc65ac79b9cbe3764ad4
2018-06-03 15:54:34 +00:00
Harald Welte a2e28ef91f Makefile: Allow override of REGISTRY/USERNAME/NAME/IMAGE
Change-Id: If2e3cc7693ce5e7c1c95d2f81e302c72bb4230be
2018-06-03 15:54:34 +00:00
Alexander Couzens 5910de0394 Makefile: use $USER/image when depending on a generated image
Te make scripts will generate docker images like
"$username/foobar-test". When depending on an previous image,
the $username must match or the build will about with image not found.

Change-Id: Ied42c3e1de9a2ffaca22ba4cd02e6a398e48e97d
2018-04-12 09:20:34 +00:00
Neels Hofmeyr 2f1b669e2f fix 'make -C subdir': use $(CURDIR) instead of $PWD
$(PWD) reflects the dir of 'make' invocation, $(CURDIR) the dir stepped into.
So obtain the current dir from $(CURDIR) instead of $(PWD).

So far, when doing 'make -C osmo-foo-maser', the image's name would be derived
from the root dir's basename and all images were tagged as 'docker-playground'.
With this fix, 'make -C' from anywhere still tags with the proper name.

Change-Id: I1dd0fd1ad89fdee18fdbea851ccc831ad60aeccf
2018-04-05 03:15:23 +02:00
Harald Welte 6bce1e644f Makefiles: Don't tag images with versions by default
Tagging each build with a version means we have to clean up lots of
images manually.  Let's change this to:
* "make build" aka "make docker-build" only builds as $name:latest
* "make docker-tag" will tag $name:latest as $name:$version

This is racey, but then we don't really need version tags for the images
so far anyway.
2017-10-15 14:45:03 +00:00
Harald Welte 58343d6c87 Makefile: Fix 'make run' to use correct image name 2017-08-19 20:18:59 +02:00
Harald Welte 4bda77175e Introduce 'make run' to run the respective container 2017-08-19 19:51:35 +02:00
Harald Welte fc0fec7941 Import Makefile from https://github.com/mvanholsteijn/docker-makefile
upstream git version is 190313ea54af7d175dd3469a39a95654d068b83e
2017-08-19 19:31:49 +02:00