Release 0.0.6 80/12280/6 i-release
authorDeepanshu Karnwal <deepanshu.k@HCL.COM>
Wed, 13 Dec 2023 16:14:05 +0000 (16:14 +0000)
committerDeepanshu Karnwal <deepanshu.k@hcl.com>
Wed, 13 Dec 2023 21:44:29 +0000 (21:44 +0000)
Change-Id: Iefa3448306de108859bae42edbbedec148c3360d
Signed-off-by: Deepanshu Karnwal <deepanshu.k@HCL.COM>
Dockerfile
Dockerfile-Unit-Test
docs/release-notes.rst
insert.py
rmr-version.yaml
setup.py
src/qp_config.ini
src/qptrain.py
tox.ini
xapp-descriptor/config.json

index 58df5f3..c891f81 100644 (file)
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 # ==================================================================================
-FROM frolvlad/alpine-miniconda3:python3.7
-#FROM python:3.7-alpine
+#Python 3.11 miniconda
+FROM continuumio/miniconda3:23.10.0-1
+
 # RMR setup
 RUN mkdir -p /opt/route/
-# copy rmr files from builder image in lieu of an Alpine package
-COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:4.0.5 /usr/local/lib64/librmr* /usr/local/lib64/
-# rmr_probe replaced health_ck
-COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:4.0.5 /usr/local/bin/rmr* /usr/local/bin/
+
+# sdl uses hiredis which needs gcc
+RUN apt update && apt install -y gcc musl-dev
+
+# copy rmr libraries from builder image in lieu of an Alpine package
+ARG RMRVERSION=4.9.0
+RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr_${RMRVERSION}_amd64.deb
+RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb
+RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb
+
 ENV LD_LIBRARY_PATH /usr/local/lib/:/usr/local/lib64
 COPY tests/fixtures/local.rt /opt/route/local.rt
 ENV RMR_SEED_RT /opt/route/local.rt
 
-# sdl needs gcc
-RUN apk update && apk add gcc musl-dev
 # Install
 COPY setup.py /tmp
 COPY LICENSE.txt /tmp/
 RUN pip install /tmp
-RUN pip install --force-reinstall redis==3.0.1
 COPY src/ /src
 # Run
 ENV PYTHONUNBUFFERED 1
-CMD PYTHONPATH=/src:/usr/lib/python3.7/site-packages/:$PYTHONPATH run-qp.py
+CMD PYTHONPATH=/src:/usr/lib/python3.11/site-packages/:$PYTHONPATH run-qp.py
index af3a370..653f123 100644 (file)
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 # ==================================================================================
-FROM frolvlad/alpine-miniconda3:python3.7
-#FROM python:3.8-alpine
+#Python 3.11 miniconda
+FROM continuumio/miniconda3:23.10.0-1
+
+# RMR setup
+RUN mkdir -p /opt/route/
 
 # sdl uses hiredis which needs gcc
-RUN apk update && apk add gcc musl-dev
+RUN apt update && apt install -y gcc musl-dev
 
 # copy rmr libraries from builder image in lieu of an Alpine package
-COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:4.0.5 /usr/local/lib64/librmr* /usr/local/lib64/
+ARG RMRVERSION=4.9.0
+RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr_${RMRVERSION}_amd64.deb
+RUN wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb
+RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb
 
 # Upgrade pip, install tox
 RUN pip install --upgrade pip && pip install tox
@@ -34,4 +40,4 @@ RUN pip install /tmp
 
 # Run the unit tests
 WORKDIR /tmp
-RUN PYTHONPATH=/tmp/src:/usr/lib/python3.7/site-packages/:$PYTHONPATH tox -e code,flake8
+RUN PYTHONPATH=/tmp/src:/usr/lib/python3.11/site-packages/:$PYTHONPATH tox -e code,flake8
index 567ea9d..3003a66 100644 (file)
@@ -11,6 +11,11 @@ All notable changes to this project will be documented in this file.
 The format is based on `Keep a Changelog <http://keepachangelog.com/>`__
 and this project adheres to `Semantic Versioning <http://semver.org/>`__.
 
+[0.0.6] - 2022-12-15
+--------------------
+* Support for python 3.11 and RMR version 4.9.0 (`RICAPP-230 <https://jira.o-ran-sc.org/browse/RICAPP-230>`_)
+
+
 [0.0.5] - 2022-12-15
 --------------------
 * Database logic modification and improvements (`RICAPP-207 <https://jira.o-ran-sc.org/browse/RICAPP-207>`_)
index d42de6a..ee562a3 100644 (file)
--- a/insert.py
+++ b/insert.py
@@ -57,7 +57,7 @@ def populatedb():
     # inintiate connection and create database UEDATA
     db = INSERTDATA()
     df = pd.read_csv('src/cells.csv')
-    print("Writin data into influxDB")
+    print("Writinig data into influxDB")
     while True:
         db.assign_timestamp(df)
 
index 02723fb..b50bbea 100644 (file)
@@ -1,3 +1,3 @@
 # CI script installs RMR from PackageCloud using this version
 ---
-version: 4.7.4
+version: 4.9.0
index 1c1633a..9eeb99a 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ setup(
     packages=find_packages(exclude=["tests.*", "tests"]),
     description="Quality-of-Service Predictor Xapp for Traffic Steering",
     url="https://gerrit.o-ran-sc.org/r/admin/repos/ric-app/qp",
-    install_requires=["ricxappframe>=1.1.1,<2.0.0", "joblib>=0.3.2", "statsmodels>=0.11.1", "mdclogpy<=1.1.1", "influxdb", "pandas>=1.1.3", "scikit-learn", "schedule", "joblib"],
+    install_requires=["ricxappframe==3.2.2", "joblib>=0.3.2", "statsmodels>=0.11.1", "mdclogpy<=1.1.1", "influxdb", "pandas==1.5.3", "scikit-learn", "schedule", "joblib"],
     entry_points={"console_scripts": ["run-qp.py=src.main:start"]},  # adds a magical entrypoint for Docker
     license="Apache 2.0",
     data_files=[("", ["LICENSE.txt"])],
index b2053d8..31bbc41 100644 (file)
@@ -1,9 +1,8 @@
 [influxdb]
-#host = ricplt-influxdb.ricplt
-host = 10.244.0.21
+host = ricplt-influxdb.ricplt
 port = 8086
 user = admin
-password = IoyLfHwWmO
+password = 
 path =
 database = RIC-Test
 uemeas = UEReports
index 0ce3438..946c430 100644 (file)
@@ -20,6 +20,7 @@ from mdclogpy import Logger
 from exceptions import DataNotMatchError
 from sklearn.metrics import mean_squared_error
 from math import sqrt
+import pandas as pd
 import joblib
 import warnings
 warnings.filterwarnings("ignore")
@@ -80,10 +81,14 @@ class PROCESS(object):
     def constant(self):
         val = True
         df = self.data.copy()
-        df = df.drop_duplicates().dropna()
-        df = df.loc[:, (df != 0).any(axis=0)]
-        if len(df) >= 10:
-            val = False
+        df = df[db.thptparam]
+        df = df.drop_duplicates()
+        df = df.loc[:, df.apply(pd.Series.nunique) != 1]
+        if df is not None:
+            df = df.dropna()
+            df = df.loc[:, (df != 0).any(axis=0)]
+            if len(df) >= 10:
+                val = False
         return val
 
     def evaluate_var(self, X, lag):
diff --git a/tox.ini b/tox.ini
index 3f7ba0d..4cc200e 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -61,6 +61,8 @@ deps =
     sphinxcontrib-httpdomain
     recommonmark
     lfdocs-conf
+    urllib3~=1.26.15
+allowlist_externals = echo
 commands =
     sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
     echo "Generated docs available in {toxinidir}/docs/_build/html"
@@ -73,4 +75,5 @@ deps = sphinx
        sphinxcontrib-httpdomain
        recommonmark
        lfdocs-conf
+       urllib3~=1.26.15
 commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
index 478559e..92c9879 100644 (file)
@@ -1,6 +1,6 @@
 {
         "xapp_name": "qp",
-        "version": "0.0.5",
+        "version": "0.0.6",
         "containers": [
             {
                 "name": "qp",