docker-playground/osmo-ran
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
..
osmocom */osmo-bsc.cfg: remove obsolete no-op parameters 2021-03-09 13:50:41 +01:00
split make: add OSMOCOM_REPO_PATH 2021-05-04 09:30:48 +02:00
Dockerfile make: add OSMOCOM_REPO_PATH 2021-05-04 09:30:48 +02:00
Makefile Introduce osmo-ran docker image set up 2020-12-18 11:45:33 +00:00
README.md Introduce osmo-ran docker image set up 2020-12-18 11:45:33 +00:00
jenkins.sh Introduce osmo-ran docker image set up 2020-12-18 11:45:33 +00:00

README.md

This directory provides an environment to set up and run an Osmocom RAN (osmo-bts, osmo-pcu, osmo-bsc, osmo-mgw) managed by systemd, all run inside a docker container.

Easiest way to build + run the setup is to execute jenkins.sh in this same directory.

This script will build the Dockerfile image, then set up a bridge network on subnet 172.18.$SUBNET.0/24, where the IP address 172.18.$SUBNET.200 is assigned to the internal network interface inside the docker container (and which RAN processes will be using), and 172.18.$SUBNET.1 is assigned to the bridge network interface outside the docker container. All The VTY and CTRL ports are available on both 172.18.$SUBNET.200 and also on 172.18.$SUBNET.1 (through docker port mapping).

Shared directories between docker container and the host are mounted in /tmp/logs/ran-$SUBNET/ on the host, with osmocom subdirectory mapping to container's /etc/osmocom, and data to /data:.

The script has the following parameters (environment variables):

  • SUBNET: The IPv4 subnet to configure and use (172.18.$SUBNET.0/24) when running the container (defaults to 25)
  • SGSN_IP: The IP address where the SGSN outside the docker container listens to (Gb interface)
  • STP_IP: The IP address where the STP outside the docker container listens to (A interface)
  • TRX_IP: The IP address where the OsmoTRX outside the docker container listens to (TRXC/TRXD interface)
  • IMAGE_SUFFIX: Type of base image to use: Leave unset to build on top of Debian (default), set to centos8 to run on top of CentOS8 distribution
  • OSMOCOM_REPO_VERSION: Osmocom OBS repository version to use: nightly or latest (default).

The above IP addresses will be replaced by jenkins.sh from tokens of the same name in the provided configuration files, available in osmocom/ directory, which will be then placer inside docker image's /etc/osmocom/ directory, where the osmocom projects will read the configuration by default (see systemd services).

Example: Run Osmocom RAN on a Centos8 distro with osmocom's nightly repository on subnet 26:

OSMOCOM_REPO_VERSION="nightly" IMAGE_SUFFIX="centos8" SUBNET=26 ./jenkins.sh

If several independent RANs are to be set up by the user, it's up to them to configure iptables rules to forbid access from one docker container to another. It should be doable pretty easily by rejecting connections between 172.18.$subnetA.0/24 and 172.18.$subnetB.0/24.

The docker container started by jenkins.sh is running systemd and hence is expected to run forever (until the container instance is killed through docker or by killing the process, eg. pressing CTRL+C on the terminal).

While the container is running, shell access to to it in order inspect the RAN processes managed by systemd can be obtained by using:

docker exec -it nonjenkins-ran-subnet$SUBNET bash