From: Deepanshu Karnwal Date: Wed, 13 Dec 2023 16:01:49 +0000 (+0000) Subject: Release 1.0.2 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=b49adee363dcd4deb41bad12323e6ec2683aec4f;p=ric-app%2Fad.git Release 1.0.2 Change-Id: I9810ccd69a18f5a2710ed3653f8f070febcb157d Signed-off-by: Deepanshu Karnwal --- diff --git a/Dockerfile b/Dockerfile index 8a27f2c..0e9d445 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,27 +13,33 @@ # See the License for the specific language governing permissions and # limitations under the License. # ================================================================================== -FROM frolvlad/alpine-miniconda3:python3.7 +#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/ +# 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 -COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:4.0.5 /usr/local/bin/rmr* /usr/local/bin/ ENV LD_LIBRARY_PATH /usr/local/lib/:/usr/local/lib64 +ENV C_INCLUDE_PATH /usr/local/include COPY local.rt /opt/route/local.rt ENV RMR_SEED_RT /opt/route/local.rt -RUN apk update && apk add gcc musl-dev - # Install COPY setup.py /tmp COPY LICENSE.txt /tmp/ # RUN mkdir -p /tmp/ad/ RUN pip install /tmp RUN pip install ricxappframe -RUN pip install --force-reinstall redis==3.0.1 ENV PYTHONUNBUFFERED 1 +ENV CONFIG_FILE /opt/ric/config/config-file.json COPY src/ /src -CMD PYTHONPATH=/src:/usr/lib/python3.7/site-packages/:$PYTHONPATH run-src.py +CMD PYTHONPATH=/src:/usr/lib/python3.11/site-packages/:$PYTHONPATH run-src.py diff --git a/Dockerfile-Unit-Test b/Dockerfile-Unit-Test index e54eecb..89223f3 100644 --- a/Dockerfile-Unit-Test +++ b/Dockerfile-Unit-Test @@ -13,22 +13,23 @@ # 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 -RUN apk update && apk add gcc musl-dev # copies COPY setup.py tox.ini LICENSE.txt /tmp/ @@ -36,5 +37,5 @@ RUN pip install /tmp COPY src/ /tmp/src COPY tests/ /tmp/tests # Run the unit tests -WORKDIR /tmp -RUN PYTHONPATH=/tmp/src:/usr/lib/python3.7/site-packages/:$PYTHONPATH tox -e code,flake8 +WORKDIR /tmp +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 2dde1d2..b6ea1b7 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -22,6 +22,10 @@ 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 `__. +[1.0.2] - 2023-12-12 +-------------------- +* Release version 1.0.2 (`RICAPP-229 `_) + [1.0.1] - 2023-06-28 -------------------- * Release version 1.0.1 (`RICAPP-215 `_) diff --git a/local.rt b/local.rt index e084807..0044b24 100644 --- a/local.rt +++ b/local.rt @@ -1,5 +1,5 @@ newrt|start -rte|30003|service-ricxapp-trafficxapp-rmr:4560 +rte|30003|service-ricxapp-trafficxapp-rmr.ricxapp:4560 rte|20011|service-ricplt-a1mediator-rmr.ricplt:4560 newrt|end diff --git a/rmr-version.yaml b/rmr-version.yaml index d7b94dd..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.0.5 +version: 4.9.0 diff --git a/setup.py b/setup.py index 671b008..ebcb13b 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup( packages=find_packages(exclude=["tests.*", "tests"]), description="Anomaly Detection xApp that integrates with Traffic Steering", url="https://gerrit.o-ran-sc.org/r/admin/repos/ric-app/ad", - install_requires=["ricxappframe>=1.1.1,<2.0.0", "pandas>=1.1.3", "joblib>=0.3.2", "Scikit-learn>=0.18", "mdclogpy<=1.1.1", "schedule>=0.0.0", "influxdb"], + install_requires=["ricxappframe==3.2.2", "pandas>=1.1.3", "joblib>=0.3.2", "Scikit-learn>=0.18", "mdclogpy<=1.1.1", "schedule>=0.0.0", "influxdb"], entry_points={"console_scripts": ["run-src.py=src.main:start"]}, # adds a magical entrypoint for Docker license="Apache 2.0", data_files=[("", ["LICENSE.txt"])], diff --git a/src/ad_config.ini b/src/ad_config.ini index cc7a8c4..3028a4e 100644 --- a/src/ad_config.ini +++ b/src/ad_config.ini @@ -15,7 +15,7 @@ # ================================================================================== [influxdb] -host = ricplt-influxdb.ricplt +host = ricplt-influxdb.ricplt port = 8086 user = admin password = diff --git a/src/ad_model.py b/src/ad_model.py index 4bac6e0..14c4dcf 100644 --- a/src/ad_model.py +++ b/src/ad_model.py @@ -108,6 +108,8 @@ class CAUSE(object): sample.loc[i, 'Degradation'] = deg if 'Throughput' in deg and ('RSRP' in deg or 'RSRQ' in deg): sample.loc[i, 'Anomaly'] = 2 + else: + sample.loc[i, 'Anomaly'] = 1 else: sample.loc[i, 'Anomaly'] = 0 return sample[['Anomaly', 'Degradation']].values.tolist() diff --git a/src/insert.py b/src/insert.py index d485b7b..a5c3a5b 100644 --- a/src/insert.py +++ b/src/insert.py @@ -32,7 +32,7 @@ class INSERTDATA(DATABASE): self.config() self.connect() # self.dropdb('RIC-Test') -# self.createdb('RIC-Test') + self.createdb('RIC-Test') def config(self): cfg = ConfigParser() @@ -49,13 +49,15 @@ class INSERTDATA(DATABASE): self.meas = cfg.get(section, "measurement") def createdb(self, dbname): - print("Create database: " + dbname) - self.client.create_database(dbname) - self.client.switch_database(dbname) + if dbname not in self.client.get_list_database(): + print("Create database: " + dbname) + self.client.create_database(dbname) + self.client.switch_database(dbname) def dropdb(self, dbname): - print("DROP database: " + dbname) - self.client.drop_database(dbname) + if next((item for item in self.client.get_list_database() if item.get("name") == dbname), None) is not None: + print("DROP database: " + dbname) + self.client.drop_database(dbname) def dropmeas(self, measname): print("DROP MEASUREMENT: " + measname) diff --git a/xapp-descriptor/config.json b/xapp-descriptor/config.json index 13f333e..f77a394 100644 --- a/xapp-descriptor/config.json +++ b/xapp-descriptor/config.json @@ -1,6 +1,6 @@ { - "xapp_name": "ad", - "version": "1.0.1", + "name": "ad", + "version": "1.0.2", "containers": [ { "name": "ad", @@ -13,6 +13,12 @@ ], "messaging": { "ports": [ + { + "name": "http", + "container": "ad", + "port": 8080, + "description": "http service" + }, { "name": "rmr-data", "container": "ad",