From d5024709403d3ae909b91af8cd04c9caef1e49c6 Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Tue, 20 Aug 2019 15:22:45 -0400 Subject: [PATCH] Upgrade to Python RMR ver 0.10.8 Repair integration tests Signed-off-by: Lott, Christopher (cl778h) Change-Id: I150598860a575b0c4f816d4179f80e7389967ff3 --- a1/openapi.yaml | 2 +- container-tag.yaml | 2 +- docs/developer-guide.rst | 25 +++++++++++++------------ docs/release-notes.rst | 9 +++++++++ integration_tests/Dockerfile | 15 ++++++--------- integration_tests/a1mediator/Chart.yaml | 2 +- setup.py | 5 ++--- 7 files changed, 33 insertions(+), 27 deletions(-) diff --git a/a1/openapi.yaml b/a1/openapi.yaml index e2d17cc..66094ef 100644 --- a/a1/openapi.yaml +++ b/a1/openapi.yaml @@ -16,7 +16,7 @@ # ================================================================================== openapi: 3.0.0 info: - version: 0.10.0 + version: 0.10.3 title: RIC A1 paths: '/a1-p/healthcheck': diff --git a/container-tag.yaml b/container-tag.yaml index e64fcd7..f8af088 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -1,4 +1,4 @@ # The Jenkins job uses this string for the tag in the image name # for example nexus3.o-ran-sc.org:10004/my-image-name:my-tag --- -tag: 0.10.2 +tag: 0.10.3 diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst index 660bd62..9ce6e51 100644 --- a/docs/developer-guide.rst +++ b/docs/developer-guide.rst @@ -43,6 +43,18 @@ This project follows semver. When changes are made, the versions are in: 7) in the it/dep repo that contains a1 helm chart, ``values.yaml``, ``Chart.yml`` +Version bumping rmr-python +========================== +rmr-python is a critial dependency of A1. Bumping the rmr version dependency requires changes in: + +1) ``setup.py`` + +2) ``Dockerfile`` + +3) ``integration_tests/Dockerfile`` + +Run the integration tests after attempting this. + Unit Testing ============ Note, before this will work, for the first time on the machine running the tests, run ``./install_deps.sh``. This is only needed once on the machine. @@ -79,8 +91,6 @@ If you've never run the integration tests before, build the test receiver, which cd integration_tests docker build --no-cache -t testreceiver:latest . -You do not need the "bombarder" image as they are not currently used in the integration tests (that is more for load testing). - Finally, run all the tests from the root (this requires the python packages ``tox``, ``pytest``, and ``tavern``). :: @@ -101,8 +111,7 @@ Running locally 1. Before this will work, for the first time on that machine, run ``./install_deps.sh`` -2. It also requires rmr-python >= 0.10.1 installed. (The dockerfile also - does this) +2. It also requires rmr-python installed. (The dockerfile does this) 3. Create a ``local.rt`` file and copy it into ``/opt/route/local.rt``. Note, the example one in ``integration_tests`` will need to be modified for @@ -155,11 +164,3 @@ while it is sleeping, and both responses should be correct. curl -v -X PUT -H "Content-Type: application/json" -d '{ "enforce":true, "window_length":10, "blocking_rate":20, "trigger_threshold":10 }' localhost:10000/ric/policies/admission_control_policy curl -v localhost:10000/ric/policies/admission_control_policy curl -v localhost:10000/a1-p/healthcheck - -Finally, there is a test “bombarder” that will flood A1 with messages -with good message types but bad transaction IDs, to test A1’s resilience -against queue-overflow attacks - -:: - - set -x LD_LIBRARY_PATH /usr/local/lib/; set -x RMR_SEED_RT /opt/route/local.rt ; python bombard.py diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 3775134..5dea627 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -23,6 +23,15 @@ 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.10.3] - 8/20/2019 + +:: + + * Update to later rmr-python + * Add docs about upgrading rmr + * remove bombarder since tavern runs apache bench + + [0.10.2] - 8/14/2019 :: diff --git a/integration_tests/Dockerfile b/integration_tests/Dockerfile index fc912b4..60ea6cd 100644 --- a/integration_tests/Dockerfile +++ b/integration_tests/Dockerfile @@ -15,24 +15,21 @@ # limitations under the License. # ================================================================================== # TODO: switch to alpine once rmr apk available -FROM python:3.7 +FROM python:3.7-alpine COPY receiver.py / -# copy NNG out of the CI builder nng -COPY --from=nexus3.o-ran-sc.org:10004/bldr-debian-python-nng:2-py3.7-nng1.1.1 /usr/local/lib/libnng.so /usr/local/lib/libnng.so - -# Installs RMr using debian package hosted at packagecloud.io -RUN wget --content-disposition https://packagecloud.io/o-ran-sc/master/packages/debian/stretch/rmr_1.0.36_amd64.deb/download.deb -RUN dpkg -i rmr_1.0.36_amd64.deb +# copy NNG and rmr out of the CI builder nng +COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3:3-a3.9 /usr/local/lib64/libnng.so /usr/local/lib64/libnng.so +COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3:3-a3.9 /usr/local/lib64/librmr_nng.so /usr/local/lib64/librmr_nng.so # Install RMr python bindings RUN pip install --upgrade pip -RUN pip install rmr==0.10.1 +RUN pip install rmr==0.10.8 # rmr setups RUN mkdir -p /opt/route/ -ENV LD_LIBRARY_PATH /usr/local/lib +ENV LD_LIBRARY_PATH /usr/local/lib:/usr/local/lib64 ENV RMR_SEED_RT /opt/route/local.rt WORKDIR / diff --git a/integration_tests/a1mediator/Chart.yaml b/integration_tests/a1mediator/Chart.yaml index 68be66b..83fa694 100644 --- a/integration_tests/a1mediator/Chart.yaml +++ b/integration_tests/a1mediator/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 description: A1 Helm chart for Kubernetes name: a1mediator -version: 0.10.2 +version: 0.10.3 diff --git a/setup.py b/setup.py index 85d8ddb..61d1382 100644 --- a/setup.py +++ b/setup.py @@ -18,14 +18,13 @@ from setuptools import setup, find_packages setup( name="a1", - version="0.10.2", + version="0.10.3", packages=find_packages(exclude=["tests.*", "tests"]), author="Tommy Carpenter", description="RIC A1 Mediator for policy/intent changes", url="https://gerrit.o-ran-sc.org/r/admin/repos/ric-plt/a1", entry_points={"console_scripts": ["run.py=a1.run:main"]}, # we require jsonschema, should be in that list, but connexion already requires a specific version of it - # rmr 0.10.4 has a bugfix required on alpine - install_requires=["requests", "Flask", "connexion[swagger-ui]", "gevent", "rmr>=0.10.7"], + install_requires=["requests", "Flask", "connexion[swagger-ui]", "gevent", "rmr>=0.10.8"], package_data={"a1": ["openapi.yaml"]}, ) -- 2.16.6