From ac2cfc3744d2612b4d0dd506675b77d672057b37 Mon Sep 17 00:00:00 2001 From: Tonirayn Date: Mon, 25 Oct 2021 15:50:05 +0200 Subject: [PATCH 01/46] test netapp over simulator --- .gitignore | 4 ++ .../localization_netapp/__init__.py | 0 .../evolvedApi/__init__.py | 0 .../evolvedApi/simulator.py | 40 +++++++++++++++++++ .../evolvedApi/test_node.py | 24 +++++++++++ .../localization_netapp/main.py | 15 +++++++ src/localization_netapp/package.xml | 19 +++++++++ .../resource/localization_netapp | 0 src/localization_netapp/setup.cfg | 4 ++ src/localization_netapp/setup.py | 27 +++++++++++++ .../test/test_copyright.py | 23 +++++++++++ src/localization_netapp/test/test_flake8.py | 25 ++++++++++++ src/localization_netapp/test/test_pep257.py | 23 +++++++++++ 13 files changed, 204 insertions(+) create mode 100644 .gitignore create mode 100644 src/localization_netapp/localization_netapp/__init__.py create mode 100644 src/localization_netapp/localization_netapp/evolvedApi/__init__.py create mode 100644 src/localization_netapp/localization_netapp/evolvedApi/simulator.py create mode 100644 src/localization_netapp/localization_netapp/evolvedApi/test_node.py create mode 100644 src/localization_netapp/localization_netapp/main.py create mode 100644 src/localization_netapp/package.xml create mode 100644 src/localization_netapp/resource/localization_netapp create mode 100644 src/localization_netapp/setup.cfg create mode 100644 src/localization_netapp/setup.py create mode 100644 src/localization_netapp/test/test_copyright.py create mode 100644 src/localization_netapp/test/test_flake8.py create mode 100644 src/localization_netapp/test/test_pep257.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dcdba01 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build/ +install/ +log/ +.idea diff --git a/src/localization_netapp/localization_netapp/__init__.py b/src/localization_netapp/localization_netapp/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/localization_netapp/localization_netapp/evolvedApi/__init__.py b/src/localization_netapp/localization_netapp/evolvedApi/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/localization_netapp/localization_netapp/evolvedApi/simulator.py b/src/localization_netapp/localization_netapp/evolvedApi/simulator.py new file mode 100644 index 0000000..f255de5 --- /dev/null +++ b/src/localization_netapp/localization_netapp/evolvedApi/simulator.py @@ -0,0 +1,40 @@ +import requests + + +class SimulatorAPI(object): + """ + This class provides a python API wrapper for the NEF simulator + """ + def __init__(self): + """ + Save login token + """ + self.token = self.access() + + def access(self) -> str: + """ + Login in the simulator + :return: login token + """ + response = requests.post("http://localhost:8888/api/v1/login/access-token", data= + { + 'username': 'admin@my-email.com', + 'password': 'pass' + }) + + jsonfile = response.json() + return jsonfile['access_token'] + + def read_cellid(self, user_id) -> int: + """ + retrieve the closest cell id given the user + :param user_id: string of user application id + :return: return the closest cell id + """ + header = {'Authorization': 'Bearer ' + self.token} + response = requests.get('http://localhost:8888/api/v1/UEs/' + user_id, + headers=header, + data={'supi': user_id} + ) + + return response.json()['Cell_id'] diff --git a/src/localization_netapp/localization_netapp/evolvedApi/test_node.py b/src/localization_netapp/localization_netapp/evolvedApi/test_node.py new file mode 100644 index 0000000..b899bd5 --- /dev/null +++ b/src/localization_netapp/localization_netapp/evolvedApi/test_node.py @@ -0,0 +1,24 @@ +from rclpy.node import Node +from .simulator import SimulatorAPI +from std_msgs.msg import String + + +class TestNode(Node): + """ + This class is a ros node for testing the interaction with the NEF + simulator api + """ + + def __init__(self): + super().__init__('minimal_publisher') + self.publisher_ = self.create_publisher(String, 'topic', 10) + timer_period = 0.5 # seconds + self.timer = self.create_timer(timer_period, self.timer_callback) + self.sapi = SimulatorAPI() + + def timer_callback(self): + msg = String() + cell_id = self.sapi.read_cellid('202010000000003') + msg.data = str(cell_id) + self.publisher_.publish(msg) + self.get_logger().info('Publishing: CellID "%s"' % msg.data) \ No newline at end of file diff --git a/src/localization_netapp/localization_netapp/main.py b/src/localization_netapp/localization_netapp/main.py new file mode 100644 index 0000000..75ef7d4 --- /dev/null +++ b/src/localization_netapp/localization_netapp/main.py @@ -0,0 +1,15 @@ + +import rclpy +from .evolvedApi.test_node import TestNode + +def main(): + rclpy.init(args=None) + minimal_publisher = TestNode() + rclpy.spin(minimal_publisher) + minimal_publisher.destroy_node() + rclpy.shutdown() + + + +if __name__ == '__main__': + main() diff --git a/src/localization_netapp/package.xml b/src/localization_netapp/package.xml new file mode 100644 index 0000000..8ce99ea --- /dev/null +++ b/src/localization_netapp/package.xml @@ -0,0 +1,19 @@ + + + + localization_netapp + 0.0.0 + TODO: Package description + antonio + TODO: License declaration + + ament_copyright + ament_flake8 + ament_pep257 + rclpy + std_msgs + + + ament_python + + diff --git a/src/localization_netapp/resource/localization_netapp b/src/localization_netapp/resource/localization_netapp new file mode 100644 index 0000000..e69de29 diff --git a/src/localization_netapp/setup.cfg b/src/localization_netapp/setup.cfg new file mode 100644 index 0000000..a0f3791 --- /dev/null +++ b/src/localization_netapp/setup.cfg @@ -0,0 +1,4 @@ +[develop] +script-dir=$base/lib/localization_netapp +[install] +install-scripts=$base/lib/localization_netapp diff --git a/src/localization_netapp/setup.py b/src/localization_netapp/setup.py new file mode 100644 index 0000000..0f63bf0 --- /dev/null +++ b/src/localization_netapp/setup.py @@ -0,0 +1,27 @@ +from setuptools import setup +from setuptools import find_packages + +packages = find_packages() +package_name = "localization_netapp" + +setup( + name=package_name, + version="0.0.0", + packages=["localization_netapp","localization_netapp.evolvedApi"], + data_files=[ + ("share/ament_index/resource_index/packages", ["resource/" + package_name]), + ("share/" + package_name, ["package.xml"]), + ], + install_requires=["setuptools"], + zip_safe=True, + maintainer="antonio", + maintainer_email="antonio@unmanned.life", + description="TODO: Package description", + license="TODO: License declaration", + tests_require=[], + entry_points={ + "console_scripts": [ + "test_node = localization_netapp.main:main", + ], + }, +) diff --git a/src/localization_netapp/test/test_copyright.py b/src/localization_netapp/test/test_copyright.py new file mode 100644 index 0000000..f46f861 --- /dev/null +++ b/src/localization_netapp/test/test_copyright.py @@ -0,0 +1,23 @@ +# Copyright 2015 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ament_copyright.main import main +import pytest + + +@pytest.mark.copyright +@pytest.mark.linter +def test_copyright(): + rc = main(argv=[".", "test"]) + assert rc == 0, "Found errors" diff --git a/src/localization_netapp/test/test_flake8.py b/src/localization_netapp/test/test_flake8.py new file mode 100644 index 0000000..ee79f31 --- /dev/null +++ b/src/localization_netapp/test/test_flake8.py @@ -0,0 +1,25 @@ +# Copyright 2017 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ament_flake8.main import main_with_errors +import pytest + + +@pytest.mark.flake8 +@pytest.mark.linter +def test_flake8(): + rc, errors = main_with_errors(argv=[]) + assert rc == 0, "Found %d code style errors / warnings:\n" % len( + errors + ) + "\n".join(errors) diff --git a/src/localization_netapp/test/test_pep257.py b/src/localization_netapp/test/test_pep257.py new file mode 100644 index 0000000..a2c3deb --- /dev/null +++ b/src/localization_netapp/test/test_pep257.py @@ -0,0 +1,23 @@ +# Copyright 2015 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ament_pep257.main import main +import pytest + + +@pytest.mark.linter +@pytest.mark.pep257 +def test_pep257(): + rc = main(argv=[".", "test"]) + assert rc == 0, "Found code style errors / warnings" From 8676660004f68b129fd245d6cd18bff37592d6ef Mon Sep 17 00:00:00 2001 From: Tonirayn <45395169+Tonirayn@users.noreply.github.com> Date: Mon, 25 Oct 2021 15:53:34 +0200 Subject: [PATCH 02/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e5bf2b0..bef6f4f 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -NetApp example \ No newline at end of file +NetApp to Localize an user over the 5G core From 96ea9839a994d6de77faab93f36043a8bc6d4dc0 Mon Sep 17 00:00:00 2001 From: Tonirayn <45395169+Tonirayn@users.noreply.github.com> Date: Mon, 25 Oct 2021 16:06:41 +0200 Subject: [PATCH 03/46] Update README.md --- src/README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/README.md b/src/README.md index a7862d3..32a293a 100644 --- a/src/README.md +++ b/src/README.md @@ -1,2 +1,16 @@ +# LocalizationNetApp + +To build the app you must have installed ros2 on your machine and build the package + +```shell + cd LocalizationNetApp/ + colcon build --symlink-install + . install/setup.bash +``` + +Than the test node can be launched using + +```shell +ros2 run localization_netapp test_node +``` -In this directory the developer will add his code and explain what his NetApp consists of. \ No newline at end of file From 1a9ff27a12a3edeefa335455bd69b06e5d7bb6b1 Mon Sep 17 00:00:00 2001 From: Tonirayn Date: Tue, 7 Dec 2021 15:49:31 +0100 Subject: [PATCH 04/46] verison with monitoring callback --- README.md | 7 ++- .../evolvedApi/cellid_node.py | 26 +++++++++ .../evolvedApi/endpoint.py | 53 +++++++++++++++++++ .../evolvedApi/simulator.py | 40 +++++++++++--- .../evolvedApi/test_node.py | 24 --------- .../localization_netapp/main.py | 22 +++++--- src/localization_netapp/setup.py | 4 +- 7 files changed, 137 insertions(+), 39 deletions(-) create mode 100644 src/localization_netapp/localization_netapp/evolvedApi/cellid_node.py create mode 100644 src/localization_netapp/localization_netapp/evolvedApi/endpoint.py delete mode 100644 src/localization_netapp/localization_netapp/evolvedApi/test_node.py diff --git a/README.md b/README.md index e5bf2b0..2175c96 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ -NetApp example \ No newline at end of file +LocalizationNetApp + + +``` +pip3 install uvloop httptools uvicorn +``` diff --git a/src/localization_netapp/localization_netapp/evolvedApi/cellid_node.py b/src/localization_netapp/localization_netapp/evolvedApi/cellid_node.py new file mode 100644 index 0000000..3614a1d --- /dev/null +++ b/src/localization_netapp/localization_netapp/evolvedApi/cellid_node.py @@ -0,0 +1,26 @@ +from rclpy.node import Node +from .simulator import SimulatorAPI +from std_msgs.msg import Int32 + + +class CellidNode(Node): + """ + This class is a ros node for testing the interaction with the NEF + simulator api + """ + def __init__(self): + super().__init__('cellid_node') + self.publisher_ = self.create_publisher(Int32, 'cellID', 10) + self.timer_period = 0.5 # seconds + self.timer = self.create_timer(self.timer_period, self.timer_callback) + self.sapi = SimulatorAPI() + self.get_logger().info('Autantication Done!!') + json_response = self.sapi.location_subscription('10003@domain.com') + self.get_logger().info('%s' % json_response) + + def timer_callback(self): + msg = Int32() + cell_id = self.sapi.read_cellid('202010000000001') + msg.data = cell_id + self.publisher_.publish(msg) + self.get_logger().info('Publishing: CellID "%s"' % msg.data) diff --git a/src/localization_netapp/localization_netapp/evolvedApi/endpoint.py b/src/localization_netapp/localization_netapp/evolvedApi/endpoint.py new file mode 100644 index 0000000..d5982be --- /dev/null +++ b/src/localization_netapp/localization_netapp/evolvedApi/endpoint.py @@ -0,0 +1,53 @@ +from fastapi import FastAPI, Request, Depends +from pydantic import BaseModel, IPvAnyAddress, AnyHttpUrl, Field +from typing import Optional +from enum import Enum +from fastapi_utils.cbv import cbv +from fastapi_utils.inferring_router import InferringRouter + + +class LocationInfo(BaseModel): + cellId: Optional[str] = None + enodeBId: Optional[str] = None + + +class MonitoringType(str, Enum): + locationReporting = "LOCATION_REPORTING" + lossOfConnectivity = "LOSS_OF_CONNECTIVITY" + + +class MonitoringEventReport(BaseModel): + externalId: Optional[str] = Field("123456789@domain.com", + description="Globally unique identifier containing a Domain Identifier and a Local Identifier. \@\") + monitoringType: MonitoringType + locationInfo: Optional[LocationInfo] = None + ipv4Addr: Optional[IPvAnyAddress] = Field(None, description="String identifying an Ipv4 address") + + +class MonitoringNotification(MonitoringEventReport): + subscription: AnyHttpUrl + + +# Creation of the endpoint using FastAPI +# Here you receive the callback notification from the emulator + +app = FastAPI() +netapp_router = InferringRouter() # Step 1: Create a router +cellid = 1 + +@cbv(netapp_router) +class netapp_endpoint: + + @netapp_router.post("/monitoring/callback") + def fill_cellid(self, item: MonitoringNotification, request: Request): + global cellid + cellid = int(item.locationInfo.cellId[-1]) + return {'ack': 'TRUE'} + + @netapp_router.get("/cellid") + def get_cellid(self,request: Request): + global cellid + return cellid + + +app.include_router(netapp_router) diff --git a/src/localization_netapp/localization_netapp/evolvedApi/simulator.py b/src/localization_netapp/localization_netapp/evolvedApi/simulator.py index f255de5..4ae6706 100644 --- a/src/localization_netapp/localization_netapp/evolvedApi/simulator.py +++ b/src/localization_netapp/localization_netapp/evolvedApi/simulator.py @@ -1,10 +1,12 @@ -import requests +import requests, json +from datetime import datetime, timedelta class SimulatorAPI(object): """ This class provides a python API wrapper for the NEF simulator """ + def __init__(self): """ Save login token @@ -31,10 +33,36 @@ def read_cellid(self, user_id) -> int: :param user_id: string of user application id :return: return the closest cell id """ - header = {'Authorization': 'Bearer ' + self.token} - response = requests.get('http://localhost:8888/api/v1/UEs/' + user_id, - headers=header, - data={'supi': user_id} + header = {} + response = requests.get('http://0.0.0.0:8000/cellid', + headers=None, + data=None ) - return response.json()['Cell_id'] + return response.json() + + def location_subscription(self, external_id): + """ + retrieve the closest cell id given the user + :param user_id: string of user application id + :return: return the closest cell id + """ + + now = datetime.now() + tomorrow = timedelta(days=+1) + expiretime = now + tomorrow + + header = {'Authorization': 'Bearer ' + self.token} + response = requests.post( + 'http://localhost:8888/api/v1/3gpp-monitoring-event/v1/LocalizationNetApp/subscriptions', + headers=header, + data=json.dumps({ + "externalId": external_id, + "notificationDestination": 'http://host.docker.internal:8000/monitoring/callback', + "monitoringType": "LOCATION_REPORTING", + "maximumNumberOfReports": 100, + "monitorExpireTime": expiretime.isoformat() + }) + ) + + return response.json() diff --git a/src/localization_netapp/localization_netapp/evolvedApi/test_node.py b/src/localization_netapp/localization_netapp/evolvedApi/test_node.py deleted file mode 100644 index b899bd5..0000000 --- a/src/localization_netapp/localization_netapp/evolvedApi/test_node.py +++ /dev/null @@ -1,24 +0,0 @@ -from rclpy.node import Node -from .simulator import SimulatorAPI -from std_msgs.msg import String - - -class TestNode(Node): - """ - This class is a ros node for testing the interaction with the NEF - simulator api - """ - - def __init__(self): - super().__init__('minimal_publisher') - self.publisher_ = self.create_publisher(String, 'topic', 10) - timer_period = 0.5 # seconds - self.timer = self.create_timer(timer_period, self.timer_callback) - self.sapi = SimulatorAPI() - - def timer_callback(self): - msg = String() - cell_id = self.sapi.read_cellid('202010000000003') - msg.data = str(cell_id) - self.publisher_.publish(msg) - self.get_logger().info('Publishing: CellID "%s"' % msg.data) \ No newline at end of file diff --git a/src/localization_netapp/localization_netapp/main.py b/src/localization_netapp/localization_netapp/main.py index 75ef7d4..0b34519 100644 --- a/src/localization_netapp/localization_netapp/main.py +++ b/src/localization_netapp/localization_netapp/main.py @@ -1,15 +1,25 @@ - import rclpy -from .evolvedApi.test_node import TestNode +from .evolvedApi.cellid_node import CellidNode +from .evolvedApi import endpoint as ep +from multiprocessing import Process +import uvicorn +import time + def main(): rclpy.init(args=None) - minimal_publisher = TestNode() - rclpy.spin(minimal_publisher) - minimal_publisher.destroy_node() + proc = Process(target=uvicorn.run, + args=(ep.app,), + kwargs={ + "host": "0.0.0.0"}, + daemon=True) + proc.start() + time.sleep(2) + node = CellidNode() + rclpy.spin(node) + node.destroy_node() rclpy.shutdown() - if __name__ == '__main__': main() diff --git a/src/localization_netapp/setup.py b/src/localization_netapp/setup.py index 0f63bf0..6905429 100644 --- a/src/localization_netapp/setup.py +++ b/src/localization_netapp/setup.py @@ -7,7 +7,7 @@ setup( name=package_name, version="0.0.0", - packages=["localization_netapp","localization_netapp.evolvedApi"], + packages=["localization_netapp", "localization_netapp.evolvedApi"], data_files=[ ("share/ament_index/resource_index/packages", ["resource/" + package_name]), ("share/" + package_name, ["package.xml"]), @@ -21,7 +21,7 @@ tests_require=[], entry_points={ "console_scripts": [ - "test_node = localization_netapp.main:main", + "cellid_node = localization_netapp.main:main", ], }, ) From 2fbebbcd38a86f376c764e31c2c2e6e54a39dd87 Mon Sep 17 00:00:00 2001 From: Tonirayn Date: Wed, 15 Dec 2021 13:18:50 +0100 Subject: [PATCH 05/46] evolvedApi moved out --- .gitignore | 1 + .../dist/evolvedApi-0.0.0-py3.8.egg | Bin 0 -> 6041 bytes src/evolvedApi/evolvedApi.egg-info/PKG-INFO | 10 +++++++ .../evolvedApi.egg-info/SOURCES.txt | 10 +++++++ .../evolvedApi.egg-info/dependency_links.txt | 1 + .../evolvedApi.egg-info/requires.txt | 1 + .../evolvedApi.egg-info/top_level.txt | 1 + src/evolvedApi/evolvedApi.egg-info/zip-safe | 1 + .../evolvedApi/__init__.py | 0 .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 174 bytes .../__pycache__/endpoint.cpython-38.pyc | Bin 0 -> 2435 bytes .../__pycache__/simulator.cpython-38.pyc | Bin 0 -> 2190 bytes .../evolvedApi/endpoint.py | 0 .../evolvedApi/simulator.py | 0 src/evolvedApi/setup.py | 18 +++++++++++++ .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 192 bytes .../__pycache__/cellid_node.cpython-38.pyc | Bin 0 -> 1403 bytes .../__pycache__/main.cpython-38.pyc | Bin 0 -> 792 bytes .../{evolvedApi => }/cellid_node.py | 2 +- .../localization_netapp/main.py | 4 +-- src/localization_netapp/setup.py | 2 +- .../test/test_copyright.py | 23 ---------------- src/localization_netapp/test/test_flake8.py | 25 ------------------ src/localization_netapp/test/test_pep257.py | 23 ---------------- 24 files changed, 47 insertions(+), 75 deletions(-) create mode 100644 src/evolvedApi/dist/evolvedApi-0.0.0-py3.8.egg create mode 100644 src/evolvedApi/evolvedApi.egg-info/PKG-INFO create mode 100644 src/evolvedApi/evolvedApi.egg-info/SOURCES.txt create mode 100644 src/evolvedApi/evolvedApi.egg-info/dependency_links.txt create mode 100644 src/evolvedApi/evolvedApi.egg-info/requires.txt create mode 100644 src/evolvedApi/evolvedApi.egg-info/top_level.txt create mode 100644 src/evolvedApi/evolvedApi.egg-info/zip-safe rename src/{localization_netapp/localization_netapp => evolvedApi}/evolvedApi/__init__.py (100%) create mode 100644 src/evolvedApi/evolvedApi/__pycache__/__init__.cpython-38.pyc create mode 100644 src/evolvedApi/evolvedApi/__pycache__/endpoint.cpython-38.pyc create mode 100644 src/evolvedApi/evolvedApi/__pycache__/simulator.cpython-38.pyc rename src/{localization_netapp/localization_netapp => evolvedApi}/evolvedApi/endpoint.py (100%) rename src/{localization_netapp/localization_netapp => evolvedApi}/evolvedApi/simulator.py (100%) create mode 100644 src/evolvedApi/setup.py create mode 100644 src/localization_netapp/localization_netapp/__pycache__/__init__.cpython-38.pyc create mode 100644 src/localization_netapp/localization_netapp/__pycache__/cellid_node.cpython-38.pyc create mode 100644 src/localization_netapp/localization_netapp/__pycache__/main.cpython-38.pyc rename src/localization_netapp/localization_netapp/{evolvedApi => }/cellid_node.py (95%) delete mode 100644 src/localization_netapp/test/test_copyright.py delete mode 100644 src/localization_netapp/test/test_flake8.py delete mode 100644 src/localization_netapp/test/test_pep257.py diff --git a/.gitignore b/.gitignore index dcdba01..3af7522 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build/ install/ log/ +__pychache__ .idea diff --git a/src/evolvedApi/dist/evolvedApi-0.0.0-py3.8.egg b/src/evolvedApi/dist/evolvedApi-0.0.0-py3.8.egg new file mode 100644 index 0000000000000000000000000000000000000000..fe1af7f738e30a27cfec8e12a8086bb2307caa9b GIT binary patch literal 6041 zcma)AXH-+$)(xSABGN(?5UJ9UE+9PuLa5S9PzVqRy+|n1n}Bqr7Xj%VMUW;+uOhvP zM5HRxks>d?H{Jz#_kQEs8T;g%A9L=x&NyqYy{4urHVzm70N?}G5HUL4u1U9ZFi+c< zNrssaB_&=J^}8DUnyUY~fkyWcwhNF#4t_p4k&SHZzn4oSmrk{2afelhR*jtvO7yE) zt}f{_-`829!cH72a= z(7njK2;uxDaMwaLjiBy!iAH0Coffup@7p3)CqlK)F_bF-vm+ZE`)yIL+(z@n6XY1T ztWR2|Z0HpaX-dahB#c4DBp)ij5NrMs&Z}u_VQ)+rU@XkM7>(_6z?lmJ=|&n*YZX>*Fr_#9(gqzrLFh3v5xZSeI-s_AZjev#FkYftZM64 z2UhbrJ=foF4m}*=eVTWJQQq~=^?_9v8-4i1yyF{R>%H>Q`P`G1?igCBEg{`^;W{tE z_hf_oy8>H`e3aGJKqtUI#U|iQ2x4PIVzdGnE{e5;JHZ_+;SLrk7!u)N=lWYU8VL9k zZOZ5Wkr;y_!c5AGXcxG%JHiG2ZxpvWFDLKKo}nSmub1%$`^!awJj|zaQT`vFju*m-*Y$xF{13@9hA}#rRRF->7tHv*B;3Oh z=>fNtb3*XLUE2Ih_TKPb#wa&kmCxM5I9_h%fYWl4Px z^rJGuXnG2sLml&x&%04d#v>Vgjc=Wb) z<|;%w>Nz;cC7`A9rTTXriAKxrJi&lL3ihnE^^b}|oItaz+-}jmo|Kk88;Da9qElDQ z#L*7lmr-7T%py%YPM1q48bN%peprTYoJ_eb%lSI)fw{qOgPVt!L>BHYQJkyHwuj>N zMD^>rBov%gfE=dXpQW*l-Q{34RUO|rjuq1PysUa~&yEM7p(O~->l^8-Hm`paCX69{ z#4>qLdXh{7lF~X^IB`PL>{AC-cYRvY%qs4F?6H(GI)t5eh#kwGZc&Bstv6{#wiexD z{T!RouF&ysIW9+ScjmqfK4c^R_8MAF2Gh(lFXj*%5Eg4>|X ziWA)_FZ}^KYbyx3bSo5~3cZ1Dudse+0nVFCUVDa>C4gTM-w#yrELk6Ny_ zUuUAT%rQYFAQQIyZ4C8dSzqA7MGGwm^5>vyrr$Ozi$7wC2R3x#c$xK(^_-A9r0!Xg z&8-=Z`_E$+CY9^Bmk^EzN|oAl=7fA>*G6faJ2$zwk+K^LsEq>|9apwu{dA9#ff((s`iG55G zkmCaY)PJUqE5hC#`M}N51(OA1y2g&v0^rBX`UWV1F{a#URmunia-BV&uq3%2@kGr9 z=zyNAWiZm)YaQxpz#8b?xk_G*c0H5M7T^mJRD8QhUiX1zI|p*BJ8^-v0PhM~)}Y|y zh7!)1PB$^b6+9L7m+S{o&u)vz4>&9P!kN)??c_-Z29paZ~BHCh)a=OgKxy-H&*KQPDUy;Pqc%$Zh~Z( zrJ=XErFTwg#Nnt|{O>VOUlxRHsuY1=I)AJ0s&uc{jJ-?SSNf$?0_bBcIXxEUYa`-! zq&ryMH+44VZiWR#<7{UXRGhK|(suE#lX4}T9t^Lyvh|k ztPgsc|75$qF<%yt7Rl^66n)kCywoq7yCnHWnx+2di-l1U#LB*4+7s z1cW%>DHQDyK(F1?8$t^y$+Bw3CY!8%?z_h9MGXI1OwF*p%=@NUo+f!r*{@clww<@! zRELv_HlG=VLph0B^wAY7;})(PTe3@&+BXra)G_|XW-v5Au)U5Hf$=TAS)W;&vu!#2 zyf^j1`Z!=AGQLudw^p)^zx>tyvxJ`3cP5f)Wjs)mZ^YKX7a^xEF1A<0!?vgGhhUSf z=c)4hNb@YD$iW_yB2O`s@6S|$!JJSQ4=ilpFxYv;v2a4U**H4z3W;M9$bx8TY3U&V z*nllbA-8LRC)|er{;I4=Kaf?MCXiN`_Eb+091u+Qo*$h*(w_l7%}?xKByY~>ZyF(- zBP6Qz6rwmC-E})1tvSi483lI*s+}Gl_BZv%A9^+i_8QZRHvHr)xLxeQ#3CKUbFt9< z7Ji_{pUQ;`09X+GpThqtdVdP{)l+qxxl8(Wo7X5F4yn$}hmHY#S2PLiM}%>&uslWQ z1L-+`u*g#5;itV3P2sz4s4buW^@YhXiHq{nQ-bC_vE6Pvjh{r#`L*01YL@cB;5pHln-~lO0+8jOH9UDWb%f#XwjA@j|7xu+|T*ax7DpzIloAk(UI(aymn-@}vj} zxkEZrU)RivW=NH{FAQOd;&_fkH0%wl)|PY3%}(bHfrJNK*0G>AiX+Kc&%S$e`qESM zZr?lTapI=4Cu>KfeZ3mxH(2u}wszK&M)R)G&H7^%s`qhS=4G3TL8L8dep10hE@Be7 z8K4iVW>VcZ52&#w2-{|4ivr2Cs=V;qETY#&U%${yD7qF{Kj;blK^m3y?2*MM3h#HK z&irD&y#~*|h(@>lJT@Jvah-8z;m@x~m#nzfY1#Jv^+w|mh%tTe2iL}cs;mp|fM?4_ zqZzm(wJxLmL{RNC_eZHbG}h0NfdqJ0qKj3zR+Q-Z+ek;)Y%_YkVJ^3@kU=79DmK2H zbp?>4La%5jNxMZ@22RhHAO(%ZCYs3OP=*T+-eCU0#5Eqlj;@e?n#UB0TLH=oUOaN} z^Ip%H*=+EZ)Hw16&CRpSPJY|md~+K1-J^A4W=eWR`WxfPh#hScd%FQy{#BgHD%wzQ z;RqBSyK`m-Vp?YEX`z4^oGmhLo1X$}hva?@GkStCFok6gBw2q}bw+CE2tp zn2hGIe;H>!3YE7%q>HtncqaQ@x#8uFUFbvAQ?}S=1x>8G01A#)i7rcPE4W%SG4Hnelz61~X|9QYv;cdbuHf?!r~`Y`AJfBgKptskI{_vi zHwFuv!~IRbjFKD${@jjl9PoyG>d`|?-{QYL_Tbb zQt6*i&RUW;V`ejq>LVLyVs(!EbzMwi=e9Uku4w&^%6z%xr_Nv0>>CA)nl=&Ws8N`L4O5%W^H7rv+K2ZU)$< zm`O>5cqc^4aCpM41{f@{RA-#xw%Km9qO=&nV(UCSe2vc2Ej5*J)km zSdpP=!vO#sFefYie=Zm2r>slcuI_-ttSBkfUj6h-w1oN`D}<~_jvsF=DUwdk90xKx zN_>T8oypmC7!nKdf+~?y#;;$0;9F9O3Ie>0K?Tnr(KqfV>MMW9rbRsZ294GnR%Q+p z%Gf+sK6OFg?eh27jQNDd9TNB@ENv?~8}nJO)VxSe#Wr{#As8pi%GS!t#!AnI3|%b8 zYnx3wYPDafx1zb-Zs0O+kue`{h!P%G+lkV(uS+bDP?uJ>iKdVSzPqAEo|YI)B~t8e z6)fsnbegOg)@bdqQlob|_MFiNRR@(^`1nF7*7H@G@7r2AI=dSa+4jlC41S{?`wiO( z!g{^@`Ql#^Ic4@EDVq6RuA7{)&{E?j{K|@LnYVuIh_;4BTZ}y*cYzNaI<%kSOxyuk z*<@U!HfPaRFi$?(_u}FSk%t8c5U12G5GCq-ZDUknqO!>ha8ZTPx>u9#%C< zE^rciaOyXvZ~Hhk`JDWa+cg(4KYiSG72?&s;`KJDNBd2O$`XWZsNpFyt5K>*@zSEM zWupa&^2)szAi-=d5>DsNC132j*Fc&y7 z_hth@|J%f@uU@jRPQQGe__k%d!-zDWIpU*l?(VdLjog(G#>dp7I)QlgOI}tDq#vV} zV`>xN$sJPP*qKW=fRlHLuYwa$SLk-DmX(#C2m}eDonA$di!2x?aZIga=@`95DjQFM z?#Z?yv2etT2;;b^ye6Bwbo6RRQ$*?BBOmh+ymN*oq?}EjHC8C~8tdQ)M^NnKMT=pb zatqM6WdcZsTdUQ}b3<~lC-=iXvHN4C#0zQC24?2V%MmU~qxxu_YmeH8#r+?tt25YN7aygS zn7-pkOyIudNjJSbA0jv7m`NlrDVrtfHZ+&kMEmnLj$e#%#fQa+5{EL91>yLnGC6)@ znHmEi*;1c|L+Iu)q&kCOvLE=<7?1J`9q84tFSx90*Gmh>wyKo8hiF54Y3(Lo=!SM& z)5DrR*Jy7x`=Z7x*JR7w#MI3~h>T}6#vh5+dwM6KP67Ut~h#5Jbu^#@tC^2+7y=`5|$=s?w1*fJyy z;fU#xGI)F>OGII!+lL&tFHqr|nZ3C|WtzI_+*r#fs`UarmKUj8>|0mh$(U zgZsMfA7;lt5*T%tH&&#oie2GK`Sjf6#7LHLm2@bBMU>Fda?9n+<;=sn?^s8$Nz}lx zIEX_$%RuYC`}3O=Zn2BUNN_Xb`&FBKN=Ta#xJR8Bf8*29VKEPr)_e!0-yPGorCTD> z2(bEIxV`sx`npEH9{XWMCc84b6mIqCZz!hKUpnqw{(u3aX(E}EFc*B zpAA9Gj`;79AMpF{f9%1_@XH3=f4~4he!$R0_ys%eGQ&k%>9;HP-;p2SgE7kf67Y8( z*=4HB7TGyf<3*~AhS_C`%P!eD#nDBIKRmOG9Diq&opVTHI{LpN`mb$v5&n0s**V-E z1OIyu?J~z@5AB>I?@x}unhPh?Wsb`h#5qS1rfIpLj1NUD6|5?^Ab6-9soO1(7{*n9qMO-Gw#dw(jz!l8T4dVcl{7yf> FzW{s73ljhU literal 0 HcmV?d00001 diff --git a/src/evolvedApi/evolvedApi.egg-info/PKG-INFO b/src/evolvedApi/evolvedApi.egg-info/PKG-INFO new file mode 100644 index 0000000..d06583d --- /dev/null +++ b/src/evolvedApi/evolvedApi.egg-info/PKG-INFO @@ -0,0 +1,10 @@ +Metadata-Version: 1.2 +Name: evolvedApi +Version: 0.0.0 +Summary: TODO: Package description +Home-page: UNKNOWN +Maintainer: antonio +Maintainer-email: antonio@unmanned.life +License: TODO: License declaration +Description: UNKNOWN +Platform: UNKNOWN diff --git a/src/evolvedApi/evolvedApi.egg-info/SOURCES.txt b/src/evolvedApi/evolvedApi.egg-info/SOURCES.txt new file mode 100644 index 0000000..02b3074 --- /dev/null +++ b/src/evolvedApi/evolvedApi.egg-info/SOURCES.txt @@ -0,0 +1,10 @@ +setup.py +evolvedApi/__init__.py +evolvedApi/endpoint.py +evolvedApi/simulator.py +evolvedApi.egg-info/PKG-INFO +evolvedApi.egg-info/SOURCES.txt +evolvedApi.egg-info/dependency_links.txt +evolvedApi.egg-info/requires.txt +evolvedApi.egg-info/top_level.txt +evolvedApi.egg-info/zip-safe \ No newline at end of file diff --git a/src/evolvedApi/evolvedApi.egg-info/dependency_links.txt b/src/evolvedApi/evolvedApi.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/evolvedApi/evolvedApi.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/src/evolvedApi/evolvedApi.egg-info/requires.txt b/src/evolvedApi/evolvedApi.egg-info/requires.txt new file mode 100644 index 0000000..49fe098 --- /dev/null +++ b/src/evolvedApi/evolvedApi.egg-info/requires.txt @@ -0,0 +1 @@ +setuptools diff --git a/src/evolvedApi/evolvedApi.egg-info/top_level.txt b/src/evolvedApi/evolvedApi.egg-info/top_level.txt new file mode 100644 index 0000000..3aa5b9c --- /dev/null +++ b/src/evolvedApi/evolvedApi.egg-info/top_level.txt @@ -0,0 +1 @@ +evolvedApi diff --git a/src/evolvedApi/evolvedApi.egg-info/zip-safe b/src/evolvedApi/evolvedApi.egg-info/zip-safe new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/evolvedApi/evolvedApi.egg-info/zip-safe @@ -0,0 +1 @@ + diff --git a/src/localization_netapp/localization_netapp/evolvedApi/__init__.py b/src/evolvedApi/evolvedApi/__init__.py similarity index 100% rename from src/localization_netapp/localization_netapp/evolvedApi/__init__.py rename to src/evolvedApi/evolvedApi/__init__.py diff --git a/src/evolvedApi/evolvedApi/__pycache__/__init__.cpython-38.pyc b/src/evolvedApi/evolvedApi/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..459244ae481e0d679ff9be998908e41ab3084377 GIT binary patch literal 174 zcmWIL<>g`k0=WY_6G8N25P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;x_;enx(7s(xZ# zNq$~tzP@XizfYK}i>|4=zE6H~VoqjNVo7Fxo?mK-V?lv_QfX#RihgQYeok3xieo`0 hGBZ9tGcU6wK3=b&@)n0pZhlH>PO2Tqvd=)w008TAE8YMA literal 0 HcmV?d00001 diff --git a/src/evolvedApi/evolvedApi/__pycache__/endpoint.cpython-38.pyc b/src/evolvedApi/evolvedApi/__pycache__/endpoint.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..daa94c8eb3fedf727997134363d50751957e297e GIT binary patch literal 2435 zcmZt|%Wm67kV{e|MN6`*D0ZBnsgM>$)rW<)Ngse=$Z-@$fFlKd0VNC&w04~`t>4h&UVF+f^pegjElaVp!VY(4XJ_ZVIx3fK1;*{a|MGq}6y;w; z7DoY)Hq7)N092tQP(tF6P<7N$b2Nf9HPFL?QwR;m2u;TfEyt2{EhvVzW6QN3EQKYf zB-e$Y99Eo)TpPi1SaqsI*;S}Xt(OY5SYfI;D}WcN4YM8E37Nbpz0>#<^`@H4#w!Bv=pmZPLB7K)a5pak5L%jXvFy5D6vdg8oVqSwhOIvpejV8m z{CCj$B@S83i?TTK<5uUmzjxeu@b$gj7Ah3@6M3}9vh5^koeuqgw%8~RMvQJJ{(H-a zCb1u78_AfLK{6_l>Hus~C6aQ*V+3~F$W{k1^BDSzs*X-I>6gl5&?}44?}y`riP~O& zXZx_*@45S(C;k1yZg1DA@AVH3-2Ov%r{C*!b`HD8-NT=I%>u82T)u*!2EbVf&V9Vk zl9*>8(y0Y;n)c6j;wWN+%pdvLc0J~U$8ITJm)i)Jp!M6Z8U^qpf+mdbqU84rIB>xi7OOjqhKJbYxuFrka8L=qK z&6(7{`S!cJ_rCw($Di6X4n05G7{uY^#cmLvdO%|y}yzoUS9iCpe>T3FO6NKhAT$JyEsvpBH+MB8XY{C(LixqZ7%Znu4g58;x zOnVJFz9E>NRDA`>O7)jI^j#BnELwmagBq`h?Da@5(xObp<%nfolDN=tW&Ka;t$AQu z&_aS!Z}4kV6}q3XP?$V#(gXC>Y~UK_4$SlhfJ}Koo{?uNCF{zRc+e22=F3Led;1QC zqk&AJAMPJ@pm%D}cJh#7iRQi2r{HNlWx*N$1c>}o1arS(fW*?79|SITTHpqPEN(@s zlF6-0Mr|x`PR!Q%5hA4y(BZRzYjnD_1Rb3z;3d*)68<@0O_k$CAJoQv%Cd81TEHXY zsA!X$msOdw^_upjv=`-bZZ6*_p(ims1DFaN{mZ`qAT*G`zeIHI54n<^?hb5x1~bJ9 zvNVg-3Kro=?KN*X<{3P;UgC2!G?$51I#x2K@P_yUj{iIIf|B`)QiPF>6R6+(VbU4A zs~rElI4kGU++pSi=>|Nsd3Vtm)FhB;#iG&`O3P+<}3?RS}HV1NB$Mk(B)Ef vr{YJ0U`W|a!UrrD)@J^wZeajZYz%dBgOu{0RxQ*DRjXcq literal 0 HcmV?d00001 diff --git a/src/evolvedApi/evolvedApi/__pycache__/simulator.cpython-38.pyc b/src/evolvedApi/evolvedApi/__pycache__/simulator.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e4eac0c3d9647997c12a0045dacb18aa77ed5c0 GIT binary patch literal 2190 zcmaJ?%Wm8@6eaZ<&De1hr*4v>4TPYZ0cwwnra&+Vinxgz7%;{`;&`ErAd9qzjwC81 z#}8q=YPR`<0JWF-gzows+IE#+NYTf=(s(j1jB>y`d|s00oO|{1+O-aWa`*S&;zgg3 zKd>`f9OyiPs_%nggwd3Q%|8t(^sUs&tkBBr(5B=mVK#H#5aw{_7dvzreL=eJ2iQpl zU90k0Y`75_ui9uCPfeWQ6ogd$v(-c7jRS9ts^KX{>cnD0wIt*FhW zkO!&U7kOahE1pj$5Fsy460UXS)>B`86-94%BvRJnhcZ3nY^@Np&FNECij&HZB9RLdMJNP~&mc~@ zG>hEI#R|BPr??rZ{L=H0G8bz7{BNLP$N@YY2?KI0=DxK~>6o5b=j7BHTg_OHaP>aGvvh@>>6(p>3=YNCY`~9L=&LDe0N(BCvK?S+ND7hkm=+UlDlqfK# z=<@!=FUHpjlgTTtRzz+vR?>#5Pi}hs=j+e5o^Njqo_=8X z3^(lX<7W2;3vcDph`ot`o`4)hUTY~__~dl^q~PHfS$qs>I2(+zU9PtFp7TN~qr)4M zb?e84P<$IcE@}ynX)6qw%FgAH!YrjcG$2a@i;=bk!DGLcY&p(`_|kn!C6n zNM3ynOGDqtOe!Uh@cMWZe#g{pbaj=`mM|qDe$gzL-@QHukD}M3IGxP2q6k=vB86GLvLSx!^i$bD zqPhcPDnNtZnHf{3sf$dbajQ=q$M+VXC>-y44VnmKjdcxk<;mRxo|t;cjJw)9`mFqi Q%{_laQET*conE*91(DuFl>h($ literal 0 HcmV?d00001 diff --git a/src/localization_netapp/localization_netapp/evolvedApi/endpoint.py b/src/evolvedApi/evolvedApi/endpoint.py similarity index 100% rename from src/localization_netapp/localization_netapp/evolvedApi/endpoint.py rename to src/evolvedApi/evolvedApi/endpoint.py diff --git a/src/localization_netapp/localization_netapp/evolvedApi/simulator.py b/src/evolvedApi/evolvedApi/simulator.py similarity index 100% rename from src/localization_netapp/localization_netapp/evolvedApi/simulator.py rename to src/evolvedApi/evolvedApi/simulator.py diff --git a/src/evolvedApi/setup.py b/src/evolvedApi/setup.py new file mode 100644 index 0000000..06dab09 --- /dev/null +++ b/src/evolvedApi/setup.py @@ -0,0 +1,18 @@ +from setuptools import setup +from setuptools import find_packages + +packages = find_packages() +package_name = "evolvedApi" + +setup( + name=package_name, + version="0.0.0", + packages=["evolvedApi"], + install_requires=["setuptools"], + zip_safe=True, + maintainer="antonio", + maintainer_email="antonio@unmanned.life", + description="TODO: Package description", + license="TODO: License declaration", + tests_require=[] +) diff --git a/src/localization_netapp/localization_netapp/__pycache__/__init__.cpython-38.pyc b/src/localization_netapp/localization_netapp/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f7be401f7d27fb3e0ccccf87f48cad7c0f39685c GIT binary patch literal 192 zcmWIL<>g`kf_Dqc5<&E15P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;x_&enx(7s(xZ# zNq$~tzP@XizfYK}i>|4=zE6H~VoqjNVo7Fxo?mK-V?lv_QfX#Rihd4~M0{RqNg_}N hn^=5&W?p7Ve7s&kf zCB}WaK)#0kn2*qYkG||vp-=e=ed_Q!rdK|nwK`Fs9Hh|u3o z*`)}S$H3+*5DYOaQHcr0ZXd{?3`ywsp^VCy#27tAEMoCn#A1#wL(*ZL7iiG^0H@Ia zH_=2f4r}^Clna?#rH`MVfgYb#_Tf?CzSe@-%>A7;X2h0Kk~V3TKBnXCeLcA<1;xv`>}W_HFiQCY6@ z!U|PozY06^#>we-{uXnUb(Yt{TME2Q(JcXR4D8Z25`;yUXpI@(0AMS$4s7U>-h?Ye zA#IQ`SUW2;hjrfF1Yqgey-WC(Cg9oMpmoaP_Vhei_gQCyf5X?F?h1c`oR=XeyEkd} z3tu;Nm6489&Q3nK22X*3{`z)#`*>mV%8DZQC7!5?-@Us$d@vr5A3kQP%tbXURJjc9 zo54X7n?=oa)1y>W!cs~O3(a%OX}vg?!pykVZbF*mTBjtnqU4&wIiVOyw+FnjIcR-F zF6DV%ydtsJwF9h)41n4sQ*NnL(#qV zn_5+dzsJoUrM}UWzDNJeMl)6N5mc-yp+=`Kzkl}f^yG^#pN^ivtx_yK3=?jT>w0v) z5R#2txGM*(xXr=yf3_X0hxHr12Q};in?n!?r}z+e@J-yq2e4n>`fnnKS73fLI}QQ| ze|zOm$#Jx(qz?aAy|63Au4JJ{r5Ww)9~6 z>GQT{FzH`sE}gTJ?B0EIZ_x8S)F}id`_NuS+tQkdZkUPM}|78G>)bsMQ9XLK7i9y#*Ta}lb(k7v_RBR#LKBe@R zMJ~6VE~QKrlzP~Gn5Mt&yHADgWa1j4eLC)Oc3e76^l%iViFURLL``%d>o-I9bhLZO zWdM6t*2F@nohgVgpDVfGp^+VTVwwQn9H9#Lp}uq$rF{$5Y3S9A~Ol(-mxc zhv||NATGcmyk#|4KuGW$RB0C2@|XAX`T2W}-|y^X2*$S`->XLip`XFo9uPwZu-YjA zM;t3uAWnFsa7_w=LyW4ZrbXP_u}bQ+NP8PAR5q;_DZudSJhww(q3?Fb4JSVyqh4*(7=a5(iE zW8{d77SzRy1-T` zX}6R!W3`WLr#%r(5mim&;})tpPo1mfGV+xve0HJXW~QA@!O8)+#}>>Yq&ukMtSp+|TLQlIvhXm>;YZh+hBx~fH4 g_Wf_ceV};utTwz;;(2&+ZK%pXZ Date: Mon, 24 Jan 2022 12:54:58 +0100 Subject: [PATCH 06/46] Update Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1989c3c..d0a317c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ NetApp to Localize an user over the 5G core ``` -pip3 install uvloop httptools uvicorn +pip3 install uvloop httptools uvicorn fastapi fastapi_utils ``` From 4bf55c9470f1f94e064988cef711966a5711cab4 Mon Sep 17 00:00:00 2001 From: Tonirayn Date: Thu, 27 Jan 2022 19:49:16 +0100 Subject: [PATCH 07/46] sdk integrated --- .../__pycache__/__init__.cpython-38.pyc | Bin 174 -> 174 bytes .../__pycache__/endpoint.cpython-38.pyc | Bin 2435 -> 2435 bytes .../__pycache__/simulator.cpython-38.pyc | Bin 2190 -> 1436 bytes src/evolvedApi/evolvedApi/endpoint.py | 2 +- src/evolvedApi/evolvedApi/simulator.py | 100 ++++++------------ .../__pycache__/__init__.cpython-38.pyc | Bin 192 -> 192 bytes .../__pycache__/cellid_node.cpython-38.pyc | Bin 1403 -> 2124 bytes .../__pycache__/main.cpython-38.pyc | Bin 792 -> 792 bytes .../localization_netapp/cellid_node.py | 41 ++++++- src/localization_netapp/setup.cfg | 4 +- 10 files changed, 74 insertions(+), 73 deletions(-) diff --git a/src/evolvedApi/evolvedApi/__pycache__/__init__.cpython-38.pyc b/src/evolvedApi/evolvedApi/__pycache__/__init__.cpython-38.pyc index 459244ae481e0d679ff9be998908e41ab3084377..a207bd4b28fca33ac148cc8425e737cb678275ff 100644 GIT binary patch delta 29 jcmZ3-xQ>xKl$V!_0SFo=zMIJH!&a7`QxKl$V!_0SM#{?3~E$!xrZ66XxnNF*XnYW90{T diff --git a/src/evolvedApi/evolvedApi/__pycache__/endpoint.cpython-38.pyc b/src/evolvedApi/evolvedApi/__pycache__/endpoint.cpython-38.pyc index daa94c8eb3fedf727997134363d50751957e297e..366347fddfe4df9e6b86cd569fac2d66f215071a 100644 GIT binary patch delta 299 zcmZn`ZWiVZ<>lpK00O4|Pl<^edA*s~%JOr{Qd1_!F|B31wV8)ml1WnrC||@0B7{MN z2#62|5pp1c7evT|2)4lpK00OxKI}@un@_I9|h57r0xw=e_V_M4?wV8)ml1WnEiXc1&6Pz};KLx8|2iUdZ{B@hZUS+pFkM_N9Icf696 zRSTynT{Cv;U;|z97Zu>zscXj$Mc<>;#4cJAB;Gsz`rh}xcQ1#-Jp%35pZ+L*i3#}) zotuq;^Av`?fJqQR6{+c*QnVu#)ojjcKIg$_Dz1}x5^Sz|^B(NsDxIe?5%JGdB%=2t zpZ6s_-wS>!`rz-&LGbp(K6pbp3f@2r!Mh{)w`4r}9o{Bm>PL1}EEdw_rK)7(#*t5- z>qXT(Yb(!RT4`WU{6fEy%?zx>NVhaiiHHAb2^cAi6Bzazm;~KGARFq)6}={#$VIP7 z7v;>6bKXUQy`dY{v8!0{1-*u_UDC1Fbi+G-)e~_?Ix1r9*U2XCVgQ@W)^`h0SIyJ< zaw6-ZQqxk`p0|ayZ>b-ax;d>DOH;T?H|vK*+p4MzPWHoOwOUP1wW%jdqhwQRA%!R7 z)I@;P4^M6$^`9)H%g?lRxjxO^namq`n#+2r3a5?dxZ?Z3%t_$NA6lto2`6MBkU`xz zpfGortu&Zq|41Q~c~O?q+T0lq;P{M_mWN((;Q zRyUCQf8pOZAg_FT-=_d&2R@+@js8kv^ANt>0uMgH00Q?M3_%00>w7z(3iW_uK7Io2 z#(TG44zzy;=PlL>p}`*?`2J2dj~5|D^ZW1o>Fu9MC<22B{Dc47Gp(T_l{Lt=!SKuj zoRIU7-jEy5s>X#tJ+sbi_3$2SutKiWFW|bRl3!x{7UeOZ2aw?dHo9}r8>N2(mp^8t literal 2190 zcmaJ?%Wm8@6eaZ<&De1hr*4v>4TPYZ0cwwnra&+Vinxgz7%;{`;&`ErAd9qzjwC81 z#}8q=YPR`<0JWF-gzows+IE#+NYTf=(s(j1jB>y`d|s00oO|{1+O-aWa`*S&;zgg3 zKd>`f9OyiPs_%nggwd3Q%|8t(^sUs&tkBBr(5B=mVK#H#5aw{_7dvzreL=eJ2iQpl zU90k0Y`75_ui9uCPfeWQ6ogd$v(-c7jRS9ts^KX{>cnD0wIt*FhW zkO!&U7kOahE1pj$5Fsy460UXS)>B`86-94%BvRJnhcZ3nY^@Np&FNECij&HZB9RLdMJNP~&mc~@ zG>hEI#R|BPr??rZ{L=H0G8bz7{BNLP$N@YY2?KI0=DxK~>6o5b=j7BHTg_OHaP>aGvvh@>>6(p>3=YNCY`~9L=&LDe0N(BCvK?S+ND7hkm=+UlDlqfK# z=<@!=FUHpjlgTTtRzz+vR?>#5Pi}hs=j+e5o^Njqo_=8X z3^(lX<7W2;3vcDph`ot`o`4)hUTY~__~dl^q~PHfS$qs>I2(+zU9PtFp7TN~qr)4M zb?e84P<$IcE@}ynX)6qw%FgAH!YrjcG$2a@i;=bk!DGLcY&p(`_|kn!C6n zNM3ynOGDqtOe!Uh@cMWZe#g{pbaj=`mM|qDe$gzL-@QHukD}M3IGxP2q6k=vB86GLvLSx!^i$bD zqPhcPDnNtZnHf{3sf$dbajQ=q$M+VXC>-y44VnmKjdcxk<;mRxo|t;cjJw)9`mFqi Q%{_laQET*conE*91(DuFl>h($ diff --git a/src/evolvedApi/evolvedApi/endpoint.py b/src/evolvedApi/evolvedApi/endpoint.py index d5982be..bbde7d0 100644 --- a/src/evolvedApi/evolvedApi/endpoint.py +++ b/src/evolvedApi/evolvedApi/endpoint.py @@ -18,7 +18,7 @@ class MonitoringType(str, Enum): class MonitoringEventReport(BaseModel): externalId: Optional[str] = Field("123456789@domain.com", - description="Globally unique identifier containing a Domain Identifier and a Local Identifier. \@\") + description="Globally unique identifier containing a Domain Identifier and a Local Identifier. \@\") monitoringType: MonitoringType locationInfo: Optional[LocationInfo] = None ipv4Addr: Optional[IPvAnyAddress] = Field(None, description="String identifying an Ipv4 address") diff --git a/src/evolvedApi/evolvedApi/simulator.py b/src/evolvedApi/evolvedApi/simulator.py index 4ae6706..cc577f0 100644 --- a/src/evolvedApi/evolvedApi/simulator.py +++ b/src/evolvedApi/evolvedApi/simulator.py @@ -1,68 +1,38 @@ +from evolved5g import swagger_client +from evolved5g.swagger_client import LoginApi, User +from evolved5g.swagger_client.models import Token import requests, json -from datetime import datetime, timedelta -class SimulatorAPI(object): - """ - This class provides a python API wrapper for the NEF simulator - """ - - def __init__(self): - """ - Save login token - """ - self.token = self.access() - - def access(self) -> str: - """ - Login in the simulator - :return: login token - """ - response = requests.post("http://localhost:8888/api/v1/login/access-token", data= - { - 'username': 'admin@my-email.com', - 'password': 'pass' - }) - - jsonfile = response.json() - return jsonfile['access_token'] - - def read_cellid(self, user_id) -> int: - """ - retrieve the closest cell id given the user - :param user_id: string of user application id - :return: return the closest cell id - """ - header = {} - response = requests.get('http://0.0.0.0:8000/cellid', - headers=None, - data=None - ) - - return response.json() - - def location_subscription(self, external_id): - """ - retrieve the closest cell id given the user - :param user_id: string of user application id - :return: return the closest cell id - """ - - now = datetime.now() - tomorrow = timedelta(days=+1) - expiretime = now + tomorrow - - header = {'Authorization': 'Bearer ' + self.token} - response = requests.post( - 'http://localhost:8888/api/v1/3gpp-monitoring-event/v1/LocalizationNetApp/subscriptions', - headers=header, - data=json.dumps({ - "externalId": external_id, - "notificationDestination": 'http://host.docker.internal:8000/monitoring/callback', - "monitoringType": "LOCATION_REPORTING", - "maximumNumberOfReports": 100, - "monitorExpireTime": expiretime.isoformat() - }) - ) - - return response.json() +def get_token() -> Token: + username = "admin@my-email.com" + password = "pass" + # User name and pass matches are set in the .env of the docker of NEF_EMULATOR. See + # https://github.com/EVOLVED-5G/NEF_emulator + configuration = swagger_client.Configuration() + # The host of the 5G API (emulator) + configuration.host = get_host_of_the_nef_emulator() + api_client = swagger_client.ApiClient(configuration=configuration) + api_client.select_header_content_type(["application/x-www-form-urlencoded"]) + api = LoginApi(api_client) + token = api.login_access_token_api_v1_login_access_token_post("", username, password, "", "", "") + return token + + +def get_api_client(token) -> swagger_client.ApiClient: + configuration = swagger_client.Configuration() + configuration.host = get_host_of_the_nef_emulator() + configuration.access_token = token.access_token + api_client = swagger_client.ApiClient(configuration=configuration) + return api_client + +def read_cellid() -> int: + response = requests.get('http://0.0.0.0:8000/cellid', + headers=None, + data=None + ) + + return response.json() + +def get_host_of_the_nef_emulator() -> str: + return "http://localhost:8888" diff --git a/src/localization_netapp/localization_netapp/__pycache__/__init__.cpython-38.pyc b/src/localization_netapp/localization_netapp/__pycache__/__init__.cpython-38.pyc index f7be401f7d27fb3e0ccccf87f48cad7c0f39685c..4bf484e346d9026c6e75628e846c35ee5d31818a 100644 GIT binary patch delta 29 jcmX@Wcz}^Rl$V!_0SFo=zMIJH!&a7`QX^{|D*lTmDU8PJvvq*BqTgQZ*y5wcr+AQ(gV2*H@*VTdgL6@!KE&1eZ4m z`3o28!-2(pnEDwIK?IFSLK&sVTd|ec%r1F5c9;V)JFX=zb4!^M*AtIUzX=-lW4Ds;#uvZIx z8yHC#6@*!WGW!h~Qeg@Ewa1*2cSH?%FhJB_6Xw1l4qvna#zyB{{O-y9Hm{oS$2Bd$N6uFSOy!oh4aZ z5DnBTnn$2%(wlM1b{wO_TwFYTbb?qK z!G!VW_b2Fcj{+=$LtRkD$^^&JtW5HrG(n!vb{BLC7INgD{BW{UAJu{)Q0u zYDFV0mGMXv8}bz-4lcohT}m?(4OhCkDAQXS$99w86(lj?=`;Zx@@&YJ%rj*)Yp)b> z`6`c;?Ld9O32s*tP$x9fSLqGVJ3>kDG=F}ku)5GhpqsC zc`Aoou3*X(k0Cns_D7Mk8?AiPB-l+AI54hjOfq z!auXB<&Yl(8F93XhYXT&8p6Us>xx=s1+*gajus8h%VOmG9eF>7NO z9{e_~O~+}t)S*`O``2sE+8=vK{{sfjRJ{dHAp**({}LFeC^Df7Xj)5XSi4ZQAh8!% zg|#_dT9gUyF8AJ+6D=00}3P{Zaw5B5R{J> zd<3}44$G45S*n9VD-!B5FzO1D&yZXLaucR@fe^Y4-p@K~-mO1##zXWBJ$wjL-vxqw z?T8xi5xWrd9?GGoO`HY#SM@pO2s(0VO7QmAwM`j0w~x%Im8lQ*AuD1EgnH{@RHiu{z#>22eTu(era~@Ee%A z{7)>i?LzivyKCN`Elcp{@agUhoO&Dd-L;a`puk0H=#Yd z*VrH0*aq|j5sTR8h}aaSCU%H(jAHkf-XB9{9p!|oJ~+;XW0saVKYZDl&3Br26;2Tb zg0MjVn-{1D#31Imhpm5v*uFp(!kW&R{dpG|s=`)bst`<0VZS{^6O{N9G_NhtJRtT0 zK&=e?c}ScEe1J>DoxlyGQGyhmC)>tt`N@cFb7auiEmeoE>}h9Xg* zvR{e%8Tq-X`iXfZ`FWZ7`mSa9Ic2FSlm9YSFp5tuV~Uj*2dcWo5g(tIn420O57vZ4 Kh)w>)qy_*ObtHKJ delta 121 zcmbQiHiL~jl$V!_0SLAq+qsc@52M*Fj^d2cl9c@NJWZxsECogR$+uYY@>5b*G8Bme zmHkT8&&bbB)lbYT$CmE8B?shBv92Yj`;Yz#N5>Qc(5iU KLSphKCN%& Date: Mon, 31 Jan 2022 12:29:27 +0100 Subject: [PATCH 08/46] Dokcerfile updated --- Dockerfile | 98 ++++++++++++++++-- entrypoint/dev_entrypoint.sh | 7 ++ .../__pycache__/cellid_node.cpython-38.pyc | Bin 2124 -> 2124 bytes 3 files changed, 96 insertions(+), 9 deletions(-) create mode 100755 entrypoint/dev_entrypoint.sh diff --git a/Dockerfile b/Dockerfile index b6746a3..b5f8a2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,89 @@ -FROM nginx -COPY ./src /usr/share/nginx/html -# support running as arbitrary user which belogs to the root group -RUN chmod g+rwx /var/cache/nginx /var/run /var/log/nginx -# users are not allowed to listen on priviliged ports -RUN sed -i.bak 's/listen\(.*\)80;/listen 1191;/' /etc/nginx/conf.d/default.conf -EXPOSE 1191 -# comment user directive as master process is run as user in OpenShift anyhow -RUN sed -i.bak 's/^user/#user/' /etc/nginx/nginx.conf \ No newline at end of file +########## FROZEN STAGE ########## +FROM ros:foxy AS frozen_stage + +########## CACHE BREAKER STAGE ########## +FROM frozen_stage AS cache_breaker_stage + +# install CI dependencies +RUN apt-get update && apt-get install -q -y \ + ccache \ + lcov \ + && rosdep update \ + && rm -rf /var/lib/apt/lists/* + +COPY src/localization_netapp /evolved5g/src/localization_netapp +COPY src/evolvedApi /evolved5g/src/evolvedApi + +RUN . /opt/ros/foxy/setup.sh \ + && rosdep keys --from-paths /evolved5g/src --ignore-src --rosdistro foxy | \ + xargs rosdep resolve --rosdistro foxy | \ + awk '/#apt/{getline; print}' > /rosdep_requirements.txt + + +########## BASE STAGE ########## +FROM frozen_stage AS base_stage + +COPY --from=cache_breaker_stage /rosdep_requirements.txt /rosdep_requirements.txt + +# Install Husarnet Client and deppendencies +RUN apt-get install ca-certificates \ + && apt update -y && apt install -y curl gnupg2 systemd + +RUN apt update \ + && apt install -y --no-install-recommends --no-upgrade $(cat /rosdep_requirements.txt) ros-foxy-rmw-cyclonedds-cpp + +RUN apt-get install libcurl4-openssl-dev -y \ + && apt-get install libcurlpp-dev -y \ + && apt-get install nlohmann-json3-dev + +########## DEV BASE STAGE ########## +FROM base_stage AS dev_base_stage + +RUN apt update \ + && apt install -y --no-install-recommends \ + python3-colcon-common-extensions \ + ros-foxy-diagnostic-updater \ + ros-foxy-tf2 \ + libboost-dev \ + python3-matplotlib \ + python3-numpy \ + python3-dev \ + python3-tk \ + python3-pip \ + libyaml-cpp-dev + +RUN pip3 install uvloop httptools uvicorn fastapi fastapi_utils evolved5g + +COPY --from=cache_breaker_stage /evolved5g /evolved5g + +########## BUILD STAGE ########## +FROM dev_base_stage AS build_stage + +WORKDIR /evolved5g +RUN . /opt/ros/foxy/setup.sh \ + && colcon build + + +########## DEV STAGE ########## +FROM build_stage AS dev_stage + +COPY entrypoint/dev_entrypoint.sh /dev_entrypoint.sh + +ENTRYPOINT ["/dev_entrypoint.sh"] +CMD tail -f /dev/null + +########## PRODUCTION BUILD STAGE ########## +FROM dev_base_stage AS prod_build_stage + + +########## PRODUCTION STAGE ########## +FROM base_stage AS prod_stage + + +########## CONTINUOUS INTEGRATION STAGE ########## +FROM dev_stage AS ci_stage + + +########## LIVE TEST STAGE ########## +FROM dev_stage AS live_test_stage + diff --git a/entrypoint/dev_entrypoint.sh b/entrypoint/dev_entrypoint.sh new file mode 100755 index 0000000..300d29a --- /dev/null +++ b/entrypoint/dev_entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +source "/opt/ros/foxy/setup.bash" +source "/evolved5g/install/setup.bash" + +exec ros2 run localization_netapp cellid_node diff --git a/src/localization_netapp/localization_netapp/__pycache__/cellid_node.cpython-38.pyc b/src/localization_netapp/localization_netapp/__pycache__/cellid_node.cpython-38.pyc index f81384398c735ff13478b7df7611a609a7506ea0..338e619d713562fa268fa1b8aac6e7a4caa6ae5c 100644 GIT binary patch delta 49 zcmX>ja7KVHl$V!_0SJ0-eM+q1+Q_HD%FM{eG})5%KBN9*Nw%MiCXja7KVHl$V!_0SG#;e@c|%-pHrH%FM*aGTD;#KBLiONw%Mi=97il7c#0&-pW25 E06A+7I{*Lx From d5d68a4b418fe611a427125cd35028c50e9ab15e Mon Sep 17 00:00:00 2001 From: Tonirayn <45395169+Tonirayn@users.noreply.github.com> Date: Mon, 31 Jan 2022 15:46:34 +0100 Subject: [PATCH 09/46] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0a317c..41c2377 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ NetApp to Localize an user over the 5G core ``` -pip3 install uvloop httptools uvicorn fastapi fastapi_utils +pip3 install uvloop httptools uvicorn fastapi fastapi_utils evolved5g ``` From 9b0a1673a2fefb57d09c35b548179d3f0ec204c8 Mon Sep 17 00:00:00 2001 From: sergigraum Date: Tue, 15 Feb 2022 17:08:40 +0100 Subject: [PATCH 10/46] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 41c2377..aaa5b9b 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,4 @@ NetApp to Localize an user over the 5G core ``` pip3 install uvloop httptools uvicorn fastapi fastapi_utils evolved5g ``` +Docker build: From a35a85a6541e824e7ec7c113d7fb8c72d7cf3276 Mon Sep 17 00:00:00 2001 From: sergigraum Date: Tue, 15 Feb 2022 17:18:16 +0100 Subject: [PATCH 11/46] Update README.md with docker commands --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index aaa5b9b..5256284 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,13 @@ NetApp to Localize an user over the 5G core pip3 install uvloop httptools uvicorn fastapi fastapi_utils evolved5g ``` Docker build: + +``` +docker build -f Dockerfile --target dev_stage -t :vx.y.z . +``` + +To run the Localization NetApp: + +``` +docker run --rm -it --name netapp --privileged --net=host :vlatest ros2 run localization_netapp cellid_node +``` From d632cbb3fef6cd5cbee766b60c094c854abfbbfa Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 5 Oct 2022 16:08:24 +0200 Subject: [PATCH 12/46] Added pip_dependencies file to solve library version mismatch --- Dockerfile | 4 ++++ pip_dependencies.txt | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 pip_dependencies.txt diff --git a/Dockerfile b/Dockerfile index b5f8a2f..087a601 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,6 +54,10 @@ RUN apt update \ RUN pip3 install uvloop httptools uvicorn fastapi fastapi_utils evolved5g +COPY pip_dependencies.txt /pip_dependencies.txt + +RUN pip3 install -r /pip_dependencies.txt + COPY --from=cache_breaker_stage /evolved5g /evolved5g ########## BUILD STAGE ########## diff --git a/pip_dependencies.txt b/pip_dependencies.txt new file mode 100644 index 0000000..3e81a5e --- /dev/null +++ b/pip_dependencies.txt @@ -0,0 +1,2 @@ +typing-extensions==4.3.0 +click==8.0.1 \ No newline at end of file From 7c8cd03b72a207335ebac11ac5354366b4f2ddb9 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Fri, 7 Oct 2022 09:12:59 +0200 Subject: [PATCH 13/46] Add NEF host as parameter --- entrypoint/dev_entrypoint.sh | 3 +++ src/evolvedApi/evolvedApi/simulator.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/entrypoint/dev_entrypoint.sh b/entrypoint/dev_entrypoint.sh index 300d29a..4191542 100755 --- a/entrypoint/dev_entrypoint.sh +++ b/entrypoint/dev_entrypoint.sh @@ -4,4 +4,7 @@ set -e source "/opt/ros/foxy/setup.bash" source "/evolved5g/install/setup.bash" +export NEF_HOST="http://nef.apps.ocp-epg.hi.inet/" +#export NEF_HOST="http://localhost:8888" + exec ros2 run localization_netapp cellid_node diff --git a/src/evolvedApi/evolvedApi/simulator.py b/src/evolvedApi/evolvedApi/simulator.py index cc577f0..2866df7 100644 --- a/src/evolvedApi/evolvedApi/simulator.py +++ b/src/evolvedApi/evolvedApi/simulator.py @@ -2,6 +2,7 @@ from evolved5g.swagger_client import LoginApi, User from evolved5g.swagger_client.models import Token import requests, json +import os def get_token() -> Token: @@ -35,4 +36,4 @@ def read_cellid() -> int: return response.json() def get_host_of_the_nef_emulator() -> str: - return "http://localhost:8888" + return os.environ.get('NEF_HOST') From 9458014f92f36cb00ec9bd31cf5816e8a0e968b3 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Mon, 17 Oct 2022 13:03:28 +0200 Subject: [PATCH 14/46] Expose NEF HOST, NEF PORT and UE external id as params --- Dockerfile | 16 ++++++++++------ entrypoint/dev_entrypoint.sh | 3 --- src/evolvedApi/evolvedApi/simulator.py | 8 +++----- .../localization_netapp/cellid_node.py | 5 +++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 087a601..4b1261a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,10 +6,10 @@ FROM frozen_stage AS cache_breaker_stage # install CI dependencies RUN apt-get update && apt-get install -q -y \ - ccache \ - lcov \ - && rosdep update \ - && rm -rf /var/lib/apt/lists/* + ccache \ + lcov \ + && rosdep update \ + && rm -rf /var/lib/apt/lists/* COPY src/localization_netapp /evolved5g/src/localization_netapp COPY src/evolvedApi /evolved5g/src/evolvedApi @@ -28,7 +28,7 @@ COPY --from=cache_breaker_stage /rosdep_requirements.txt /rosdep_requirements.tx # Install Husarnet Client and deppendencies RUN apt-get install ca-certificates \ && apt update -y && apt install -y curl gnupg2 systemd - + RUN apt update \ && apt install -y --no-install-recommends --no-upgrade $(cat /rosdep_requirements.txt) ros-foxy-rmw-cyclonedds-cpp @@ -51,7 +51,7 @@ RUN apt update \ python3-tk \ python3-pip \ libyaml-cpp-dev - + RUN pip3 install uvloop httptools uvicorn fastapi fastapi_utils evolved5g COPY pip_dependencies.txt /pip_dependencies.txt @@ -73,6 +73,10 @@ FROM build_stage AS dev_stage COPY entrypoint/dev_entrypoint.sh /dev_entrypoint.sh +ENV NEF_HOST="http://nef.apps.ocp-epg.hi.inet/" +ENV NEF_PORT="8888" +ENV UE_EXTERNAL_ID="10003@domain.com" + ENTRYPOINT ["/dev_entrypoint.sh"] CMD tail -f /dev/null diff --git a/entrypoint/dev_entrypoint.sh b/entrypoint/dev_entrypoint.sh index 4191542..300d29a 100755 --- a/entrypoint/dev_entrypoint.sh +++ b/entrypoint/dev_entrypoint.sh @@ -4,7 +4,4 @@ set -e source "/opt/ros/foxy/setup.bash" source "/evolved5g/install/setup.bash" -export NEF_HOST="http://nef.apps.ocp-epg.hi.inet/" -#export NEF_HOST="http://localhost:8888" - exec ros2 run localization_netapp cellid_node diff --git a/src/evolvedApi/evolvedApi/simulator.py b/src/evolvedApi/evolvedApi/simulator.py index 2866df7..1507adf 100644 --- a/src/evolvedApi/evolvedApi/simulator.py +++ b/src/evolvedApi/evolvedApi/simulator.py @@ -28,12 +28,10 @@ def get_api_client(token) -> swagger_client.ApiClient: return api_client def read_cellid() -> int: - response = requests.get('http://0.0.0.0:8000/cellid', - headers=None, - data=None - ) + cellid_path = os.environ.get("NEF_HOST") + ":8000/cellid" + response = requests.get(cellid_path, headers=None, data=None) return response.json() def get_host_of_the_nef_emulator() -> str: - return os.environ.get('NEF_HOST') + return os.environ.get("NEF_HOST") + ":" + os.environ.get("NEF_PORT") diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index 26cd0d4..8960611 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -3,6 +3,7 @@ import datetime import evolvedApi.simulator as simulator from std_msgs.msg import Int32 +import os class CellidNode(Node): @@ -21,9 +22,9 @@ def __init__(self): host = simulator.get_host_of_the_nef_emulator() token = simulator.get_token() self.location_subscriber = LocationSubscriber(host, token.access_token) - self.get_logger().info('Autantication Done!!') + self.get_logger().info('Authentication Done!!') - external_id = "10003@domain.com" + external_id = os.environ.get("UE_EXTERNAL_ID") # In this example we are running flask at http://localhost:5000 with a POST route to (/monitoring/callback) in order to retrieve notifications. # If you are running on the NEF emulator, you need to provide a notification_destination with an IP that the From 01370df5e682f272e17598ad0ee5f14905a3e846 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Mon, 17 Oct 2022 17:33:01 +0200 Subject: [PATCH 15/46] Correct typo in netapp id --- src/localization_netapp/localization_netapp/cellid_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index 8960611..73d9853 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -18,7 +18,7 @@ def __init__(self): self.timer = self.create_timer(self.timer_period, self.timer_callback) # Create a subscription, that will notify us 1000 times, for the next 1 day starting from now expire_time = (datetime.datetime.utcnow() + datetime.timedelta(days=1)).isoformat() + "Z" - self.netapp_id = "LocalizationNetapp" + self.netapp_id = "LocalizationNetApp" host = simulator.get_host_of_the_nef_emulator() token = simulator.get_token() self.location_subscriber = LocationSubscriber(host, token.access_token) From 56f7c3d9962db929cc650ed618c55a8d6187da1e Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 2 Nov 2022 09:11:02 +0100 Subject: [PATCH 16/46] Add NEF port in cellid + rollback previous change --- src/evolvedApi/evolvedApi/simulator.py | 10 ++++++++-- .../localization_netapp/cellid_node.py | 17 ++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/evolvedApi/evolvedApi/simulator.py b/src/evolvedApi/evolvedApi/simulator.py index 1507adf..da27483 100644 --- a/src/evolvedApi/evolvedApi/simulator.py +++ b/src/evolvedApi/evolvedApi/simulator.py @@ -16,7 +16,9 @@ def get_token() -> Token: api_client = swagger_client.ApiClient(configuration=configuration) api_client.select_header_content_type(["application/x-www-form-urlencoded"]) api = LoginApi(api_client) - token = api.login_access_token_api_v1_login_access_token_post("", username, password, "", "", "") + token = api.login_access_token_api_v1_login_access_token_post( + "", username, password, "", "", "" + ) return token @@ -27,11 +29,15 @@ def get_api_client(token) -> swagger_client.ApiClient: api_client = swagger_client.ApiClient(configuration=configuration) return api_client + def read_cellid() -> int: - cellid_path = os.environ.get("NEF_HOST") + ":8000/cellid" + cellid_path = ( + os.environ.get("NEF_HOST") + ":" + os.environ.get("NEF_PORT") + "/cellid" + ) response = requests.get(cellid_path, headers=None, data=None) return response.json() + def get_host_of_the_nef_emulator() -> str: return os.environ.get("NEF_HOST") + ":" + os.environ.get("NEF_PORT") diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index 73d9853..db59a3f 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -11,18 +11,21 @@ class CellidNode(Node): This class is a ros node for testing the interaction with the NEF simulator api """ + def __init__(self): - super().__init__('cellid_node') - self.publisher_ = self.create_publisher(Int32, 'cellID', 10) + super().__init__("cellid_node") + self.publisher_ = self.create_publisher(Int32, "cellID", 10) self.timer_period = 0.5 # seconds self.timer = self.create_timer(self.timer_period, self.timer_callback) # Create a subscription, that will notify us 1000 times, for the next 1 day starting from now - expire_time = (datetime.datetime.utcnow() + datetime.timedelta(days=1)).isoformat() + "Z" - self.netapp_id = "LocalizationNetApp" + expire_time = ( + datetime.datetime.utcnow() + datetime.timedelta(days=1) + ).isoformat() + "Z" + self.netapp_id = "LocalizationNetapp" host = simulator.get_host_of_the_nef_emulator() token = simulator.get_token() self.location_subscriber = LocationSubscriber(host, token.access_token) - self.get_logger().info('Authentication Done!!') + self.get_logger().info("Authentication Done!!") external_id = os.environ.get("UE_EXTERNAL_ID") @@ -38,7 +41,7 @@ def __init__(self): external_id=external_id, notification_destination="http://host.docker.internal:8000/monitoring/callback", maximum_number_of_reports=1000, - monitor_expire_time=expire_time + monitor_expire_time=expire_time, ) # From now on we should retrieve POST notifications to http://host.docker.internal:8000/monitoring/callback @@ -47,7 +50,7 @@ def __init__(self): def destroy_node(self): id = self.subscription.link.split("/")[-1] - self.location_subscriber.delete_subscription(self.netapp_id,id) + self.location_subscriber.delete_subscription(self.netapp_id, id) return super().destroy_node() def timer_callback(self): From eff9a9dff4b594c515cc298432c76193cd3f1f57 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 2 Nov 2022 11:27:23 +0100 Subject: [PATCH 17/46] Fix sdk version to 0.8.2 --- pip_dependencies.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pip_dependencies.txt b/pip_dependencies.txt index 3e81a5e..d83f7b1 100644 --- a/pip_dependencies.txt +++ b/pip_dependencies.txt @@ -1,2 +1,3 @@ typing-extensions==4.3.0 -click==8.0.1 \ No newline at end of file +click==8.0.1 +evolved5g==0.8.2 \ No newline at end of file From 677ad59ddf3c6c2c92d058e6905a1a01ff7b5bc6 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 2 Nov 2022 11:30:49 +0100 Subject: [PATCH 18/46] Remove evolved5g from pip install --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4b1261a..1fe1454 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,7 @@ RUN apt update \ python3-pip \ libyaml-cpp-dev -RUN pip3 install uvloop httptools uvicorn fastapi fastapi_utils evolved5g +RUN pip3 install uvloop httptools uvicorn fastapi fastapi_utils COPY pip_dependencies.txt /pip_dependencies.txt From 3acc0d2b7807b63648745a81c948a408528ada72 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 2 Nov 2022 11:39:46 +0100 Subject: [PATCH 19/46] Add cellid port as variable --- Dockerfile | 3 ++- src/evolvedApi/evolvedApi/simulator.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1fe1454..a051752 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,7 +74,8 @@ FROM build_stage AS dev_stage COPY entrypoint/dev_entrypoint.sh /dev_entrypoint.sh ENV NEF_HOST="http://nef.apps.ocp-epg.hi.inet/" -ENV NEF_PORT="8888" +ENV NEF_PORT="80" +ENV CELLID_PORT="8000" ENV UE_EXTERNAL_ID="10003@domain.com" ENTRYPOINT ["/dev_entrypoint.sh"] diff --git a/src/evolvedApi/evolvedApi/simulator.py b/src/evolvedApi/evolvedApi/simulator.py index da27483..6066263 100644 --- a/src/evolvedApi/evolvedApi/simulator.py +++ b/src/evolvedApi/evolvedApi/simulator.py @@ -32,7 +32,7 @@ def get_api_client(token) -> swagger_client.ApiClient: def read_cellid() -> int: cellid_path = ( - os.environ.get("NEF_HOST") + ":" + os.environ.get("NEF_PORT") + "/cellid" + os.environ.get("NEF_HOST") + ":" + os.environ.get("CELLID_PORT") + "/cellid" ) response = requests.get(cellid_path, headers=None, data=None) From c0ecfed3af9c68cd2e572359453e5b747179b06c Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 2 Nov 2022 12:30:10 +0100 Subject: [PATCH 20/46] Fix the version of all python packages --- Dockerfile | 7 +++---- pip_dependencies.txt | 9 +++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index a051752..c1d7e5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,8 +52,6 @@ RUN apt update \ python3-pip \ libyaml-cpp-dev -RUN pip3 install uvloop httptools uvicorn fastapi fastapi_utils - COPY pip_dependencies.txt /pip_dependencies.txt RUN pip3 install -r /pip_dependencies.txt @@ -73,8 +71,9 @@ FROM build_stage AS dev_stage COPY entrypoint/dev_entrypoint.sh /dev_entrypoint.sh -ENV NEF_HOST="http://nef.apps.ocp-epg.hi.inet/" -ENV NEF_PORT="80" +# Local configuration, to be set according to the NEF location +ENV NEF_HOST="http://localhost" +ENV NEF_PORT="8888" ENV CELLID_PORT="8000" ENV UE_EXTERNAL_ID="10003@domain.com" diff --git a/pip_dependencies.txt b/pip_dependencies.txt index d83f7b1..9796dc6 100644 --- a/pip_dependencies.txt +++ b/pip_dependencies.txt @@ -1,3 +1,8 @@ +evolved5g==0.8.2 +uvloop==0.17.0 +httptools==0.5.0 +uvicorn==0.19.0 +fastapi==0.85.2 +fastapi_utils==0.2.1 typing-extensions==4.3.0 -click==8.0.1 -evolved5g==0.8.2 \ No newline at end of file +click==8.0.1 \ No newline at end of file From 5e795e12694b454f6246f64117e4a22fb4fbe7eb Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 2 Nov 2022 13:07:41 +0100 Subject: [PATCH 21/46] Add debugging msg for cellid type --- src/localization_netapp/localization_netapp/cellid_node.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index db59a3f..d036a1b 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -56,6 +56,8 @@ def destroy_node(self): def timer_callback(self): msg = Int32() cell_id = simulator.read_cellid() + print(cell_id) + print("Received CellId, of type:", type(cell_id)) msg.data = cell_id self.publisher_.publish(msg) self.get_logger().info('Publishing: CellID "%s"' % msg.data) From 5397c4f355e103e44d70d2f705d4d343500d02b0 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Thu, 3 Nov 2022 17:12:37 +0100 Subject: [PATCH 22/46] Add external UE id to ros publisher --- src/localization_netapp/localization_netapp/cellid_node.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index d036a1b..f432728 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -14,7 +14,9 @@ class CellidNode(Node): def __init__(self): super().__init__("cellid_node") - self.publisher_ = self.create_publisher(Int32, "cellID", 10) + external_id = os.environ.get("UE_EXTERNAL_ID") + publisher_topic_name = "cell_id_" + external_id[0:5] + self.publisher_ = self.create_publisher(Int32, publisher_topic_name, 10) self.timer_period = 0.5 # seconds self.timer = self.create_timer(self.timer_period, self.timer_callback) # Create a subscription, that will notify us 1000 times, for the next 1 day starting from now @@ -27,8 +29,6 @@ def __init__(self): self.location_subscriber = LocationSubscriber(host, token.access_token) self.get_logger().info("Authentication Done!!") - external_id = os.environ.get("UE_EXTERNAL_ID") - # In this example we are running flask at http://localhost:5000 with a POST route to (/monitoring/callback) in order to retrieve notifications. # If you are running on the NEF emulator, you need to provide a notification_destination with an IP that the # NEF emulator docker can understand @@ -45,7 +45,6 @@ def __init__(self): ) # From now on we should retrieve POST notifications to http://host.docker.internal:8000/monitoring/callback - print(self.subscription) def destroy_node(self): From bd01330f6983cce84f9158d3f729fef233c0b512 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Thu, 3 Nov 2022 17:33:46 +0100 Subject: [PATCH 23/46] Add debug msg + generalized monitoring callback path --- Dockerfile | 3 ++- src/evolvedApi/evolvedApi/endpoint.py | 4 ++++ src/evolvedApi/evolvedApi/simulator.py | 2 +- src/localization_netapp/localization_netapp/cellid_node.py | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1d7e5d..12680e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -74,7 +74,8 @@ COPY entrypoint/dev_entrypoint.sh /dev_entrypoint.sh # Local configuration, to be set according to the NEF location ENV NEF_HOST="http://localhost" ENV NEF_PORT="8888" -ENV CELLID_PORT="8000" +ENV NETAPP_HOST="http://host.docker.internal" +ENV NETAPP_PORT="8000" ENV UE_EXTERNAL_ID="10003@domain.com" ENTRYPOINT ["/dev_entrypoint.sh"] diff --git a/src/evolvedApi/evolvedApi/endpoint.py b/src/evolvedApi/evolvedApi/endpoint.py index bbde7d0..b18146c 100644 --- a/src/evolvedApi/evolvedApi/endpoint.py +++ b/src/evolvedApi/evolvedApi/endpoint.py @@ -41,12 +41,16 @@ class netapp_endpoint: @netapp_router.post("/monitoring/callback") def fill_cellid(self, item: MonitoringNotification, request: Request): global cellid + print("----- Received cellid change -----") + print(item.locationInfo.cellId) cellid = int(item.locationInfo.cellId[-1]) return {'ack': 'TRUE'} @netapp_router.get("/cellid") def get_cellid(self,request: Request): global cellid + print("Got cellid") + print(cellid) return cellid diff --git a/src/evolvedApi/evolvedApi/simulator.py b/src/evolvedApi/evolvedApi/simulator.py index 6066263..e7d7b15 100644 --- a/src/evolvedApi/evolvedApi/simulator.py +++ b/src/evolvedApi/evolvedApi/simulator.py @@ -32,7 +32,7 @@ def get_api_client(token) -> swagger_client.ApiClient: def read_cellid() -> int: cellid_path = ( - os.environ.get("NEF_HOST") + ":" + os.environ.get("CELLID_PORT") + "/cellid" + "http://localhost:" + os.environ.get("NETAPP_PORT") + "/cellid" ) response = requests.get(cellid_path, headers=None, data=None) diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index f432728..02d0210 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -18,7 +18,7 @@ def __init__(self): publisher_topic_name = "cell_id_" + external_id[0:5] self.publisher_ = self.create_publisher(Int32, publisher_topic_name, 10) self.timer_period = 0.5 # seconds - self.timer = self.create_timer(self.timer_period, self.timer_callback) + # self.timer = self.create_timer(self.timer_period, self.timer_callback) # Create a subscription, that will notify us 1000 times, for the next 1 day starting from now expire_time = ( datetime.datetime.utcnow() + datetime.timedelta(days=1) @@ -39,7 +39,7 @@ def __init__(self): self.subscription = self.location_subscriber.create_subscription( netapp_id=self.netapp_id, external_id=external_id, - notification_destination="http://host.docker.internal:8000/monitoring/callback", + notification_destination=os.environ.get("NETAPP_HOST")+ ":"+ os.environ.get("NETAPP_PORT") + "/monitoring/callback", maximum_number_of_reports=1000, monitor_expire_time=expire_time, ) From 9c71ac89cace8bb64969ecd87efe8b8924d601e9 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Mon, 7 Nov 2022 10:40:37 +0100 Subject: [PATCH 24/46] Debugging session - uncomment timer callback --- src/localization_netapp/localization_netapp/cellid_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index 02d0210..48c59ab 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -18,7 +18,7 @@ def __init__(self): publisher_topic_name = "cell_id_" + external_id[0:5] self.publisher_ = self.create_publisher(Int32, publisher_topic_name, 10) self.timer_period = 0.5 # seconds - # self.timer = self.create_timer(self.timer_period, self.timer_callback) + self.timer = self.create_timer(self.timer_period, self.timer_callback) # Create a subscription, that will notify us 1000 times, for the next 1 day starting from now expire_time = ( datetime.datetime.utcnow() + datetime.timedelta(days=1) From aaae0fd4adb10855cf1afe66b641c884d80d0aa1 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Tue, 8 Nov 2022 17:02:05 +0100 Subject: [PATCH 25/46] Capif integration version - tested locally --- Dockerfile | 5 +- entrypoint/dev_entrypoint.sh | 6 ++ pip_dependencies.txt | 2 +- src/cfg/capif_registration.json | 17 ++++ src/cfg/netapp.properties | 13 +++ src/evolvedApi/evolvedApi/netapp_utils.py | 82 +++++++++++++++++++ src/evolvedApi/evolvedApi/simulator.py | 43 ---------- .../evolvedApi/{endpoint.py => webserver.py} | 4 +- .../localization_netapp/cellid_node.py | 43 +++++----- .../localization_netapp/main.py | 4 +- 10 files changed, 144 insertions(+), 75 deletions(-) create mode 100644 src/cfg/capif_registration.json create mode 100644 src/cfg/netapp.properties create mode 100644 src/evolvedApi/evolvedApi/netapp_utils.py delete mode 100644 src/evolvedApi/evolvedApi/simulator.py rename src/evolvedApi/evolvedApi/{endpoint.py => webserver.py} (94%) diff --git a/Dockerfile b/Dockerfile index 12680e5..a8d5c3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ RUN apt-get update && apt-get install -q -y \ && rosdep update \ && rm -rf /var/lib/apt/lists/* +COPY src/cfg /evolved5g/cfg COPY src/localization_netapp /evolved5g/src/localization_netapp COPY src/evolvedApi /evolved5g/src/evolvedApi @@ -72,9 +73,9 @@ FROM build_stage AS dev_stage COPY entrypoint/dev_entrypoint.sh /dev_entrypoint.sh # Local configuration, to be set according to the NEF location -ENV NEF_HOST="http://localhost" +ENV NEF_IP="host.docker.internal" ENV NEF_PORT="8888" -ENV NETAPP_HOST="http://host.docker.internal" +ENV NETAPP_IP="172.18.0.21" ENV NETAPP_PORT="8000" ENV UE_EXTERNAL_ID="10003@domain.com" diff --git a/entrypoint/dev_entrypoint.sh b/entrypoint/dev_entrypoint.sh index 300d29a..8edf5bb 100755 --- a/entrypoint/dev_entrypoint.sh +++ b/entrypoint/dev_entrypoint.sh @@ -4,4 +4,10 @@ set -e source "/opt/ros/foxy/setup.bash" source "/evolved5g/install/setup.bash" +echo "172.17.0.1 capifcore" >> /etc/hosts + +evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" + exec ros2 run localization_netapp cellid_node + +exec "$@" diff --git a/pip_dependencies.txt b/pip_dependencies.txt index 9796dc6..ed96c2c 100644 --- a/pip_dependencies.txt +++ b/pip_dependencies.txt @@ -1,4 +1,4 @@ -evolved5g==0.8.2 +evolved5g==0.8.5 uvloop==0.17.0 httptools==0.5.0 uvicorn==0.19.0 diff --git a/src/cfg/capif_registration.json b/src/cfg/capif_registration.json new file mode 100644 index 0000000..d7da52c --- /dev/null +++ b/src/cfg/capif_registration.json @@ -0,0 +1,17 @@ +{ + "folder_to_store_certificates": "/evolved5g/cfg/capif_onboarding", + "capif_host": "capifcore", + "capif_http_port": 8080, + "capif_https_port": 443, + "capif_netapp_username": "test_netapp_54", + "capif_netapp_password": "test_netapp_password", + "capif_callback_url": "http://192.168.1.13:5000", + "description": ",test_app_description", + "csr_common_name": "test_app_common_name", + "csr_organizational_unit": "test_app_ou", + "csr_organization": "test_app_o", + "crs_locality": "Madrid", + "csr_state_or_province_name": "Madrid", + "csr_country_name": "ES", + "csr_email_address": "test@example.com" +} \ No newline at end of file diff --git a/src/cfg/netapp.properties b/src/cfg/netapp.properties new file mode 100644 index 0000000..4ef256f --- /dev/null +++ b/src/cfg/netapp.properties @@ -0,0 +1,13 @@ +[configs] +capif_callback_ip = host.docker.internal +capif_callback_port = 8086 +nef_user = admin@my-email.com +nef_pass = pass +nef_ip = host.docker.internal +nef_port = 8888 +nef_callback_ip = 172.18.0.21 +nef_callback_port = 8085 +certificates_folder = /evolved5g/cfg/capif_onboarding +capif_host = capifcore +capif_https_port = 443 +netapp_id = LocalizationNetapp \ No newline at end of file diff --git a/src/evolvedApi/evolvedApi/netapp_utils.py b/src/evolvedApi/evolvedApi/netapp_utils.py new file mode 100644 index 0000000..5cb2662 --- /dev/null +++ b/src/evolvedApi/evolvedApi/netapp_utils.py @@ -0,0 +1,82 @@ +from evolved5g import swagger_client +from evolved5g.swagger_client import LoginApi, User +from evolved5g.swagger_client.models import Token +import requests, json +import os +import configparser +import json + +class Utils: + def __init__(self) -> None: + self.get_configs() + + def get_configs(self): + config = configparser.RawConfigParser() + configFilePath = '/evolved5g/cfg/netapp.properties' + try: + config.read(configFilePath) + except Exception as e : + print(str(e)) + self.nef_username = config.get("configs", "nef_user") + self.nef_pass = config.get("configs", "nef_pass") + self.nef_ip = os.environ.get("NEF_IP") + self.nef_port = os.environ.get("NEF_PORT") + self.ue_external_id = os.environ.get("UE_EXTERNAL_ID") + self.netapp_host = os.environ.get("NETAPP_IP") + self.netapp_port = os.environ.get("NETAPP_PORT") + self.netapp_id = config.get("configs", "netapp_id") + self.capif_callback_ip = config.get("configs", "capif_callback_ip") + self.capif_callback_port = config.get("configs", "capif_callback_port") + self.certificates_folder = config.get("configs", "certificates_folder") + self.capif_host = config.get("configs", "capif_host") + self.capif_https_port = config.get("configs", "capif_https_port") + + print("================================================") + print("Starting NetApp with the following configuration:") + print("================================================") + print("NEF_IP:", self.nef_ip) + print("UE_EXTERNAL_ID:", self.ue_external_id) + print("NETAPP_IP:", self.netapp_host) + print("NETAPP_PORT:", self.netapp_port) + print("NETAPP_ID:", self.netapp_id) + print("CERTIFICATES_FOLDER:", self.certificates_folder) + print("CAPIF_HOST:", self.capif_host) + print("CAPIF_PORT:", self.capif_https_port) + print("================================================") + + def get_token(self) -> Token: + configuration = swagger_client.Configuration() + configuration.host = self.get_host_of_the_nef_emulator() + api_client = swagger_client.ApiClient(configuration=configuration) + api_client.select_header_content_type(["application/x-www-form-urlencoded"]) + api = LoginApi(api_client) + token = api.login_access_token_api_v1_login_access_token_post( + "", self.nef_username, self.nef_pass, "", "", "" + ) + print("NEF Token: {}\n".format(token.access_token)) + return token + + + def get_api_client(token,self) -> swagger_client.ApiClient: + configuration = swagger_client.Configuration() + configuration.host = self.get_host_of_the_nef_emulator() + configuration.access_token = token.access_token + api_client = swagger_client.ApiClient(configuration=configuration) + return api_client + + + def get_host_of_the_nef_emulator(self) -> str: + return "http://{}:{}".format(self.nef_ip, self.nef_port) + + def get_host_of_the_netapp(self) -> str: + return "http://{}:{}/nefcallbacks".format(self.netapp_id, self.netapp_port) + +def read_cellid() -> int: + cellid_path = ( + "http://localhost:" + os.environ.get("NETAPP_PORT") + "/cellid" + ) + response = requests.get(cellid_path, headers=None, data=None) + + return response.json() + + diff --git a/src/evolvedApi/evolvedApi/simulator.py b/src/evolvedApi/evolvedApi/simulator.py deleted file mode 100644 index e7d7b15..0000000 --- a/src/evolvedApi/evolvedApi/simulator.py +++ /dev/null @@ -1,43 +0,0 @@ -from evolved5g import swagger_client -from evolved5g.swagger_client import LoginApi, User -from evolved5g.swagger_client.models import Token -import requests, json -import os - - -def get_token() -> Token: - username = "admin@my-email.com" - password = "pass" - # User name and pass matches are set in the .env of the docker of NEF_EMULATOR. See - # https://github.com/EVOLVED-5G/NEF_emulator - configuration = swagger_client.Configuration() - # The host of the 5G API (emulator) - configuration.host = get_host_of_the_nef_emulator() - api_client = swagger_client.ApiClient(configuration=configuration) - api_client.select_header_content_type(["application/x-www-form-urlencoded"]) - api = LoginApi(api_client) - token = api.login_access_token_api_v1_login_access_token_post( - "", username, password, "", "", "" - ) - return token - - -def get_api_client(token) -> swagger_client.ApiClient: - configuration = swagger_client.Configuration() - configuration.host = get_host_of_the_nef_emulator() - configuration.access_token = token.access_token - api_client = swagger_client.ApiClient(configuration=configuration) - return api_client - - -def read_cellid() -> int: - cellid_path = ( - "http://localhost:" + os.environ.get("NETAPP_PORT") + "/cellid" - ) - response = requests.get(cellid_path, headers=None, data=None) - - return response.json() - - -def get_host_of_the_nef_emulator() -> str: - return os.environ.get("NEF_HOST") + ":" + os.environ.get("NEF_PORT") diff --git a/src/evolvedApi/evolvedApi/endpoint.py b/src/evolvedApi/evolvedApi/webserver.py similarity index 94% rename from src/evolvedApi/evolvedApi/endpoint.py rename to src/evolvedApi/evolvedApi/webserver.py index b18146c..37d624e 100644 --- a/src/evolvedApi/evolvedApi/endpoint.py +++ b/src/evolvedApi/evolvedApi/webserver.py @@ -41,7 +41,7 @@ class netapp_endpoint: @netapp_router.post("/monitoring/callback") def fill_cellid(self, item: MonitoringNotification, request: Request): global cellid - print("----- Received cellid change -----") + print("[webserver] Received cell_id change") print(item.locationInfo.cellId) cellid = int(item.locationInfo.cellId[-1]) return {'ack': 'TRUE'} @@ -49,8 +49,6 @@ def fill_cellid(self, item: MonitoringNotification, request: Request): @netapp_router.get("/cellid") def get_cellid(self,request: Request): global cellid - print("Got cellid") - print(cellid) return cellid diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index 02d0210..d734d61 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -1,7 +1,7 @@ from rclpy.node import Node from evolved5g.sdk import LocationSubscriber import datetime -import evolvedApi.simulator as simulator +import evolvedApi.netapp_utils as netapp_utils from std_msgs.msg import Int32 import os @@ -14,37 +14,34 @@ class CellidNode(Node): def __init__(self): super().__init__("cellid_node") - external_id = os.environ.get("UE_EXTERNAL_ID") - publisher_topic_name = "cell_id_" + external_id[0:5] + + # Initialize Utils class and get configs + utils = netapp_utils.Utils() + + # Create ROS publisher + publisher_topic_name = "cell_id_" + utils.ue_external_id[0:5] self.publisher_ = self.create_publisher(Int32, publisher_topic_name, 10) self.timer_period = 0.5 # seconds - # self.timer = self.create_timer(self.timer_period, self.timer_callback) + self.timer = self.create_timer(self.timer_period, self.timer_callback) + # Create a subscription, that will notify us 1000 times, for the next 1 day starting from now expire_time = ( datetime.datetime.utcnow() + datetime.timedelta(days=1) ).isoformat() + "Z" - self.netapp_id = "LocalizationNetapp" - host = simulator.get_host_of_the_nef_emulator() - token = simulator.get_token() - self.location_subscriber = LocationSubscriber(host, token.access_token) - self.get_logger().info("Authentication Done!!") - - # In this example we are running flask at http://localhost:5000 with a POST route to (/monitoring/callback) in order to retrieve notifications. - # If you are running on the NEF emulator, you need to provide a notification_destination with an IP that the - # NEF emulator docker can understand - # For latest versions of docker this should be: http://host.docker.internal:5000/monitoring/callback" - # Alternative you can find the ip of the HOST by running 'ip addr show | grep "\binet\b.*\bdocker0\b" | awk '{print $2}' | cut -d '/' -f 1' - # See article for details: https://stackoverflow.com/questions/48546124/what-is-linux-equivalent-of-host-docker-internal/61001152 + + host = utils.get_host_of_the_nef_emulator() + token = utils.get_token() + self.location_subscriber = LocationSubscriber(host, token.access_token, utils.certificates_folder, utils.capif_host, utils.capif_https_port) + self.get_logger().info("Authentication Done") self.subscription = self.location_subscriber.create_subscription( - netapp_id=self.netapp_id, - external_id=external_id, - notification_destination=os.environ.get("NETAPP_HOST")+ ":"+ os.environ.get("NETAPP_PORT") + "/monitoring/callback", + netapp_id=utils.netapp_id, + external_id=utils.ue_external_id, + notification_destination=utils.get_host_of_the_netapp(), maximum_number_of_reports=1000, monitor_expire_time=expire_time, ) - - # From now on we should retrieve POST notifications to http://host.docker.internal:8000/monitoring/callback + self.get_logger().info("Successfully subscribed to location monitoring") print(self.subscription) def destroy_node(self): @@ -54,9 +51,7 @@ def destroy_node(self): def timer_callback(self): msg = Int32() - cell_id = simulator.read_cellid() - print(cell_id) - print("Received CellId, of type:", type(cell_id)) + cell_id = netapp_utils.read_cellid() msg.data = cell_id self.publisher_.publish(msg) self.get_logger().info('Publishing: CellID "%s"' % msg.data) diff --git a/src/localization_netapp/localization_netapp/main.py b/src/localization_netapp/localization_netapp/main.py index 777db3e..f7c5c69 100644 --- a/src/localization_netapp/localization_netapp/main.py +++ b/src/localization_netapp/localization_netapp/main.py @@ -1,6 +1,6 @@ import rclpy from .cellid_node import CellidNode -from evolvedApi import endpoint as ep +from evolvedApi import webserver from multiprocessing import Process import uvicorn import time @@ -9,7 +9,7 @@ def main(): rclpy.init(args=None) proc = Process(target=uvicorn.run, - args=(ep.app,), + args=(webserver.app,), kwargs={ "host": "0.0.0.0"}, daemon=True) From a1e34a7872b25bbcad8d11d10848683bf1b3cf64 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 30 Nov 2022 15:38:13 +0100 Subject: [PATCH 26/46] Upgrade SDK to 0.8.7 + configure capif host for openshift --- pip_dependencies.txt | 2 +- src/cfg/capif_registration.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pip_dependencies.txt b/pip_dependencies.txt index ed96c2c..3515f59 100644 --- a/pip_dependencies.txt +++ b/pip_dependencies.txt @@ -1,4 +1,4 @@ -evolved5g==0.8.5 +evolved5g==0.8.7 uvloop==0.17.0 httptools==0.5.0 uvicorn==0.19.0 diff --git a/src/cfg/capif_registration.json b/src/cfg/capif_registration.json index d7da52c..21f8854 100644 --- a/src/cfg/capif_registration.json +++ b/src/cfg/capif_registration.json @@ -1,7 +1,7 @@ { "folder_to_store_certificates": "/evolved5g/cfg/capif_onboarding", - "capif_host": "capifcore", - "capif_http_port": 8080, + "capif_host": "capif.apps.ocp-epg.hi.inet", + "capif_http_port": 80, "capif_https_port": 443, "capif_netapp_username": "test_netapp_54", "capif_netapp_password": "test_netapp_password", From 8065346aaf2365041e689a2733d38966cb765b65 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Fri, 2 Dec 2022 17:41:27 +0100 Subject: [PATCH 27/46] Expose capif host and ports as environmental variables + fix wrong endpoint route --- Dockerfile | 5 ++++- entrypoint/dev_entrypoint.sh | 5 +++++ src/cfg/capif_registration.json | 6 +++--- src/evolvedApi/evolvedApi/netapp_utils.py | 12 ++++++------ 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index a8d5c3b..3b41753 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,8 +75,11 @@ COPY entrypoint/dev_entrypoint.sh /dev_entrypoint.sh # Local configuration, to be set according to the NEF location ENV NEF_IP="host.docker.internal" ENV NEF_PORT="8888" -ENV NETAPP_IP="172.18.0.21" +ENV NETAPP_IP="172.18.0.20" ENV NETAPP_PORT="8000" +ENV CAPIF_HOST="capifcore" +ENV CAPIF_HTTP_PORT="8080" +ENV CAPIF_HTTPS_PORT="443" ENV UE_EXTERNAL_ID="10003@domain.com" ENTRYPOINT ["/dev_entrypoint.sh"] diff --git a/entrypoint/dev_entrypoint.sh b/entrypoint/dev_entrypoint.sh index 8edf5bb..49d39cc 100755 --- a/entrypoint/dev_entrypoint.sh +++ b/entrypoint/dev_entrypoint.sh @@ -6,6 +6,11 @@ source "/evolved5g/install/setup.bash" echo "172.17.0.1 capifcore" >> /etc/hosts +sed "s/capifcore/$CAPIF_HOST/" /evolved5g/cfg/capif_registration.json +sed "s/8080/$CAPIF_HTTP_PORT/" /evolved5g/cfg/capif_registration.json +sed "s/443/$CAPIF_HTTPS_PORT/" /evolved5g/cfg/capif_registration.json + + evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" exec ros2 run localization_netapp cellid_node diff --git a/src/cfg/capif_registration.json b/src/cfg/capif_registration.json index 21f8854..f0a20e7 100644 --- a/src/cfg/capif_registration.json +++ b/src/cfg/capif_registration.json @@ -1,9 +1,9 @@ { "folder_to_store_certificates": "/evolved5g/cfg/capif_onboarding", - "capif_host": "capif.apps.ocp-epg.hi.inet", - "capif_http_port": 80, + "capif_host": "capifcore", + "capif_http_port": 8080, "capif_https_port": 443, - "capif_netapp_username": "test_netapp_54", + "capif_netapp_username": "test_netapp_18", "capif_netapp_password": "test_netapp_password", "capif_callback_url": "http://192.168.1.13:5000", "description": ",test_app_description", diff --git a/src/evolvedApi/evolvedApi/netapp_utils.py b/src/evolvedApi/evolvedApi/netapp_utils.py index 5cb2662..e1d0008 100644 --- a/src/evolvedApi/evolvedApi/netapp_utils.py +++ b/src/evolvedApi/evolvedApi/netapp_utils.py @@ -22,26 +22,26 @@ def get_configs(self): self.nef_ip = os.environ.get("NEF_IP") self.nef_port = os.environ.get("NEF_PORT") self.ue_external_id = os.environ.get("UE_EXTERNAL_ID") - self.netapp_host = os.environ.get("NETAPP_IP") + self.netapp_ip = os.environ.get("NETAPP_IP") self.netapp_port = os.environ.get("NETAPP_PORT") self.netapp_id = config.get("configs", "netapp_id") self.capif_callback_ip = config.get("configs", "capif_callback_ip") self.capif_callback_port = config.get("configs", "capif_callback_port") self.certificates_folder = config.get("configs", "certificates_folder") - self.capif_host = config.get("configs", "capif_host") - self.capif_https_port = config.get("configs", "capif_https_port") + self.capif_host = os.environ.get("CAPIF_HOST") + self.capif_https_port = os.environ.get("CAPIF_HTTPS_PORT") print("================================================") print("Starting NetApp with the following configuration:") print("================================================") print("NEF_IP:", self.nef_ip) print("UE_EXTERNAL_ID:", self.ue_external_id) - print("NETAPP_IP:", self.netapp_host) + print("NETAPP_IP:", self.netapp_ip) print("NETAPP_PORT:", self.netapp_port) print("NETAPP_ID:", self.netapp_id) print("CERTIFICATES_FOLDER:", self.certificates_folder) print("CAPIF_HOST:", self.capif_host) - print("CAPIF_PORT:", self.capif_https_port) + print("CAPIF_HTTPS_PORT:", self.capif_https_port) print("================================================") def get_token(self) -> Token: @@ -69,7 +69,7 @@ def get_host_of_the_nef_emulator(self) -> str: return "http://{}:{}".format(self.nef_ip, self.nef_port) def get_host_of_the_netapp(self) -> str: - return "http://{}:{}/nefcallbacks".format(self.netapp_id, self.netapp_port) + return "http://{}:{}/monitoring/callback".format(self.netapp_ip, self.netapp_port) def read_cellid() -> int: cellid_path = ( From 063432b4667aa5c3f681732521c94447656c76bf Mon Sep 17 00:00:00 2001 From: biancabnd Date: Tue, 13 Dec 2022 14:48:08 +0100 Subject: [PATCH 28/46] Adapt env variables to standard convention + other changes based on Malaga discussions --- Dockerfile | 19 +++++++++------- entrypoint/dev_entrypoint.sh | 6 ++--- pip_dependencies.txt | 2 +- src/cfg/capif_registration.json | 2 +- src/cfg/netapp.properties | 8 +++---- src/evolvedApi/evolvedApi/netapp_utils.py | 27 ++++++++++------------- 6 files changed, 31 insertions(+), 33 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3b41753..2154746 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,7 +51,8 @@ RUN apt update \ python3-dev \ python3-tk \ python3-pip \ - libyaml-cpp-dev + libyaml-cpp-dev \ + jq COPY pip_dependencies.txt /pip_dependencies.txt @@ -73,13 +74,15 @@ FROM build_stage AS dev_stage COPY entrypoint/dev_entrypoint.sh /dev_entrypoint.sh # Local configuration, to be set according to the NEF location -ENV NEF_IP="host.docker.internal" -ENV NEF_PORT="8888" -ENV NETAPP_IP="172.18.0.20" -ENV NETAPP_PORT="8000" -ENV CAPIF_HOST="capifcore" -ENV CAPIF_HTTP_PORT="8080" -ENV CAPIF_HTTPS_PORT="443" +ENV NEF_ADDRESS="host.docker.internal:8888" +ENV NEF_USER="admin@my-email.com" +ENV NEF_PASSWORD="pass" +ENV VAPP_ADDRESS= +ENV PATH_TO_CERTS="/evolved5g/cfg/capif_onboarding" +ENV CAPIF_HOSTNAME="capifcore" +ENV CAPIF_PORT_HTTP="8080" +ENV CAPIF_PORT_HTTPS="443" +ENV CALLBACK_ADDRESS="172.18.0.20:8000" ENV UE_EXTERNAL_ID="10003@domain.com" ENTRYPOINT ["/dev_entrypoint.sh"] diff --git a/entrypoint/dev_entrypoint.sh b/entrypoint/dev_entrypoint.sh index 49d39cc..d241fef 100755 --- a/entrypoint/dev_entrypoint.sh +++ b/entrypoint/dev_entrypoint.sh @@ -6,9 +6,9 @@ source "/evolved5g/install/setup.bash" echo "172.17.0.1 capifcore" >> /etc/hosts -sed "s/capifcore/$CAPIF_HOST/" /evolved5g/cfg/capif_registration.json -sed "s/8080/$CAPIF_HTTP_PORT/" /evolved5g/cfg/capif_registration.json -sed "s/443/$CAPIF_HTTPS_PORT/" /evolved5g/cfg/capif_registration.json +jq -r .capif_host=\"$CAPIF_HOSTNAME\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json +jq -r .capif_http_port=\"$CAPIF_PORT_HTTP\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json +jq -r .capif_https_port=\"$CAPIF_PORT_HTTPS\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" diff --git a/pip_dependencies.txt b/pip_dependencies.txt index 3515f59..abb45fb 100644 --- a/pip_dependencies.txt +++ b/pip_dependencies.txt @@ -1,4 +1,4 @@ -evolved5g==0.8.7 +evolved5g uvloop==0.17.0 httptools==0.5.0 uvicorn==0.19.0 diff --git a/src/cfg/capif_registration.json b/src/cfg/capif_registration.json index f0a20e7..af89d21 100644 --- a/src/cfg/capif_registration.json +++ b/src/cfg/capif_registration.json @@ -3,7 +3,7 @@ "capif_host": "capifcore", "capif_http_port": 8080, "capif_https_port": 443, - "capif_netapp_username": "test_netapp_18", + "capif_netapp_username": "test_netapp_1", "capif_netapp_password": "test_netapp_password", "capif_callback_url": "http://192.168.1.13:5000", "description": ",test_app_description", diff --git a/src/cfg/netapp.properties b/src/cfg/netapp.properties index 4ef256f..5606f5e 100644 --- a/src/cfg/netapp.properties +++ b/src/cfg/netapp.properties @@ -3,11 +3,9 @@ capif_callback_ip = host.docker.internal capif_callback_port = 8086 nef_user = admin@my-email.com nef_pass = pass -nef_ip = host.docker.internal -nef_port = 8888 -nef_callback_ip = 172.18.0.21 -nef_callback_port = 8085 +nef_address = host.docker.internal:8888 +callback_address = 172.18.0.21:8085 certificates_folder = /evolved5g/cfg/capif_onboarding capif_host = capifcore capif_https_port = 443 -netapp_id = LocalizationNetapp \ No newline at end of file +netapp_id = LocalizationNetapp diff --git a/src/evolvedApi/evolvedApi/netapp_utils.py b/src/evolvedApi/evolvedApi/netapp_utils.py index e1d0008..ba30e27 100644 --- a/src/evolvedApi/evolvedApi/netapp_utils.py +++ b/src/evolvedApi/evolvedApi/netapp_utils.py @@ -17,27 +17,24 @@ def get_configs(self): config.read(configFilePath) except Exception as e : print(str(e)) - self.nef_username = config.get("configs", "nef_user") - self.nef_pass = config.get("configs", "nef_pass") - self.nef_ip = os.environ.get("NEF_IP") - self.nef_port = os.environ.get("NEF_PORT") + self.nef_username = os.environ.get("NEF_USER") + self.nef_pass = os.environ.get("NEF_PASSWORD") + self.nef_address = os.environ.get("NEF_ADDRESS") self.ue_external_id = os.environ.get("UE_EXTERNAL_ID") - self.netapp_ip = os.environ.get("NETAPP_IP") - self.netapp_port = os.environ.get("NETAPP_PORT") + self.callback_adddress = os.environ.get("CALLBACK_ADDRESS") self.netapp_id = config.get("configs", "netapp_id") self.capif_callback_ip = config.get("configs", "capif_callback_ip") self.capif_callback_port = config.get("configs", "capif_callback_port") - self.certificates_folder = config.get("configs", "certificates_folder") - self.capif_host = os.environ.get("CAPIF_HOST") - self.capif_https_port = os.environ.get("CAPIF_HTTPS_PORT") + self.certificates_folder = os.environ.get("PATH_TO_CERTS") + self.capif_host = os.environ.get("CAPIF_HOSTNAME") + self.capif_https_port = os.environ.get("CAPIF_PORT_HTTPS") print("================================================") print("Starting NetApp with the following configuration:") print("================================================") - print("NEF_IP:", self.nef_ip) + print("NEF_ADDRESS:", self.nef_address) print("UE_EXTERNAL_ID:", self.ue_external_id) - print("NETAPP_IP:", self.netapp_ip) - print("NETAPP_PORT:", self.netapp_port) + print("CALLBACK_ADDRESS:", self.callback_adddress) print("NETAPP_ID:", self.netapp_id) print("CERTIFICATES_FOLDER:", self.certificates_folder) print("CAPIF_HOST:", self.capif_host) @@ -66,14 +63,14 @@ def get_api_client(token,self) -> swagger_client.ApiClient: def get_host_of_the_nef_emulator(self) -> str: - return "http://{}:{}".format(self.nef_ip, self.nef_port) + return "http://{}".format(self.nef_address) def get_host_of_the_netapp(self) -> str: - return "http://{}:{}/monitoring/callback".format(self.netapp_ip, self.netapp_port) + return "http://{}/monitoring/callback".format(self.callback_adddress) def read_cellid() -> int: cellid_path = ( - "http://localhost:" + os.environ.get("NETAPP_PORT") + "/cellid" + "http://localhost:8000" + "/cellid" ) response = requests.get(cellid_path, headers=None, data=None) From dc5b3048dd78d138cf7305f931e4f32d81f5b042 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 14 Dec 2022 15:52:04 +0100 Subject: [PATCH 29/46] Create capif_onboarding folder in dockerfile --- Dockerfile | 2 ++ src/cfg/capif_registration.json | 17 ----------------- src/cfg/netapp.properties | 11 ----------- 3 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 src/cfg/capif_registration.json delete mode 100644 src/cfg/netapp.properties diff --git a/Dockerfile b/Dockerfile index 2154746..e78770b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,8 @@ RUN . /opt/ros/foxy/setup.sh \ xargs rosdep resolve --rosdistro foxy | \ awk '/#apt/{getline; print}' > /rosdep_requirements.txt +WORKDIR /evolved5g/cfg +RUN mkdir capif_onboarding ########## BASE STAGE ########## FROM frozen_stage AS base_stage diff --git a/src/cfg/capif_registration.json b/src/cfg/capif_registration.json deleted file mode 100644 index af89d21..0000000 --- a/src/cfg/capif_registration.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "folder_to_store_certificates": "/evolved5g/cfg/capif_onboarding", - "capif_host": "capifcore", - "capif_http_port": 8080, - "capif_https_port": 443, - "capif_netapp_username": "test_netapp_1", - "capif_netapp_password": "test_netapp_password", - "capif_callback_url": "http://192.168.1.13:5000", - "description": ",test_app_description", - "csr_common_name": "test_app_common_name", - "csr_organizational_unit": "test_app_ou", - "csr_organization": "test_app_o", - "crs_locality": "Madrid", - "csr_state_or_province_name": "Madrid", - "csr_country_name": "ES", - "csr_email_address": "test@example.com" -} \ No newline at end of file diff --git a/src/cfg/netapp.properties b/src/cfg/netapp.properties deleted file mode 100644 index 5606f5e..0000000 --- a/src/cfg/netapp.properties +++ /dev/null @@ -1,11 +0,0 @@ -[configs] -capif_callback_ip = host.docker.internal -capif_callback_port = 8086 -nef_user = admin@my-email.com -nef_pass = pass -nef_address = host.docker.internal:8888 -callback_address = 172.18.0.21:8085 -certificates_folder = /evolved5g/cfg/capif_onboarding -capif_host = capifcore -capif_https_port = 443 -netapp_id = LocalizationNetapp From fd2a108841657667a03132a0b5d27586392e08a3 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 14 Dec 2022 16:57:19 +0100 Subject: [PATCH 30/46] Create cfg folder in dockerfile --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e78770b..3e81c90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,6 @@ RUN apt-get update && apt-get install -q -y \ && rosdep update \ && rm -rf /var/lib/apt/lists/* -COPY src/cfg /evolved5g/cfg COPY src/localization_netapp /evolved5g/src/localization_netapp COPY src/evolvedApi /evolved5g/src/evolvedApi @@ -20,8 +19,8 @@ RUN . /opt/ros/foxy/setup.sh \ xargs rosdep resolve --rosdistro foxy | \ awk '/#apt/{getline; print}' > /rosdep_requirements.txt -WORKDIR /evolved5g/cfg -RUN mkdir capif_onboarding +WORKDIR /evolved5g +RUN mkdir -p cfg/capif_onboarding ########## BASE STAGE ########## FROM frozen_stage AS base_stage From 080358add2bbf44c4424831071be7becc53a1800 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 14 Dec 2022 17:35:20 +0100 Subject: [PATCH 31/46] Fix error of removing capif_registration.json file --- Dockerfile | 5 +++-- src/cfg/capif_registration.json | 17 +++++++++++++++++ src/cfg/netapp.properties | 11 +++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/cfg/capif_registration.json create mode 100644 src/cfg/netapp.properties diff --git a/Dockerfile b/Dockerfile index 3e81c90..e78770b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ RUN apt-get update && apt-get install -q -y \ && rosdep update \ && rm -rf /var/lib/apt/lists/* +COPY src/cfg /evolved5g/cfg COPY src/localization_netapp /evolved5g/src/localization_netapp COPY src/evolvedApi /evolved5g/src/evolvedApi @@ -19,8 +20,8 @@ RUN . /opt/ros/foxy/setup.sh \ xargs rosdep resolve --rosdistro foxy | \ awk '/#apt/{getline; print}' > /rosdep_requirements.txt -WORKDIR /evolved5g -RUN mkdir -p cfg/capif_onboarding +WORKDIR /evolved5g/cfg +RUN mkdir capif_onboarding ########## BASE STAGE ########## FROM frozen_stage AS base_stage diff --git a/src/cfg/capif_registration.json b/src/cfg/capif_registration.json new file mode 100644 index 0000000..911ad44 --- /dev/null +++ b/src/cfg/capif_registration.json @@ -0,0 +1,17 @@ +{ + "folder_to_store_certificates": "/evolved5g/cfg/capif_onboarding", + "capif_host": "capifcore", + "capif_http_port": 8080, + "capif_https_port": 443, + "capif_netapp_username": "test_netapp_2", + "capif_netapp_password": "test_netapp_password", + "capif_callback_url": "http://192.168.1.13:5000", + "description": ",test_app_description", + "csr_common_name": "test_app_common_name", + "csr_organizational_unit": "test_app_ou", + "csr_organization": "test_app_o", + "crs_locality": "Madrid", + "csr_state_or_province_name": "Madrid", + "csr_country_name": "ES", + "csr_email_address": "test@example.com" +} \ No newline at end of file diff --git a/src/cfg/netapp.properties b/src/cfg/netapp.properties new file mode 100644 index 0000000..a1b6f02 --- /dev/null +++ b/src/cfg/netapp.properties @@ -0,0 +1,11 @@ +[configs] +capif_callback_ip = host.docker.internal +capif_callback_port = 8086 +nef_user = admin@my-email.com +nef_pass = pass +nef_address = host.docker.internal:8888 +callback_address = 172.18.0.21:8085 +certificates_folder = /evolved5g/cfg/capif_onboarding +capif_host = capifcore +capif_https_port = 443 +netapp_id = LocalizationNetapp \ No newline at end of file From 9b963026424d6b90b5cd32dae6aaac9c4bdbe8d4 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Fri, 3 Feb 2023 10:43:04 +0100 Subject: [PATCH 32/46] Fix typo + add more informative name on capif_registration --- src/cfg/capif_registration.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cfg/capif_registration.json b/src/cfg/capif_registration.json index 911ad44..97b2106 100644 --- a/src/cfg/capif_registration.json +++ b/src/cfg/capif_registration.json @@ -3,11 +3,11 @@ "capif_host": "capifcore", "capif_http_port": 8080, "capif_https_port": 443, - "capif_netapp_username": "test_netapp_2", + "capif_netapp_username": "user01", "capif_netapp_password": "test_netapp_password", "capif_callback_url": "http://192.168.1.13:5000", "description": ",test_app_description", - "csr_common_name": "test_app_common_name", + "csr_common_name": "uml_localization_napp", "csr_organizational_unit": "test_app_ou", "csr_organization": "test_app_o", "crs_locality": "Madrid", From 51c110c552541f864b031c9483545bd697d7bb88 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Fri, 3 Feb 2023 10:43:51 +0100 Subject: [PATCH 33/46] Fix typo --- src/evolvedApi/evolvedApi/netapp_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/evolvedApi/evolvedApi/netapp_utils.py b/src/evolvedApi/evolvedApi/netapp_utils.py index ba30e27..f594c62 100644 --- a/src/evolvedApi/evolvedApi/netapp_utils.py +++ b/src/evolvedApi/evolvedApi/netapp_utils.py @@ -21,7 +21,7 @@ def get_configs(self): self.nef_pass = os.environ.get("NEF_PASSWORD") self.nef_address = os.environ.get("NEF_ADDRESS") self.ue_external_id = os.environ.get("UE_EXTERNAL_ID") - self.callback_adddress = os.environ.get("CALLBACK_ADDRESS") + self.callback_address = os.environ.get("CALLBACK_ADDRESS") self.netapp_id = config.get("configs", "netapp_id") self.capif_callback_ip = config.get("configs", "capif_callback_ip") self.capif_callback_port = config.get("configs", "capif_callback_port") @@ -34,7 +34,7 @@ def get_configs(self): print("================================================") print("NEF_ADDRESS:", self.nef_address) print("UE_EXTERNAL_ID:", self.ue_external_id) - print("CALLBACK_ADDRESS:", self.callback_adddress) + print("CALLBACK_ADDRESS:", self.callback_address) print("NETAPP_ID:", self.netapp_id) print("CERTIFICATES_FOLDER:", self.certificates_folder) print("CAPIF_HOST:", self.capif_host) @@ -66,7 +66,7 @@ def get_host_of_the_nef_emulator(self) -> str: return "http://{}".format(self.nef_address) def get_host_of_the_netapp(self) -> str: - return "http://{}/monitoring/callback".format(self.callback_adddress) + return "http://{}/monitoring/callback".format(self.callback_address) def read_cellid() -> int: cellid_path = ( From 44909ef090e76cc6e707e8d8a977337c57c98972 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Tue, 14 Mar 2023 15:24:49 +0100 Subject: [PATCH 34/46] Change ports and adapt network app to match newer versions --- Dockerfile | 5 +++-- entrypoint/dev_entrypoint.sh | 5 ++++- src/cfg/netapp.properties | 2 +- src/evolvedApi/evolvedApi/netapp_utils.py | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e78770b..db7b789 100644 --- a/Dockerfile +++ b/Dockerfile @@ -76,7 +76,7 @@ FROM build_stage AS dev_stage COPY entrypoint/dev_entrypoint.sh /dev_entrypoint.sh # Local configuration, to be set according to the NEF location -ENV NEF_ADDRESS="host.docker.internal:8888" +ENV NEF_ADDRESS="host.docker.internal:4443" ENV NEF_USER="admin@my-email.com" ENV NEF_PASSWORD="pass" ENV VAPP_ADDRESS= @@ -84,8 +84,9 @@ ENV PATH_TO_CERTS="/evolved5g/cfg/capif_onboarding" ENV CAPIF_HOSTNAME="capifcore" ENV CAPIF_PORT_HTTP="8080" ENV CAPIF_PORT_HTTPS="443" -ENV CALLBACK_ADDRESS="172.18.0.20:8000" +ENV CALLBACK_ADDRESS="localization:8000" ENV UE_EXTERNAL_ID="10003@domain.com" +ENV CAPIF_USERNAME="user300" ENTRYPOINT ["/dev_entrypoint.sh"] CMD tail -f /dev/null diff --git a/entrypoint/dev_entrypoint.sh b/entrypoint/dev_entrypoint.sh index d241fef..f1dfbe5 100755 --- a/entrypoint/dev_entrypoint.sh +++ b/entrypoint/dev_entrypoint.sh @@ -4,12 +4,15 @@ set -e source "/opt/ros/foxy/setup.bash" source "/evolved5g/install/setup.bash" +#export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp +#export CYCLONEDDS_URI=file:///umd2_ws/install/umd_utils/share/umd_utils/cfg/$NETWORK.xml + echo "172.17.0.1 capifcore" >> /etc/hosts jq -r .capif_host=\"$CAPIF_HOSTNAME\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json jq -r .capif_http_port=\"$CAPIF_PORT_HTTP\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json jq -r .capif_https_port=\"$CAPIF_PORT_HTTPS\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json - +jq -r .capif_netapp_username=\"$CAPIF_USERNAME\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" diff --git a/src/cfg/netapp.properties b/src/cfg/netapp.properties index a1b6f02..4ffb86c 100644 --- a/src/cfg/netapp.properties +++ b/src/cfg/netapp.properties @@ -3,7 +3,7 @@ capif_callback_ip = host.docker.internal capif_callback_port = 8086 nef_user = admin@my-email.com nef_pass = pass -nef_address = host.docker.internal:8888 +nef_address = http://host.docker.internal:4443 callback_address = 172.18.0.21:8085 certificates_folder = /evolved5g/cfg/capif_onboarding capif_host = capifcore diff --git a/src/evolvedApi/evolvedApi/netapp_utils.py b/src/evolvedApi/evolvedApi/netapp_utils.py index f594c62..f377b98 100644 --- a/src/evolvedApi/evolvedApi/netapp_utils.py +++ b/src/evolvedApi/evolvedApi/netapp_utils.py @@ -44,6 +44,7 @@ def get_configs(self): def get_token(self) -> Token: configuration = swagger_client.Configuration() configuration.host = self.get_host_of_the_nef_emulator() + configuration.verify_ssl = False api_client = swagger_client.ApiClient(configuration=configuration) api_client.select_header_content_type(["application/x-www-form-urlencoded"]) api = LoginApi(api_client) @@ -63,7 +64,7 @@ def get_api_client(token,self) -> swagger_client.ApiClient: def get_host_of_the_nef_emulator(self) -> str: - return "http://{}".format(self.nef_address) + return "https://{}".format(self.nef_address) def get_host_of_the_netapp(self) -> str: return "http://{}/monitoring/callback".format(self.callback_address) From 2b0af2c4364e4ae2b84dcf35025261c04ac13545 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Tue, 16 May 2023 11:29:14 +0200 Subject: [PATCH 35/46] Add multiple users to the localization subscription --- Dockerfile | 3 +- src/evolvedApi/evolvedApi/netapp_utils.py | 31 +++++---- src/evolvedApi/evolvedApi/webserver.py | 47 +++++++++---- .../localization_netapp/cellid_node.py | 68 +++++++++++++++---- 4 files changed, 107 insertions(+), 42 deletions(-) diff --git a/Dockerfile b/Dockerfile index db7b789..0b98c12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -85,7 +85,8 @@ ENV CAPIF_HOSTNAME="capifcore" ENV CAPIF_PORT_HTTP="8080" ENV CAPIF_PORT_HTTPS="443" ENV CALLBACK_ADDRESS="localization:8000" -ENV UE_EXTERNAL_ID="10003@domain.com" +ENV UE_EXTERNAL_ID_1="10003@domain.com" +ENV UE_EXTERNAL_ID_2="10002@domain.com" ENV CAPIF_USERNAME="user300" ENTRYPOINT ["/dev_entrypoint.sh"] diff --git a/src/evolvedApi/evolvedApi/netapp_utils.py b/src/evolvedApi/evolvedApi/netapp_utils.py index f377b98..d8531bd 100644 --- a/src/evolvedApi/evolvedApi/netapp_utils.py +++ b/src/evolvedApi/evolvedApi/netapp_utils.py @@ -3,24 +3,26 @@ from evolved5g.swagger_client.models import Token import requests, json import os -import configparser +import configparser import json + class Utils: def __init__(self) -> None: self.get_configs() def get_configs(self): config = configparser.RawConfigParser() - configFilePath = '/evolved5g/cfg/netapp.properties' + configFilePath = "/evolved5g/cfg/netapp.properties" try: config.read(configFilePath) - except Exception as e : + except Exception as e: print(str(e)) self.nef_username = os.environ.get("NEF_USER") - self.nef_pass = os.environ.get("NEF_PASSWORD") + self.nef_pass = os.environ.get("NEF_PASSWORD") self.nef_address = os.environ.get("NEF_ADDRESS") - self.ue_external_id = os.environ.get("UE_EXTERNAL_ID") + self.ue_external_id_1 = os.environ.get("UE_EXTERNAL_ID_1") + self.ue_external_id_2 = os.environ.get("UE_EXTERNAL_ID_2") self.callback_address = os.environ.get("CALLBACK_ADDRESS") self.netapp_id = config.get("configs", "netapp_id") self.capif_callback_ip = config.get("configs", "capif_callback_ip") @@ -33,7 +35,8 @@ def get_configs(self): print("Starting NetApp with the following configuration:") print("================================================") print("NEF_ADDRESS:", self.nef_address) - print("UE_EXTERNAL_ID:", self.ue_external_id) + print("UE_EXTERNAL_ID_1:", self.ue_external_id_1) + print("UE_EXTERNAL_ID_2:", self.ue_external_id_2) print("CALLBACK_ADDRESS:", self.callback_address) print("NETAPP_ID:", self.netapp_id) print("CERTIFICATES_FOLDER:", self.certificates_folder) @@ -54,27 +57,29 @@ def get_token(self) -> Token: print("NEF Token: {}\n".format(token.access_token)) return token - - def get_api_client(token,self) -> swagger_client.ApiClient: + def get_api_client(token, self) -> swagger_client.ApiClient: configuration = swagger_client.Configuration() configuration.host = self.get_host_of_the_nef_emulator() configuration.access_token = token.access_token api_client = swagger_client.ApiClient(configuration=configuration) return api_client - def get_host_of_the_nef_emulator(self) -> str: return "https://{}".format(self.nef_address) def get_host_of_the_netapp(self) -> str: return "http://{}/monitoring/callback".format(self.callback_address) -def read_cellid() -> int: - cellid_path = ( - "http://localhost:8000" + "/cellid" - ) + +def read_cellid_user_1() -> int: + cellid_path = "http://localhost:8000" + "/cellid_user_1" response = requests.get(cellid_path, headers=None, data=None) return response.json() +def read_cellid_user_2() -> int: + cellid_path = "http://localhost:8000" + "/cellid_user_2" + response = requests.get(cellid_path, headers=None, data=None) + + return response.json() diff --git a/src/evolvedApi/evolvedApi/webserver.py b/src/evolvedApi/evolvedApi/webserver.py index 37d624e..99002f3 100644 --- a/src/evolvedApi/evolvedApi/webserver.py +++ b/src/evolvedApi/evolvedApi/webserver.py @@ -4,6 +4,7 @@ from enum import Enum from fastapi_utils.cbv import cbv from fastapi_utils.inferring_router import InferringRouter +import evolvedApi.netapp_utils as netapp_utils class LocationInfo(BaseModel): @@ -17,11 +18,15 @@ class MonitoringType(str, Enum): class MonitoringEventReport(BaseModel): - externalId: Optional[str] = Field("123456789@domain.com", - description="Globally unique identifier containing a Domain Identifier and a Local Identifier. \@\") + externalId: Optional[str] = Field( + "123456789@domain.com", + description="Globally unique identifier containing a Domain Identifier and a Local Identifier. \@\", + ) monitoringType: MonitoringType locationInfo: Optional[LocationInfo] = None - ipv4Addr: Optional[IPvAnyAddress] = Field(None, description="String identifying an Ipv4 address") + ipv4Addr: Optional[IPvAnyAddress] = Field( + None, description="String identifying an Ipv4 address" + ) class MonitoringNotification(MonitoringEventReport): @@ -33,23 +38,39 @@ class MonitoringNotification(MonitoringEventReport): app = FastAPI() netapp_router = InferringRouter() # Step 1: Create a router -cellid = 1 + +utils = netapp_utils.Utils() +cellid_user_1 = 1 +cellid_user_2 = 1 + @cbv(netapp_router) class netapp_endpoint: - @netapp_router.post("/monitoring/callback") def fill_cellid(self, item: MonitoringNotification, request: Request): - global cellid + global cellid_user_1, cellid_user_2 print("[webserver] Received cell_id change") + print(item.externalId) print(item.locationInfo.cellId) - cellid = int(item.locationInfo.cellId[-1]) - return {'ack': 'TRUE'} - - @netapp_router.get("/cellid") - def get_cellid(self,request: Request): - global cellid - return cellid + if item.externalId == utils.ue_external_id_1: + print("[webserver] Received cell_id change for user 1") + print(item.locationInfo.cellId) + cellid_user_1 = int(item.locationInfo.cellId[-1]) + if item.externalId == utils.ue_external_id_2: + print("[webserver] Received cell_id change for user 2") + print(item.locationInfo.cellId) + cellid_user_2 = int(item.locationInfo.cellId[-1]) + return {"ack": "TRUE"} + + @netapp_router.get("/cellid_user_1") + def get_cellid_user_1(self, request: Request): + global cellid_user_1 + return cellid_user_1 + + @netapp_router.get("/cellid_user_2") + def get_cellid_user_2(self, request: Request): + global cellid_user_2 + return cellid_user_2 app.include_router(netapp_router) diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index 496dbdd..d529c44 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -19,38 +19,76 @@ def __init__(self): utils = netapp_utils.Utils() # Create ROS publisher - publisher_topic_name = "cell_id_" + utils.ue_external_id[0:5] - self.publisher_ = self.create_publisher(Int32, publisher_topic_name, 10) + publisher_topic_name_user_1 = "cell_id_" + utils.ue_external_id_1[0:5] + publisher_topic_name_user_2 = "cell_id_" + utils.ue_external_id_2[0:5] + + self.publisher_1_ = self.create_publisher( + Int32, publisher_topic_name_user_1, 10 + ) + self.publisher_2_ = self.create_publisher( + Int32, publisher_topic_name_user_2, 10 + ) self.timer_period = 0.5 # seconds self.timer = self.create_timer(self.timer_period, self.timer_callback) + # Create a subscription, that will notify us 1000 times, for the next 1 day starting from now expire_time = ( datetime.datetime.utcnow() + datetime.timedelta(days=1) ).isoformat() + "Z" - + host = utils.get_host_of_the_nef_emulator() token = utils.get_token() - self.location_subscriber = LocationSubscriber(host, token.access_token, utils.certificates_folder, utils.capif_host, utils.capif_https_port) + self.location_subscriber = LocationSubscriber( + host, + token.access_token, + utils.certificates_folder, + utils.capif_host, + utils.capif_https_port, + ) self.get_logger().info("Authentication Done") - self.subscription = self.location_subscriber.create_subscription( + # Create subscription for first external id + self.subscription_1 = self.location_subscriber.create_subscription( netapp_id=utils.netapp_id, - external_id=utils.ue_external_id, + external_id=utils.ue_external_id_1, notification_destination=utils.get_host_of_the_netapp(), maximum_number_of_reports=1000, monitor_expire_time=expire_time, ) - self.get_logger().info("Successfully subscribed to location monitoring") - print(self.subscription) + self.get_logger().info( + "Successfully subscribed to location monitoring for user 1" + ) + print(self.subscription_1) + + # Create subscription for second external id + self.subscription_2 = self.location_subscriber.create_subscription( + netapp_id=utils.netapp_id, + external_id=utils.ue_external_id_2, + notification_destination=utils.get_host_of_the_netapp(), + maximum_number_of_reports=1000, + monitor_expire_time=expire_time, + ) + self.get_logger().info( + "Successfully subscribed to location monitoring for user 2" + ) + print(self.subscription_2) def destroy_node(self): - id = self.subscription.link.split("/")[-1] - self.location_subscriber.delete_subscription(self.netapp_id, id) + id_1 = self.subscription_1.link.split("/")[-1] + id_2 = self.subscription_2.link.split("/")[-1] + self.location_subscriber.delete_subscription(self.netapp_id, id_1) + self.location_subscriber.delete_subscription(self.netapp_id, id_2) return super().destroy_node() def timer_callback(self): - msg = Int32() - cell_id = netapp_utils.read_cellid() - msg.data = cell_id - self.publisher_.publish(msg) - self.get_logger().info('Publishing: CellID "%s"' % msg.data) + msg_user_1 = Int32() + cell_id_user_1 = netapp_utils.read_cellid_user_1() + msg_user_1.data = cell_id_user_1 + self.publisher_1_.publish(msg_user_1) + self.get_logger().debug('Publishing User 1: CellID "%s"' % msg_user_1.data) + + msg_user_2 = Int32() + cell_id_user_2 = netapp_utils.read_cellid_user_2() + msg_user_2.data = cell_id_user_2 + self.publisher_2_.publish(msg_user_2) + self.get_logger().debug('Publishing User 2: CellID "%s"' % msg_user_2.data) From da8917656707407d6e190ca91aae89a4ad43476d Mon Sep 17 00:00:00 2001 From: biancabnd Date: Tue, 16 May 2023 14:42:44 +0200 Subject: [PATCH 36/46] Separate ROS specific entrypoints + add ROS specific env variables + network file --- Dockerfile | 7 +++-- .../{dev_entrypoint.sh => entrypoint.sh} | 5 +--- entrypoint/ros_entrypoint.sh | 8 +++++ src/cfg/evolved5G_dds.xml | 30 +++++++++++++++++++ src/cfg/local.xml | 14 +++++++++ 5 files changed, 58 insertions(+), 6 deletions(-) rename entrypoint/{dev_entrypoint.sh => entrypoint.sh} (85%) create mode 100755 entrypoint/ros_entrypoint.sh create mode 100644 src/cfg/evolved5G_dds.xml create mode 100644 src/cfg/local.xml diff --git a/Dockerfile b/Dockerfile index 0b98c12..6a3489a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -73,7 +73,8 @@ RUN . /opt/ros/foxy/setup.sh \ ########## DEV STAGE ########## FROM build_stage AS dev_stage -COPY entrypoint/dev_entrypoint.sh /dev_entrypoint.sh +COPY entrypoint/entrypoint.sh /entrypoint.sh +COPY entrypoint/ros_entrypoint.sh /ros_entrypoint.sh # Local configuration, to be set according to the NEF location ENV NEF_ADDRESS="host.docker.internal:4443" @@ -88,8 +89,10 @@ ENV CALLBACK_ADDRESS="localization:8000" ENV UE_EXTERNAL_ID_1="10003@domain.com" ENV UE_EXTERNAL_ID_2="10002@domain.com" ENV CAPIF_USERNAME="user300" +ENV NETWORK="local" +ENV ROS_DOMAIN_ID="1" -ENTRYPOINT ["/dev_entrypoint.sh"] +ENTRYPOINT ["/entrypoint.sh"] CMD tail -f /dev/null ########## PRODUCTION BUILD STAGE ########## diff --git a/entrypoint/dev_entrypoint.sh b/entrypoint/entrypoint.sh similarity index 85% rename from entrypoint/dev_entrypoint.sh rename to entrypoint/entrypoint.sh index f1dfbe5..7aeba78 100755 --- a/entrypoint/dev_entrypoint.sh +++ b/entrypoint/entrypoint.sh @@ -1,12 +1,9 @@ #!/bin/bash set -e -source "/opt/ros/foxy/setup.bash" +source "/ros_entrypoint.sh" source "/evolved5g/install/setup.bash" -#export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp -#export CYCLONEDDS_URI=file:///umd2_ws/install/umd_utils/share/umd_utils/cfg/$NETWORK.xml - echo "172.17.0.1 capifcore" >> /etc/hosts jq -r .capif_host=\"$CAPIF_HOSTNAME\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json diff --git a/entrypoint/ros_entrypoint.sh b/entrypoint/ros_entrypoint.sh new file mode 100755 index 0000000..f05314a --- /dev/null +++ b/entrypoint/ros_entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +source "/opt/ros/foxy/setup.bash" + +export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp +export CYCLONEDDS_URI=file:///evolved5g/cfg/$NETWORK.xml + diff --git a/src/cfg/evolved5G_dds.xml b/src/cfg/evolved5G_dds.xml new file mode 100644 index 0000000..b8c8e83 --- /dev/null +++ b/src/cfg/evolved5G_dds.xml @@ -0,0 +1,30 @@ + + + + + auto + false + 1400B + udp + + + + + + + auto + 5 + + + + 500kB + + + + config + stdout + + + diff --git a/src/cfg/local.xml b/src/cfg/local.xml new file mode 100644 index 0000000..f989327 --- /dev/null +++ b/src/cfg/local.xml @@ -0,0 +1,14 @@ + + + + + + + auto + + + 30 + + + + \ No newline at end of file From 30f6222b3c2b7d1c7cc022c41adf4bc270457661 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Thu, 15 Jun 2023 16:39:24 +0200 Subject: [PATCH 37/46] Adapt network app for new sdk changes v1.1.0 --- Dockerfile | 1 + entrypoint/entrypoint.sh | 2 +- src/localization_netapp/localization_netapp/cellid_node.py | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a3489a..4280844 100644 --- a/Dockerfile +++ b/Dockerfile @@ -91,6 +91,7 @@ ENV UE_EXTERNAL_ID_2="10002@domain.com" ENV CAPIF_USERNAME="user300" ENV NETWORK="local" ENV ROS_DOMAIN_ID="1" +ENV ENVIRONMENT="development" ENTRYPOINT ["/entrypoint.sh"] CMD tail -f /dev/null diff --git a/entrypoint/entrypoint.sh b/entrypoint/entrypoint.sh index 7aeba78..744916c 100755 --- a/entrypoint/entrypoint.sh +++ b/entrypoint/entrypoint.sh @@ -11,7 +11,7 @@ jq -r .capif_http_port=\"$CAPIF_PORT_HTTP\" /evolved5g/cfg/capif_registration.js jq -r .capif_https_port=\"$CAPIF_PORT_HTTPS\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json jq -r .capif_netapp_username=\"$CAPIF_USERNAME\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json -evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" +evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" --environment="development" exec ros2 run localization_netapp cellid_node diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index d529c44..8485882 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -40,7 +40,6 @@ def __init__(self): token = utils.get_token() self.location_subscriber = LocationSubscriber( host, - token.access_token, utils.certificates_folder, utils.capif_host, utils.capif_https_port, From 86111f00fd287e6462321d786c14e7544fd5a992 Mon Sep 17 00:00:00 2001 From: andresanaya21 Date: Tue, 20 Jun 2023 10:20:04 +0000 Subject: [PATCH 38/46] sleep 180 --- entrypoint/entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entrypoint/entrypoint.sh b/entrypoint/entrypoint.sh index 744916c..3baf235 100755 --- a/entrypoint/entrypoint.sh +++ b/entrypoint/entrypoint.sh @@ -1,4 +1,7 @@ #!/bin/bash + +sleep 180 + set -e source "/ros_entrypoint.sh" From ede0d50b72ad10017c0035358b86ccdcbc200b47 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Tue, 20 Jun 2023 13:28:50 +0200 Subject: [PATCH 39/46] Separate neg address and port + add sleep 180 --- Dockerfile | 3 ++- src/cfg/netapp.properties | 3 ++- src/evolvedApi/evolvedApi/netapp_utils.py | 5 ++++- src/localization_netapp/localization_netapp/cellid_node.py | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4280844..9522ea4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -77,7 +77,8 @@ COPY entrypoint/entrypoint.sh /entrypoint.sh COPY entrypoint/ros_entrypoint.sh /ros_entrypoint.sh # Local configuration, to be set according to the NEF location -ENV NEF_ADDRESS="host.docker.internal:4443" +ENV NEF_ADDRESS="host.docker.internal" +ENV NEF_PORT="443" ENV NEF_USER="admin@my-email.com" ENV NEF_PASSWORD="pass" ENV VAPP_ADDRESS= diff --git a/src/cfg/netapp.properties b/src/cfg/netapp.properties index 4ffb86c..c04bc9e 100644 --- a/src/cfg/netapp.properties +++ b/src/cfg/netapp.properties @@ -3,7 +3,8 @@ capif_callback_ip = host.docker.internal capif_callback_port = 8086 nef_user = admin@my-email.com nef_pass = pass -nef_address = http://host.docker.internal:4443 +nef_address = http://host.docker.internal +nef_port = 443 callback_address = 172.18.0.21:8085 certificates_folder = /evolved5g/cfg/capif_onboarding capif_host = capifcore diff --git a/src/evolvedApi/evolvedApi/netapp_utils.py b/src/evolvedApi/evolvedApi/netapp_utils.py index d8531bd..47e598c 100644 --- a/src/evolvedApi/evolvedApi/netapp_utils.py +++ b/src/evolvedApi/evolvedApi/netapp_utils.py @@ -21,6 +21,7 @@ def get_configs(self): self.nef_username = os.environ.get("NEF_USER") self.nef_pass = os.environ.get("NEF_PASSWORD") self.nef_address = os.environ.get("NEF_ADDRESS") + self.nef_port = os.environ.get("NEF_PORT") self.ue_external_id_1 = os.environ.get("UE_EXTERNAL_ID_1") self.ue_external_id_2 = os.environ.get("UE_EXTERNAL_ID_2") self.callback_address = os.environ.get("CALLBACK_ADDRESS") @@ -35,6 +36,7 @@ def get_configs(self): print("Starting NetApp with the following configuration:") print("================================================") print("NEF_ADDRESS:", self.nef_address) + print("NEF_PORT:", self.nef_port) print("UE_EXTERNAL_ID_1:", self.ue_external_id_1) print("UE_EXTERNAL_ID_2:", self.ue_external_id_2) print("CALLBACK_ADDRESS:", self.callback_address) @@ -51,6 +53,7 @@ def get_token(self) -> Token: api_client = swagger_client.ApiClient(configuration=configuration) api_client.select_header_content_type(["application/x-www-form-urlencoded"]) api = LoginApi(api_client) + print("Trying to get NEF token on nef host:", configuration.host) token = api.login_access_token_api_v1_login_access_token_post( "", self.nef_username, self.nef_pass, "", "", "" ) @@ -65,7 +68,7 @@ def get_api_client(token, self) -> swagger_client.ApiClient: return api_client def get_host_of_the_nef_emulator(self) -> str: - return "https://{}".format(self.nef_address) + return "https://{}:{}".format(self.nef_address, self.nef_port) def get_host_of_the_netapp(self) -> str: return "http://{}/monitoring/callback".format(self.callback_address) diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index 8485882..bd38b19 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -17,6 +17,7 @@ def __init__(self): # Initialize Utils class and get configs utils = netapp_utils.Utils() + utils.get_configs() # Create ROS publisher publisher_topic_name_user_1 = "cell_id_" + utils.ue_external_id_1[0:5] From 3f2ba81bf73b5b9e8997cbf81c52c3fe8fac7053 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Thu, 22 Jun 2023 10:47:55 +0200 Subject: [PATCH 40/46] Remove peers from dds config --- Dockerfile | 2 +- src/cfg/evolved5G_dds.xml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9522ea4..bf5b8a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -78,7 +78,7 @@ COPY entrypoint/ros_entrypoint.sh /ros_entrypoint.sh # Local configuration, to be set according to the NEF location ENV NEF_ADDRESS="host.docker.internal" -ENV NEF_PORT="443" +ENV NEF_PORT="4443" ENV NEF_USER="admin@my-email.com" ENV NEF_PASSWORD="pass" ENV VAPP_ADDRESS= diff --git a/src/cfg/evolved5G_dds.xml b/src/cfg/evolved5G_dds.xml index b8c8e83..5e108b0 100644 --- a/src/cfg/evolved5G_dds.xml +++ b/src/cfg/evolved5G_dds.xml @@ -11,8 +11,6 @@ - - auto 5 From 6826e96123284d558f1260e4181bd5ec8739b814 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Thu, 22 Jun 2023 10:53:37 +0200 Subject: [PATCH 41/46] Remove sleep --- entrypoint/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint/entrypoint.sh b/entrypoint/entrypoint.sh index 3baf235..1a7952a 100755 --- a/entrypoint/entrypoint.sh +++ b/entrypoint/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/bash -sleep 180 +#sleep 180 set -e From cd4d01a2c68dcb3d9d3ef17a9ddb6d4c48508d18 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Mon, 26 Jun 2023 09:31:36 +0200 Subject: [PATCH 42/46] Modify evolved5G dds and add env variables in Dockerfile --- Dockerfile | 6 ++++++ src/cfg/evolved5G_dds.xml | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index bf5b8a1..cc0a7f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -94,6 +94,12 @@ ENV NETWORK="local" ENV ROS_DOMAIN_ID="1" ENV ENVIRONMENT="development" +# DDS Variables +ENV DDS_IFACE="auto" +ENV DDS_EXTERNAL_ADDRESS="10.11.23.49" +ENV DDS_PARTICIPANT_INDEX="auto" +ENV DDS_MAX_PARTICIPANT_INDEX="3" + ENTRYPOINT ["/entrypoint.sh"] CMD tail -f /dev/null diff --git a/src/cfg/evolved5G_dds.xml b/src/cfg/evolved5G_dds.xml index 5e108b0..9b90384 100644 --- a/src/cfg/evolved5G_dds.xml +++ b/src/cfg/evolved5G_dds.xml @@ -4,16 +4,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd"> - auto + ${DDS_IFACE} false - 1400B + 1200B udp + ${DDS_EXTERNAL_ADDRESS} - - - auto - 5 + + ${DDS_PARTICIPANT_INDEX} + ${DDS_MAX_PARTICIPANT_INDEX} From cf7a97db6ac302ee91e1805365aa83e891287c07 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Wed, 12 Jul 2023 11:55:26 +0200 Subject: [PATCH 43/46] Small change on comment info --- src/localization_netapp/localization_netapp/cellid_node.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/localization_netapp/localization_netapp/cellid_node.py b/src/localization_netapp/localization_netapp/cellid_node.py index bd38b19..40f22bf 100644 --- a/src/localization_netapp/localization_netapp/cellid_node.py +++ b/src/localization_netapp/localization_netapp/cellid_node.py @@ -56,7 +56,8 @@ def __init__(self): monitor_expire_time=expire_time, ) self.get_logger().info( - "Successfully subscribed to location monitoring for user 1" + "Successfully subscribed to location monitoring for %s" + % utils.ue_external_id_1 ) print(self.subscription_1) @@ -69,7 +70,8 @@ def __init__(self): monitor_expire_time=expire_time, ) self.get_logger().info( - "Successfully subscribed to location monitoring for user 2" + "Successfully subscribed to location monitoring for %s" + % utils.ue_external_id_2 ) print(self.subscription_2) From 534d7a4d5a6f6d3d9b9c0d53683da0f686ac3f82 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Thu, 13 Jul 2023 13:12:44 +0200 Subject: [PATCH 44/46] Add environtment param as variable --- entrypoint/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint/entrypoint.sh b/entrypoint/entrypoint.sh index 1a7952a..448a12a 100755 --- a/entrypoint/entrypoint.sh +++ b/entrypoint/entrypoint.sh @@ -14,7 +14,7 @@ jq -r .capif_http_port=\"$CAPIF_PORT_HTTP\" /evolved5g/cfg/capif_registration.js jq -r .capif_https_port=\"$CAPIF_PORT_HTTPS\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json jq -r .capif_netapp_username=\"$CAPIF_USERNAME\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json -evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" --environment="development" +evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" --environment="$ENVIRONMENT" exec ros2 run localization_netapp cellid_node From c04adbec97c4085264dfc79aef76f61cac1b162e Mon Sep 17 00:00:00 2001 From: biancabnd Date: Tue, 26 Sep 2023 11:31:45 +0200 Subject: [PATCH 45/46] Change environment mode to production --- Dockerfile | 2 +- entrypoint/entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cc0a7f2..4a5792c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -92,7 +92,7 @@ ENV UE_EXTERNAL_ID_2="10002@domain.com" ENV CAPIF_USERNAME="user300" ENV NETWORK="local" ENV ROS_DOMAIN_ID="1" -ENV ENVIRONMENT="development" +ENV ENVIRONMENT_MODE="production" # DDS Variables ENV DDS_IFACE="auto" diff --git a/entrypoint/entrypoint.sh b/entrypoint/entrypoint.sh index 448a12a..5d44047 100755 --- a/entrypoint/entrypoint.sh +++ b/entrypoint/entrypoint.sh @@ -14,7 +14,7 @@ jq -r .capif_http_port=\"$CAPIF_PORT_HTTP\" /evolved5g/cfg/capif_registration.js jq -r .capif_https_port=\"$CAPIF_PORT_HTTPS\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json jq -r .capif_netapp_username=\"$CAPIF_USERNAME\" /evolved5g/cfg/capif_registration.json >> /evolved5g/cfg/tmp.json && mv /evolved5g/cfg/tmp.json /evolved5g/cfg/capif_registration.json -evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" --environment="$ENVIRONMENT" +evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" --environment="$ENVIRONMENT_MODE" exec ros2 run localization_netapp cellid_node From 719139cf0d7f599ff75c13e152cb569c322589a4 Mon Sep 17 00:00:00 2001 From: biancabnd Date: Thu, 19 Oct 2023 11:37:22 +0200 Subject: [PATCH 46/46] Add possibility to enable or disable the NEF callbacks for certification purposes --- Dockerfile | 3 +++ entrypoint/entrypoint.sh | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4a5792c..ba6a383 100644 --- a/Dockerfile +++ b/Dockerfile @@ -100,6 +100,9 @@ ENV DDS_EXTERNAL_ADDRESS="10.11.23.49" ENV DDS_PARTICIPANT_INDEX="auto" ENV DDS_MAX_PARTICIPANT_INDEX="3" +# Unable NEF callbacks for certification purposes +ENV ENABLE_NEF_CALLBACKS=true + ENTRYPOINT ["/entrypoint.sh"] CMD tail -f /dev/null diff --git a/entrypoint/entrypoint.sh b/entrypoint/entrypoint.sh index 5d44047..589b240 100755 --- a/entrypoint/entrypoint.sh +++ b/entrypoint/entrypoint.sh @@ -16,6 +16,11 @@ jq -r .capif_netapp_username=\"$CAPIF_USERNAME\" /evolved5g/cfg/capif_registrati evolved5g register-and-onboard-to-capif --config_file_full_path="/evolved5g/cfg/capif_registration.json" --environment="$ENVIRONMENT_MODE" -exec ros2 run localization_netapp cellid_node +if [ "$ENABLE_NEF_CALLBACKS" = "true" ]; then + exec ros2 run localization_netapp cellid_node +else + echo "$ENABLE_NEF_CALLBACKS is set to False, NEF callbacks are not enabled!" +fi + exec "$@"