5glab

5glab implements 5GCN REST APIs, in order to help 3GPP delegates in their standardisation works.

Currently the project allows to use Swagger Editor to view Open API files and send requests to paths. It also have a NRF emulator which allows to test each path of the API with the NF mechanisms.

Project history

Atomgen

First step in this project has been to use the https://gitlab.forge.orange-labs.fr/lucy/atomgen/blob/master/README.md tutorial, in order to create the directories as recommended for Plug'in atoms.

Atomstore

Next step has been to create a .gitlab-ci.yml job to generate and upload the documentation in Atomstore, as explained in https://gitlab.forge.orange-labs.fr/lucy/sandbox/tp-srol/atomdocs

The variables LUCY_ATOMDOCS_CI_SERVER, LUCY_ATOMDOCS_CI_TOKEN, LUCY_ATOMDOCS_FILE_SERVER and LUCY_ATOMDOCS_USER_CREDS, initialy documented to be set as private variables in menu 'setting > ci / cd', has been integrated as variables in the .gitlab-ci.yml file.

Generated documentation appears at http://10.226.226.55/lucy/docs/all_atoms/5glab/5glab_overview/

Choices

For this lab, it has been decided to work with Swagger in order to easily understand OpenAPI specification and test NFs APIs.

Each NF Service is dockerized to have a better scalability and evolution of each service.

Concerning the technologies involved in the lab, there are :

  • Swagger to view the APIs and interact with them. It will help to better understand the pros of OAS (Open API Specification)

  • Apache2 as the server for each NFs service because it's simple to work with it and fully works with HTTP/2.

  • Django (Python Framework) as backend code to create web apps inside each service to handle HTTP requests. The reason of that choice is that the language is easy to learn so it will be better to maintain the project. Moreover, performance isn't needed right now so Django is sufficient.

  • MongoDB as database engine because we are manipulating JSON documents for data payloads and it's easy to store JSON with MongoDB. Moreover, the engine is powerful and very fast. It's a NoSQL database which is a bit hard to manipulate but it's the best one for the lab.

  • Mitmproxy to view and analyze HTTP requests in an interactive shell. See "5glab implementation" for information about starting the MITM.

  • Spring Boot 2.0 and Spring 5.0 for the OAuth2 Authorization service of the NRF. Spring is a JAVA framework which allows to do webapps and it embeds dependencies to create OAuth2 Authorization Server.

Using Plug'in platform

Plug'in is a platform that allows to deploy applications in a virtualized environment using Docker Each time you commit something in Gitlab, it runs a pipeline.

It executes jobs in order to deploy the project in Plugin without doing anything.

IMPORTANT : Add a Deploy Token

In order to enable the deployment on Playground, you need to add a Deploy Token in Gitlab. To do so, go into the settings -> Repository and then expand the Deploy Token section.

Put "gitlab-deploy-token" as a Name, nothing in Expiring and check read_registry option.

CI/CD

To open the Swagger instance, go in the "CI/CD" tab of your project or Lucy's one and click on "Pipelines".

  • If you don't have any pipelines

Run a pipeline by clicking on "Run pipeline" and "Create pipeline".

It will launch further steps. Since it's the first time you launch a pipeline it will fail but it's normal because you don't have the common images. To download them, just click on the "play" icon located on the right of the pipeline line. Then you must click on each job to launch them. Once the jobs are done, just run a pipeline again an it will work.

  • If you have at least one pipeline

Creating a pipeline manually is ONLY necessary if you want to setup a demonstration of the project. Otherwise, when you commit something to the repository, a pipeline is automatically created.

A pipeline lasts exactly 12h (duration of a Plug'in session).

To check if the session isn't closed, pick the first line and be sure that there is a cloud icon with an arrow on the right of the line.

  • If it's the case, click on the second third validation tick and click on "deploy_job".

In the shell window, you'll find the playground URL.

Starting playground at URL = http://...

Copy/paste the URL into your browser. Then click, on the instance ..._node1

Now you just need to click on the "80" blue link to launch Swagger.

  • If there isn't any cloud icon

Click on "Run Pipeline" and wait the pipeline to be completed (~5-7min)

Compatibility problems

The Playground tool isn't compatible with HTTPS and HTTP/2. These lacks are due to the reverse proxy which isn't compatible with HTTPS and HTTP/2. It means that the "NfApiTester" tool cannot be used with the playground using HTTP/2...

Nevertheless, it can be used over HTTP/1.1.

A workaround would be to enable HTTPS and HTTP/2 on the Playground's reverse proxy or deploying the project elsewhere.