Merge "Chore: Update Centos8 docker node"
authorEric Ball <eball@linuxfoundation.org>
Wed, 15 Feb 2023 23:26:54 +0000 (23:26 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 15 Feb 2023 23:26:54 +0000 (23:26 +0000)
19 files changed:
jjb/ccsdk/apps.yaml
jjb/ccsdk/ccsdk-oran.yaml
jjb/ccsdk/cds.yaml
jjb/ccsdk/distribution.yaml
jjb/ccsdk/features.yaml
jjb/ccsdk/odl-legacy.yaml
jjb/ccsdk/parent.yaml
jjb/ccsdk/sli.yaml
jjb/integration/include-raw-integration-install-robotframework-py3.sh
jjb/integration/prepare-csit.sh
jjb/integration/run-csit.sh
jjb/portal-ng/portal-ng.yaml [new file with mode: 0644]
jjb/sdc/sdc-sdc-docker-base.yaml
jjb/sdc/sdc-sdc-helm-validator.yaml
jjb/sdc/sdc-sdc-workflow-designer.yaml
jjb/sdc/sdc.yaml
jjb/sdnc/sdnc-apps.yaml
jjb/sdnc/sdnc-northbound.yaml
jjb/sdnc/sdnc-oam.yaml

index 40d57d0..6849c8e 100644 (file)
@@ -19,7 +19,7 @@
           sign-artifacts: true
           mvn-params: '-Dmaven.test.skip=true'
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
 
       - gerrit-maven-docker-stage:
           container-public-registry: 'nexus3.onap.org:10001'
index 6b49939..8076a03 100644 (file)
@@ -14,7 +14,7 @@
           mvn-params: '-Dmaven.test.skip=true'
           mvn-opts: '-Ddocker.skip=true'
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
       - gerrit-maven-docker-stage:
           build-node: centos8-docker-8c-8g
           container-public-registry: 'nexus3.onap.org:10001'
index a0447db..708a2e4 100644 (file)
@@ -13,7 +13,7 @@
           sign-artifacts: true
           mvn-params: '-Dmaven.test.skip=true'
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
       - gerrit-maven-docker-stage:
           container-public-registry: 'nexus3.onap.org:10001'
           container-staging-registry: 'nexus3.onap.org:10003'
index 26eb0b6..95ba9ce 100644 (file)
@@ -14,7 +14,7 @@
           mvn-params: '-Dmaven.test.skip=true'
           maven-versions-plugin: true
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
       - gerrit-maven-docker-stage:
           build-node: centos8-docker-8c-8g
           container-public-registry: 'nexus3.onap.org:10001'
index 4a2ba1d..43241ed 100644 (file)
@@ -13,7 +13,7 @@
           sign-artifacts: true
           mvn-params: '-Dmaven.test.skip=true'
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
       - '{project-name}-gerrit-release-jobs':
           build-node: centos8-docker-8c-8g
 
index 21036bc..567f989 100644 (file)
@@ -19,7 +19,7 @@
           sign-artifacts: true
           mvn-params: '-Dmaven.test.skip=true'
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
       - '{project-name}-gerrit-release-jobs':
           build-node: centos8-docker-8c-8g
 
index 2a8cc5e..d894801 100644 (file)
@@ -13,7 +13,7 @@
           sign-artifacts: true
           mvn-params: '-Dmaven.test.skip=true'
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
       - '{project-name}-gerrit-release-jobs':
           build-node: centos8-docker-8c-8g
 
index 51407c2..90fa8ca 100644 (file)
@@ -13,7 +13,7 @@
           sign-artifacts: true
           mvn-params: '-Dmaven.test.skip=true'
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
       - '{project-name}-gerrit-release-jobs':
           build-node: centos8-docker-8c-8g
 
index 6d0b496..efeb0f7 100644 (file)
 ##############################################################################
 # vim: sw=4 ts=4 sts=4 et ft=sh :
 
-set -eu pipefail
+set -euxo pipefail
 
-# shellcheck disable=SC1090
-. ~/lf-env.sh
+echo "---> install-robotframework-py3.sh"
 
-# Create a virtual environment for robot tests and make sure setuptools & wheel
-# are up-to-date in addition to pip
-lf-activate-venv --python python3 --venv-file "${WORKSPACE}/.robot3_venv" \
-    setuptools \
-    wheel
+### Common variables
+
+REQUIRED_PYTHON="3.7.0"
+
+### Common functions
+
+# Allows for the comparison of two Python version strings
+ver_cmp()
+{
+    local IFS=.
+    # shellcheck disable=SC2206
+    local V1=($1) V2=($2) I
+    for ((I=0 ; I<${#V1[*]} || I<${#V2[*]} ; I++)) ; do
+        [[ ${V1[$I]:-0} -lt ${V2[$I]:-0} ]] && echo -1 && return
+        [[ ${V1[$I]:-0} -gt ${V2[$I]:-0} ]] && echo 1 && return
+    done
+    echo 0
+}
+# Checks if first version/string is greater than or equal to the second
+ver_ge()
+{
+    [[ ! $(ver_cmp "$1" "$2") -eq -1 ]]
+}
 
-# Save the virtual environment in ROBOT_VENV
-ROBOT3_VENV="$(cat "${WORKSPACE}/.robot3_venv")"
-echo ROBOT3_VENV="${ROBOT3_VENV}" >> "${WORKSPACE}/env.properties"
+### Main script entry point
 
-set -exu
+# Check for required Python versions and activate/warn appropriately
+# Use PYENV for selecting the latest python version, if available
+if [[ -d "/opt/pyenv" ]]; then
+    echo "Setup pyenv:"
+    export PYENV_ROOT="/opt/pyenv"
+    export PATH="$PYENV_ROOT/bin:$PATH"
+    pyenv versions
+    if command -v pyenv 1>/dev/null 2>&1; then
+        eval "$(pyenv init - --no-rehash)"
+        # Choose the latest numeric Python version from installed list
+        version=$(pyenv versions --bare | sed '/^[^0-9]/d' |\
+            sort -V | tail -n 1)
+        pyenv local "${version}"
+    fi
+fi
 
-echo "Installing Python Requirements"
+# Store the active/current Python3 version
+PYTHON_VERSION=$(python3 --version | awk '{print $2}')
+
+#  Check that the required minimum version has been met
+if ! (ver_ge "${PYTHON_VERSION}" "${REQUIRED_PYTHON}"); then
+    echo "Warning: possible Python version problem"
+    echo "Python ${PYTHON_VERSION} does not meet requirement: ${REQUIRED_PYTHON}"
+fi
+
+if (python3 -m robot.run --version > /dev/null 2>&1); then
+    echo "Working robot framework found; no installation necessary"
+    echo "Installed under Python version: ${PYTHON_VERSION}"
+    exit 0
+fi
+
+
+# Create a requirements file; keep it around for potential later use
+# Versions and dependencies below have been carefully tested for Python3
 cat << 'EOF' > "requirements.txt"
 paramiko
 six
@@ -79,6 +125,49 @@ PyVirtualDisplay
 odltools
 EOF
 
-python3 -m pip install -r requirements.txt
+
+if [[ -f ~/lf-env.sh ]]; then
+    echo "Installing robot-framework using LF common tooling"
+    # shellcheck disable=SC1090
+    source ~/lf-env.sh
+
+    # Create a virtual environment for robot tests and make sure setuptools & wheel
+    # are up-to-date in addition to pip
+    lf-activate-venv --python python3 --venv-file "${WORKSPACE}/.robot3_venv" \
+    setuptools \
+    pip \
+    wheel
+
+    # Install the robot framework and other dependencies
+    python3 -m pip install -r requirements.txt
+
+    # Save the virtual environment in ROBOT3_VENV
+    ROBOT3_VENV="$(cat "${WORKSPACE}/.robot3_venv")"
+
+else
+    echo "Installing robot-framework in a virtual environment"
+    if [[ -z "${WORKSPACE}" ]]; then
+        # Use a temporary folder location
+        WORKSPACE="/tmp"
+        ROBOT3_VENV=$(mktemp -d --suffix=-robot3_venv)
+    else
+        ROBOT3_VENV="${WORKSPACE}/.robot3_venv"
+    fi
+
+    # The --system-site-packages parameter allows us to pick up system level
+    # installed packages. This allows us to bake matplotlib which takes very long
+    # to install into the image.
+    python3 -m venv --system-site-packages "${ROBOT3_VENV}"
+    source "${ROBOT3_VENV}/bin/activate"
+
+    echo "Installing robot-framework using basic methods"
+    python3 -m pip install -r requirements.txt
+fi
+
+# Store the virtual environment location
+echo "ROBOT3_VENV=${ROBOT3_VENV}" >> "${WORKSPACE}/env.properties"
+
+# Display versioning/debugging output
+python3 --version
 python3 -m pip freeze
 python3 -m robot.run --version || :
index 1052bff..0db140f 100644 (file)
@@ -24,18 +24,48 @@ set -exo pipefail
 
 ROBOT_INSTALLER='include-raw-integration-install-robotframework-py3.sh'
 
-if !(which git > /dev/null 2>&1); then
-    echo "GIT binary not found current PATH"
-    echo $PATH; exit 1
+# Allows testing for root permissions
+REQ_USER=$(id -un)
+
+if ! (which git > /dev/null 2>&1); then
+    echo "GIT binary not found in current PATH"
+    # Add missing package to prevent script/job failures
+    if (grep Ubuntu /etc/os-release > /dev/null 2>&1) || \
+    (grep Debian /etc/os-release > /dev/null 2>&1); then
+        echo "Installing package dependency for Ubuntu/Debian"
+        if [[ "${REQ_USER}" == 'root' ]]; then
+            apt-get update
+            apt-get install -y git
+        else
+            sudo apt-get update
+            sudo apt-get install -y git
+        fi
+    elif (grep RedHat /etc/os-release > /dev/null 2>&1) || \
+    (grep CentOS /etc/os-release > /dev/null 2>&1); then
+        echo "Installing package dependency for CentOS/RedHat"
+        if [[ "${REQ_USER}" == 'root' ]]; then
+            yum install -y git
+        else
+            sudo yum install -y git
+        fi
+    else
+        echo "Warning: unmatched OS/distribution"
+        echo "Missing software will not be installed"
+    fi
 fi
 
-if [ -z "$WORKSPACE" ]; then
-    # shellcheck disable=SC2155
-    export WORKSPACE=`git rev-parse --show-toplevel`
+if [[ -z "${WORKSPACE}" ]]; then
+    if (git rev-parse --show-toplevel > /dev/null 2>&1); then
+        WORKSPACE=$(git rev-parse --show-toplevel)
+        export WORKSPACE
+    else
+        WORKSPACE=$(pwd)
+        export WORKSPACE
+    fi
 fi
 
 # shellcheck disable=SC2034
-TESTPLANDIR=${WORKSPACE}/${TESTPLAN}
+TESTPLANDIR="${WORKSPACE}/${TESTPLAN}"
 
 # Python version should match that used to setup
 #  robot-framework in other jobs/stages
@@ -56,22 +86,26 @@ fi
 
 # Assume that if ROBOT3_VENV is set, virtualenv
 #  with system site packages can be activated
-if [ -f ${WORKSPACE}/env.properties ]; then
-    source ${WORKSPACE}/env.properties
+if [[ -f "${WORKSPACE}/env.properties" ]]; then
+    source "${WORKSPACE}/env.properties"
+elif [[ -f /tmp/env.properties ]]; then
+    source /tmp/env.properties
 fi
-if [ -f ${ROBOT3_VENV}/bin/activate ]; then
-    source ${ROBOT3_VENV}/bin/activate
+
+if [[ -f "${ROBOT3_VENV}/bin/activate" ]]; then
+    source "${ROBOT3_VENV}/bin/activate"
 else
     # Robot framework was not found
     #  clone ci-management repository and use install script
     git clone "https://gerrit.onap.org/r/ci-management" \
         /tmp/ci-management
-    source /tmp/ci-management/jjb/integration/${ROBOT_INSTALLER}
+    # shellcheck disable=SC1090
+    source "/tmp/ci-management/jjb/integration/${ROBOT_INSTALLER}"
 fi
 
 # install eteutils
-mkdir -p ${ROBOT3_VENV}/src/onap
-rm -rf ${ROBOT3_VENV}/src/onap/testsuite
+mkdir -p "${ROBOT3_VENV}/src/onap"
+rm -rf "${ROBOT3_VENV}/src/onap/testsuite"
 # Source from the Nexus repository
 python3 -m pip install --upgrade \
     --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" \
index bd35ac4..877cebb 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-# $1 project/functionality
-# $2 robot options
+# $1 project/functionality {TESTPLAN}
+# $2 robot options         {TESTOPTIONS}
 
 echo "---> run-csit.sh"
 
 WORKDIR=$(mktemp -d --suffix=-robot-workdir)
 
+# Exit if no arguments are provided and required variables not set
+if [[ $# -eq 0 ]] && [[ -z "${TESTPLAN}" ]] && [[ -z "${TESTOPTIONS}" ]]; then
+    echo
+    echo "Usage: $0 plans/<project>/<functionality> [<robot-options>]"
+    echo
+    echo " <project>, <functionality>, <robot-options>:  "
+    echo "  The same values as for the JJB job template:"
+    echo '  {project}-csit-{functionality}'
+    echo
+    exit 1
+
+elif [[ $# -ne 2 ]] && [[ -z "${TESTPLAN}" ]] && [[ -z "${TESTOPTIONS}" ]]; then
+    echo
+    echo "Script called without arguments, but the following variables"
+    echo " must be set: {TESTPLAN} {TESTOPTIONS}"
+    echo
+    exit 1
+
+elif [[ $# -eq 2 ]]; then
+    export TESTPLAN=$1; export TESTOPTIONS=$2
+fi
+
 # Python version should match that used to setup
 #  robot-framework in other jobs/stages
 # Use pyenv for selecting the python version
@@ -43,12 +65,52 @@ fi
 # functions
 #
 
+# load the saved set options
+function load_set {
+    _setopts="$-"
+
+    # bash shellopts
+    for i in $(echo "$SHELLOPTS" | tr ':' ' ') ; do
+        set +o "${i}"
+    done
+    for i in $(echo "$RUN_CSIT_SHELLOPTS" | tr ':' ' ') ; do
+        set -o "${i}"
+    done
+
+    # other options
+    for i in $(echo "$_setopts" | sed 's/./& /g') ; do
+        set +"${i}"
+    done
+    set -"${RUN_CSIT_SAVE_SET}"
+}
+
+# set options for quick bailout when error
+function harden_set {
+    set -xeo pipefail
+    set +u # enabled it would probably fail too many often
+}
+
+# relax set options so the sourced file will not fail
+# the responsibility is shifted to the sourced file...
+function relax_set {
+    set +e
+    set +o pipefail
+}
+
+# save current set options
+function save_set {
+    RUN_CSIT_SAVE_SET="$-"
+    RUN_CSIT_SHELLOPTS="$SHELLOPTS"
+}
+
 # wrapper for sourcing a file
 function source_safely {
-    [ -z "$1" ] && return 1
-    relax_set
-    . "$1"
-    load_set
+    if [[ -z "$1" ]] && return 1; then
+        relax_set
+        # shellcheck disable=SC1090
+        source "$1"
+        load_set
+    fi
 }
 
 function on_exit {
@@ -66,11 +128,10 @@ function on_exit {
     # Run teardown script plan if it exists
     cd "${TESTPLANDIR}"
     TEARDOWN="${TESTPLANDIR}/teardown.sh"
-    if [ -f "${TEARDOWN}" ]; then
+    if [[ -f "${TEARDOWN}" ]]; then
         echo "Running teardown script ${TEARDOWN}"
         source_safely "${TEARDOWN}"
     fi
-    # TODO: do something with the output
     exit $rc
 }
 # ensure that teardown and other finalizing steps are always executed
@@ -96,44 +157,6 @@ function docker_stats {
     echo
 }
 
-# save current set options
-function save_set {
-    RUN_CSIT_SAVE_SET="$-"
-    RUN_CSIT_SHELLOPTS="$SHELLOPTS"
-}
-
-# load the saved set options
-function load_set {
-    _setopts="$-"
-
-    # bash shellopts
-    for i in $(echo "$SHELLOPTS" | tr ':' ' ') ; do
-        set +o ${i}
-    done
-    for i in $(echo "$RUN_CSIT_SHELLOPTS" | tr ':' ' ') ; do
-        set -o ${i}
-    done
-
-    # other options
-    for i in $(echo "$_setopts" | sed 's/./& /g') ; do
-        set +${i}
-    done
-    set -${RUN_CSIT_SAVE_SET}
-}
-
-# set options for quick bailout when error
-function harden_set {
-    set -xeo pipefail
-    set +u # enabled it would probably fail too many often
-}
-
-# relax set options so the sourced file will not fail
-# the responsibility is shifted to the sourced file...
-function relax_set {
-    set +e
-    set +o pipefail
-}
-
 #
 # main
 #
@@ -141,29 +164,21 @@ function relax_set {
 # set and save options for quick failure
 harden_set && save_set
 
-if [ $# -eq 0 ]; then
-    echo
-    echo "Usage: $0 plans/<project>/<functionality> [<robot-options>]"
-    echo
-    echo "    <project>, <functionality>, <robot-options>:  "
-    echo "        The same values as for the '{project}-csit-{functionality}' JJB job template."
-    echo
-    exit 1
-fi
-
-if [ -z "$WORKSPACE" ]; then
-    export WORKSPACE=$(git rev-parse --show-toplevel)
+if [[ -z "${WORKSPACE}" ]]; then
+    if (git rev-parse --show-toplevel > /dev/null 2>&1); then
+        WORKSPACE=$(git rev-parse --show-toplevel)
+        export WORKSPACE
+    else
+        WORKSPACE=$(pwd)
+        export WORKSPACE
+    fi
 fi
 
-if [ -f "${WORKSPACE}/${1}/testplan.txt" ]; then
-    export TESTPLAN="${1}"
-else
+if [[ ! -f "${WORKSPACE}/${TESTPLAN}/testplan.txt" ]]; then
     echo "testplan not found: ${WORKSPACE}/${TESTPLAN}/testplan.txt"
     exit 2
 fi
 
-export TESTOPTIONS="${2}"
-
 rm -rf "$WORKSPACE/archives/$TESTPLAN"
 mkdir -p "$WORKSPACE/archives/$TESTPLAN"
 
@@ -178,7 +193,7 @@ source_safely "${ROBOT3_VENV}/bin/activate"
 cd "${WORKDIR}"
 
 # Add csit scripts to PATH
-export PATH="${PATH}:${WORKSPACE}/docker/scripts:${WORKSPACE}/scripts:${ROBOT_VENV}/bin"
+export PATH="${PATH}:${WORKSPACE}/docker/scripts:${WORKSPACE}/scripts:${ROBOT3_VENV}/bin"
 export SCRIPTS="${WORKSPACE}/scripts"
 export ROBOT_VARIABLES=
 
@@ -199,7 +214,8 @@ docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-1-after-setup.txt"
 # Run test plan
 cd "$WORKDIR"
 echo "Reading the testplan:"
-cat "${TESTPLANDIR}/testplan.txt" | egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' | sed "s|^|${WORKSPACE}/tests/|" > testplan.txt
+grep -E -v '(^[[:space:]]*#|^[[:space:]]*$)' "${TESTPLANDIR}/testplan.txt" |\
+    sed "s|^|${WORKSPACE}/tests/|" > testplan.txt
 cat testplan.txt
 SUITES=$( xargs -a testplan.txt )
 
@@ -212,10 +228,9 @@ python3 --version
 pip freeze
 python3 -m robot.run --version || :
 
-python -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES}
+python -m robot.run -N "${TESTPLAN}" -v WORKSPACE:/tmp "${ROBOT_VARIABLES}" "${TESTOPTIONS}" "${SUITES}"
 RESULT=$?
 load_set
 echo "RESULT: $RESULT"
 # Note that the final steps are done in on_exit function after this exit!
 exit $RESULT
-
diff --git a/jjb/portal-ng/portal-ng.yaml b/jjb/portal-ng/portal-ng.yaml
new file mode 100644 (file)
index 0000000..8bc5d13
--- /dev/null
@@ -0,0 +1,15 @@
+---
+- project:
+    name: portal-ng-project-view
+    project-name: portal-ng
+    views:
+      - project-view
+
+- project:
+    name: portal-ng-info
+    project: portal-ng
+    project-name: portal-ng
+    build-node: centos7-builder-2c-1g
+    branch: master
+    jobs:
+      - gerrit-info-yaml-verify
\ No newline at end of file
index 0a894db..3798685 100644 (file)
@@ -12,6 +12,7 @@
           docker-pom: 'pom.xml'
           mvn-profile: 'default'
       - gerrit-maven-docker-stage:
+          sbom-generator: true
           build-node: ubuntu1804-docker-8c-8g
           maven-versions-plugin: true
           mvn-params: '-P default'
index 26ca8fe..9877904 100644 (file)
@@ -27,6 +27,7 @@
           maven-versions-plugin: true
           mvn-goals: 'clean deploy'
       - gerrit-maven-docker-stage:
+          sbom-generator: true
           build-node: ubuntu1804-docker-8c-8g
           maven-versions-plugin: true
           mvn-goals: 'clean install docker:build docker:push'
index 409b1de..68a03fc 100644 (file)
@@ -18,6 +18,7 @@
           build-node: centos7-builder-4c-4g
           maven-versions-plugin: true
       - gerrit-maven-docker-stage:
+          sbom-generator: true
           build-node: ubuntu1804-docker-8c-8g
           maven-versions-plugin: true
           mvn-params: '-P docker -Dmaven.test.skip=true'
index 6a754e5..2a330ed 100644 (file)
@@ -55,6 +55,7 @@
           mvn-version: 'mvn36'
           mvn-params: '-DskipTests=true -Dnpm.registry=https://nexus3.onap.org/repository/npm.public/npm/-/'
       - gerrit-maven-docker-stage:
+          sbom-generator: true
           build-node: ubuntu1804-docker-v1-8c-8g
           maven-versions-plugin: true
           mvn-params: '-P docker -DskipTests=true -Dnpm.registry=https://nexus3.onap.org/repository/npm.public/npm/-/'
index 7b40832..9e9eb53 100644 (file)
@@ -22,7 +22,7 @@
           sign-artifacts: true
           mvn-params: '-Dmaven.test.skip=true'
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
       - gerrit-maven-docker-stage:
           build-node: ubuntu1804-docker-8c-8g
           container-public-registry: 'nexus3.onap.org:10001'
index d44904c..af39912 100644 (file)
@@ -10,7 +10,7 @@
           sign-artifacts: true
           build-node: centos8-builder-4c-4g
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
       - '{project-name}-gerrit-release-jobs':
           build-node: centos8-docker-8c-8g
 
index da7a4cc..9961802 100644 (file)
@@ -13,7 +13,7 @@
           sign-artifacts: true
           mvn-params: '-Dmaven.test.skip=true'
           cron: ''
-          sbom-generator: false
+          sbom-generator: true
       - gerrit-maven-docker-stage:
           build-node: ubuntu1804-docker-8c-8g
           container-public-registry: 'nexus3.onap.org:10001'