Skip to content

Commit

Permalink
Merge branch 'RC_v1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjwbbc committed Oct 20, 2022
2 parents 26af195 + 41fe62b commit 6f98f90
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 35 deletions.
48 changes: 29 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,60 @@
# 5G-MAG Reference Tools: 5GMS Application Server

This repository holds the 5GMS Application Server implementation for the 5G-MAG
Reference Tools.
This repository holds the 5GMS Application Server implementation for the 5G-MAG Reference Tools.

## Introduction

The 5GMS application server (AS) is a Network Function that forms part of the
5G Media Services framework as defined in ETSI TS 126.501.
The 5GMS application server (AS) is a Network Function that forms part of the 5G Media Services framework as defined in
ETSI TS 126.501.

This implementation is comprised of a small Python daemon process which
implements the 5GMS M3 interface as a simple configuration file that is shared
with the Reference Tools [5GMS AF](https://github.com/5G-MAG/rt-5gms-application-function).
This implementation is comprised of a small Python daemon process which implements the 5GMS M3 interface as a simple
configuration file that is shared with the Reference
Tools [5GMS AF](https://github.com/5G-MAG/rt-5gms-application-function).

The web server or reverse proxy functionality is provided by an external
daemon. This 5GMS AS manages the external daemon by dynamically writing its
configuration files and managing the daemon process lifecycle. At present the
only daemon that can be controlled by the AS is nginx
The web server or reverse proxy functionality is provided by an external daemon. This 5GMS AS manages the external
daemon by dynamically writing its configuration files and managing the daemon process lifecycle. At present the only
daemon that can be controlled by the AS is nginx
([website](https://nginx.org/)).

## Specifications

* [ETSI TS 126 501](https://portal.etsi.org/webapp/workprogram/Report_WorkItem.asp?WKI_ID=66447) - 5G Media Streaming (5GMS): General description and architecture (3GPP TS 26.501 version 17.2.0 Release 17)
* [ETSI TS 126 512](https://portal.etsi.org/webapp/workprogram/Report_WorkItem.asp?WKI_ID=66919) - 5G Media Streaming (5GMS): Protocols (3GPP TS 26.512 version 17.1.2 Release 17)
* [ETSI TS 126 501](https://portal.etsi.org/webapp/workprogram/Report_WorkItem.asp?WKI_ID=66447) - 5G Media Streaming (
5GMS): General description and architecture (3GPP TS 26.501 version 17.2.0 Release 17)
* [ETSI TS 126 512](https://portal.etsi.org/webapp/workprogram/Report_WorkItem.asp?WKI_ID=66919) - 5G Media Streaming (
5GMS): Protocols (3GPP TS 26.512 version 17.1.2 Release 17)

## Downloading

Release sdist tar files can be downloaded from _TBC_.

The source can be obtained by cloning the github repository.

```
git clone --recurse-submodules https://github.com/5G-MAG/rt-5gms-application-server.git
```

## Building a Python distribution

To build a Python sdist distribution tar do the following.

```
git clone --recurse-submodules https://github.com/5G-MAG/rt-5gms-application-server.git
cd rt-5gms-application-server
python3 -m build --sdist
```

The distribution sdist tar file can then be found in the `dist` subdirectory.

## Installing

This application can be installed using pip with a distribution sdist tar file:

```
python3 -m pip install rt-5gms-application-server-<version>.tar.gz
```

Alternatively, to installing the 5GMS Application Server from the source can be
done using these commands:
Alternatively, to installing the 5GMS Application Server from the source can be done using these commands:

```
git clone --recurse-submodules https://github.com/5G-MAG/rt-5gms-application-server.git
cd rt-5gms-application-server
Expand All @@ -59,18 +63,24 @@ python3 -m pip install .

## Running

Once [installed](#Installing), the application server can be run using the
following command syntax:
Once [installed](#Installing), the application server can be run using the following command syntax:

```
Syntax: 5gms-application-server [-c <configuration-file>] <ContentHostingConfiguration-JSON-file>
```

Command line help can be obtained using the -h flag:

```
5gms-application-server -h
```

Please note that the default configuration will require the application server to be run as the root user as it uses the privileged port 80 and stores logs and caches in root owned directories. If you wish to run this as an unprivileged user you will need to follow the instructions for creating and using an alternative configuration file. These instructions can be found in the [development documentation](docs/README.md#running-the-example-without-building).

## Development

Please see the [docs/README.md](docs/README.md) file for project development
and testing information.
This project follows
the [Gitflow workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow). The `development`
branch of this project serves as an integration branch for new features. Consequently, please make sure to switch to the `development`
branch before starting the implementation of a new feature. Please check the [docs/README.md](docs/README.md) file for
further project development and testing information.
24 changes: 23 additions & 1 deletion build_scripts/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
from setuptools import build_meta as _orig
import subprocess

replace = ['build_sdist']
replace = ['build_sdist',
'build_wheel',
'get_requires_for_build_sdist',
'get_requires_for_build_wheel',
'prepare_metadata_for_build_wheel']
log = logging.getLogger(__name__)

# Copy all exported variables from the original
Expand All @@ -48,3 +52,21 @@ def _check_openapi():
def build_sdist(sdist_directory, config_settings=None):
_check_openapi()
return _orig.build_sdist(sdist_directory, config_settings)

def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
_check_openapi()
return _orig.build_wheel(wheel_directory, config_settings,
metadata_directory)

def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None):
_check_openapi()
return _orig.prepare_metadata_for_build_wheel(metadata_directory,
config_settings)

def get_requires_for_build_sdist(config_settings=None):
_check_openapi()
return _orig.get_requires_for_build_sdist(config_settings)

def get_requires_for_build_wheel(config_settings=None):
_check_openapi()
return _orig.get_requires_for_build_wheel(config_settings)
26 changes: 14 additions & 12 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@ In this directory you will find files to assist with development and testing of
the 5G-MAG Reference Tools 5GMS Application Server (AS).

Files in this repository:
- README.md - Project README file.
- LICENSE - The software license for this project.
- pyproject.toml - The Python project description for building and installing the application.
- build_scripts/ - Scripts used when building the python project.
- ATTRIBUTION_NOTICE - Project run-time attributions
- LICENSE - The software license for this project.
- README.md - Project README file.
- pyproject.toml - The Python project description for building and installing the application.
- build_scripts/ - Scripts used when building the python project.
- backend.py - build backend wrapper to trigger extra build actions.
- generate_5gms_as_openapi - Will generate the OpenAPI python modules if not already present.
- docs/ - Development documentation and examples.
- docs/ - Development documentation and examples.
- README.md - This document.
- chc.json - An example ContentHostingConfiguration JSON file which provisions a pull-ingest AS for "Big Buck Bunny".
- src/ - The application source modules.
- rt_5gms_as - The main Python module for this application
- example-application-server.conf - An application configuration which documents the defaults and meaning for each application configuration option.
- external/ - Directory containing submodule mount points.
- rt-common-shared/ - The common shared examples and scripts.
- src/ - The application source modules.
- rt_5gms_as/ - The main Python module for this application
- app.py - Application entry point.
- openapi_5g - Python bindings generated by openapi-generator-cli from the 5G APIs. Note: This directory is not present in the tree until `build_scripts/generate_5gms_as_openapi` is run.
- context.py - module for the application Context class.
- openapi_5g/ - Python bindings generated by openapi-generator-cli from the 5G APIs. Note: This directory is not present in the tree until `build_scripts/generate_openapi` is run.
- proxy_factory.py - Factory module to pick a suitable web server/proxy.
- proxies/ - Contains the web server/proxy detection and configuration classes and any data files they need.
- utils.py - Common utility functions for the web server/proxy classes.
Expand Down Expand Up @@ -68,9 +72,7 @@ This will start nginx with a configuration which will provide a reverse proxy to

Regenerating the 5G API bindings
--------------------------------
The `build_scripts/generate_5gms_as_openapi` script will use wget, git and java to
download the openapi-generator tool, the 5G OpenAPI YAML and generate the `rt_5gms_as.openapi_5g` Python module package. The script will only do this if the
`src/rt_5gms_as/openapi_5g` directory does not already exist.
The `build_scripts/generate_5gms_as_openapi` script will use wget, git and java to download the openapi-generator tool, the 5G OpenAPI YAML and generate the `rt_5gms_as.openapi_5g` Python module package. The script will only do this if the `src/rt_5gms_as/openapi_5g` directory does not already exist.

Therefore to regenerate the API bindings you first need to remove the old bindings:
```
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ backend-path = ["build_scripts"]

[project]
name = "rt-5gms-application-server"
version = "0.0.1"
version = "1.0.0"
dependencies = [
'urllib3 >= 1.25.3',
'python-dateutil',
Expand All @@ -30,5 +30,5 @@ where = ["src"]
"rt_5gms_as.proxies" = ["*.tmpl"]

[tool.setuptools.data-files]
'share/doc/rt-5gms-application-server' = ['docs/*']
'share/doc/rt-5gms-application-server' = ['docs/*', 'ATTRIBUTION_NOTICE']
'share/doc/rt-5gms-application-server/examples' = ['external/rt-common-shared/5gms/examples/*']

0 comments on commit 6f98f90

Please sign in to comment.