Skip to content

Configurable, emulated environment for providing Network Exposure Function (NEF) APIs

License

Notifications You must be signed in to change notification settings

EVOLVED-5G/NEF_emulator

 
 

Repository files navigation

NEF_emulator

Contents

⚙ Setup locally

Host prerequisites: Docker version 23.0.1, Docker Compose v2, build-essential*, jq**

After cloning the repository, there are 4 more steps to do. For convinience, we have created a Makefile that contains a command for each step + several common docker-compose tasks which you may find handy in the future.

  1. create your local .env file
  2. build the container images
  3. run the containers
  4. add some test data (optional)
cd NEF_emulator

# 1.
make prepare-dev-env

# 2.
make build

# 3.
make up

# 4.
make db-init

* 💡 Info: To use the make command you need to apt install build-essential first. In case you don't want to proceed with this installation, you can head over to the Makefile and copy/paste the shell commands that are being used for every step.

** 💡 Info: The shell script used at step 4 (for adding test data) uses jq which is a lightweight and flexible command-line JSON processor. You can install it with apt install jq

Try out your setup

After the containers are up and running:



🏷️ How to work on a specific tag / release

After git clone or git pull you can specify the release you want to work on by just using its tag in the following command:

git switch --detach tag_here

You will get into a detached HEAD state in Git, but this is perfectly fine, you can go back anytime by just using git switch main.
Short reasoning on why we choose tags over branches:

A tag is immutable.
source



↔️ NetApp communication options

To be updated...

Integration with CAPIF

In order to integrate NEF Emulator with CAPIF you should perform the following steps:

  1. Ensure that all CAPIF services are up and running. Clone the code from the official Github repository https://github.com/EVOLVED-5G/CAPIF_API_Services, navigate to the services/ directory and execute the following commands:
cd services/
sudo ./run.sh
./check_services_are_running.sh

These commands will start the CAPIF services and ensure that they are running correctly.

  1. Configure the NEF Emulator project to join the CAPIF network by following one of the below steps based on your deployment requirements:
  • For local deployment: Update the EXTERNAL_NET environment variable to true in the .env file of the NEF Emulator project. This will allow NEF containers to join CAPIF's pre-existing network called services_default. If you do not want to use NEF Emulator with CAPIF, change the EXTERNAL_NET environment variable back to false in the .env file. Add the following entry to the /etc/hosts file of the host machine:
127.0.0.1 capifcore

This entry maps the hostname "capifcore" to the IP address 127.0.0.1, which is the loopback address of the local network interface.

  • For deployment in separate VMs: Update the EXTERNAL_NET environment variable to false in the .env file of the NEF Emulator project. Add the following entry to the /etc/hosts file of the host machine:
<ip-of-capif> capifcore

This entry maps the hostname "capifcore" to the IP address of the machine that CAPIF is running on.

  1. Start the NEF services by executing either the make up or make debug-up command in the NEF Emulator project directory.

💡 Once you have completed these steps, NEF should be successfully onboarded to the CAPIF Core Function. To confirm this, check that 12 files have been created in the app/core/certificates/ folder.

About

Configurable, emulated environment for providing Network Exposure Function (NEF) APIs

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 65.3%
  • CSS 15.5%
  • Python 10.7%
  • HTML 5.0%
  • Shell 3.4%
  • Makefile 0.1%