From be2fe296264e5f58c44f271af83a875baa747849 Mon Sep 17 00:00:00 2001 From: "aravind.est" Date: Fri, 26 Jul 2024 18:20:20 +0100 Subject: [PATCH] Fix A1 simulator extensions EXT_SRV and KAFKA_DISPATCHER extensions fixed Issue-ID: NONRTRIC-1024 Change-Id: I4baf298dfeea95ba7da216e7510e790899c01a99 Signed-off-by: aravind.est --- near-rt-ric-simulator/test/EXT_SRV/Dockerfile | 3 ++- near-rt-ric-simulator/test/EXT_SRV/src/main.py | 3 ++- near-rt-ric-simulator/test/EXT_SRV/src/server.py | 3 ++- near-rt-ric-simulator/test/KAFKA_DISPATCHER/Dockerfile | 5 +++-- near-rt-ric-simulator/test/KAFKA_DISPATCHER/src/main.py | 3 ++- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/near-rt-ric-simulator/test/EXT_SRV/Dockerfile b/near-rt-ric-simulator/test/EXT_SRV/Dockerfile index 84144d7..53f92fa 100644 --- a/near-rt-ric-simulator/test/EXT_SRV/Dockerfile +++ b/near-rt-ric-simulator/test/EXT_SRV/Dockerfile @@ -1,5 +1,6 @@ # ============LICENSE_START=============================================== # Copyright (C) 2022 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +18,7 @@ FROM python:3.8-slim-buster -RUN pip install connexion[swagger-ui] +RUN pip3 install "connexion[swagger-ui,flask,uvicorn]" #install nginx and curl RUN apt-get update && apt-get install -y nginx=1.14.* nginx-extras curl diff --git a/near-rt-ric-simulator/test/EXT_SRV/src/main.py b/near-rt-ric-simulator/test/EXT_SRV/src/main.py index 9587308..834aa62 100755 --- a/near-rt-ric-simulator/test/EXT_SRV/src/main.py +++ b/near-rt-ric-simulator/test/EXT_SRV/src/main.py @@ -1,5 +1,6 @@ # ============LICENSE_START=============================================== # Copyright (C) 2022 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -79,4 +80,4 @@ if len(sys.argv) >= 2: app.add_api('EXT_SRV_api.yaml') if __name__ == '__main__': - app.run(port=port_number, host="127.0.0.1", threaded=False) + app.run(port=port_number, host="127.0.0.1") diff --git a/near-rt-ric-simulator/test/EXT_SRV/src/server.py b/near-rt-ric-simulator/test/EXT_SRV/src/server.py index cbf2a47..a15826d 100644 --- a/near-rt-ric-simulator/test/EXT_SRV/src/server.py +++ b/near-rt-ric-simulator/test/EXT_SRV/src/server.py @@ -1,5 +1,6 @@ # ============LICENSE_START=============================================== # Copyright (C) 2022 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -40,7 +41,7 @@ def get_all_a1_policies(): return r res = list(a1_policy_instances) - return (res, 200) + return Response(json.dumps(res), 200, mimetype=APPL_JSON) # API Function: Get A1 policy def get_a1_policy(a1policyId): diff --git a/near-rt-ric-simulator/test/KAFKA_DISPATCHER/Dockerfile b/near-rt-ric-simulator/test/KAFKA_DISPATCHER/Dockerfile index bc5d815..d7bb104 100644 --- a/near-rt-ric-simulator/test/KAFKA_DISPATCHER/Dockerfile +++ b/near-rt-ric-simulator/test/KAFKA_DISPATCHER/Dockerfile @@ -1,5 +1,6 @@ # ============LICENSE_START=============================================== # Copyright (C) 2022 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,8 +18,8 @@ FROM python:3.8-slim-buster -RUN pip install connexion[swagger-ui] -RUN pip install kafka-python +RUN pip3 install "connexion[swagger-ui,flask,uvicorn]" +RUN pip3 install kafka-python #install nginx and curl RUN apt-get update && apt-get install -y nginx=1.14.* nginx-extras curl diff --git a/near-rt-ric-simulator/test/KAFKA_DISPATCHER/src/main.py b/near-rt-ric-simulator/test/KAFKA_DISPATCHER/src/main.py index 7816e7f..e429d4e 100644 --- a/near-rt-ric-simulator/test/KAFKA_DISPATCHER/src/main.py +++ b/near-rt-ric-simulator/test/KAFKA_DISPATCHER/src/main.py @@ -1,5 +1,6 @@ # ============LICENSE_START=============================================== # Copyright (C) 2022 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2024 OpenInfra Foundation Europe. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -74,4 +75,4 @@ if len(sys.argv) >= 2: app.add_api('KAFKA_DISPATCHER_api.yaml') if __name__ == '__main__': - app.run(port=port_number, host="127.0.0.1", threaded=False) + app.run(port=port_number, host="127.0.0.1") -- 2.16.6