From bde567d29b9b36e055f417491e6f4bbdd745968a Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Thu, 12 Sep 2019 15:32:33 -0400 Subject: [PATCH] Verify ric-plt/a1 code with tox, not Docker Add shell script to install NNG and RMR which are prerequisites for the A1 Python implementation. Run unit tests directly in tox, not wrapped in a Docker container. Signed-off-by: Lott, Christopher (cl778h) Change-Id: I8d01c885006cdb38d09cead83dd39a9f903580d8 --- jjb/ric-plt-a1/ric-plt-a1.yaml | 31 ++++++++++++------------------ jjb/shell/install-deb-nng-rmr.sh | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 19 deletions(-) create mode 100644 jjb/shell/install-deb-nng-rmr.sh diff --git a/jjb/ric-plt-a1/ric-plt-a1.yaml b/jjb/ric-plt-a1/ric-plt-a1.yaml index 00ef2109..e8e5fecf 100644 --- a/jjb/ric-plt-a1/ric-plt-a1.yaml +++ b/jjb/ric-plt-a1/ric-plt-a1.yaml @@ -32,35 +32,28 @@ container-tag-method: yaml-file # use host network to clone from our gerrit docker-build-args: '--network=host' + # the install script assumes an ubuntu image + build-node: ubuntu1804-builder-2c-2g + pre-build-script: !include-raw-escape: + - ../shell/install-deb-nng-rmr.sh + python-version: python3 stream: - master: branch: master jobs: - - gerrit-python-xc-clm + - gerrit-tox-verify - '{project-name}-gerrit-docker-jobs' - -# runs unit tests on verify only -- project: - <<: *a1_docker_common - name: ric-plt-a1-test - project-name: ric-plt-a1-test - # image name, but is never pushed - docker-name: '{name}' - # source of docker tag - container-tag-method: latest - # running without network = host led to repeated and numerous timeouts. - docker-build-args: '--network=host -f Dockerfile-Unit-Test' - build-timeout: 10 - stream: - - master: - branch: master - jobs: - - gerrit-docker-verify + - gerrit-python-xc-clm - project: <<: *a1_docker_common name: ric-plt-a1-sonar branch: master + python-version: python3 + # the install script assumes an ubuntu image + build-node: ubuntu1804-builder-2c-2g + pre-build-script: !include-raw-escape: + - ../shell/install-deb-nng-rmr.sh sonarcloud: true sonarcloud-project-key: o-ran-sc_ric-plt-a1 sonarcloud-project-organization: o-ran-sc diff --git a/jjb/shell/install-deb-nng-rmr.sh b/jjb/shell/install-deb-nng-rmr.sh new file mode 100644 index 00000000..7dbf3820 --- /dev/null +++ b/jjb/shell/install-deb-nng-rmr.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# O-RAN-SC +# +# Copyright (C) 2019 AT&T Intellectual Property and Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Installs NNG from source and RMR from PackageCloud on Ubuntu + +echo "---> install-deb-nng-rmr.sh" + +echo "Install packages" +sudo apt-get update +sudo apt-get install -y \ + cmake \ + ninja-build + +echo "Clone and build NNG" +git clone --branch v1.1.1 https://github.com/nanomsg/nng.git +(cd nng \ + && mkdir build \ + && cd build \ + && cmake -DBUILD_SHARED_LIBS=1 -G Ninja .. \ + && ninja \ + && sudo ninja install) + +ver="1.3.0" +echo "Install RMR library ${ver}" +wget --content-disposition https://packagecloud.io/o-ran-sc/master/packages/debian/stretch/rmr_${ver}_amd64.deb/download.deb +sudo dpkg -i rmr_${ver}_amd64.deb -- 2.16.6