From d26734faf0366f95ed055a783fed8297f8c63ff6 Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Mon, 27 Apr 2020 17:25:05 -0400 Subject: [PATCH] Upgrade A1 to use RMR library version 4.0.2 This picks up a fix to dynamic route-table distribution features. Drop mention of ricmanifest from the installation guide. Signed-off-by: Lott, Christopher (cl778h) Change-Id: I7e91b9bd4e7ee1eb8a2efb5056218c4d9c31dc3f --- Dockerfile | 7 +++++-- Dockerfile-Unit-Test | 12 +++++------ docs/developer-guide.rst | 23 ++++++++++++++-------- docs/installation-guide.rst | 2 +- docs/release-notes.rst | 4 ++-- integration_tests/install_rmr.sh | 2 +- .../testxappcode/Dockerfile-delay-receiver | 10 +++++++--- .../testxappcode/Dockerfile-query-receiver | 10 +++++++--- .../testxappcode/Dockerfile-test-receiver | 10 +++++++--- rmr-version.yaml | 2 +- 10 files changed, 52 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd18fe7..c8ef420 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,12 +35,15 @@ RUN pip install --user /home/a1user ########### # 2nd stage FROM python:3.8-alpine + +# 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.2 /usr/local/lib64/librmr* /usr/local/lib64/ + # dir that rmr routing file temp goes into RUN mkdir -p /opt/route/ # python copy; this basically makes the 2 stage python build work COPY --from=compile-image /home/a1user/.local /home/a1user/.local -# copy rmr .so from builder image in lieu of an Alpine package -COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:3.8.0 /usr/local/lib64/librmr_si.so /usr/local/lib64/librmr_si.so + # Switch to a non-root user for security reasons. a1 does not currently write into any dirs so no chowns are needed at this time. RUN addgroup -S a1user && adduser -S -G a1user a1user USER a1user diff --git a/Dockerfile-Unit-Test b/Dockerfile-Unit-Test index 097d4f3..8aba74f 100644 --- a/Dockerfile-Unit-Test +++ b/Dockerfile-Unit-Test @@ -16,14 +16,14 @@ # ================================================================================== FROM python:3.8-alpine -# copy rmr .so from builder image in lieu of an Alpine package -COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:3.8.0 /usr/local/lib64/librmr_si.so /usr/local/lib64/librmr_si.so +# 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.2 /usr/local/lib64/librmr* /usr/local/lib64/ # dir that rmr routing file temp goes into RUN mkdir -p /opt/route/ -# Gevent needs gcc -RUN apk add gcc musl-dev +# Gevent needs gcc, make, file, ffi +RUN apk update && apk add gcc musl-dev make file libffi-dev # Upgrade pip, install tox (gevent is installed as a speed hack in local dev where tox is run many times) RUN pip install --upgrade pip && pip install tox gevent @@ -34,5 +34,5 @@ COPY tests/ /tmp/tests COPY setup.py tox.ini /tmp/ WORKDIR /tmp -# Run the unit tests -RUN tox -e py38,flake8 +# Run the unit tests but skip doc +RUN tox -e code,flake8 diff --git a/docs/developer-guide.rst b/docs/developer-guide.rst index f562c7c..4c0d38d 100644 --- a/docs/developer-guide.rst +++ b/docs/developer-guide.rst @@ -37,11 +37,14 @@ This project follows semver. When changes are made, the versions are in: Version bumping RMR ------------------- -As of 2020/02/13, A1 (Dockerfile), Dockerfile-Unit-Test, and all three integration test receivers use a base image from o-ran-sc. -The rmr version is in that base image. -When version changes are made in that image, rebuilding those 5 containers in the A1 repo will pick it up (or just A1 itself for prod usage). +As of 2020/02/13, A1 (Dockerfile), Dockerfile-Unit-Test, and all three +integration test receivers use an Alpine base image and install RMR +from a base builder image. Must update and rebuild all 5 containers +in the A1 repo (or just A1 itself for prod usage). -However, there are two items in this repo that must be kept in sync: ``rmr-version.yaml``, which controls what rmr gets installed for unit testing in Jenkins, and ``integration_tests/install_rmr.sh`` which is a useful script for a variety of local testing. +In addition these items in this repo must be kept in sync: +* ``rmr-version.yaml`` controls what rmr gets installed for unit testing in Jenkins +* ``integration_tests/install_rmr.sh`` is a useful script for a variety of local testing. Version bumping Python ---------------------- @@ -57,15 +60,18 @@ If you want to update the version of python itself (ie just done from 37 to 38): 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. -Also, this requires the python packages ``tox`` and ``pytest``. +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. Also, this requires the python packages ``tox`` and +``pytest``. :: tox open htmlcov/index.html -Alternatively, you can run the unit tests in Docker (this is somewhat less nice because you don't get the pretty HTML) +Alternatively, you can run the unit tests in Docker (this is somewhat +less nice because you don't get the pretty HTML) :: @@ -74,7 +80,8 @@ Alternatively, you can run the unit tests in Docker (this is somewhat less nice Integration testing ------------------- -This tests A1’s external API with three test receivers. This requires docker, kubernetes and helm. +This tests A1’s external API with three test receivers. This requires +docker, kubernetes and helm. Build all the images: diff --git a/docs/installation-guide.rst b/docs/installation-guide.rst index d59cb87..ff12eca 100644 --- a/docs/installation-guide.rst +++ b/docs/installation-guide.rst @@ -40,5 +40,5 @@ running :: - docker run -dt -p 10000:10000 -v /path/to/localrt:/opt/route/local.rt -v /path/to/ricmanifest:/opt/ricmanifest.json a1:X.Y.Z -v + docker run -dt -p 10000:10000 -v /path/to/localrt:/opt/route/local.rt a1:X.Y.Z -v diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 3ced56e..14d0612 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -14,10 +14,10 @@ and this project adheres to `Semantic Versioning `__. :depth: 3 :local: -[2.1.7] - 2020-04-27 +[2.1.7] - 2020-04-28 -------------------- -* Upgrade to rmr 3.8.0 +* Upgrade to rmr 4.0.2 * Upgrade integration tests to xapp-frame-go version 0.4.8 which drops NNG * Extend exception handler to return error details in HTTP response * Ensure that policy type ID on path matches ID in object diff --git a/integration_tests/install_rmr.sh b/integration_tests/install_rmr.sh index 95f6beb..1ccc6b4 100755 --- a/integration_tests/install_rmr.sh +++ b/integration_tests/install_rmr.sh @@ -1,5 +1,5 @@ #!/bin/sh -git clone --branch 3.8.0 https://gerrit.oran-osc.org/r/ric-plt/lib/rmr \ +git clone --branch 4.0.2 https://gerrit.oran-osc.org/r/ric-plt/lib/rmr \ && cd rmr \ && mkdir .build; cd .build \ && echo "<<>>" \ diff --git a/integration_tests/testxappcode/Dockerfile-delay-receiver b/integration_tests/testxappcode/Dockerfile-delay-receiver index 42303e0..420aeb8 100644 --- a/integration_tests/testxappcode/Dockerfile-delay-receiver +++ b/integration_tests/testxappcode/Dockerfile-delay-receiver @@ -16,7 +16,11 @@ # ================================================================================== # This Dockerfile uses a two stage Docker build -FROM nexus3.o-ran-sc.org:10004/bldr-alpine3:10-a3.11-rmr3 +FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-alpine3:12-a3.11 + +# copy rmr headers and 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.2 /usr/local/include/rmr /usr/local/include/rmr +COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:4.0.2 /usr/local/lib64/librmr* /usr/local/lib64/ # go will complain if there is a go.mod at the root of the GOPATH so we can't. RUN mkdir myxapp @@ -33,8 +37,8 @@ RUN go build -a -installsuffix cgo -o receiver receiver.go # 2nd stage FROM alpine:3.11 -# copy rmr .so from builder image in lieu of an Alpine package -COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:3.8.0 /usr/local/lib64/librmr_si.so* /usr/local/lib64/ +# 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.2 /usr/local/lib64/librmr* /usr/local/lib64/ COPY --from=0 /myxapp/receiver . COPY delay-config-file.yaml . diff --git a/integration_tests/testxappcode/Dockerfile-query-receiver b/integration_tests/testxappcode/Dockerfile-query-receiver index c3c98e0..6004d11 100644 --- a/integration_tests/testxappcode/Dockerfile-query-receiver +++ b/integration_tests/testxappcode/Dockerfile-query-receiver @@ -16,7 +16,11 @@ # ================================================================================== # This Dockerfile uses a two stage Docker build -FROM nexus3.o-ran-sc.org:10004/bldr-alpine3:10-a3.11-rmr3 +FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-alpine3:12-a3.11 + +# copy rmr headers and 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.2 /usr/local/include/rmr /usr/local/include/rmr +COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:4.0.2 /usr/local/lib64/librmr* /usr/local/lib64/ # go will complain if there is a go.mod at the root of the GOPATH so we can't. RUN mkdir myxapp @@ -33,8 +37,8 @@ RUN go build -a -installsuffix cgo -o receiver receiver.go # 2nd stage FROM alpine:3.11 -# copy rmr .so from builder image in lieu of an Alpine package -COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:3.8.0 /usr/local/lib64/librmr_si.so* /usr/local/lib64/ +# 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.2 /usr/local/lib64/librmr* /usr/local/lib64/ COPY --from=0 /myxapp/receiver . COPY query-config-file.yaml . diff --git a/integration_tests/testxappcode/Dockerfile-test-receiver b/integration_tests/testxappcode/Dockerfile-test-receiver index b7afc4a..1d59467 100644 --- a/integration_tests/testxappcode/Dockerfile-test-receiver +++ b/integration_tests/testxappcode/Dockerfile-test-receiver @@ -16,7 +16,11 @@ # ================================================================================== # This Dockerfile uses a two stage Docker build -FROM nexus3.o-ran-sc.org:10004/bldr-alpine3:10-a3.11-rmr3 +FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-alpine3:12-a3.11 + +# copy rmr headers and 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.2 /usr/local/include/rmr /usr/local/include/rmr +COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:4.0.2 /usr/local/lib64/librmr* /usr/local/lib64/ # go will complain if there is a go.mod at the root of the GOPATH so we can't. RUN mkdir myxapp @@ -33,8 +37,8 @@ RUN go build -a -installsuffix cgo -o receiver receiver.go # 2nd stage FROM alpine:3.11 -# copy rmr .so from builder image in lieu of an Alpine package -COPY --from=nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-alpine3-rmr:3.8.0 /usr/local/lib64/librmr_si.so* /usr/local/lib64/ +# 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.2 /usr/local/lib64/librmr* /usr/local/lib64/ COPY --from=0 /myxapp/receiver . COPY test-config-file.yaml . diff --git a/rmr-version.yaml b/rmr-version.yaml index 7f7e478..48cb15e 100644 --- a/rmr-version.yaml +++ b/rmr-version.yaml @@ -1,3 +1,3 @@ # CI script installs RMR from PackageCloud using this version --- -version: 3.8.0 +version: 4.0.2 -- 2.16.6