5G-MAG / rt-5gms-application-provider

The 5GMS Application Provider interacts with the 5GMS Application Function via M1 Provisioning interface, and uses M8 interface to communicate with UE.
Other
2 stars 4 forks source link

MSAF-Configuration tool: Move `m8.json` output code to generic Python modules #48

Open davidjwbbc opened 2 months ago

davidjwbbc commented 2 months ago

Introduction

At present the msaf-configuration Python command-line tool is the only part of this repository that can publish the data that will be retrieved by the 5GMS Aware App via the M8 interface to the Application Provider. It is desirable for all tools in this repository to be able to publish data, for retrieval via M8, when the Application Providers' media model changes. This will require other tools such as the WebUI and m1-session tool to be able to publish M8 data files too.

This issue tracks the work to separate the M8 data publication from the msaf-configuration tool into a set of reusable Python classes. Other issues will cover the integration of these new classes into the other existing tools (i.e. at this time that would be the WebUI and m1-session tool).

This is based on the discussion in discussion thread #43.

Description

After this work msaf-configuration will just be a command line interface to the classes in the rt_media_configuration Python module.

To be done:

  1. Create rt_m8_output.M8Output as an interface class that can take a rt_media_configuration.MediaConfiguration object to be serialised.
  2. Create a rt_m8_output.M8JSONFormatter class which implements the rt_m8_output.M8Output interface and moves the logic from msaf-configuration.dump_m8_files().
  3. Create a MediaConfiguration class which will model the media configuration.
    1. Move the AF synchronisation routines from msaf-configuration into the MediaConfiguration class so that they will synchronise the model with the AF configuration by using rt_m1-client.M1Session and make this operation triggered by calling a sychronise() method.
    2. Add methods to register/deregister rt_m8_output.M8Output interface type objects (e.g rt_m8_output.M8JSONFormatter) to use when the configuration is synchronise()'d.
  4. Create an interface class rt_media_configuration.MediaConfigurationImporter for configuration imports (these will populate the MediaConfiguration model from a given source).
    1. Create a rt_media_configuration.M1SessionImporter to synchonise the MediaConfiguration with the current AF configuration (as seen by rt_m1_client.M1Session)
    2. Create a rt_media_configuration.StreamsJSONImporter to synchonise the MediaConfiguration with a streams.json file and move the logic for this from msaf-configuration.
  5. Update msaf-configuration to use the new importers, formatters and model based on its configuration file.
dsilhavy commented 2 months ago

Based on the discussion on 09.08:

davidjwbbc commented 2 months ago

I've created the data model in the rt_media_configuration python module, now I have to add the output registration and synchronisation logic.

If you want a sneak peek then you can look at the development branch in my fork.

davidjwbbc commented 2 months ago

I've updated the model to fix a couple of issues and added most of the synchronisation code.

I've split the synchronisation code into 2 parts instead of just one monolithic chuck of code which did these two operations one after another. The first part analyses the changes between the current model and what the AF currently has configured and passes back a list of delta operation objects describing the various changes needed. These delta operations can then be applied to synchronise the AF with the new model. This also gives the option for a UI to present the user with a readable list of changes for approval before the changes are committed.

Once this part is complete then the rt_media_configuration python module should be in a suitable state for integration into the WebUI and m1-session tool to begin. I'll then continue to work on the background M8 publication parts that go along with the synchronisation operation.

dsilhavy commented 1 month ago

@stojkovicv This is now in a state that is ready for checking and starting the integration into the WebUI