Skip to content

Commit 2f11171

Browse files
authored
Merge pull request #70 from medianetlab/develop
Update README.md
2 parents 2301ffc + d5d2fc4 commit 2f11171

File tree

1 file changed

+21
-100
lines changed

1 file changed

+21
-100
lines changed

README.md

Lines changed: 21 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## ⚙ Setup locally
1717

18-
**Host prerequisites**: `docker`, `docker-compose 1.29.2`, `build-essential`\*, `jq`\*\*
18+
**Host prerequisites**: `Docker version 23.0.1`, `Docker Compose v2`, `build-essential`\*, `jq`\*\*
1919

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

@@ -48,17 +48,13 @@ make db-init
4848

4949
After the containers are up and running:
5050

51-
- access and start playing with the Swager UI at: [localhost:8888/nef/docs](http://localhost:8888/nef/docs)
52-
- login to the admin dashboard at: [localhost:8888/login](http://localhost:8888/login)
51+
- access and start playing with the Swager UI at: [http://localhost:8090/nef/docs](http://localhost:8090/nef/docs) or [https://localhost:4443/nef/docs](http://localhost:4443/nef/docs)
52+
- login to the admin dashboard at: [http://localhost:8090/login](http://localhost:8090) or [https://localhost:4443/login](http://localhost:4443/login)
5353
- Default credentials: `admin@my-email.com` / `pass`
5454
- they can be found/changed inside your `.env` file
5555

56-
57-
5856
<br><br>
5957

60-
61-
6258
## 🏷️ How to work on a specific tag / release
6359

6460
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:
@@ -79,112 +75,37 @@ Short reasoning on why we choose tags over branches:
7975

8076
## ↔️ NetApp communication options
8177

82-
Below, you may find different options for establishing a bi-directional communication over HTTP between the NetApp and the NEF_emulator (for example to be used for `callbacks`).
83-
84-
### 1. via `host.docker.internal`
85-
86-
If you develop your NetApp directly on the host, for example a `Flask` app running on port `9999`:
87-
- you will be able to connect to the NEF_emulator at: `http://localhost:8888`
88-
- the NEF_emulator will **not** be able to connect to `http://localhost:9999` because "localhost" for a container is itself, not the host.
89-
- to overcome the above problem, Docker provides `host.docker.internal`
90-
- the NEF_emulator will be able to connect to `http://host.docker.internal:9999`
91-
- ⚠ make sure you bind your NetApp on `0.0.0.0:[port]` and not only on `127.0.0.1:[port]`
92-
93-
```
94-
┌───────────────────────────────────────────────────────────────┐
95-
│ HOST │
96-
│ │
97-
│ ┌───────────────────────────────┐ │
98-
│ NetApp │ docker-compose network │ │
99-
│ │ ├───────────────────────────────┤ │
100-
│ │ │ NEF_emulator containers │ │
101-
│ │ │ live here │ │
102-
│ │ └── :80 ────────────── :5050 ───┘ │
103-
│ │ │ │ │
104-
│ │ │ │ │
105-
└────── :9999 ───────────── :8888 ───────────── :5050 ──────────┘
106-
│ │
107-
└─< communication >─┘
108-
```
109-
110-
<br>
111-
112-
### 2. via the same docker `bridge` network
113-
114-
If you develop your NetApp as a container, the easiest way to establish a bi-directional communication would be to `attach` it to the pre-existing bridge network that the NEF_emulator containers use:
115-
- this bridge network is automatically created whenever you `docker-compose up` a project, in our case if CAPIF Core Function is integrated with NEF then the docker network is named as `services_default`. If NEF Emulator is used **without** CAPIF Core Function then the network is named as `nef_emulator_services_default`
116-
- Docker will provide automatic DNS resolution between these containers names
117-
- your NetApp will be able to connect to the NEF_emulator at `http://backend`
118-
- the NEF_emulator will be able to connect to your NetApp at `http://your_netapp_container_name:9999`
119-
- ⚠ make sure you use the container ports directly, not the `published` ones
120-
- ⚠ make sure you first `docker-compose up` the NEF_emulator and then `attach` your NetApp container
121-
- more details at Docker docs: [Use bridge networks](https://docs.docker.com/network/bridge/) and [Networking in Compose](https://docs.docker.com/compose/networking/)
122-
123-
```
124-
┌───────────────────────────────────────────────────────────────┐
125-
│ HOST │
126-
│ │
127-
│ ┌───────────────────────────────────────────────────┐ │
128-
│ │ docker-compose network │ │
129-
│ ├───────────────────────────────────────────────────┤ │
130-
│ │ │ │
131-
│ │ NetApp NEF_emulator containers │ │
132-
│ │ also lives here live here │ │
133-
│ │ │ │
134-
│ └─── :9999 ──────────── :80 ────────────── :5050 ───┘ │
135-
│ │ │ │ │
136-
│ ├─< communication >─┤ │ │
137-
│ │ │ │ │
138-
│ │ │ │ │
139-
└────── :9999 ───────────── :8888 ───────────── :5050 ──────────┘
140-
```
141-
142-
Three possible ways to achieve the above approach:
143-
144-
1. with **docker**, try the `--net=...` option and provide the bridge name that you want to `attach` to:
145-
146-
docker container run --net=<network_name> ...
147-
148-
2. with **docker-compose**, try adding the bridge as an external network, something like:
149-
150-
151-
services:
152-
....
153-
netapp:
154-
....
155-
networks:
156-
- <network_name>
157-
networks:
158-
<network_name>:
159-
external: true
160-
161-
3. with **docker network connect**, try adding your container to the bridge network:
162-
163-
docker network connect BRIDGE_NAME NETAPP_NAME
78+
To be updated...
16479

16580
## Integration with CAPIF
16681

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

169-
1. The first step is to ensure that all CAPIF services are up and running. After cloning the code from the official github repository https://github.com/EVOLVED-5G/CAPIF_API_Services you can execute:
84+
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:
17085

17186
```
17287
cd services/
173-
17488
sudo ./run.sh
175-
17689
./check_services_are_running.sh
17790
```
91+
These commands will start the CAPIF services and ensure that they are running correctly.
17892

179-
2. Then, in NEF Emulator project, change the `EXTERNAL_NET` environment variable to **true** in `.env` file. This will enable NEF containers to join CAPIF's pre-existing network (services_default). Note that if you want to use NEF Emulator without CAPIF, then change the `EXTERNAL_NET` environment variable back to **false** in `.env` file
93+
2. Configure the NEF Emulator project to join the CAPIF network by following one of the below steps based on your deployment requirements:
18094

181-
3. Start NEF services either using `make up` or `make debug-up` commands
182-
183-
NEF should be successfully onboard to CAPIF Core Function. To ensure that, the following files should be created in `app/core/certificates/` folder:
95+
- For local deployment:
96+
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:
97+
```
98+
127.0.0.1 capifcore
99+
```
100+
> This entry maps the hostname "capifcore" to the IP address `127.0.0.1`, which is the loopback address of the local network interface.
184101
102+
- For deployment in separate VMs:
103+
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:
185104
```
186-
ca.crt
187-
private.key
188-
test_nef01.crt
189-
capif_exposer_details.json
105+
<ip-of-capif> capifcore
190106
```
107+
> This entry maps the hostname "capifcore" to the IP address of the machine that CAPIF is running on.
108+
109+
3. Start the NEF services by executing either the make up or make debug-up command in the NEF Emulator project directory.
110+
111+
> 💡 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.

0 commit comments

Comments
 (0)