From 6b85eed29d60f343b0712d757c114bc6207ccdbe Mon Sep 17 00:00:00 2001 From: Deepanshu Karnwal Date: Wed, 13 Dec 2023 16:14:05 +0000 Subject: [PATCH] Release 0.0.6 Change-Id: Iefa3448306de108859bae42edbbedec148c3360d Signed-off-by: Deepanshu Karnwal --- Dockerfile | 24 ++++++++++++++---------- Dockerfile-Unit-Test | 16 +++++++++++----- docs/release-notes.rst | 5 +++++ insert.py | 2 +- rmr-version.yaml | 2 +- setup.py | 2 +- src/qp_config.ini | 5 ++--- src/qptrain.py | 13 +++++++++---- tox.ini | 3 +++ xapp-descriptor/config.json | 2 +- 10 files changed, 48 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 58df5f3..c891f81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,26 +14,30 @@ # 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 diff --git a/Dockerfile-Unit-Test b/Dockerfile-Unit-Test index af3a370..653f123 100644 --- a/Dockerfile-Unit-Test +++ b/Dockerfile-Unit-Test @@ -14,14 +14,20 @@ # 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 diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 567ea9d..3003a66 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -11,6 +11,11 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `__ and this project adheres to `Semantic Versioning `__. +[0.0.6] - 2022-12-15 +-------------------- +* Support for python 3.11 and RMR version 4.9.0 (`RICAPP-230 `_) + + [0.0.5] - 2022-12-15 -------------------- * Database logic modification and improvements (`RICAPP-207 `_) diff --git a/insert.py b/insert.py index d42de6a..ee562a3 100644 --- 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) diff --git a/rmr-version.yaml b/rmr-version.yaml index 02723fb..b50bbea 100644 --- a/rmr-version.yaml +++ b/rmr-version.yaml @@ -1,3 +1,3 @@ # CI script installs RMR from PackageCloud using this version --- -version: 4.7.4 +version: 4.9.0 diff --git a/setup.py b/setup.py index 1c1633a..9eeb99a 100644 --- 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"])], diff --git a/src/qp_config.ini b/src/qp_config.ini index b2053d8..31bbc41 100644 --- a/src/qp_config.ini +++ b/src/qp_config.ini @@ -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 diff --git a/src/qptrain.py b/src/qptrain.py index 0ce3438..946c430 100644 --- a/src/qptrain.py +++ b/src/qptrain.py @@ -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 --- 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 diff --git a/xapp-descriptor/config.json b/xapp-descriptor/config.json index 478559e..92c9879 100644 --- a/xapp-descriptor/config.json +++ b/xapp-descriptor/config.json @@ -1,6 +1,6 @@ { "xapp_name": "qp", - "version": "0.0.5", + "version": "0.0.6", "containers": [ { "name": "qp", -- 2.16.6