-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a Docker file for AF and AS and a docker-compose.yml (#13)
* Adds a Docker file for AF and AS and a docker-compose.yml to connect the two containers * Working AS build but AF fails * Running AF and AS * Change port config for M1 and M5 * WiP: Connect the containers to communicate with each other * WiP: Connect the containers to communicate with each other * WiP: Getting 404 errors when requesting the MPD from the Service Access Information * WiP: Getting 404 errors when requesting the MPD from the Service Access Information * First working return of MPD * Add documentation on Docker usage
- Loading branch information
Showing
7 changed files
with
702 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Use an official Ubuntu as a parent image | ||
FROM ubuntu:24.04 | ||
|
||
# Avoid any questions | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
bison \ | ||
build-essential \ | ||
curl \ | ||
flex \ | ||
git \ | ||
default-jdk \ | ||
ninja-build wget \ | ||
python3-pip \ | ||
python3-venv \ | ||
python3-setuptools \ | ||
python3-wheel \ | ||
python3-yaml \ | ||
python3-aiofiles \ | ||
python3-build \ | ||
python3-h11 \ | ||
python3-h2 \ | ||
python3-httpx\ | ||
python3-openssl \ | ||
libsctp-dev \ | ||
libgnutls28-dev \ | ||
libgcrypt-dev \ | ||
libssl-dev \ | ||
libidn11-dev \ | ||
libmongoc-dev \ | ||
libbson-dev \ | ||
libyaml-dev \ | ||
libnghttp2-dev \ | ||
libmicrohttpd-dev \ | ||
libcurl4-gnutls-dev \ | ||
libnghttp2-dev \ | ||
libtins-dev \ | ||
libtalloc-dev cmake \ | ||
libpcre2-dev | ||
|
||
RUN apt-get update && apt-get install -y meson python3-venv python3-pip | ||
|
||
# Clone the repository | ||
RUN git clone --recurse-submodules https://github.com/5G-MAG/rt-5gms-application-function.git | ||
|
||
# Set working directory | ||
WORKDIR /rt-5gms-application-function | ||
|
||
# Update submodules | ||
RUN git submodule update | ||
|
||
# Build the application | ||
RUN meson build && ninja -C build | ||
|
||
# Install the application | ||
RUN meson install --no-rebuild -C build | ||
|
||
# Command to run the application with the configuration file | ||
CMD ["/usr/local/bin/open5gs-msafd", "-c", "/etc/open5gs/alternate-msaf.yaml"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Use Ubuntu 22.04 as a parent image | ||
FROM ubuntu:22.04 | ||
|
||
# Install dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
git \ | ||
python3-pip \ | ||
python3-venv \ | ||
wget \ | ||
default-jdk \ | ||
&& apt-get clean | ||
|
||
# Install Openresty | ||
RUN apt-get -y install --no-install-recommends wget gnupg ca-certificates lsb-release && \ | ||
wget -O - https://openresty.org/package/pubkey.gpg | gpg --dearmor -o /usr/share/keyrings/openresty.gpg && \ | ||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/package/arm64/ubuntu $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/openresty.list > /dev/null && \ | ||
apt-get update && \ | ||
apt-get -y install openresty | ||
|
||
# Add Openresty version of nginx to the path | ||
ENV PATH="/usr/local/openresty/nginx/sbin:$PATH" | ||
|
||
# Disable and stop nginx and openresty services | ||
RUN systemctl disable --now nginx.service openresty.service || true | ||
|
||
# Clone the repository | ||
RUN git clone --recurse-submodules https://github.com/5G-MAG/rt-5gms-application-server.git /5gms-application-server | ||
|
||
# Set the working directory | ||
WORKDIR /5gms-application-server | ||
|
||
# Install Python dependencies | ||
RUN python3 -m pip install --upgrade pip setuptools && \ | ||
python3 -m pip install . | ||
|
||
# Command to run the application | ||
CMD ["5gms-application-server","-c","/etc/5gmag/as/conf/application-server.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# 5G Media Streaming - Docker Compose Setup | ||
|
||
This project provides a docker-compose setup to run the 5GMS Application Function and the 5GMS Application Server | ||
in a local Docker container environment. The setup includes Docker files for the Application Function and the Application | ||
Server. In addition, it includes a Docker Compose file to | ||
connect the two projects. The configuration files included in this project can be edited on the host machine and | ||
are mounted to the respective Docker container during runtime. | ||
|
||
## Installation | ||
|
||
Navigate to the `5gms-docker-setup` folder of this repository: | ||
|
||
` cd 5gms-docker-setup` | ||
|
||
Start Docker Compose to build the containers and start the services: | ||
|
||
`docker-compose up` | ||
|
||
## Usage | ||
|
||
After the containers are built and started, the 5GMS Application Function and the 5GMS Application Server are available | ||
via the host machine. As an example, running the following curl command will create a provisioning session via the `M1` | ||
interface of the Application Function: | ||
|
||
````shell | ||
curl -X POST http://localhost:5555/3gpp-m1/v2/provisioning-sessions \ | ||
-H "Content-Type: application/json" \ | ||
-d '{ | ||
"aspId": "aspId", | ||
"appId": "appId", | ||
"provisioningSessionType": "DOWNLINK" | ||
}' | ||
|
||
```` | ||
|
||
By default the following ports are exposed to the host machine: | ||
|
||
* Application Function `M1` interface: Port `5555` | ||
* Application Function `M5` interface: Port `7778` | ||
* Application Server `M4` interface: Port `80` | ||
|
||
## Configuration | ||
|
||
The configuration files for the 5GMS Application Function and the 5GMS Application Server are located in `msaf.yaml` and | ||
`application-server.conf` respectively. The configuration files are mounted to the respective Docker container during | ||
runtime. | ||
|
||
By default, the M1 and M5 interface of the Application Function run on ports | ||
`5555` and `7778` and are exposed to the host machine. | ||
|
||
The Application Server runs on port `80` which is also available on the host machine. | ||
|
||
For details on the configuration options, please refer to our documentation of | ||
the [Application Function](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-function/configuration-5GMSAF.html) | ||
and | ||
the [Application Server](https://5g-mag.github.io/Getting-Started/pages/5g-media-streaming/usage/application-server/testing-AS.html#testing). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,214 @@ | ||
############################################################################# | ||
# 5G-MAG Reference Tools: 5GMS application server example configuration file | ||
############################################################################# | ||
# Author: David Waring <[email protected]> | ||
# License: 5G-MAG Public Licence v1.0 | ||
# Copyright: © 2022 British Broadcasting Corporation | ||
# | ||
# For full license terms please see the LICENSE file distributed with this | ||
# program. If this file is missing then the license can be retrieved from | ||
# https://drive.google.com/file/d/1cinCiA778IErENZ3JN52VFW-1ffHpx7Z/view | ||
############################################################################# | ||
# | ||
# This is an example configuration file for the 5G-MAG Reference Tools 5GMS | ||
# Application Server. This file contains a description of the configuration | ||
# settings available and their default values. | ||
# | ||
|
||
### Defaults for the 5G-MAG Reference Tools: 5GMS applications | ||
[DEFAULT] | ||
#log_dir = /var/log/rt-5gms | ||
#run_dir = /run/rt-5gms | ||
|
||
|
||
|
||
### 5GMS Application Server specific configurations | ||
[5gms_as] | ||
# log_level - The logging level for the 5GMS Application Server | ||
# | ||
# This sets the minimum logging level of the 5GMS Application Server. | ||
# The field can be one of: debug, info, warn, error or fatal. | ||
# | ||
# Default is info | ||
log_level = debug | ||
|
||
# cache_dir - The directory to hold cached objects in | ||
# | ||
# The actual format of files and subdirectories within this directory is | ||
# dependant on the web proxy/server chosen at run-time. | ||
# | ||
# If this setting is empty or omitted then the web proxy/server will run | ||
# without a disk cache. | ||
# | ||
# For the nginx web proxy it is advisable to locate this directory on the same | ||
# filesystem partition as the temporary directories to make moving objects from | ||
# temporary stores to the disk cache more efficient. | ||
# | ||
# Default is /var/cache/rt-5gms/as/cache | ||
#cache_dir = /var/cache/rt-5gms/as/cache | ||
|
||
# docroot - The top level directory which will hold the document roots | ||
# | ||
# This is a directory which will hold the document roots for each virtual | ||
# server. This prefix will be followed by the hostname of the server to which | ||
# this root applies. | ||
# | ||
# Default is /var/cache/rt-5gms/as/docroots | ||
#docroot = /var/cache/rt-5gms/as/docroots | ||
|
||
# http_port - The TCP port number to listen for HTTP requests on | ||
# | ||
# This determines which port the web proxy/server will bind to for distribution | ||
# configurations without a security certificate. | ||
# | ||
# The default is port 80 | ||
http_port = 80 | ||
|
||
# https_port - The TCP port number to listen for TLS based HTTP requests on | ||
# | ||
# This determines which port the web proxy/server will bind to for distribution | ||
# configurations with an associated security certificate. | ||
# | ||
# The default port is 443 | ||
#https_port = 443 | ||
|
||
# m3_listen - The IP address or hostname to listen for M3 requests on | ||
# | ||
# This determines which addresses the M3 configuration channel will bind to | ||
# when listening for new connections from 5GMS Application Functions. | ||
# This interface is used by the 5GMS Application Function to configure the | ||
# 5GMS Application Server. | ||
# | ||
# See also: m3_port | ||
# | ||
# The default listening address is localhost | ||
m3_listen = 0.0.0.0 | ||
|
||
# m3_port - The TCP port number to listen for M3 requests on | ||
# | ||
# This determines which port the M3 configuration channel will listen on. | ||
# This interface is used by the 5GMS Application Function to configure the | ||
# 5GMS Application Server. | ||
# | ||
# See also: m3_listen | ||
# | ||
# The default port is 7777 | ||
m3_port = 7777 | ||
|
||
# access_log - The location to write the web proxy/server access log. | ||
# | ||
# This is the path to the file to log access requests in. | ||
# | ||
# The default is /var/log/rt-5gms/application-server-access.log | ||
#access_log = %(log_dir)s/application-server-access.log | ||
|
||
# error_log - The location to write the web proxy/server access log. | ||
# | ||
# This is the path to the file to log access requests in. | ||
# | ||
# The default is /var/log/rt-5gms/application-server-error.log | ||
#error_log = %(log_dir)s/application-server-error.log | ||
|
||
# pid_path - Path for the process identifier for the 5gms application server | ||
# | ||
# The top level process id will be written to this file. | ||
# | ||
# The default is /run/rt-5gms/application-server.pid | ||
#pid_path = %(run_dir)s/application-server.pid | ||
|
||
# provisioning_session_id - Provisioning session for this application server | ||
# | ||
# This is the provisioning session identifier for this application server (AS) | ||
# instance. This is the session ID as allocated to the application provider | ||
# (AP) by the application function (AF) during the ProvisioningSessions. | ||
# | ||
# The default is d54a1fcc-d411-4e32-807b-2c60dbaeaf5f | ||
#provisioning_session_id = d54a1fcc-d411-4e32-807b-2c60dbaeaf5f | ||
|
||
# m4d_path_prefix - Path prefix for the M4d interface | ||
# | ||
# This is the path prefix that will be used on all media accesses for this | ||
# provisioning session. | ||
# | ||
# The default is /m4d/provisioning-session-<session-id>/ | ||
#m4d_path_prefix = /m4d/provisioning-session-%(provisioning_session_id)s/ | ||
|
||
|
||
### 5GMS Application Server nginx specific configuration | ||
[5gms_as.nginx] | ||
# config_file - The path in which the NGINX configuration file will be stored | ||
#config_file = /tmp/rt_5gms_as.conf | ||
|
||
# root_temp - variable to hold the top level temporary store directory | ||
#root_temp = /var/cache/rt-5gms/as | ||
|
||
# client_body_temp - Temporary disk store for client request body contents | ||
# | ||
# nginx temporary storage area for client request body contents. This must be | ||
# specified as a valid directory and cannot be empty. | ||
# | ||
# See: https://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_temp_path | ||
# | ||
# Default is /tmp/rt-5gms-as/client-body-tmp | ||
#client_body_temp = %(root_temp)s/client-body-tmp | ||
|
||
# proxy_temp - Temporary disk store for proxied responses | ||
# | ||
# nginx temporary storage area for proxied response body contents. This must be | ||
# specified as a valid directory and cannot be empty. | ||
# | ||
# It is advisable to place this directory on the same filesystem partition as | ||
# the main cache directories (see 5gms_as.cache_dir above). | ||
# | ||
# See: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_temp_path | ||
# | ||
# Default is /tmp/rt-5gms-as/proxy-tmp | ||
#proxy_temp = %(root_temp)s/proxy-tmp | ||
|
||
# fastcgi_temp - Temporary disk store for fastcgi server responses | ||
# | ||
# nginx storage area for responses from a backend fastcgi server. This must be | ||
# specified as a valid directory and cannot be empty. | ||
# | ||
# See: https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_temp_path | ||
# | ||
# Default is /tmp/rt-5gms-as/fastcgi-tmp | ||
#fastcgi_temp = %(root_temp)s/fastcgi-tmp | ||
|
||
# uwsgi_temp - Temporary disk store for uwsgi server responses | ||
# | ||
# nginx storage area for responses from a backend uwsgi server. This must be | ||
# specified as a valid directory and cannot be empty. | ||
# | ||
# See: https://nginx.org/en/docs/http/ngx_http_uwsgi_module.html#uwsgi_temp_path | ||
# | ||
# Default is /tmp/rt-5gms-as/uwsgi-tmp | ||
#uwsgi_temp = %(root_temp)s/uwsgi-tmp | ||
|
||
# scgi_temp - Temporary disk store for SCGI server responses | ||
# | ||
# nginx storage area for responses from a backend SCGI server. This must be | ||
# specified as a valid directory and cannot be empty. | ||
# | ||
# See: https://nginx.org/en/docs/http/ngx_http_scgi_module.html#scgi_temp_path | ||
# | ||
# Default is /tmp/rt-5gms-as/scgi-tmp | ||
#scgi_temp = %(root_temp)s/scgi-tmp | ||
|
||
# pid_path - File location to store the PID of the nginx process | ||
# | ||
# The nginx daemon will store the pid of its process in this file. | ||
# | ||
# See: https://nginx.org/en/docs/ngx_core_module.html#pid | ||
# | ||
# Default is /tmp/rt-5gms-as/5gms-as-nginx.pid | ||
#pid_path = %(root_temp)s/5gms-as-nginx.pid | ||
|
||
# resolvers - DNS resolvers for NGinx | ||
# | ||
# This is a space separated list of DNS resolvers that Nginx should use. | ||
# | ||
# See: https://nginx.org/en/docs/ngx_http_core_module.html#resolver | ||
# | ||
# Default is 127.0.0.53 (use local systemd-resolved) | ||
resolvers = 127.0.0.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
services: | ||
application-server: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile-Application-Server | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ./application-server.conf:/etc/5gmag/as/conf/application-server.conf | ||
|
||
application-function: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile-Application-Function | ||
ports: | ||
- "5555:5555" | ||
- "7778:7778" | ||
- "4444:4444" | ||
volumes: | ||
- ./msaf.yaml:/etc/open5gs/alternate-msaf.yaml | ||
|
||
|
||
# See: https://docs.docker.com/compose/how-tos/networking/ |
Oops, something went wrong.