Skip to content

Commit

Permalink
Merge branch 'medianetlab:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tgogos authored Jun 24, 2022
2 parents bcbce43 + 565b02d commit 489208f
Show file tree
Hide file tree
Showing 50 changed files with 3,438 additions and 2,519 deletions.
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
# Changelog

## v1.5.0

***Summary:***

> - *changes and optimizations for making NEF_emulator capable of running bigger scenarios*
> - *UE movement approach change:*
> - *old: iterate over all path-points and simulate speed by using sleep() (LOW=1sec HIGH=0.1sec)*
> - *new: constantly use sleep(1sec) and simulate speed by skipping (or not) path-points*
> - *more on the pros/cons of this approach can be found at the relative source code section, the old one is commented out*
> - *update of `leaflet.js` to version `1.8.0` (we've indetified a bug when closing mark tooltips, it's supposed to be fixed by the maintainers of the project at the upcoming release)*

### UI changes

- `dashboard-cells.js` minor fix to display error details correctly in the toast message
- 🪛 fix `/map` js console errors caused by the UEs layer-checkbox (access to `null` marker)
- 🪛 fix `/map` UEs buttons: handle case of UEs with no paths assigned
- `/dashboard` page change: instead of 2 consecutive API requests on UE `Save` 👇:
- 1 API request to assign path everytime the user selects something different
- 1 API request on `Save` button
- `/map` page: add type-of-service column to datatable (cells now display `Monitoring Event API` or `AsSession With QoS API`)
- `/login`: add "hit enter --> submit form" functionality
- `/register`: add "hit enter --> submit form" functionality
- add `NEF` logo
- move part of `login.js` code to `app.js` (more clean approach + added `app.default_redirect` variable)
- `maps.js`: increase timeouts to 60 sec (edge case with >200 UEs, start/stop takes time)
- `maps.js`: add `api_get_moving_UEs()` to only retrieve moving UEs ➡ move part of `ui_map_paint_UEs()` to `ui_map_paint_moving_UEs()`
- `app.js`: move `api_test_token()` outside document.ready() for quicker user auth checks
- `401` page redirect: when the token can't be validated the user is redirected to a 401 Unauthorized page and after a few seconds is redirected to `/login`. Previously, the user was redirected to login without being notified.
- `map.js`: optimize `helper_check_path_is_already_painted( path_id )` by replacing the simple array of painted paths with a key-value object


### Backend

- ⛔ for optimization purposes, the UEs movement is handled in memory (no more intensive read/writes to Postgres) 👇
-`api/v1/ue_movement/state-ues` now returns moving UEs information only. It helps with the edge cases of having many UEs and only a few of them actually moving around
- create new module/file for threads `utils.py``ue_movement.py`
-`/utils/state-loop/{{supi}}``/ue_movement/state-loop/{{supi}}`
-`/utils/start-loop``/ue_movement/start-loop`
-`/utils/stop-loop``/ue_movement/stop-loop`
- `utils.py`: add a 2nd approach for making the UEs move within their path and control their speed (see #2eb19f8)
- `SQLAlchemy`: add `pool_size=150, max_overflow=20` to `create_engine( ... )`
- fix `NoneType` exception on MonitoringEvent one time request when cell is None
- Add middleware to return custom response header `X-Process-Time` that counts request-response proccesing time
- Split callbacks in two files 👉 From `send_callback.py``monitoring_callbacks.py` + `qos_callback.py`
- fix callback notification for QoS after the transition from db to memory


### Database

- postgreSQL add `command: -c shared_buffers=256MB -c max_connections=200` to `docker-compose`
- MonitoringEvent: migration from postgreSQL to MongoDB 👇
- fix `check_numberOfReports` function accordingly


### Libraries

- upgrade `leaflet.js` (`1.7.1` to `1.8.0`)



<br><br>

## v1.4.1

### Migration to Python 3.9
Expand Down Expand Up @@ -90,6 +153,8 @@





## v1.3.2

- Fix UE-association-path selection with `path_id` 0 (no path selected) - both dashboard and backend
Expand All @@ -99,6 +164,11 @@

<br><br>






## v1.3.1

- Fix endpoints on MonitoringEvent API <kbd>{apiroot}/nef/api/v1/3gpp-monitoring-event/**v1**/{scsAsId}/subscriptions</kbd>
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# NEF_emulator


<p align="center">
<img src="./backend/app/app/static/NEF_logo_400x400_light.svg" />
</p>


## ⚙ Setup locally

**Host prerequisites**: `docker`, `docker-compose 1.29.2`, `build-essential`\*, `jq`\*\*
Expand Down
23 changes: 12 additions & 11 deletions backend/app/app/api/api_v1/api.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
from fastapi import APIRouter

from app.api.api_v1.endpoints import paths, login, users, utils, gNB, Cell, UE, monitoringevent, qosMonitoring, qosInformation
from app.api.api_v1 import endpoints

api_router = APIRouter()
api_router.include_router(login.router, tags=["login"])
api_router.include_router(users.router, prefix="/users", tags=["users"])
api_router.include_router(utils.router, prefix="/utils", tags=["UI"])
api_router.include_router(paths.router, prefix="/paths", tags=["Paths"])
api_router.include_router(gNB.router, prefix="/gNBs", tags=["gNBs"])
api_router.include_router(Cell.router, prefix="/Cells", tags=["Cells"])
api_router.include_router(UE.router, prefix="/UEs", tags=["UEs"])
api_router.include_router(qosInformation.router, prefix="/qosInfo", tags=["QoS Information"])
api_router.include_router(endpoints.login.router, tags=["login"])
api_router.include_router(endpoints.users.router, prefix="/users", tags=["users"])
api_router.include_router(endpoints.utils.router, prefix="/utils", tags=["UI"])
api_router.include_router(endpoints.ue_movement.router, prefix="/ue_movement", tags=["Movement"])
api_router.include_router(endpoints.paths.router, prefix="/paths", tags=["Paths"])
api_router.include_router(endpoints.gNB.router, prefix="/gNBs", tags=["gNBs"])
api_router.include_router(endpoints.Cell.router, prefix="/Cells", tags=["Cells"])
api_router.include_router(endpoints.UE.router, prefix="/UEs", tags=["UEs"])
api_router.include_router(endpoints.qosInformation.router, prefix="/qosInfo", tags=["QoS Information"])
# api_router.include_router(monitoringevent.router, prefix="/3gpp-monitoring-event/v1", tags=["Monitoring Event API"])
# api_router.include_router(qosMonitoring.router, prefix="/3gpp-as-session-with-qos/v1", tags=["Session With QoS API"])
#api_router.include_router(monitoringevent.monitoring_callback_router, prefix="/3gpp-monitoring-event/v1", tags=["Monitoring Event API"])


# ---Create a subapp---
nef_router = APIRouter()
nef_router.include_router(monitoringevent.router, prefix="/3gpp-monitoring-event/v1", tags=["Monitoring Event API"])
nef_router.include_router(qosMonitoring.router, prefix="/3gpp-as-session-with-qos/v1", tags=["Session With QoS API"])
nef_router.include_router(endpoints.monitoringevent.router, prefix="/3gpp-monitoring-event/v1", tags=["Monitoring Event API"])
nef_router.include_router(endpoints.qosMonitoring.router, prefix="/3gpp-as-session-with-qos/v1", tags=["Session With QoS API"])


11 changes: 11 additions & 0 deletions backend/app/app/api/api_v1/endpoints/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from .login import router
from .users import router
from .utils import router
from .ue_movement import router
from .paths import router
from .gNB import router
from .Cell import router
from .UE import router
from .qosInformation import router
from .qosMonitoring import router
from .monitoringevent import router
Loading

0 comments on commit 489208f

Please sign in to comment.