Updated pipelines for Voltha-2.8 release
Change-Id: I53ca9a5418a73299165bbc00ad655288734fd35e
diff --git a/jjb/pipeline/voltha/voltha-2.7/bbsim-tests.groovy b/jjb/pipeline/voltha/voltha-2.7/bbsim-tests.groovy
deleted file mode 100644
index 4cf748a..0000000
--- a/jjb/pipeline/voltha/voltha-2.7/bbsim-tests.groovy
+++ /dev/null
@@ -1,222 +0,0 @@
-// Copyright 2017-present Open Networking Foundation
-//
-// 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.
-
-// voltha-2.x e2e tests
-// uses bbsim to simulate OLT/ONUs
-
-// NOTE we are importing the library even if it's global so that it's
-// easier to change the keywords during a replay
-library identifier: 'cord-jenkins-libraries@master',
- retriever: modernSCM([
- $class: 'GitSCMSource',
- remote: 'https://gerrit.opencord.org/ci-management.git'
-])
-
-def test_workflow(name) {
- timeout(time: 10, unit: 'MINUTES') {
- stage('Deploy - '+ name + ' workflow') {
- def extraHelmFlags = "${extraHelmFlags} --set global.log_level=DEBUG,onu=1,pon=1 "
-
- if (gerritProject != "") {
- extraHelmFlags = extraHelmFlags + getVolthaImageFlags("${gerritProject}")
- }
-
- def localCharts = false
- if (gerritProject == "voltha-helm-charts" || branch != "master") {
- localCharts = true
- }
-
- volthaDeploy([
- workflow: name,
- extraHelmFlags: extraHelmFlags,
- localCharts: localCharts,
- dockerRegistry: "mirror.registry.opennetworking.org"
- ])
- // start logging
- sh """
- mkdir -p $WORKSPACE/${name}
- _TAG=kail-${name} kail -n infra -n voltha > $WORKSPACE/${name}/onos-voltha-combined.log &
- """
- // forward ONOS and VOLTHA ports
- sh """
- _TAG=onos-port-forward kubectl port-forward --address 0.0.0.0 -n infra svc/voltha-infra-onos-classic-hs 8101:8101&
- _TAG=onos-port-forward kubectl port-forward --address 0.0.0.0 -n infra svc/voltha-infra-onos-classic-hs 8181:8181&
- _TAG=voltha-port-forward kubectl port-forward --address 0.0.0.0 -n voltha svc/voltha-voltha-api 55555:55555&
- """
- }
- }
- stage('Test VOLTHA - '+ name + ' workflow') {
- sh """
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/${name.toUpperCase()}Workflow"
- mkdir -p \$ROBOT_LOGS_DIR
- export ROBOT_MISC_ARGS="-d \$ROBOT_LOGS_DIR -e PowerSwitch"
-
- # By default, all tests tagged 'sanity' are run. This covers basic functionality
- # like running through the ATT workflow for a single subscriber.
- export TARGET=sanity-kind-${name}
-
- # If the Gerrit comment contains a line with "functional tests" then run the full
- # functional test suite. This covers tests tagged either 'sanity' or 'functional'.
- # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
- REGEX="functional tests"
- if [[ "\$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
- export TARGET=functional-single-kind-${name}
- fi
-
- if [[ "${gerritProject}" == "bbsim" ]]; then
- echo "Running BBSim specific Tests"
- export TARGET=sanity-bbsim-${name}
- fi
-
- export VOLTCONFIG=$HOME/.volt/config
- export KUBECONFIG=$HOME/.kube/config
-
- # Run the specified tests
- make -C $WORKSPACE/voltha-system-tests \$TARGET || true
- """
- // stop logging
- sh """
- P_IDS="\$(ps e -ww -A | grep "_TAG=kail-${name}" | grep -v grep | awk '{print \$1}')"
- if [ -n "\$P_IDS" ]; then
- echo \$P_IDS
- for P_ID in \$P_IDS; do
- kill -9 \$P_ID
- done
- fi
- """
- // remove port-forwarding
- sh """
- # remove orphaned port-forward from different namespaces
- ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 || true
- """
- // collect pod details
- get_pods_info("$WORKSPACE/${name}")
- helmTeardown(['infra', 'voltha'])
- }
-}
-
-def get_pods_info(dest) {
- // collect pod details, this is here in case of failure
- sh """
- mkdir -p ${dest}
- kubectl get pods --all-namespaces -o wide | tee ${dest}/pods.txt || true
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee ${dest}/pod-images.txt || true
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee ${dest}/pod-imagesId.txt || true
- kubectl describe pods --all-namespaces -l app.kubernetes.io/part-of=voltha > ${dest}/pods-describe.txt
- helm ls --all-namespaces | tee ${dest}/helm-charts.txt
- """
-}
-
-pipeline {
-
- /* no label, executor is determined by JJB */
- agent {
- label "${params.buildNode}"
- }
- options {
- timeout(time: 35, unit: 'MINUTES')
- }
- environment {
- PATH="$PATH:$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
- KUBECONFIG="$HOME/.kube/kind-config-${clusterName}"
- }
-
- stages{
- stage('Download Code') {
- steps {
- getVolthaCode([
- branch: "${branch}",
- gerritProject: "${gerritProject}",
- gerritRefspec: "${gerritRefspec}",
- volthaSystemTestsChange: "${volthaSystemTestsChange}",
- volthaHelmChartsChange: "${volthaHelmChartsChange}",
- ])
- }
- }
- stage('Build patch') {
- steps {
- // NOTE that the correct patch has already been checked out
- // during the getVolthaCode step
- buildVolthaComponent("${gerritProject}")
- }
- }
- stage('Create K8s Cluster') {
- steps {
- createKubernetesCluster([nodes: 3])
- }
- }
- stage('Load image in kind nodes') {
- steps {
- loadToKind()
- }
- }
- stage('Replace voltctl') {
- // if the project is voltctl override the downloaded one with the built one
- when {
- expression {
- return gerritProject == "voltctl"
- }
- }
- steps{
- sh """
- mv `ls $WORKSPACE/voltctl/release/voltctl-*-linux-amd*` $WORKSPACE/bin/voltctl
- chmod +x $WORKSPACE/bin/voltctl
- """
- }
- }
- stage('Run Test') {
- steps {
- timeout(time: 30, unit: 'MINUTES') {
- test_workflow("att")
- test_workflow("dt")
- test_workflow("tt")
- }
- }
- }
- }
-
- post {
- aborted {
- get_pods_info("$WORKSPACE/failed")
- sh """
- kubectl logs -n voltha -l app.kubernetes.io/part-of=voltha > $WORKSPACE/failed/voltha.log
- """
- archiveArtifacts artifacts: '**/*.log,**/*.txt'
- }
- failure {
- get_pods_info("$WORKSPACE/failed")
- sh """
- kubectl logs -n voltha -l app.kubernetes.io/part-of=voltha > $WORKSPACE/failed/voltha.logs
- """
- archiveArtifacts artifacts: '**/*.log,**/*.txt'
- }
- always {
- sh '''
- gzip $WORKSPACE/att/onos-voltha-combined.log || true
- gzip $WORKSPACE/dt/onos-voltha-combined.log || true
- gzip $WORKSPACE/tt/onos-voltha-combined.log || true
- '''
- step([$class: 'RobotPublisher',
- disableArchiveOutput: false,
- logFileName: 'RobotLogs/*/log*.html',
- otherFiles: '',
- outputFileName: 'RobotLogs/*/output*.xml',
- outputPath: '.',
- passThreshold: 100,
- reportFileName: 'RobotLogs/*/report*.html',
- unstableThreshold: 0]);
- archiveArtifacts artifacts: '*.log,**/*.log,**/*.gz,*.gz,*.txt,**/*.txt'
- }
- }
-}
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-DMI-bbsim-tests.groovy b/jjb/pipeline/voltha/voltha-2.7/voltha-DMI-bbsim-tests.groovy
deleted file mode 100755
index e7dba07..0000000
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-DMI-bbsim-tests.groovy
+++ /dev/null
@@ -1,207 +0,0 @@
-// Copyright 2017-present Open Networking Foundation
-//
-// 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.
-
-// voltha-2.x e2e tests
-// uses kind-voltha to deploy voltha-2.X
-// uses bbsim to simulate OLT/ONUs
-
-pipeline {
-
- /* no label, executor is determined by JJB */
- agent {
- label "${params.buildNode}"
- }
- options {
- timeout(time: 30, unit: 'MINUTES')
- }
- environment {
- KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
- VOLTCONFIG="$HOME/.volt/config-minimal"
- PATH="$PATH:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- NAME="minimal"
- FANCY=0
- WITH_SIM_ADAPTERS="no"
- WITH_RADIUS="yes"
- WITH_BBSIM="yes"
- DEPLOY_K8S="yes"
- VOLTHA_LOG_LEVEL="DEBUG"
- CONFIG_SADIS="external"
- BBSIM_CFG="configs/bbsim-sadis-att.yaml"
- ROBOT_MISC_ARGS="-e PowerSwitch ${params.extraRobotArgs}"
- KARAF_HOME="${params.karafHome}"
- DIAGS_PROFILE="VOLTHA_PROFILE"
- NUM_OF_BBSIM="${olts}"
- }
- stages {
- stage('Clone kind-voltha') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/kind-voltha",
- // refspec: "${kindVolthaChange}"
- ]],
- branches: [[ name: "master", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- }
- }
- stage('Cleanup') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down || ./voltha down
- """
- }
- }
- }
- stage('Clone voltha-system-tests') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/voltha-system-tests",
- // refspec: "${volthaSystemTestsChange}"
- ]],
- branches: [[ name: "${branch}", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- }
- }
-
- stage('Deploy Voltha') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${params.extraHelmFlags}"
-
- cd $WORKSPACE/kind-voltha/
- ./voltha up
- """
- }
- }
- }
-
- stage('Device Management Interface Tests') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/DMITests"
- }
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh '''
- set +e
- mkdir -p $ROBOT_LOGS_DIR
- cd $WORKSPACE/kind-voltha/scripts
- ./log-collector.sh > /dev/null &
- ./log-combine.sh > /dev/null &
-
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
- make -C $WORKSPACE/voltha-system-tests ${makeTarget} || true
- '''
- }
- }
- }
- }
-
- post {
- always {
- sh '''
- set +e
- cp $WORKSPACE/kind-voltha/install-minimal.log $WORKSPACE/
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
- kubectl get nodes -o wide
- kubectl get pods -o wide
- kubectl get pods -n voltha -o wide
-
- sleep 60 # Wait for log-collector and log-combine to complete
-
- ## Pull out errors from log files
- extract_errors_go() {
- echo
- echo "Error summary for $1:"
- grep '"level":"error"' $WORKSPACE/kind-voltha/scripts/logger/combined/$1*
- echo
- }
-
- extract_errors_python() {
- echo
- echo "Error summary for $1:"
- grep 'ERROR' $WORKSPACE/kind-voltha/scripts/logger/combined/$1*
- echo
- }
-
- extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log
- extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log
- extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log
- extract_errors_go voltha-ofagent >> $WORKSPACE/error-report.log
- extract_errors_python onos >> $WORKSPACE/error-report.log
-
- gzip error-report.log || true
-
- cd $WORKSPACE/kind-voltha/scripts/logger/combined/
- tar czf $WORKSPACE/container-logs.tgz *
-
- cd $WORKSPACE
- gzip *-combined.log || true
-
- ## shut down voltha but leave kind-voltha cluster
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- DEPLOY_K8S=n WAIT_ON_DOWN=y ./voltha down
- kubectl delete deployment voltctl || true
- '''
- step([$class: 'RobotPublisher',
- disableArchiveOutput: false,
- logFileName: '**/log*.html',
- otherFiles: '',
- outputFileName: '**/output*.xml',
- outputPath: 'RobotLogs',
- passThreshold: 100,
- reportFileName: '**/report*.html',
- unstableThreshold: 0]);
-
- archiveArtifacts artifacts: '*.log,*.gz,*.tgz'
-
- }
- }
-}
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-bbsim-tests.groovy b/jjb/pipeline/voltha/voltha-2.7/voltha-bbsim-tests.groovy
deleted file mode 100644
index 5208368..0000000
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-bbsim-tests.groovy
+++ /dev/null
@@ -1,526 +0,0 @@
-// Copyright 2017-present Open Networking Foundation
-//
-// 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.
-
-// voltha-2.x e2e tests
-// uses kind-voltha to deploy voltha-2.X
-// uses bbsim to simulate OLT/ONUs
-
-pipeline {
-
- /* no label, executor is determined by JJB */
- agent {
- label "${params.buildNode}"
- }
- options {
- timeout(time: 90, unit: 'MINUTES')
- }
- environment {
- PATH="$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- VOLTHA_LOG_LEVEL="DEBUG"
- FANCY=0
- WITH_SIM_ADAPTERS="n"
- NAME="test"
- VOLTCONFIG="$HOME/.volt/config-$NAME"
- KUBECONFIG="$HOME/.kube/kind-config-voltha-$NAME"
- EXTRA_HELM_FLAGS=" --set global.image_registry=mirror.registry.opennetworking.org/ --set defaults.image_registry=mirror.registry.opennetworking.org/ "
- }
-
- stages {
- stage('Clone kind-voltha') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/kind-voltha",
- refspec: "${kindVolthaChange}"
- ]],
- branches: [[ name: "master", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- sh """
- if [ '${kindVolthaChange}' != '' ] ; then
- cd $WORKSPACE/kind-voltha
- git fetch https://gerrit.opencord.org/kind-voltha ${kindVolthaChange} && git checkout FETCH_HEAD
- fi
- """
- }
- }
- stage('Clone voltha-system-tests') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/voltha-system-tests",
- refspec: "${volthaSystemTestsChange}"
- ]],
- branches: [[ name: "${branch}", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- sh """
- if [ '${volthaSystemTestsChange}' != '' ] ; then
- cd $WORKSPACE/voltha-system-tests
- git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD
- fi
- """
- }
- }
- // If the repo under test is not kind-voltha
- // then download it and checkout the patch
- stage('Download Patch') {
- when {
- expression {
- return "${gerritProject}" != 'kind-voltha';
- }
- }
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/${gerritProject}",
- refspec: "${gerritRefspec}"
- ]],
- branches: [[ name: "${branch}", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "${gerritProject}"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- sh """
- pushd $WORKSPACE/${gerritProject}
- git fetch https://gerrit.opencord.org/${gerritProject} ${gerritRefspec} && git checkout FETCH_HEAD
-
- echo "Currently on commit: \n"
- git log -1 --oneline
- popd
- """
- }
- }
- // If the repo under test is kind-voltha we don't need to download it again,
- // as we already have it, simply checkout the patch
- stage('Checkout kind-voltha patch') {
- when {
- expression {
- return "${gerritProject}" == 'kind-voltha';
- }
- }
- steps {
- sh """
- cd $WORKSPACE/kind-voltha
- git fetch https://gerrit.opencord.org/kind-voltha ${gerritRefspec} && git checkout FETCH_HEAD
- """
- }
- }
- stage('Create K8s Cluster') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- cd $WORKSPACE/kind-voltha/
- JUST_K8S=y ./voltha up
- bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/kind-voltha/bin"
- """
- }
- }
- }
-
- stage('Build Images') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- make-local () {
- make -C $WORKSPACE/\$1 DOCKER_REGISTRY=mirror.registry.opennetworking.org/ DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
- }
- if [ "${gerritProject}" = "pyvoltha" ]; then
- make -C $WORKSPACE/pyvoltha/ dist
- export LOCAL_PYVOLTHA=$WORKSPACE/pyvoltha/
- make-local voltha-openonu-adapter
- elif [ "${gerritProject}" = "voltha-lib-go" ]; then
- make -C $WORKSPACE/voltha-lib-go/ build
- export LOCAL_LIB_GO=$WORKSPACE/voltha-lib-go/
- make-local voltha-go
- make-local voltha-openolt-adapter
- elif [ "${gerritProject}" = "voltha-protos" ]; then
- make -C $WORKSPACE/voltha-protos/ build
- export LOCAL_PROTOS=$WORKSPACE/voltha-protos/
- make-local voltha-go
- make-local voltha-openolt-adapter
- make-local voltha-openonu-adapter
- make-local ofagent-py
- elif [ "${gerritProject}" = "voltctl" ]; then
- # Set and handle GOPATH and PATH
- export GOPATH=\${GOPATH:-$WORKSPACE/go}
- export PATH=\$PATH:/usr/lib/go-1.12/bin:/usr/local/go/bin:\$GOPATH/bin
- make -C $WORKSPACE/voltctl/ build
- elif ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests|kind-voltha)\$ ]]; then
- make-local ${gerritProject}
- fi
- """
- }
- }
- }
-
- stage('Push Images') {
- steps {
- sh '''
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- if ! [[ "${gerritProject}" =~ ^(voltha-helm-charts|voltha-system-tests|voltctl|kind-voltha)\$ ]]; then
- export GOROOT=/usr/local/go
- export GOPATH=\$(pwd)
- docker images | grep citest
- for image in \$(docker images -f "reference=*/*/*citest" --format "{{.Repository}}"); do echo "Pushing \$image to nodes"; kind load docker-image \$image:citest --name voltha-\$NAME --nodes voltha-\$NAME-worker,voltha-\$NAME-worker2; done
- fi
- '''
- }
- }
-
- stage('ATT workflow') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ATTWorkflow"
- }
- steps {
- timeout(time: 15, unit: 'MINUTES') {
- sh '''
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- if [[ "${gerritProject}" == voltha-helm-charts ]]; then
- export EXTRA_HELM_FLAGS+="--set global.image_tag=null "
- fi
-
- # Workflow-specific flags
- export WITH_RADIUS=yes
- export WITH_BBSIM=yes
- export DEPLOY_K8S=yes
- export CONFIG_SADIS="external"
- export BBSIM_CFG="configs/bbsim-sadis-att.yaml"
-
- export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
-
- IMAGES=""
- if [ "${gerritProject}" = "voltha-go" ]; then
- IMAGES="rw_core ro_core "
- elif [ "${gerritProject}" = "ofagent-py" ]; then
- IMAGES="ofagent_py "
- EXTRA_HELM_FLAGS+="--set use_ofagent_go=false "
- elif [ "${gerritProject}" = "ofagent-go" ]; then
- IMAGES="ofagent_go "
- elif [ "${gerritProject}" = "voltha-onos" ]; then
- IMAGES="onos "
- EXTRA_HELM_FLAGS+="--set images.onos.repository=mirror.registry.opennetworking.org/voltha/voltha-onos "
- elif [ "${gerritProject}" = "voltha-openolt-adapter" ]; then
- IMAGES="adapter_open_olt "
- elif [ "${gerritProject}" = "voltha-openonu-adapter" ]; then
- IMAGES="adapter_open_onu "
- elif [ "${gerritProject}" = "voltha-api-server" ]; then
- IMAGES="afrouter afrouterd "
- elif [ "${gerritProject}" = "bbsim" ]; then
- IMAGES="bbsim "
- elif [ "${gerritProject}" = "pyvoltha" ]; then
- IMAGES="adapter_open_onu "
- elif [ "${gerritProject}" = "voltha-lib-go" ]; then
- IMAGES="rw_core ro_core adapter_open_olt "
- elif [ "${gerritProject}" = "voltha-protos" ]; then
- IMAGES="rw_core ro_core adapter_open_olt adapter_open_onu ofagent "
- else
- echo "No images to push"
- fi
-
- for I in \$IMAGES
- do
- EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
- done
-
- if [ "${gerritProject}" = "voltha-helm-charts" ]; then
- export CHART_PATH=$WORKSPACE/voltha-helm-charts
- export VOLTHA_CHART=\$CHART_PATH/voltha
- export VOLTHA_ADAPTER_OPEN_OLT_CHART=\$CHART_PATH/voltha-adapter-openolt
- export VOLTHA_ADAPTER_OPEN_ONU_CHART=\$CHART_PATH/voltha-adapter-openonu
- helm dep update \$VOLTHA_CHART
- helm dep update \$VOLTHA_ADAPTER_OPEN_OLT_CHART
- helm dep update \$VOLTHA_ADAPTER_OPEN_ONU_CHART
- fi
-
- if [ "${gerritProject}" = "voltctl" ]; then
- export VOLTCTL_VERSION=$(cat $WORKSPACE/voltctl/VERSION)
- cp $WORKSPACE/voltctl/voltctl $WORKSPACE/kind-voltha/bin/voltctl
- md5sum $WORKSPACE/kind-voltha/bin/voltctl
- fi
-
- printenv
-
- # start logging
- mkdir -p $WORKSPACE/att
- _TAG=kail-att kail -n voltha -n default > $WORKSPACE/att/onos-voltha-combined.log &
-
- cd $WORKSPACE/kind-voltha/
- ./voltha up
-
- # $NAME-env.sh contains the environment we used
- # Save value of EXTRA_HELM_FLAGS there to use in subsequent stages
- echo export EXTRA_HELM_FLAGS=\\"\$EXTRA_HELM_FLAGS\\" >> $NAME-env.sh
-
- mkdir -p $ROBOT_LOGS_DIR
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
-
- # By default, all tests tagged 'sanity' are run. This covers basic functionality
- # like running through the ATT workflow for a single subscriber.
- export TARGET=sanity-single-kind
-
- # If the Gerrit comment contains a line with "functional tests" then run the full
- # functional test suite. This covers tests tagged either 'sanity' or 'functional'.
- # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
- REGEX="functional tests"
- if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
- TARGET=functional-single-kind
- fi
-
- make -C $WORKSPACE/voltha-system-tests \$TARGET || true
-
- # stop logging
- P_IDS="$(ps e -ww -A | grep "_TAG=kail-att" | grep -v grep | awk '{print $1}')"
- if [ -n "$P_IDS" ]; then
- echo $P_IDS
- for P_ID in $P_IDS; do
- kill -9 $P_ID
- done
- fi
-
- # get pods information
- kubectl get pods -o wide > $WORKSPACE/att/pods.txt || true
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee $WORKSPACE/att/pod-images.txt || true
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee $WORKSPACE/att/pod-imagesId.txt || true
- '''
- }
- }
- }
-
- stage('DT workflow') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/DTWorkflow"
- }
- steps {
- timeout(time: 15, unit: 'MINUTES') {
- sh '''
- cd $WORKSPACE/kind-voltha/
- source $NAME-env.sh
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
-
- # Workflow-specific flags
- export WITH_RADIUS=no
- export WITH_EAPOL=no
- export WITH_DHCP=no
- export WITH_IGMP=no
- export CONFIG_SADIS="external"
- export BBSIM_CFG="configs/bbsim-sadis-dt.yaml"
-
- if [[ "${gerritProject}" == voltha-helm-charts ]]; then
- export EXTRA_HELM_FLAGS+="--set global.image_tag=null "
- fi
-
- # start logging
- mkdir -p $WORKSPACE/dt
- _TAG=kail-dt kail -n voltha -n default > $WORKSPACE/dt/onos-voltha-combined.log &
-
- DEPLOY_K8S=n ./voltha up
-
- mkdir -p $ROBOT_LOGS_DIR
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
-
- # By default, all tests tagged 'sanityDt' are run. This covers basic functionality
- # like running through the DT workflow for a single subscriber.
- export TARGET=sanity-kind-dt
-
- # If the Gerrit comment contains a line with "functional tests" then run the full
- # functional test suite. This covers tests tagged either 'sanityDt' or 'functionalDt'.
- # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
- REGEX="functional tests"
- if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
- TARGET=functional-single-kind-dt
- fi
-
- make -C $WORKSPACE/voltha-system-tests \$TARGET || true
-
- # stop logging
- P_IDS="$(ps e -ww -A | grep "_TAG=kail-dt" | grep -v grep | awk '{print $1}')"
- if [ -n "$P_IDS" ]; then
- echo $P_IDS
- for P_ID in $P_IDS; do
- kill -9 $P_ID
- done
- fi
-
- # get pods information
- kubectl get pods -o wide > $WORKSPACE/dt/pods.txt || true
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee $WORKSPACE/dt/pod-images.txt || true
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee $WORKSPACE/dt/pod-imagesId.txt || true
- '''
- }
- }
- }
-
- stage('TT workflow') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/TTWorkflow"
- }
- steps {
- timeout(time: 15, unit: 'MINUTES') {
- sh '''
- cd $WORKSPACE/kind-voltha/
- source $NAME-env.sh
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
-
- # Workflow-specific flags
- export WITH_RADIUS=no
- export WITH_EAPOL=no
- export WITH_DHCP=yes
- export WITH_IGMP=yes
- export CONFIG_SADIS="external"
- export BBSIM_CFG="configs/bbsim-sadis-tt.yaml"
-
- if [[ "${gerritProject}" == voltha-helm-charts ]]; then
- export EXTRA_HELM_FLAGS+="--set global.image_tag=null "
- fi
-
- # start logging
- mkdir -p $WORKSPACE/tt
- _TAG=kail-tt kail -n voltha -n default > $WORKSPACE/tt/onos-voltha-combined.log &
-
- DEPLOY_K8S=n ./voltha up
-
- mkdir -p $ROBOT_LOGS_DIR
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
-
- # By default, all tests tagged 'sanityTt' are run. This covers basic functionality
- # like running through the TT workflow for a single subscriber.
- export TARGET=sanity-kind-tt
-
- # If the Gerrit comment contains a line with "functional tests" then run the full
- # functional test suite. This covers tests tagged either 'sanityTt' or 'functionalTt'.
- # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
- REGEX="functional tests"
- if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
- TARGET=functional-single-kind-tt
- fi
-
- make -C $WORKSPACE/voltha-system-tests \$TARGET || true
-
- # stop logging
- P_IDS="$(ps e -ww -A | grep "_TAG=kail-att" | grep -v grep | awk '{print $1}')"
- if [ -n "$P_IDS" ]; then
- echo $P_IDS
- for P_ID in $P_IDS; do
- kill -9 $P_ID
- done
- fi
-
- # get pods information
- kubectl get pods -o wide > $WORKSPACE/tt/pods.txt || true
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee $WORKSPACE/tt/pod-images.txt || true
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee $WORKSPACE/tt/pod-imagesId.txt || true
- '''
- }
- }
- }
- }
-
- post {
- always {
- sh '''
-
- # get pods information
- kubectl get pods -o wide --all-namespaces
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}"
- helm ls --all-namespaces
-
- set +e
- cp $WORKSPACE/kind-voltha/install-$NAME.log $WORKSPACE/
-
- sync
- md5sum $WORKSPACE/kind-voltha/bin/voltctl
-
- ## Pull out errors from log files
- extract_errors_go() {
- echo
- echo "Error summary for $1:"
- grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg'
- echo
- }
-
- extract_errors_python() {
- echo
- echo "Error summary for $1:"
- grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2-
- echo
- }
-
- extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log || true
- extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log || true
- extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log || true
- extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log || true
-
- gzip $WORKSPACE/att/onos-voltha-combined.log || true
- gzip $WORKSPACE/dt/onos-voltha-combined.log || true
- gzip $WORKSPACE/tt/onos-voltha-combined.log || true
-
- '''
- step([$class: 'RobotPublisher',
- disableArchiveOutput: false,
- logFileName: 'RobotLogs/*/log*.html',
- otherFiles: '',
- outputFileName: 'RobotLogs/*/output*.xml',
- outputPath: '.',
- passThreshold: 100,
- reportFileName: 'RobotLogs/*/report*.html',
- unstableThreshold: 0]);
- archiveArtifacts artifacts: '*.log,**/*.log,**/*.gz,*.gz'
- }
- }
-}
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-dt-physical-build-and-tests.groovy b/jjb/pipeline/voltha/voltha-2.7/voltha-dt-physical-build-and-tests.groovy
deleted file mode 100644
index 2ac34bf..0000000
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-dt-physical-build-and-tests.groovy
+++ /dev/null
@@ -1,448 +0,0 @@
-// Copyright 2019-present Open Networking Foundation
-//
-// 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.
-
-// deploy VOLTHA built from patchset on a physical pod and run e2e test
-// uses kind-voltha to deploy voltha-2.X
-
-// Need this so that deployment_config has global scope when it's read later
-deployment_config = null
-localDeploymentConfigFile = null
-localKindVolthaValuesFile = null
-localSadisConfigFile = null
-
-// The pipeline assumes these variables are always defined
-if ( params.manualBranch != "" ) {
- GERRIT_EVENT_COMMENT_TEXT = ""
- GERRIT_PROJECT = ""
- GERRIT_BRANCH = "${params.manualBranch}"
- GERRIT_CHANGE_NUMBER = ""
- GERRIT_PATCHSET_NUMBER = ""
-}
-
-pipeline {
-
- /* no label, executor is determined by JJB */
- agent {
- label "${params.buildNode}"
- }
- options {
- timeout(time: 120, unit: 'MINUTES')
- }
-
- environment {
- KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
- VOLTCONFIG="$HOME/.volt/config-minimal"
- PATH="$WORKSPACE/voltha/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- NAME="minimal"
- FANCY=0
- //VOL-2194 ONOS SSH and REST ports hardcoded to 30115/30120 in tests
- ONOS_SSH_PORT=30115
- ONOS_API_PORT=30120
- }
-
- stages {
- stage ('Initialize') {
- steps {
- sh returnStdout: false, script: """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- test -e $WORKSPACE/voltha/kind-voltha/voltha && cd $WORKSPACE/voltha/kind-voltha && ./voltha down
- cd $WORKSPACE
- rm -rf $WORKSPACE/*
- """
- script {
- if (env.configRepo && ! env.localConfigDir) {
- env.localConfigDir = "$WORKSPACE"
- sh returnStdout: false, script: "git clone -b master ${cordRepoUrl}/${configRepo}"
- }
- localDeploymentConfigFile = "${env.localConfigDir}/${params.deploymentConfigFile}"
- localKindVolthaValuesFile = "${env.localConfigDir}/${params.kindVolthaValuesFile}"
- localSadisConfigFile = "${env.localConfigDir}/${params.sadisConfigFile}"
- }
- }
- }
-
- stage('Repo') {
- steps {
- checkout(changelog: true,
- poll: false,
- scm: [$class: 'RepoScm',
- manifestRepositoryUrl: "${params.manifestUrl}",
- manifestBranch: "${params.branch}",
- currentBranch: true,
- destinationDir: 'voltha',
- forceSync: true,
- resetFirst: true,
- quiet: true,
- jobs: 4,
- showAllChanges: true]
- )
- }
- }
-
- stage('Get Patch') {
- when {
- expression { params.manualBranch == "" }
- }
- steps {
- sh returnStdout: false, script: """
- cd voltha
- repo download "${gerritProject}" "${gerritChangeNumber}/${gerritPatchsetNumber}"
- """
- }
- }
-
- stage('Check config files') {
- steps {
- script {
- try {
- deployment_config = readYaml file: "${localDeploymentConfigFile}"
- } catch (err) {
- echo "Error reading ${localDeploymentConfigFile}"
- throw err
- }
- sh returnStdout: false, script: """
- if [ ! -e ${localKindVolthaValuesFile} ]; then echo "${localKindVolthaValuesFile} not found"; exit 1; fi
- if [ ! -e ${localSadisConfigFile} ]; then echo "${localSadisConfigFile} not found"; exit 1; fi
- """
- }
- }
- }
-
- stage('Create KinD Cluster') {
- steps {
- sh returnStdout: false, script: """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/voltha/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- cd $WORKSPACE/voltha/kind-voltha/
- JUST_K8S=y ./voltha up
- """
- }
- }
-
- stage('Build and Push Images') {
- when {
- expression { params.manualBranch == "" }
- }
- steps {
- sh returnStdout: false, script: """
-
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/voltha/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- if ! [[ "${gerritProject}" =~ ^(voltha-system-tests|kind-voltha|voltha-helm-charts)\$ ]]; then
- make -C $WORKSPACE/voltha/${gerritProject} DOCKER_REPOSITORY=voltha/ DOCKER_TAG=citest docker-build
- docker images | grep citest
- for image in \$(docker images -f "reference=*/*citest" --format "{{.Repository}}")
- do
- echo "Pushing \$image to nodes"
- kind load docker-image \$image:citest --name voltha-\$NAME --nodes voltha-\$NAME-worker,voltha-\$NAME-worker2
- docker rmi \$image:citest \$image:latest || true
- done
- fi
- """
- }
- }
-
- stage('Deploy Voltha') {
- environment {
- WITH_RADIUS="no"
- WITH_EAPOL="no"
- WITH_DHCP="no"
- WITH_IGMP="no"
- CONFIG_SADIS="no"
- WITH_SIM_ADAPTERS="no"
- DEPLOY_K8S="no"
- VOLTHA_LOG_LEVEL="DEBUG"
- }
- steps {
- script {
- sh returnStdout: false, script: """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/voltha/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- export EXTRA_HELM_FLAGS+='--set log_agent.enabled=False -f ${localKindVolthaValuesFile} '
-
- IMAGES=""
- if [ "${gerritProject}" = "voltha-go" ]; then
- IMAGES="rw_core ro_core "
- elif [ "${gerritProject}" = "ofagent-py" ]; then
- IMAGES="ofagent "
- elif [ "${gerritProject}" = "voltha-onos" ]; then
- IMAGES="onos "
- elif [ "${gerritProject}" = "voltha-openolt-adapter" ]; then
- IMAGES="adapter_open_olt "
- elif [ "${gerritProject}" = "voltha-openonu-adapter" ]; then
- IMAGES="adapter_open_onu "
- elif [ "${gerritProject}" = "voltha-openonu-adapter-go" ]; then
- IMAGES="adapter_open_onu_go "
- elif [ "${gerritProject}" = "voltha-api-server" ]; then
- IMAGES="afrouter afrouterd "
- else
- echo "No images to push"
- fi
-
- for I in \$IMAGES
- do
- EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
- done
-
- if [ "${gerritProject}" = "voltha-helm-charts" ]; then
- export CHART_PATH=$WORKSPACE/voltha/voltha-helm-charts
- export VOLTHA_CHART=\$CHART_PATH/voltha
- export VOLTHA_ADAPTER_OPEN_OLT_CHART=\$CHART_PATH/voltha-adapter-openolt
- export VOLTHA_ADAPTER_OPEN_ONU_CHART=\$CHART_PATH/voltha-adapter-openonu
- helm dep update \$VOLTHA_CHART
- helm dep update \$VOLTHA_ADAPTER_OPEN_OLT_CHART
- helm dep update \$VOLTHA_ADAPTER_OPEN_ONU_CHART
- fi
-
- cd $WORKSPACE/voltha/kind-voltha/
- echo \$EXTRA_HELM_FLAGS
- kail -n voltha -n default > $WORKSPACE/onos-voltha-combined.log &
- ./voltha up
-
- set +e
-
- # Remove noise from voltha-core logs
- voltctl log level set WARN read-write-core#github.com/opencord/voltha-go/db/model
- voltctl log level set WARN read-write-core#github.com/opencord/voltha-lib-go/v3/pkg/kafka
- # Remove noise from openolt logs
- voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/db
- voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/probe
- voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/kafka
- """
- }
- }
- }
-
- stage('Deploy Kafka Dump Chart') {
- steps {
- script {
- sh returnStdout: false, script: """
- helm repo add cord https://charts.opencord.org
- helm repo update
- if helm version -c --short|grep v2 -q; then
- helm install -n voltha-kafka-dump cord/voltha-kafka-dump
- else
- helm install voltha-kafka-dump cord/voltha-kafka-dump
- fi
- """
- }
- }
- }
-
- stage('Push Tech-Profile') {
- when {
- expression { params.profile != "Default" }
- }
- steps {
- sh returnStdout: false, script: """
- etcd_container=\$(kubectl get pods -n voltha | grep voltha-etcd-cluster | awk 'NR==1{print \$1}')
- kubectl cp $WORKSPACE/voltha/voltha-system-tests/tests/data/TechProfile-${profile}.json voltha/\$etcd_container:/tmp/flexpod.json
- kubectl exec -it \$etcd_container -n voltha -- /bin/sh -c 'cat /tmp/flexpod.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/XGS-PON/64'
- """
- }
- }
-
- stage('Push Sadis-config') {
- steps {
- sh returnStdout: false, script: """
- curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:$ONOS_API_PORT/onos/v1/network/configuration --data @${localSadisConfigFile}
- """
- }
- }
-
- stage('Reinstall OLT software') {
- when {
- expression { params.reinstallOlt }
- }
- steps {
- script {
- deployment_config.olts.each { olt ->
- sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --remove asfvolt16 && dpkg --purge asfvolt16'"
- waitUntil {
- olt_sw_present = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --list | grep asfvolt16 | wc -l'"
- return olt_sw_present.toInteger() == 0
- }
- if ( params.branch == 'voltha-2.3' ) {
- oltDebVersion = oltDebVersionVoltha23
- } else {
- oltDebVersion = oltDebVersionMaster
- }
- sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --install ${oltDebVersion}'"
- waitUntil {
- olt_sw_present = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --list | grep asfvolt16 | wc -l'"
- return olt_sw_present.toInteger() == 1
- }
- if ( olt.fortygig ) {
- // If the OLT is connected to a 40G switch interface, set the NNI port to be downgraded
- sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'echo port ce128 sp=40000 >> /broadcom/qax.soc ; /opt/bcm68620/svk_init.sh'"
- }
- }
- }
- }
- }
-
- stage('Restart OLT processes') {
- steps {
- script {
- deployment_config.olts.each { olt ->
- sh returnStdout: false, script: """
- ssh-keyscan -H ${olt.ip} >> ~/.ssh/known_hosts
- sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'rm -f /var/log/openolt.log; rm -f /var/log/dev_mgmt_daemon.log; reboot'
- sleep 120
- """
- waitUntil {
- onu_discovered = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'grep \"onu discover indication\" /var/log/openolt.log | wc -l'"
- return onu_discovered.toInteger() > 0
- }
- }
- }
- }
- }
-
- stage('Run E2E Tests') {
- environment {
- ROBOT_CONFIG_FILE="${localDeploymentConfigFile}"
- ROBOT_MISC_ARGS="${params.extraRobotArgs} --removekeywords wuks -d $WORKSPACE/RobotLogs -v container_log_dir:$WORKSPACE "
- ROBOT_FILE="Voltha_DT_PODTests.robot"
- }
- steps {
- sh returnStdout: false, script: """
- cd voltha
- mkdir -p $WORKSPACE/RobotLogs
-
- # If the Gerrit comment contains a line with "functional tests" then run the full
- # functional test suite. This covers tests tagged either 'sanity' or 'functional'.
- # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
- REGEX="functional tests"
- if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
- ROBOT_MISC_ARGS+="-i functionalDt"
- fi
- # Likewise for dataplane tests
- REGEX="dataplane tests"
- if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
- ROBOT_MISC_ARGS+="-i dataplaneDt"
- fi
-
- make -C $WORKSPACE/voltha/voltha-system-tests voltha-dt-test || true
- """
- }
- }
-
- stage('After-Test Delay') {
- when {
- expression { params.manualBranch == "" }
- }
- steps {
- sh returnStdout: false, script: """
- # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
- REGEX="hardware test with delay\$"
- [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]] && sleep 10m || true
- """
- }
- }
- }
-
- post {
- always {
- sh returnStdout: false, script: '''
- set +e
- cp $WORKSPACE/voltha/kind-voltha/install-minimal.log $WORKSPACE/
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
- kubectl get nodes -o wide
- kubectl get pods -o wide
- kubectl get pods -n voltha -o wide
-
- sync
- pkill kail || true
-
- ## Pull out errors from log files
- extract_errors_go() {
- echo
- echo "Error summary for $1:"
- grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg'
- echo
- }
-
- extract_errors_python() {
- echo
- echo "Error summary for $1:"
- grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2-
- echo
- }
-
- extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log
- extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log
- extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log
- extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log
-
- gzip $WORKSPACE/onos-voltha-combined.log
-
- ## collect events, the chart should be running by now
- kubectl get pods | grep -i voltha-kafka-dump | grep -i running
- if [[ $? == 0 ]]; then
- kubectl exec -it `kubectl get pods | grep -i voltha-kafka-dump | grep -i running | cut -f1 -d " "` ./voltha-dump-events.sh > $WORKSPACE/voltha-events.log
- fi
- '''
- script {
- deployment_config.olts.each { olt ->
- sh returnStdout: false, script: """
- until sshpass -p ${olt.pass} scp ${olt.user}@${olt.ip}:/var/log/openolt.log $WORKSPACE/openolt-${olt.ip}.log
- do
- echo "Fetching openolt.log log failed, retrying..."
- sleep 10
- done
- sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt-${olt.ip}.log # Remove escape sequences
- until sshpass -p ${olt.pass} scp ${olt.user}@${olt.ip}:/var/log/dev_mgmt_daemon.log $WORKSPACE/dev_mgmt_daemon-${olt.ip}.log
- do
- echo "Fetching dev_mgmt_daemon.log failed, retrying..."
- sleep 10
- done
- sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/dev_mgmt_daemon-${olt.ip}.log # Remove escape sequences
- """
- }
- }
- step([$class: 'RobotPublisher',
- disableArchiveOutput: false,
- logFileName: 'RobotLogs/log*.html',
- otherFiles: '',
- outputFileName: 'RobotLogs/output*.xml',
- outputPath: '.',
- passThreshold: 100,
- reportFileName: 'RobotLogs/report*.html',
- unstableThreshold: 0]);
- archiveArtifacts artifacts: '*.log,*.gz'
- }
- }
-}
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-go-multi-tests.groovy b/jjb/pipeline/voltha/voltha-2.7/voltha-go-multi-tests.groovy
deleted file mode 100644
index e7bb4f0..0000000
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-go-multi-tests.groovy
+++ /dev/null
@@ -1,191 +0,0 @@
-// Copyright 2017-present Open Networking Foundation
-//
-// 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.
-
-// voltha-2.x e2e tests
-// uses kind-voltha to deploy voltha-2.X
-// uses bbsim to simulate OLT/ONUs
-
-pipeline {
-
- /* no label, executor is determined by JJB */
- agent {
- label "${params.buildNode}"
- }
- options {
- timeout(time: 60, unit: 'MINUTES')
- }
- environment {
- KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
- VOLTCONFIG="$HOME/.volt/config-minimal"
- PATH="$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- NAME="minimal"
- FANCY=0
- WITH_SIM_ADAPTERS="n"
- WITH_RADIUS="y"
- WITH_BBSIM="y"
- DEPLOY_K8S="y"
- VOLTHA_LOG_LEVEL="DEBUG"
- CONFIG_SADIS="external"
- BBSIM_CFG="configs/bbsim-sadis-att.yaml"
- }
- stages {
- stage('Clone kind-voltha') {
- steps {
- step([$class: 'WsCleanup'])
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/kind-voltha",
- refspec: "${kindVolthaChange}"
- ]],
- branches: [[ name: "master", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- }
- }
- stage('Clone voltha-system-tests') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/voltha-system-tests",
- refspec: "${volthaSystemTestsChange}"
- ]],
- branches: [[ name: "${branch}", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- }
- }
-
- stage('Deploy Voltha') {
- steps {
- timeout(time: 15, unit: 'MINUTES') {
- sh """
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${params.extraHelmFlags} "
-
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down || ./voltha down
- ./voltha up
- """
- }
- }
- }
-
- stage('Run E2E Tests') {
- steps {
- // this may potentially fail as we don't know how many times we repeat this tests
- timeout(time: 30, unit: 'MINUTES') {
- sh """
- set +e
- mkdir -p $WORKSPACE/RobotLogs
-
- cd $WORKSPACE/kind-voltha/scripts
- ./log-collector.sh > /dev/null &
- ./log-combine.sh > /dev/null &
-
- for i in \$(seq 1 ${testRuns})
- do
- export ROBOT_MISC_ARGS="${params.extraRobotArgs} -d $WORKSPACE/RobotLogs/\$i -e PowerSwitch"
- make -C $WORKSPACE/voltha-system-tests ${makeTarget}
- echo "Completed run: \$i"
- echo ""
- done
- """
- }
- }
- }
- }
-
- post {
- always {
- sh '''
- set +e
- cp $WORKSPACE/kind-voltha/install-minimal.log $WORKSPACE/
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
- kubectl get nodes -o wide
- kubectl get pods -o wide
- kubectl get pods -n voltha -o wide
-
- sleep 60 # Wait for log-collector and log-combine to complete
-
- ## Pull out errors from log files
- extract_errors_go() {
- echo
- echo "Error summary for $1:"
- grep '"level":"error"' $WORKSPACE/kind-voltha/scripts/logger/combined/$1*
- echo
- }
-
- extract_errors_python() {
- echo
- echo "Error summary for $1:"
- grep 'ERROR' $WORKSPACE/kind-voltha/scripts/logger/combined/$1*
- echo
- }
-
- extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log
- extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log
- extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log
- extract_errors_go voltha-ofagent >> $WORKSPACE/error-report.log
- extract_errors_python onos >> $WORKSPACE/error-report.log
-
- gzip error-report.log || true
-
- cd $WORKSPACE/kind-voltha/scripts/logger/combined/
- tar czf $WORKSPACE/container-logs.tgz *
-
- cd $WORKSPACE
- gzip *-combined.log || true
-
- ## shut down voltha but leave kind-voltha cluster
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- DEPLOY_K8S=n WAIT_ON_DOWN=y ./voltha down
- '''
- step([$class: 'RobotPublisher',
- disableArchiveOutput: false,
- logFileName: '**/log*.html',
- otherFiles: '',
- outputFileName: '**/output*.xml',
- outputPath: 'RobotLogs',
- passThreshold: 100,
- reportFileName: '**/report*.html',
- unstableThreshold: 0]);
- archiveArtifacts artifacts: '*.log,*.gz,*.tgz'
-
- }
- }
-}
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-go-tests.groovy b/jjb/pipeline/voltha/voltha-2.7/voltha-go-tests.groovy
deleted file mode 100644
index 61f600c..0000000
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-go-tests.groovy
+++ /dev/null
@@ -1,211 +0,0 @@
-// Copyright 2017-present Open Networking Foundation
-//
-// 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.
-
-// voltha-2.x e2e tests
-// uses kind-voltha to deploy voltha-2.X
-// uses bbsim to simulate OLT/ONUs
-
-pipeline {
-
- /* no label, executor is determined by JJB */
- agent {
- label "${params.buildNode}"
- }
- options {
- timeout(time: 60, unit: 'MINUTES')
- }
- environment {
- KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
- VOLTCONFIG="$HOME/.volt/config-minimal"
- PATH="$PATH:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- NAME="minimal"
- FANCY=0
- WITH_SIM_ADAPTERS="no"
- WITH_RADIUS="yes"
- WITH_BBSIM="yes"
- DEPLOY_K8S="yes"
- VOLTHA_LOG_LEVEL="DEBUG"
- CONFIG_SADIS="external"
- BBSIM_CFG="configs/bbsim-sadis-att.yaml"
- ROBOT_MISC_ARGS="${params.extraRobotArgs} -d $WORKSPACE/RobotLogs -e PowerSwitch"
- KARAF_HOME="${params.karafHome}"
- DIAGS_PROFILE="VOLTHA_PROFILE"
- }
- stages {
-
- stage('Clone kind-voltha') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/kind-voltha",
- // refspec: "${kindVolthaChange}"
- ]],
- branches: [[ name: "master", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- }
- }
- stage('Cleanup') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down || true
- """
- }
- }
- }
- stage('Clone voltha-system-tests') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/voltha-system-tests",
- // refspec: "${volthaSystemTestsChange}"
- ]],
- branches: [[ name: "${branch}", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- }
- }
-
- stage('Deploy Voltha') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- if [ "${workFlow}" == "DT" ]; then
- export WITH_DHCP=no
- export WITH_IGMP=no
- export WITH_EAPOL=no
- export WITH_RADIUS=no
- export BBSIM_CFG="configs/bbsim-sadis-dt.yaml"
- fi
-
- EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${params.extraHelmFlags} "
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down || ./voltha down
- ./voltha up
- """
- }
- }
- }
-
- stage('Run E2E Tests') {
- steps {
- timeout(time: 5, unit: 'MINUTES') {
- sh '''
- set +e
- mkdir -p $WORKSPACE/RobotLogs
-
- cd $WORKSPACE/kind-voltha/scripts
- ./log-collector.sh > /dev/null &
- ./log-combine.sh > /dev/null &
-
- make -C $WORKSPACE/voltha-system-tests ${makeTarget} || true
- '''
- }
- }
- }
- }
-
- post {
- always {
- sh '''
- set +e
- cp $WORKSPACE/kind-voltha/install-minimal.log $WORKSPACE/
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
- kubectl get nodes -o wide
- kubectl get pods -o wide
- kubectl get pods -n voltha -o wide
-
- sleep 60 # Wait for log-collector and log-combine to complete
-
- ## Pull out errors from log files
- extract_errors_go() {
- echo
- echo "Error summary for $1:"
- grep '"level":"error"' $WORKSPACE/kind-voltha/scripts/logger/combined/$1*
- echo
- }
-
- extract_errors_python() {
- echo
- echo "Error summary for $1:"
- grep 'ERROR' $WORKSPACE/kind-voltha/scripts/logger/combined/$1*
- echo
- }
-
- extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log
- extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log
- extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log
- extract_errors_go voltha-ofagent >> $WORKSPACE/error-report.log
- extract_errors_python onos >> $WORKSPACE/error-report.log
-
- gzip error-report.log || true
-
- cd $WORKSPACE/kind-voltha/scripts/logger/combined/
- tar czf $WORKSPACE/container-logs.tgz *
-
- cd $WORKSPACE
- gzip *-combined.log || true
-
- ## shut down voltha but leave kind-voltha cluster
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- DEPLOY_K8S=n WAIT_ON_DOWN=y ./voltha down
- kubectl delete deployment voltctl || true
- '''
- step([$class: 'RobotPublisher',
- disableArchiveOutput: false,
- logFileName: 'RobotLogs/log*.html',
- otherFiles: '',
- outputFileName: 'RobotLogs/output*.xml',
- outputPath: '.',
- passThreshold: 100,
- reportFileName: 'RobotLogs/report*.html',
- unstableThreshold: 0]);
- archiveArtifacts artifacts: '*.log,*.gz,*.tgz'
-
- }
- }
-}
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-nightly-tests-bbsim.groovy b/jjb/pipeline/voltha/voltha-2.7/voltha-nightly-tests-bbsim.groovy
deleted file mode 100644
index da4dc8a..0000000
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-nightly-tests-bbsim.groovy
+++ /dev/null
@@ -1,289 +0,0 @@
-// Copyright 2017-present Open Networking Foundation
-//
-// 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.
-
-// voltha-2.x e2e tests
-// uses kind-voltha to deploy voltha-2.X
-// uses bbsim to simulate OLT/ONUs
-
-pipeline {
-
- /* no label, executor is determined by JJB */
- agent {
- label "${params.buildNode}"
- }
- options {
- timeout(time: 150, unit: 'MINUTES')
- }
- environment {
- KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
- VOLTCONFIG="$HOME/.volt/config-minimal"
- PATH="$PATH:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- NAME="minimal"
- FANCY=0
- WITH_SIM_ADAPTERS="no"
- WITH_RADIUS="yes"
- WITH_BBSIM="yes"
- DEPLOY_K8S="yes"
- VOLTHA_LOG_LEVEL="DEBUG"
- CONFIG_SADIS="external"
- BBSIM_CFG="configs/bbsim-sadis-att.yaml"
- ROBOT_MISC_ARGS="-e PowerSwitch ${params.extraRobotArgs}"
- KARAF_HOME="${params.karafHome}"
- DIAGS_PROFILE="VOLTHA_PROFILE"
- NUM_OF_BBSIM="${olts}"
- }
- stages {
- stage('Clone kind-voltha') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/kind-voltha",
- // refspec: "${kindVolthaChange}"
- ]],
- branches: [[ name: "master", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- }
- }
- stage('Cleanup') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down || ./voltha down
- """
- }
- }
- }
- stage('Clone voltha-system-tests') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/voltha-system-tests",
- refspec: "${volthaSystemTestsChange}"
- ]],
- branches: [[ name: "${branch}", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- script {
- sh(script:"""
- if [ '${volthaSystemTestsChange}' != '' ] ; then
- cd $WORKSPACE/voltha-system-tests;
- git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD
- fi
- """)
- }
- }
- }
-
- stage('Deploy Voltha') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- export INFRA_NS="infra"
- echo "on master, using default settings for kind-voltha"
- fi
-
- EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${params.extraHelmFlags} --set defaults.image_registry=mirror.registry.opennetworking.org/ "
-
- cd $WORKSPACE/kind-voltha/
- ./voltha up
- """
- }
- }
- }
-
- stage('Functional Tests') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/FunctionalTests"
- }
- steps {
- timeout(time: 50, unit: 'MINUTES') {
- sh '''
- set +e
- mkdir -p $ROBOT_LOGS_DIR
- cd $WORKSPACE/kind-voltha/scripts
- ./log-collector.sh > /dev/null &
- ./log-combine.sh > /dev/null &
-
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
- make -C $WORKSPACE/voltha-system-tests ${makeTarget} || true
- '''
- }
- }
- }
-
- stage('Alarm Tests') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/AlarmTests"
- }
- when {
- expression {
- return params.withAlarms
- }
- }
- steps {
- timeout(time: 5, unit: 'MINUTES') {
- sh '''
- set +e
- mkdir -p $WORKSPACE/RobotLogs
-
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
- make -C $WORKSPACE/voltha-system-tests ${makeAlarmtestTarget} || true
- '''
- }
- }
- }
-
- stage('Failure/Recovery Tests') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/FailureTests"
- }
- steps {
- timeout(time: 70, unit: 'MINUTES') {
- sh '''
- set +e
- mkdir -p $WORKSPACE/RobotLogs
-
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
- make -C $WORKSPACE/voltha-system-tests ${makeFailtestTarget} || true
- '''
- }
- }
- }
- stage('Multiple OLT Tests') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/MultipleOLTTests"
- }
- steps {
- timeout(time: 15, unit: 'MINUTES') {
- sh '''
- if [ "${olts}" -gt 1 ]; then
- set +e
- mkdir -p $WORKSPACE/RobotLogs
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
- make -C $WORKSPACE/voltha-system-tests ${makeMultiOltTarget} || true
- fi
- '''
- }
- }
- }
-
- stage('Error Tests') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ErrorTests"
- }
- steps {
- timeout(time: 15, unit: 'MINUTES') {
- sh '''
- set +e
- mkdir -p $WORKSPACE/RobotLogs
-
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
- make -C $WORKSPACE/voltha-system-tests ${makeErrortestTarget} || true
- '''
- }
- }
- }
- }
-
- post {
- always {
- sh '''
- set +e
- cp $WORKSPACE/kind-voltha/install-minimal.log $WORKSPACE/
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
- kubectl get nodes -o wide
- kubectl get pods -o wide
- kubectl get pods -n voltha -o wide
-
- sleep 60 # Wait for log-collector and log-combine to complete
-
- ## Pull out errors from log files
- extract_errors_go() {
- echo
- echo "Error summary for $1:"
- grep '"level":"error"' $WORKSPACE/kind-voltha/scripts/logger/combined/$1*
- echo
- }
-
- extract_errors_python() {
- echo
- echo "Error summary for $1:"
- grep 'ERROR' $WORKSPACE/kind-voltha/scripts/logger/combined/$1*
- echo
- }
-
- extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log
- extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log
- extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log
- extract_errors_go voltha-ofagent >> $WORKSPACE/error-report.log
- extract_errors_python onos >> $WORKSPACE/error-report.log
-
- gzip error-report.log || true
-
- cd $WORKSPACE/kind-voltha/scripts/logger/combined/
- tar czf $WORKSPACE/container-logs.tgz *
-
- cd $WORKSPACE
- gzip *-combined.log || true
-
- ## shut down voltha but leave kind-voltha cluster
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- DEPLOY_K8S=n WAIT_ON_DOWN=y ./voltha down
- kubectl delete deployment voltctl || true
- '''
- step([$class: 'RobotPublisher',
- disableArchiveOutput: false,
- logFileName: '**/log*.html',
- otherFiles: '',
- outputFileName: '**/output*.xml',
- outputPath: 'RobotLogs',
- passThreshold: 100,
- reportFileName: '**/report*.html',
- unstableThreshold: 0]);
-
- archiveArtifacts artifacts: '*.log,*.gz,*.tgz'
-
- }
- }
-}
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-openonu-go-test-bbsim.groovy b/jjb/pipeline/voltha/voltha-2.7/voltha-openonu-go-test-bbsim.groovy
deleted file mode 100755
index 3f65752..0000000
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-openonu-go-test-bbsim.groovy
+++ /dev/null
@@ -1,539 +0,0 @@
-// Copyright 2017-present Open Networking Foundation
-//
-// 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.
-
-// voltha-2.x e2e tests
-// uses kind-voltha to deploy voltha-2.X
-// uses bbsim to simulate OLT/ONUs
-
-pipeline {
-
- /* no label, executor is determined by JJB */
- agent {
- label "${params.buildNode}"
- }
- options {
- timeout(time: 130, unit: 'MINUTES')
- }
- environment {
- KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
- VOLTCONFIG="$HOME/.volt/config-minimal"
- PATH="$PATH:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- NAME="minimal"
- FANCY=0
- WITH_SIM_ADAPTERS="no"
- WITH_RADIUS="yes"
- WITH_BBSIM="yes"
- DEPLOY_K8S="yes"
- VOLTHA_LOG_LEVEL="DEBUG"
- CONFIG_SADIS="external"
- BBSIM_CFG="configs/bbsim-sadis-att.yaml"
- ROBOT_MISC_ARGS="-e PowerSwitch ${params.extraRobotArgs}"
- KARAF_HOME="${params.karafHome}"
- DIAGS_PROFILE="VOLTHA_PROFILE"
- NUM_OF_BBSIM="${olts}"
- }
- stages {
- stage('Clone kind-voltha') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/kind-voltha",
- // refspec: "${kindVolthaChange}"
- ]],
- branches: [[ name: "master", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- }
- }
- stage('Cleanup') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down || ./voltha down
- """
- }
- }
- }
- stage('Clone voltha-system-tests') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/voltha-system-tests",
- // refspec: "${volthaSystemTestsChange}"
- ]],
- branches: [[ name: "${branch}", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- }
- }
-
- stage('Deploy Voltha') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${params.extraHelmFlags} --set defaults.image_registry=mirror.registry.opennetworking.org/ "
-
- cd $WORKSPACE/kind-voltha/
- ./voltha up
- bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/kind-voltha/bin"
- """
- }
- }
- }
-
- stage('Run E2E Tests 1t1gem') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t1gem"
- }
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh '''
- # start logging
- mkdir -p $WORKSPACE/1t1gem
- _TAG=kail-1t1gem kail -n voltha -n default > $WORKSPACE/1t1gem/onos-voltha-combined.log &
-
- mkdir -p $ROBOT_LOGS_DIR/1t1gem
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
- export KVSTOREPREFIX=voltha_voltha
-
- make -C $WORKSPACE/voltha-system-tests ${makeTarget} || true
-
- # stop logging
- P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t1gem" | grep -v grep | awk '{print $1}')"
- if [ -n "$P_IDS" ]; then
- echo $P_IDS
- for P_ID in $P_IDS; do
- kill -9 $P_ID
- done
- fi
- cd $WORKSPACE/1t1gem/
- gzip -k onos-voltha-combined.log
- rm onos-voltha-combined.log
- # get pods information
- kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t1gem/pods.txt || true
- '''
- }
- }
- }
-
- stage('Run E2E Tests 1t4gem') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t4gem"
- }
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh '''
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
-
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
-
- # start logging
- mkdir -p $WORKSPACE/1t4gem
- _TAG=kail-1t4gem kail -n voltha -n default > $WORKSPACE/1t4gem/onos-voltha-combined.log &
-
- DEPLOY_K8S=n ./voltha up
-
- mkdir -p $ROBOT_LOGS_DIR/1t4gem
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
- export KVSTOREPREFIX=voltha_voltha
-
- make -C $WORKSPACE/voltha-system-tests ${make1t4gemTestTarget} || true
-
- # stop logging
- P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t4gem" | grep -v grep | awk '{print $1}')"
- if [ -n "$P_IDS" ]; then
- echo $P_IDS
- for P_ID in $P_IDS; do
- kill -9 $P_ID
- done
- fi
- cd $WORKSPACE/1t4gem/
- gzip -k onos-voltha-combined.log
- rm onos-voltha-combined.log
- # get pods information
- kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t4gem/pods.txt || true
- '''
- }
- }
- }
-
- stage('Run E2E Tests 1t8gem') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/1t8gem"
- }
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh '''
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
-
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
-
- # start logging
- mkdir -p $WORKSPACE/1t8gem
- _TAG=kail-1t8gem kail -n voltha -n default > $WORKSPACE/1t8gem/onos-voltha-combined.log &
-
- DEPLOY_K8S=n ./voltha up
-
- mkdir -p $ROBOT_LOGS_DIR/1t8gem
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
- export KVSTOREPREFIX=voltha_voltha
-
- make -C $WORKSPACE/voltha-system-tests ${make1t8gemTestTarget} || true
-
- # stop logging
- P_IDS="$(ps e -ww -A | grep "_TAG=kail-1t8gem" | grep -v grep | awk '{print $1}')"
- if [ -n "$P_IDS" ]; then
- echo $P_IDS
- for P_ID in $P_IDS; do
- kill -9 $P_ID
- done
- fi
- cd $WORKSPACE/1t8gem/
- gzip -k onos-voltha-combined.log
- rm onos-voltha-combined.log
- # get pods information
- kubectl get pods -o wide --all-namespaces > $WORKSPACE/1t8gem/pods.txt || true
- '''
- }
- }
- }
-
- stage('Run MIB Upload Tests') {
- when { beforeAgent true; expression { return "${olts}" == "1" } }
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/openonu-go-MIB"
- }
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh '''
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
-
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
- export EXTRA_HELM_FLAGS+="--set pon=2,onu=2,controlledActivation=only-onu "
-
- # start logging
- mkdir -p $WORKSPACE/mib
- _TAG=kail-mib kail -n voltha -n default > $WORKSPACE/mib/onos-voltha-combined.log &
-
- DEPLOY_K8S=n ./voltha up
-
- mkdir -p $ROBOT_LOGS_DIR
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR"
- export TARGET_DEFAULT=mib-upload-templating-openonu-go-adapter-test
-
- make -C $WORKSPACE/voltha-system-tests \$TARGET_DEFAULT || true
-
- # stop logging
- P_IDS="$(ps e -ww -A | grep "_TAG=kail-mib" | grep -v grep | awk '{print $1}')"
- if [ -n "$P_IDS" ]; then
- echo $P_IDS
- for P_ID in $P_IDS; do
- kill -9 $P_ID
- done
- fi
- cd $WORKSPACE/mib/
- gzip -k onos-voltha-combined.log
- rm onos-voltha-combined.log
- # get pods information
- kubectl get pods -o wide --all-namespaces > $WORKSPACE/mib/pods.txt || true
- '''
- }
- }
- }
-
- stage('Reconcile DT workflow') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileDT"
- }
- steps {
- timeout(time: 25, unit: 'MINUTES') {
- sh '''
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
-
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
-
- # Workflow-specific flags
- export WITH_RADIUS=no
- export WITH_EAPOL=no
- export WITH_DHCP=no
- export WITH_IGMP=no
- export CONFIG_SADIS="external"
- export BBSIM_CFG="configs/bbsim-sadis-dt.yaml"
-
- # start logging
- mkdir -p $WORKSPACE/reconciledt
- _TAG=kail-reconcile-dt kail -n voltha -n default > $WORKSPACE/reconciledt/onos-voltha-combined.log &
-
- DEPLOY_K8S=n ./voltha up
-
- mkdir -p $ROBOT_LOGS_DIR
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
-
- make -C $WORKSPACE/voltha-system-tests ${makeReconcileDtTestTarget} || true
-
- # stop logging
- P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-dt" | grep -v grep | awk '{print $1}')"
- if [ -n "$P_IDS" ]; then
- echo $P_IDS
- for P_ID in $P_IDS; do
- kill -9 $P_ID
- done
- fi
- cd $WORKSPACE/reconciledt/
- gzip -k onos-voltha-combined.log
- rm onos-voltha-combined.log
- # get pods information
- kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconciledt/pods.txt || true
- '''
- }
- }
- }
-
- stage('Reconcile ATT workflow') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileATT"
- }
- steps {
- timeout(time: 25, unit: 'MINUTES') {
- sh '''
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
-
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
-
- # Workflow-specific flags
- export WITH_RADIUS=yes
- export WITH_EAPOL=yes
- export WITH_BBSIM=yes
- export DEPLOY_K8S=yes
- export CONFIG_SADIS="external"
- export BBSIM_CFG="configs/bbsim-sadis-att.yaml"
-
- if [ "${gerritProject}" = "voltctl" ]; then
- export VOLTCTL_VERSION=$(cat $WORKSPACE/voltctl/VERSION)
- cp $WORKSPACE/voltctl/voltctl $WORKSPACE/kind-voltha/bin/voltctl
- md5sum $WORKSPACE/kind-voltha/bin/voltctl
- fi
-
- # start logging
- mkdir -p $WORKSPACE/reconcileatt
- _TAG=kail-reconcile-att kail -n voltha -n default > $WORKSPACE/reconcileatt/onos-voltha-combined.log &
-
- DEPLOY_K8S=n ./voltha up
-
- mkdir -p $ROBOT_LOGS_DIR
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
-
- make -C $WORKSPACE/voltha-system-tests ${makeReconcileTestTarget} || true
-
- # stop logging
- P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-att" | grep -v grep | awk '{print $1}')"
- if [ -n "$P_IDS" ]; then
- echo $P_IDS
- for P_ID in $P_IDS; do
- kill -9 $P_ID
- done
- fi
- cd $WORKSPACE/reconcileatt/
- gzip -k onos-voltha-combined.log
- rm onos-voltha-combined.log
- # get pods information
- kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcileatt/pods.txt || true
- '''
- }
- }
- }
-
- stage('Reconcile TT workflow') {
- environment {
- ROBOT_LOGS_DIR="$WORKSPACE/RobotLogs/ReconcileTT"
- }
- steps {
- timeout(time: 25, unit: 'MINUTES') {
- sh '''
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- WAIT_ON_DOWN=y DEPLOY_K8S=n ./voltha down
-
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- export EXTRA_HELM_FLAGS+="--set log_agent.enabled=False ${extraHelmFlags} "
-
- # Workflow-specific flags
- export WITH_RADIUS=no
- export WITH_EAPOL=no
- export WITH_DHCP=yes
- export WITH_IGMP=yes
- export CONFIG_SADIS="external"
- export BBSIM_CFG="configs/bbsim-sadis-tt.yaml"
-
- # start logging
- mkdir -p $WORKSPACE/reconcilett
- _TAG=kail-reconcile-tt kail -n voltha -n default > $WORKSPACE/reconcilett/onos-voltha-combined.log &
-
- DEPLOY_K8S=n ./voltha up
-
- mkdir -p $ROBOT_LOGS_DIR
- export ROBOT_MISC_ARGS="-d $ROBOT_LOGS_DIR -e PowerSwitch"
-
- make -C $WORKSPACE/voltha-system-tests ${makeReconcileTtTestTarget} || true
-
- # stop logging
- P_IDS="$(ps e -ww -A | grep "_TAG=kail-reconcile-tt" | grep -v grep | awk '{print $1}')"
- if [ -n "$P_IDS" ]; then
- echo $P_IDS
- for P_ID in $P_IDS; do
- kill -9 $P_ID
- done
- fi
- cd $WORKSPACE/reconcilett/
- gzip -k onos-voltha-combined.log
- rm onos-voltha-combined.log
- # get pods information
- kubectl get pods -o wide --all-namespaces > $WORKSPACE/reconcilett/pods.txt || true
- '''
- }
- }
- }
- }
- post {
- always {
- sh '''
- # get pods information
- kubectl get pods -o wide
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}"
- helm ls
-
- sync
- pkill kail || true
- md5sum $WORKSPACE/kind-voltha/bin/voltctl
-
- '''
- step([$class: 'RobotPublisher',
- disableArchiveOutput: false,
- logFileName: 'RobotLogs/*/log*.html',
- otherFiles: '',
- outputFileName: 'RobotLogs/*/output*.xml',
- outputPath: '.',
- passThreshold: 100,
- reportFileName: 'RobotLogs/*/report*.html',
- unstableThreshold: 0]);
- archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.txt'
- }
- }
-}
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-physical-build-and-tests.groovy b/jjb/pipeline/voltha/voltha-2.7/voltha-physical-build-and-tests.groovy
deleted file mode 100644
index f0b6787..0000000
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-physical-build-and-tests.groovy
+++ /dev/null
@@ -1,456 +0,0 @@
-// Copyright 2019-present Open Networking Foundation
-//
-// 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.
-
-// deploy VOLTHA built from patchset on a physical pod and run e2e test
-// uses kind-voltha to deploy voltha-2.X
-
-// NOTE we are importing the library even if it's global so that it's
-// easier to change the keywords during a replay
-library identifier: 'cord-jenkins-libraries@master',
- retriever: modernSCM([
- $class: 'GitSCMSource',
- remote: 'https://gerrit.opencord.org/ci-management.git'
-])
-
-// Need this so that deployment_config has global scope when it's read later
-deployment_config = null
-localDeploymentConfigFile = null
-localKindVolthaValuesFile = null
-localSadisConfigFile = null
-
-// The pipeline assumes these variables are always defined
-if ( params.manualBranch != "" ) {
- GERRIT_EVENT_COMMENT_TEXT = ""
- GERRIT_PROJECT = ""
- GERRIT_BRANCH = "${params.manualBranch}"
- GERRIT_CHANGE_NUMBER = ""
- GERRIT_PATCHSET_NUMBER = ""
-}
-
-pipeline {
-
- /* no label, executor is determined by JJB */
- agent {
- label "${params.buildNode}"
- }
- options {
- timeout(time: 120, unit: 'MINUTES')
- }
-
- environment {
- KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
- VOLTCONFIG="$HOME/.volt/config-minimal"
- PATH="$WORKSPACE/bin:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
- NAME="minimal"
- FANCY=0
- //VOL-2194 ONOS SSH and REST ports hardcoded to 30115/30120 in tests
- ONOS_SSH_PORT=30115
- ONOS_API_PORT=30120
- }
-
- stages {
- stage ('Initialize') {
- steps {
- sh returnStdout: false, script: """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- test -e $WORKSPACE/kind-voltha/voltha && cd $WORKSPACE/kind-voltha && ./voltha down
- cd $WORKSPACE
- rm -rf $WORKSPACE/*
- """
- script {
- if (env.configRepo && ! env.localConfigDir) {
- env.localConfigDir = "$WORKSPACE"
- sh returnStdout: false, script: "git clone -b master ${cordRepoUrl}/${configRepo}"
- }
- localDeploymentConfigFile = "${env.localConfigDir}/${params.deploymentConfigFile}"
- localKindVolthaValuesFile = "${env.localConfigDir}/${params.kindVolthaValuesFile}"
- localSadisConfigFile = "${env.localConfigDir}/${params.sadisConfigFile}"
- }
- }
- }
-
- stage('Download Code') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/kind-voltha",
- ]],
- branches: [[ name: "master", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- getVolthaCode([
- branch: "${branch}",
- gerritProject: "${gerritProject}",
- gerritRefspec: "${gerritRefspec}",
- volthaSystemTestsChange: "${volthaSystemTestsChange}",
- volthaHelmChartsChange: "${volthaHelmChartsChange}",
- ])
- }
- }
-
- stage('Check config files') {
- steps {
- script {
- try {
- deployment_config = readYaml file: "${localDeploymentConfigFile}"
- } catch (err) {
- echo "Error reading ${localDeploymentConfigFile}"
- throw err
- }
- sh returnStdout: false, script: """
- if [ ! -e ${localKindVolthaValuesFile} ]; then echo "${localKindVolthaValuesFile} not found"; exit 1; fi
- if [ ! -e ${localSadisConfigFile} ]; then echo "${localSadisConfigFile} not found"; exit 1; fi
- """
- }
- }
- }
-
- stage('Build patch') {
- steps {
- // NOTE that the correct patch has already been checked out
- // during the getVolthaCode step
- buildVolthaComponent("${gerritProject}")
- }
- }
-
- stage('Create KinD Cluster') {
- steps {
- sh returnStdout: false, script: """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha/
- JUST_K8S=y ./voltha up
- """
- }
- }
-
- stage('Load image in kind nodes') {
- when {
- expression { params.manualBranch == "" }
- }
- steps {
- sh returnStdout: false, script: """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- if ! [[ "${gerritProject}" =~ ^(voltha-system-tests|kind-voltha|voltha-helm-charts)\$ ]]; then
- docker images | grep citest
- for image in \$(docker images -f "reference=*/*citest" --format "{{.Repository}}")
- do
- echo "Pushing \$image to nodes"
- kind load docker-image \$image:citest --name voltha-\$NAME --nodes voltha-\$NAME-worker,voltha-\$NAME-worker2
- docker rmi \$image:citest \$image:latest || true
- done
- fi
- """
- }
- }
-
- stage('Deploy Voltha') {
- environment {
- WITH_SIM_ADAPTERS="no"
- WITH_RADIUS="yes"
- DEPLOY_K8S="no"
- VOLTHA_LOG_LEVEL="DEBUG"
- }
- steps {
- script {
- sh returnStdout: false, script: """
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- export EXTRA_HELM_FLAGS+='--set log_agent.enabled=False -f ${localKindVolthaValuesFile} '
-
- IMAGES=""
- if [ "${gerritProject}" = "voltha-go" ]; then
- IMAGES="rw_core ro_core "
- elif [ "${gerritProject}" = "ofagent-py" ]; then
- IMAGES="ofagent "
- elif [ "${gerritProject}" = "voltha-onos" ]; then
- IMAGES="onos "
- elif [ "${gerritProject}" = "voltha-openolt-adapter" ]; then
- IMAGES="adapter_open_olt "
- elif [ "${gerritProject}" = "voltha-openonu-adapter" ]; then
- IMAGES="adapter_open_onu "
- elif [ "${gerritProject}" = "voltha-openonu-adapter-go" ]; then
- IMAGES="adapter_open_onu_go "
- elif [ "${gerritProject}" = "voltha-api-server" ]; then
- IMAGES="afrouter afrouterd "
- else
- echo "No images to push"
- fi
-
- for I in \$IMAGES
- do
- EXTRA_HELM_FLAGS+="--set images.\$I.tag=citest,images.\$I.pullPolicy=Never "
- done
-
- if [ "${gerritProject}" = "voltha-helm-charts" ]; then
- export CHART_PATH=$WORKSPACE/voltha-helm-charts
- export VOLTHA_CHART=\$CHART_PATH/voltha
- export VOLTHA_ADAPTER_OPEN_OLT_CHART=\$CHART_PATH/voltha-adapter-openolt
- export VOLTHA_ADAPTER_OPEN_ONU_CHART=\$CHART_PATH/voltha-adapter-openonu
- helm dep update \$VOLTHA_CHART
- helm dep update \$VOLTHA_ADAPTER_OPEN_OLT_CHART
- helm dep update \$VOLTHA_ADAPTER_OPEN_ONU_CHART
- fi
-
- cd $WORKSPACE/kind-voltha/
- echo \$EXTRA_HELM_FLAGS
- kail -n voltha -n default > $WORKSPACE/onos-voltha-combined.log &
- ./voltha up
-
- set +e
-
- # Remove noise from voltha-core logs
- voltctl log level set WARN read-write-core#github.com/opencord/voltha-go/db/model
- voltctl log level set WARN read-write-core#github.com/opencord/voltha-lib-go/v3/pkg/kafka
- # Remove noise from openolt logs
- voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/db
- voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/probe
- voltctl log level set WARN adapter-open-olt#github.com/opencord/voltha-lib-go/v3/pkg/kafka
- """
- }
- }
- }
-
- stage('Deploy Kafka Dump Chart') {
- steps {
- script {
- sh returnStdout: false, script: """
- helm repo add cord https://charts.opencord.org
- helm repo update
- if helm version -c --short|grep v2 -q; then
- helm install -n voltha-kafka-dump cord/voltha-kafka-dump
- else
- helm install voltha-kafka-dump cord/voltha-kafka-dump
- fi
- """
- }
- }
- }
-
- stage('Push Tech-Profile') {
- when {
- expression { params.profile != "Default" }
- }
- steps {
- sh returnStdout: false, script: """
- etcd_container=\$(kubectl get pods -n voltha | grep voltha-etcd-cluster | awk 'NR==1{print \$1}')
- kubectl cp $WORKSPACE/voltha-system-tests/tests/data/TechProfile-${profile}.json voltha/\$etcd_container:/tmp/flexpod.json
- kubectl exec -it \$etcd_container -n voltha -- /bin/sh -c 'cat /tmp/flexpod.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/XGS-PON/64'
- """
- }
- }
-
- stage('Push Sadis-config') {
- steps {
- sh returnStdout: false, script: """
- ssh-keygen -R [${deployment_config.nodes[0].ip}]:30115
- ssh-keyscan -p 30115 -H ${deployment_config.nodes[0].ip} >> ~/.ssh/known_hosts
- sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.dhcpl2relay"
- sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.aaa"
- sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.olt"
- sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set DEBUG org.onosproject.net.flowobjective.impl.FlowObjectiveManager"
- sshpass -p karaf ssh -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set DEBUG org.onosproject.net.flowobjective.impl.InOrderFlowObjectiveManager"
- curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:$ONOS_API_PORT/onos/v1/network/configuration --data @${localSadisConfigFile}
- """
- }
- }
-
- stage('Reinstall OLT software') {
- when {
- expression { params.reinstallOlt }
- }
- steps {
- script {
- deployment_config.olts.each { olt ->
- sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --remove asfvolt16 && dpkg --purge asfvolt16'"
- waitUntil {
- olt_sw_present = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --list | grep asfvolt16 | wc -l'"
- return olt_sw_present.toInteger() == 0
- }
- if ( params.branch == 'voltha-2.3' ) {
- oltDebVersion = oltDebVersionVoltha23
- } else {
- oltDebVersion = oltDebVersionMaster
- }
- sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --install ${oltDebVersion}'"
- waitUntil {
- olt_sw_present = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --list | grep asfvolt16 | wc -l'"
- return olt_sw_present.toInteger() == 1
- }
- if ( olt.fortygig ) {
- // If the OLT is connected to a 40G switch interface, set the NNI port to be downgraded
- sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'echo port ce128 sp=40000 >> /broadcom/qax.soc ; /opt/bcm68620/svk_init.sh'"
- }
- }
- }
- }
- }
-
- stage('Restart OLT processes') {
- steps {
- script {
- deployment_config.olts.each { olt ->
- sh returnStdout: false, script: """
- ssh-keyscan -H ${olt.ip} >> ~/.ssh/known_hosts
- sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'rm -f /var/log/openolt.log; rm -f /var/log/dev_mgmt_daemon.log; reboot'
- sleep 120
- """
- waitUntil {
- onu_discovered = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'grep \"onu discover indication\" /var/log/openolt.log | wc -l'"
- return onu_discovered.toInteger() > 0
- }
- }
- }
- }
- }
-
- stage('Run E2E Tests') {
- environment {
- ROBOT_CONFIG_FILE="${localDeploymentConfigFile}"
- ROBOT_MISC_ARGS="${params.extraRobotArgs} --removekeywords wuks -d $WORKSPACE/RobotLogs -v container_log_dir:$WORKSPACE "
- ROBOT_FILE="Voltha_PODTests.robot"
- }
- steps {
- sh returnStdout: false, script: """
- mkdir -p $WORKSPACE/RobotLogs
-
- # If the Gerrit comment contains a line with "functional tests" then run the full
- # functional test suite. This covers tests tagged either 'sanity' or 'functional'.
- # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
- REGEX="functional tests"
- if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
- ROBOT_MISC_ARGS+="-i functional"
- fi
- # Likewise for dataplane tests
- REGEX="dataplane tests"
- if [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]]; then
- ROBOT_MISC_ARGS+="-i dataplane"
- fi
-
- make -C $WORKSPACE/voltha-system-tests voltha-test || true
- """
- }
- }
-
- stage('After-Test Delay') {
- when {
- expression { params.manualBranch == "" }
- }
- steps {
- sh returnStdout: false, script: """
- # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
- REGEX="hardware test with delay\$"
- [[ "$GERRIT_EVENT_COMMENT_TEXT" =~ \$REGEX ]] && sleep 10m || true
- """
- }
- }
- }
-
- post {
- always {
- sh returnStdout: false, script: '''
- set +e
- cp $WORKSPACE/kind-voltha/install-minimal.log $WORKSPACE/
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
- kubectl get nodes -o wide
- kubectl get pods -o wide
- kubectl get pods -n voltha -o wide
-
- sync
- pkill kail || true
-
- ## Pull out errors from log files
- extract_errors_go() {
- echo
- echo "Error summary for $1:"
- grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg'
- echo
- }
-
- extract_errors_python() {
- echo
- echo "Error summary for $1:"
- grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2-
- echo
- }
-
- extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log
- extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log
- extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log
- extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log
-
- gzip $WORKSPACE/onos-voltha-combined.log
-
- ## collect events, the chart should be running by now
- kubectl get pods | grep -i voltha-kafka-dump | grep -i running
- if [[ $? == 0 ]]; then
- kubectl exec -it `kubectl get pods | grep -i voltha-kafka-dump | grep -i running | cut -f1 -d " "` ./voltha-dump-events.sh > $WORKSPACE/voltha-events.log
- fi
- '''
- script {
- deployment_config.olts.each { olt ->
- sh returnStdout: false, script: """
- until sshpass -p ${olt.pass} scp ${olt.user}@${olt.ip}:/var/log/openolt.log $WORKSPACE/openolt-${olt.ip}.log
- do
- echo "Fetching openolt.log log failed, retrying..."
- sleep 10
- done
- sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/openolt-${olt.ip}.log # Remove escape sequences
- until sshpass -p ${olt.pass} scp ${olt.user}@${olt.ip}:/var/log/dev_mgmt_daemon.log $WORKSPACE/dev_mgmt_daemon-${olt.ip}.log
- do
- echo "Fetching dev_mgmt_daemon.log failed, retrying..."
- sleep 10
- done
- sed -i 's/\\x1b\\[[0-9;]*[a-zA-Z]//g' $WORKSPACE/dev_mgmt_daemon-${olt.ip}.log # Remove escape sequences
- """
- }
- }
- step([$class: 'RobotPublisher',
- disableArchiveOutput: false,
- logFileName: 'RobotLogs/log*.html',
- otherFiles: '',
- outputFileName: 'RobotLogs/output*.xml',
- outputPath: '.',
- passThreshold: 100,
- reportFileName: 'RobotLogs/report*.html',
- unstableThreshold: 0]);
- archiveArtifacts artifacts: '*.log,*.gz'
- }
- }
-}
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-system-test-bbsim.groovy b/jjb/pipeline/voltha/voltha-2.7/voltha-system-test-bbsim.groovy
deleted file mode 100644
index aa08ecb..0000000
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-system-test-bbsim.groovy
+++ /dev/null
@@ -1,191 +0,0 @@
-// Copyright 2017-present Open Networking Foundation
-//
-// 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.
-
-// voltha-2.x e2e tests
-// uses kind-voltha to deploy voltha-2.X
-// uses bbsim to simulate OLT/ONUs
-
-
-pipeline {
-
- /* no label, executor is determined by JJB */
- agent {
- label "${params.buildNode}"
- }
- options {
- timeout(time: 80, unit: 'MINUTES')
- }
- environment {
- KUBECONFIG="$HOME/.kube/kind-config-voltha-full"
- VOLTCONFIG="$HOME/.volt/config-full"
- PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$WORKSPACE/kind-voltha/bin"
- TYPE="full"
- FANCY=0
- WITH_SIM_ADAPTERS="n"
- WITH_RADIUS="y"
- WITH_BBSIM="y"
- DEPLOY_K8S="y"
- VOLTHA_LOG_LEVEL="DEBUG"
- CONFIG_SADIS="external"
- BBSIM_CFG="configs/bbsim-sadis-att.yaml"
- ROBOT_MISC_ARGS="-d $WORKSPACE/RobotLogs"
- NUM_OF_ETCD=3
- SCHEDULE_ON_CONTROL_NODES="y"
- }
-
- stages {
- stage('Create Kubernetes Cluster') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- git clone https://gerrit.opencord.org/kind-voltha
- pushd kind-voltha/
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- JUST_K8S=y ./voltha up
- popd
- """
- }
- }
- }
-
- stage('Setup log collector') {
- steps {
- sh """
- bash <( curl -sfL https://raw.githubusercontent.com/boz/kail/master/godownloader.sh) -b "$WORKSPACE/kind-voltha/bin"
- kail -n voltha -n default > $WORKSPACE/onos-voltha-combined.log &
- """
- }
- }
-
- stage('Deploy Voltha') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh """
- export EXTRA_HELM_FLAGS=""
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
-
- EXTRA_HELM_FLAGS+="${params.extraHelmFlags} "
- echo \$EXTRA_HELM_FLAGS
-
- pushd kind-voltha/
- ./voltha up
- popd
- """
- }
- }
- }
-
- stage('Run E2E Tests') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh '''
- rm -rf $WORKSPACE/RobotLogs; mkdir -p $WORKSPACE/RobotLogs
- git clone -b ${branch} https://gerrit.opencord.org/voltha-system-tests
- make ROBOT_DEBUG_LOG_OPT="-l sanity_log.html -r sanity_report.html -o sanity_output.xml" -C $WORKSPACE/voltha-system-tests ${makeTarget}
- '''
- }
- }
- }
-
- stage('Kubernetes ETCD Scale Test') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh '''
- make ROBOT_DEBUG_LOG_OPT="-l functional_log.html -r functional_report.html -o functional_output.xml" -C $WORKSPACE/voltha-system-tests system-scale-test
- '''
- }
- }
- }
-
- stage('Kubernetes ETCD Failure Test') {
- steps {
- timeout(time: 10, unit: 'MINUTES') {
- sh '''
- make ROBOT_DEBUG_LOG_OPT="-l failure_log.html -r failure_report.html -o failure_output.xml" -C $WORKSPACE/voltha-system-tests failure-test
- '''
- }
- }
- }
-
- }
-
- post {
- always {
- sh '''
- set +e
- cp $WORKSPACE/kind-voltha/install-full.log $WORKSPACE/
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
- kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
- kubectl get nodes -o wide
- kubectl get pods -o wide
- kubectl get pods -n voltha -o wide
-
- sync
- pkill kail || true
-
- ## Pull out errors from log files
- extract_errors_go() {
- echo
- echo "Error summary for $1:"
- grep $1 $WORKSPACE/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg'
- echo
- }
-
- extract_errors_python() {
- echo
- echo "Error summary for $1:"
- grep $1 $WORKSPACE/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2-
- echo
- }
-
- extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log
- extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log
- extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log
- extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log
-
- ## shut down kind-voltha
- if [ "${branch}" != "master" ]; then
- echo "on branch: ${branch}, sourcing kind-voltha/releases/${branch}"
- source "$WORKSPACE/kind-voltha/releases/${branch}"
- else
- echo "on master, using default settings for kind-voltha"
- fi
- cd $WORKSPACE/kind-voltha
- WAIT_ON_DOWN=y ./voltha down
-
- '''
- step([$class: 'RobotPublisher',
- disableArchiveOutput: false,
- logFileName: 'RobotLogs/*log*.html',
- otherFiles: '',
- outputFileName: 'RobotLogs/*output*.xml',
- outputPath: '.',
- passThreshold: 100,
- reportFileName: 'RobotLogs/*report*.html',
- unstableThreshold: 0]);
- archiveArtifacts artifacts: '*.log'
-
- }
- }
-}
diff --git a/jjb/pipeline/voltha/voltha-2.8/bbsim-tests.groovy b/jjb/pipeline/voltha/voltha-2.8/bbsim-tests.groovy
new file mode 100755
index 0000000..8649916
--- /dev/null
+++ b/jjb/pipeline/voltha/voltha-2.8/bbsim-tests.groovy
@@ -0,0 +1,272 @@
+// Copyright 2021-present Open Networking Foundation
+//
+// 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.
+
+// voltha-2.x e2e tests for openonu-go
+// uses bbsim to simulate OLT/ONUs
+
+library identifier: 'cord-jenkins-libraries@master',
+ retriever: modernSCM([
+ $class: 'GitSCMSource',
+ remote: 'https://gerrit.opencord.org/ci-management.git'
+])
+
+def clusterName = "kind-ci"
+
+def execute_test(testTarget, workflow, teardown, testSpecificHelmFlags = "") {
+ def infraNamespace = "default"
+ def volthaNamespace = "voltha"
+ def robotLogsDir = "RobotLogs"
+ stage('Cleanup') {
+ if (teardown) {
+ timeout(15) {
+ script {
+ helmTeardown(["default", infraNamespace, volthaNamespace])
+ }
+ timeout(1) {
+ sh returnStdout: false, script: '''
+ # remove orphaned port-forward from different namespaces
+ ps aux | grep port-forw | grep -v grep | awk '{print $2}' | xargs --no-run-if-empty kill -9 || true
+ '''
+ }
+ }
+ }
+ }
+ stage('Deploy Voltha') {
+ if (teardown) {
+ timeout(10) {
+ script {
+
+ sh """
+ mkdir -p $WORKSPACE/${testTarget}-components
+ _TAG=kail-startup kail -n ${infraNamespace} -n ${volthaNamespace} > $WORKSPACE/${testTarget}-components/onos-voltha-startup-combined.log &
+ """
+
+ // if we're downloading a voltha-helm-charts patch, then install from a local copy of the charts
+ def localCharts = false
+ if (gerritProject == "voltha-helm-charts" || branch != "master") {
+ localCharts = true
+ }
+
+ // NOTE temporary workaround expose ONOS node ports
+ def localHelmFlags = extraHelmFlags + " --set global.log_level=${logLevel.toUpperCase()} " +
+ " --set onos-classic.onosSshPort=30115 " +
+ " --set onos-classic.onosApiPort=30120 " +
+ " --set onos-classic.onosOfPort=31653 " +
+ " --set onos-classic.individualOpenFlowNodePorts=true " + testSpecificHelmFlags
+
+ if (gerritProject != "") {
+ localHelmFlags = "${localHelmFlags} " + getVolthaImageFlags("${gerritProject}")
+ }
+
+ volthaDeploy([
+ infraNamespace: infraNamespace,
+ volthaNamespace: volthaNamespace,
+ workflow: workflow.toLowerCase(),
+ extraHelmFlags: localHelmFlags,
+ localCharts: localCharts,
+ bbsimReplica: olts.toInteger(),
+ dockerRegistry: registry,
+ ])
+ }
+
+ // stop logging
+ sh """
+ P_IDS="\$(ps e -ww -A | grep "_TAG=kail-startup" | grep -v grep | awk '{print \$1}')"
+ if [ -n "\$P_IDS" ]; then
+ echo \$P_IDS
+ for P_ID in \$P_IDS; do
+ kill -9 \$P_ID
+ done
+ fi
+ cd $WORKSPACE/${testTarget}-components/
+ gzip -k onos-voltha-startup-combined.log
+ rm onos-voltha-startup-combined.log
+ """
+ }
+ sh """
+ JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-voltha-api" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${volthaNamespace} svc/voltha-voltha-api 55555:55555; done"&
+ JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-infra-etcd" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-etcd 2379:2379; done"&
+ JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-infra-kafka" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-kafka 9092:9092; done"&
+ bbsimDmiPortFwd=50075
+ for i in {0..${olts.toInteger() - 1}}; do
+ JENKINS_NODE_COOKIE="dontKillMe" _TAG="bbsim\${i}" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${volthaNamespace} svc/bbsim\${i} \${bbsimDmiPortFwd}:50075; done"&
+ ((bbsimDmiPortFwd++))
+ done
+ ps aux | grep port-forward
+ """
+ }
+ }
+ stage('Run test ' + testTarget + ' on ' + workflow + ' workFlow') {
+ // start logging
+ sh """
+ mkdir -p $WORKSPACE/${testTarget}-components
+ _TAG=kail-${workflow} kail -n ${infraNamespace} -n ${volthaNamespace} > $WORKSPACE/${testTarget}-components/onos-voltha-combined.log &
+ """
+ sh """
+ mkdir -p $WORKSPACE/${robotLogsDir}/${testTarget}-robot
+ export ROBOT_MISC_ARGS="-d $WORKSPACE/${robotLogsDir}/${testTarget}-robot "
+ ROBOT_MISC_ARGS+="-v ONOS_SSH_PORT:30115 -v ONOS_REST_PORT:30120 -v INFRA_NAMESPACE:${infraNamespace}"
+ export KVSTOREPREFIX=voltha/voltha_voltha
+
+ make -C $WORKSPACE/voltha-system-tests ${testTarget} || true
+ """
+ // stop logging
+ sh """
+ P_IDS="\$(ps e -ww -A | grep "_TAG=kail-${workflow}" | grep -v grep | awk '{print \$1}')"
+ if [ -n "\$P_IDS" ]; then
+ echo \$P_IDS
+ for P_ID in \$P_IDS; do
+ kill -9 \$P_ID
+ done
+ fi
+ cd $WORKSPACE/${testTarget}-components/
+ rm onos-voltha-combined.log.gz || true
+ gzip -k onos-voltha-combined.log
+ rm onos-voltha-combined.log
+ """
+ getPodsInfo("$WORKSPACE/${testTarget}-components")
+ }
+}
+
+def collectArtifacts(exitStatus) {
+ getPodsInfo("$WORKSPACE/${exitStatus}")
+ sh """
+ kubectl logs -n voltha -l app.kubernetes.io/part-of=voltha > $WORKSPACE/${exitStatus}/voltha.log || true
+ """
+ archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.txt,**/*.html'
+ sh '''
+ sync
+ pkill kail || true
+ which voltctl
+ md5sum $(which voltctl)
+ '''
+ step([$class: 'RobotPublisher',
+ disableArchiveOutput: false,
+ logFileName: "RobotLogs/*/log*.html",
+ otherFiles: '',
+ outputFileName: "RobotLogs/*/output*.xml",
+ outputPath: '.',
+ passThreshold: 100,
+ reportFileName: "RobotLogs/*/report*.html",
+ unstableThreshold: 0,
+ onlyCritical: true]);
+}
+
+pipeline {
+
+ /* no label, executor is determined by JJB */
+ agent {
+ label "${params.buildNode}"
+ }
+ options {
+ timeout(time: "${timeout}", unit: 'MINUTES')
+ }
+ environment {
+ KUBECONFIG="$HOME/.kube/kind-${clusterName}"
+ VOLTCONFIG="$HOME/.volt/config"
+ PATH="$PATH:$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+ ROBOT_MISC_ARGS="-e PowerSwitch ${params.extraRobotArgs}"
+ DIAGS_PROFILE="VOLTHA_PROFILE"
+ }
+ stages {
+ stage('Download Code') {
+ steps {
+ getVolthaCode([
+ branch: "${branch}",
+ gerritProject: "${gerritProject}",
+ gerritRefspec: "${gerritRefspec}",
+ volthaSystemTestsChange: "${volthaSystemTestsChange}",
+ volthaHelmChartsChange: "${volthaHelmChartsChange}",
+ ])
+ }
+ }
+ stage('Build patch') {
+ // build the patch only if gerritProject is specified
+ when {
+ expression {
+ return !gerritProject.isEmpty()
+ }
+ }
+ steps {
+ // NOTE that the correct patch has already been checked out
+ // during the getVolthaCode step
+ buildVolthaComponent("${gerritProject}")
+ }
+ }
+ stage('Create K8s Cluster') {
+ steps {
+ script {
+ def clusterExists = sh returnStdout: true, script: """
+ kind get clusters | grep ${clusterName} | wc -l
+ """
+ if (clusterExists.trim() == "0") {
+ createKubernetesCluster([nodes: 3, name: clusterName])
+ }
+ }
+ }
+ }
+ stage('Replace voltctl') {
+ // if the project is voltctl override the downloaded one with the built one
+ when {
+ expression {
+ return gerritProject == "voltctl"
+ }
+ }
+ steps{
+ sh """
+ mv `ls $WORKSPACE/voltctl/release/voltctl-*-linux-amd*` $WORKSPACE/bin/voltctl
+ chmod +x $WORKSPACE/bin/voltctl
+ """
+ }
+ }
+ stage('Load image in kind nodes') {
+ when {
+ expression {
+ return !gerritProject.isEmpty()
+ }
+ }
+ steps {
+ loadToKind()
+ }
+ }
+ stage('Parse and execute tests') {
+ steps {
+ script {
+ def tests = readYaml text: testTargets
+
+ for(int i = 0;i<tests.size();i++) {
+ def test = tests[i]
+ def target = test["target"]
+ def workflow = test["workflow"]
+ def flags = test["flags"]
+ def teardown = test["teardown"].toBoolean()
+ println "Executing test ${target} on workflow ${workflow} with extra flags ${flags}"
+ execute_test(target, workflow, teardown, flags)
+ }
+ }
+ }
+ }
+ }
+ post {
+ aborted {
+ collectArtifacts("aborted")
+ }
+ failure {
+ collectArtifacts("failed")
+ }
+ always {
+ collectArtifacts("always")
+ }
+ }
+}
diff --git a/jjb/pipeline/voltha/voltha-2.8/device-management-mock-tests.groovy b/jjb/pipeline/voltha/voltha-2.8/device-management-mock-tests.groovy
new file mode 100644
index 0000000..8a15ac6
--- /dev/null
+++ b/jjb/pipeline/voltha/voltha-2.8/device-management-mock-tests.groovy
@@ -0,0 +1,172 @@
+// Copyright 2017-present Open Networking Foundation
+//
+// 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.
+
+// NOTE we are importing the library even if it's global so that it's
+// easier to change the keywords during a replay
+library identifier: 'cord-jenkins-libraries@master',
+ retriever: modernSCM([
+ $class: 'GitSCMSource',
+ remote: 'https://gerrit.opencord.org/ci-management.git'
+])
+
+def localCharts = false
+
+pipeline {
+
+ /* no label, executor is determined by JJB */
+ agent {
+ label "${params.buildNode}"
+ }
+ options {
+ timeout(time: 90, unit: 'MINUTES')
+ }
+ environment {
+ KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal"
+ PATH="$PATH:$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+ ROBOT_MISC_ARGS="-d $WORKSPACE/RobotLogs"
+ }
+
+ stages {
+
+ stage('Download Code') {
+ steps {
+ getVolthaCode([
+ branch: "${branch}",
+ gerritProject: "${gerritProject}",
+ gerritRefspec: "${gerritRefspec}",
+ volthaSystemTestsChange: "${volthaSystemTestsChange}",
+ volthaHelmChartsChange: "${volthaHelmChartsChange}",
+ ])
+ }
+ }
+ stage('Build Redfish Importer Image') {
+ steps {
+ sh """
+ make -C $WORKSPACE/device-management/\$1 DOCKER_REPOSITORY=opencord/ DOCKER_TAG=citest docker-build-importer
+ """
+ }
+ }
+ stage('Build demo_test Image') {
+ steps {
+ sh """
+ make -C $WORKSPACE/device-management/\$1/demo_test DOCKER_REPOSITORY=opencord/ DOCKER_TAG=citest docker-build
+ """
+ }
+ }
+ stage('Build mock-redfish-server Image') {
+ steps {
+ sh """
+ make -C $WORKSPACE/device-management/\$1/mock-redfish-server DOCKER_REPOSITORY=opencord/ DOCKER_TAG=citest docker-build
+ """
+ }
+ }
+ stage('Create K8s Cluster') {
+ steps {
+ createKubernetesCluster([nodes: 3])
+ }
+ }
+ stage('Load image in kind nodes') {
+ steps {
+ loadToKind()
+ }
+ }
+ stage('Deploy Voltha') {
+ steps {
+ script {
+ if (branch != "master" || volthaHelmChartsChange != "") {
+ // if we're using a release or testing changes in the charts, then use the local clone
+ localCharts = true
+ }
+ }
+ volthaDeploy([
+ workflow: "att",
+ extraHelmFlags: extraHelmFlags,
+ dockerRegistry: "mirror.registry.opennetworking.org",
+ localCharts: localCharts,
+ ])
+ // start logging
+ sh """
+ mkdir -p $WORKSPACE/att
+ _TAG=kail-att kail -n infra -n voltha -n default > $WORKSPACE/att/onos-voltha-combined.log &
+ """
+ // forward ONOS and VOLTHA ports
+ sh """
+ _TAG=onos-port-forward kubectl port-forward --address 0.0.0.0 -n infra svc/voltha-infra-onos-classic-hs 8101:8101&
+ _TAG=onos-port-forward kubectl port-forward --address 0.0.0.0 -n infra svc/voltha-infra-onos-classic-hs 8181:8181&
+ _TAG=voltha-port-forward kubectl port-forward --address 0.0.0.0 -n voltha svc/voltha-voltha-api 55555:55555&
+ """
+ }
+ }
+
+ stage('Run E2E Tests') {
+ steps {
+ sh '''
+ mkdir -p $WORKSPACE/RobotLogs
+
+ # tell the kubernetes script to use images tagged citest and pullPolicy:Never
+ sed -i 's/master/citest/g' $WORKSPACE/device-management/kubernetes/deploy*.yaml
+ sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/g' $WORKSPACE/device-management/kubernetes/deploy*.yaml
+ make -C $WORKSPACE/device-management functional-mock-test || true
+ '''
+ }
+ }
+ }
+
+ post {
+ always {
+ sh '''
+ set +e
+ kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq
+ kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq
+ kubectl get nodes -o wide
+ kubectl get pods -o wide --all-namespaces
+
+ sync
+ pkill kail || true
+
+ ## Pull out errors from log files
+ extract_errors_go() {
+ echo
+ echo "Error summary for $1:"
+ grep $1 $WORKSPACE/att/onos-voltha-combined.log | grep '"level":"error"' | cut -d ' ' -f 2- | jq -r '.msg'
+ echo
+ }
+
+ extract_errors_python() {
+ echo
+ echo "Error summary for $1:"
+ grep $1 $WORKSPACE/att/onos-voltha-combined.log | grep 'ERROR' | cut -d ' ' -f 2-
+ echo
+ }
+
+ extract_errors_go voltha-rw-core > $WORKSPACE/error-report.log
+ extract_errors_go adapter-open-olt >> $WORKSPACE/error-report.log
+ extract_errors_python adapter-open-onu >> $WORKSPACE/error-report.log
+ extract_errors_python voltha-ofagent >> $WORKSPACE/error-report.log
+
+ gzip $WORKSPACE/att/onos-voltha-combined.log
+ '''
+ step([$class: 'RobotPublisher',
+ disableArchiveOutput: false,
+ logFileName: 'RobotLogs/log*.html',
+ otherFiles: '',
+ outputFileName: 'RobotLogs/output*.xml',
+ outputPath: '.',
+ passThreshold: 80,
+ reportFileName: 'RobotLogs/report*.html',
+ unstableThreshold: 0]);
+ archiveArtifacts artifacts: '**/*.log,**/*.gz'
+ }
+ }
+}
diff --git a/jjb/pipeline/voltha/voltha-2.8/physical-build.groovy b/jjb/pipeline/voltha/voltha-2.8/physical-build.groovy
new file mode 100644
index 0000000..9ea7387
--- /dev/null
+++ b/jjb/pipeline/voltha/voltha-2.8/physical-build.groovy
@@ -0,0 +1,384 @@
+// Copyright 2017-present Open Networking Foundation
+//
+// 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.
+
+// used to deploy VOLTHA and configure ONOS physical PODs
+
+// NOTE we are importing the library even if it's global so that it's
+// easier to change the keywords during a replay
+library identifier: 'cord-jenkins-libraries@master',
+ retriever: modernSCM([
+ $class: 'GitSCMSource',
+ remote: 'https://gerrit.opencord.org/ci-management.git'
+])
+
+def infraNamespace = "infra"
+def volthaNamespace = "voltha"
+
+pipeline {
+
+ /* no label, executor is determined by JJB */
+ agent {
+ label "${params.buildNode}"
+ }
+ options {
+ timeout(time: 35, unit: 'MINUTES')
+ }
+ environment {
+ PATH="$PATH:$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
+ KUBECONFIG="$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf"
+ }
+
+ stages{
+ stage('Download Code') {
+ steps {
+ getVolthaCode([
+ branch: "${branch}",
+ volthaSystemTestsChange: "${volthaSystemTestsChange}",
+ volthaHelmChartsChange: "${volthaHelmChartsChange}",
+ ])
+ }
+ }
+ stage ("Parse deployment configuration file") {
+ steps {
+ sh returnStdout: true, script: "rm -rf ${configBaseDir}"
+ sh returnStdout: true, script: "git clone -b master ${cordRepoUrl}/${configBaseDir}"
+ script {
+ if ( params.workFlow == "DT" ) {
+ deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml"
+ }
+ else if ( params.workFlow == "TT" )
+ {
+ deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-TT.yaml"
+ }
+ else
+ {
+ deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
+ }
+ }
+ }
+ }
+ stage('Clean up') {
+ steps {
+ timeout(15) {
+ script {
+ helmTeardown(["default", infraNamespace, volthaNamespace])
+ }
+ timeout(1) {
+ sh returnStdout: false, script: '''
+ # remove orphaned port-forward from different namespaces
+ ps aux | grep port-forw | grep -v grep | awk '{print $2}' | xargs --no-run-if-empty kill -9 || true
+ '''
+ }
+ }
+ }
+ }
+ stage('Install Voltha') {
+ steps {
+ timeout(20) {
+ script {
+ // if we're downloading a voltha-helm-charts patch, then install from a local copy of the charts
+ def localCharts = false
+ if (volthaHelmChartsChange != "" || branch != "master") {
+ localCharts = true
+ }
+
+ // should the config file be suffixed with the workflow? see "deployment_config"
+ def localHelmFlags = "-f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/voltha/${configFileName}.yml --set global.log_level=${logLevel} "
+
+ if (workFlow.toLowerCase() == "dt") {
+ localHelmFlags += " --set radius.enabled=false "
+ }
+ if (workFlow.toLowerCase() == "tt") {
+ localHelmFlags += " --set radius.enabled=false --set global.incremental_evto_update=true "
+ if (enableMultiUni.toBoolean()) {
+ localHelmFlags += " --set voltha-adapter-openonu.adapter_open_onu.uni_port_mask=${uniPortMask} "
+ }
+ }
+
+ // NOTE temporary workaround expose ONOS node ports (pod-config needs to be updated to contain these values)
+ // and to connect the ofagent to all instances of ONOS
+ localHelmFlags = localHelmFlags + " --set onos-classic.onosSshPort=30115 " +
+ "--set onos-classic.onosApiPort=30120 " +
+ "--set onos-classic.onosOfPort=31653 " +
+ "--set onos-classic.individualOpenFlowNodePorts=true " +
+ "--set voltha.onos_classic.replicas=${params.NumOfOnos}"
+
+ if (bbsimReplicas.toInteger() != 0) {
+ localHelmFlags = localHelmFlags + " --set onu=${onuNumber},pon=${ponNumber} "
+ }
+
+ // adding user specified helm flags at the end so they'll have priority over everything else
+ localHelmFlags = localHelmFlags + " ${extraHelmFlags}"
+
+ volthaDeploy([
+ workflow: workFlow.toLowerCase(),
+ extraHelmFlags: localHelmFlags,
+ localCharts: localCharts,
+ kubeconfig: "$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf",
+ onosReplica: params.NumOfOnos,
+ atomixReplica: params.NumOfAtomix,
+ kafkaReplica: params.NumOfKafka,
+ etcdReplica: params.NumOfEtcd,
+ bbsimReplica: bbsimReplicas.toInteger(),
+ ])
+ }
+ sh """
+ JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-api" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${volthaNamespace} svc/voltha-voltha-api 55555:55555; done"&
+ JENKINS_NODE_COOKIE="dontKillMe" _TAG="etcd" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-etcd ${params.VolthaEtcdPort}:2379; done"&
+ JENKINS_NODE_COOKIE="dontKillMe" _TAG="kafka" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-kafka 9092:9092; done"&
+ ps aux | grep port-forward
+ """
+ getPodsInfo("$WORKSPACE")
+ }
+ }
+ }
+ stage('Push Tech-Profile') {
+ steps {
+ script {
+ if ( params.configurePod && params.profile != "Default" ) {
+ for(int i=0; i < deployment_config.olts.size(); i++) {
+ def tech_prof_directory = "XGS-PON"
+ // If no debian package is specified we default to GPON for the ADTRAN OLT.
+ if (!deployment_config.olts[i].containsKey("oltDebVersion") || deployment_config.olts[i].oltDebVersion.contains("asgvolt64")){
+ tech_prof_directory = "GPON"
+ }
+ timeout(1) {
+ sh returnStatus: true, script: """
+ export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+ etcd_container=\$(kubectl get pods -n ${infraNamespace} | grep etcd | awk 'NR==1{print \$1}')
+ if [[ "${workFlow}" == "TT" ]]; then
+ if [[ "${params.enableMultiUni}" == "true" ]]; then
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-multi-uni-HSIA.json \$etcd_container:/tmp/hsia.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/hsia.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/64'
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-multi-uni-VoIP.json \$etcd_container:/tmp/voip.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/voip.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/65'
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-multi-uni-MCAST-AdditionalBW-None.json \$etcd_container:/tmp/mcast_additionalBW_none.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/mcast_additionalBW_none.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/66'
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-multi-uni-MCAST-AdditionalBW-NA.json \$etcd_container:/tmp/mcast_additionalBW_na.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/mcast_additionalBW_na.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/67'
+ else
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-HSIA.json \$etcd_container:/tmp/hsia.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/hsia.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/64'
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-VoIP.json \$etcd_container:/tmp/voip.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/voip.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/65'
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-MCAST-AdditionalBW-None.json \$etcd_container:/tmp/mcast_additionalBW_none.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/mcast_additionalBW_none.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/66'
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-MCAST-AdditionalBW-NA.json \$etcd_container:/tmp/mcast_additionalBW_na.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/mcast_additionalBW_na.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/67'
+ fi
+ else
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/TechProfile-${profile}.json \$etcd_container:/tmp/flexpod.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/flexpod.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/64'
+ fi
+ """
+ }
+ timeout(1) {
+ sh returnStatus: true, script: """
+ export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+ etcd_container=\$(kubectl get pods -n ${infraNamespace} | grep etcd | awk 'NR==1{print \$1}')
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'ETCDCTL_API=3 etcdctl get --prefix service/voltha/technology_profiles/${tech_prof_directory}/64'
+ """
+ }
+ }
+ }
+ }
+ }
+ }
+ stage('Push MIB templates') {
+ steps {
+ sh """
+ export KUBECONFIG=$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf
+ etcd_container=\$(kubectl get pods -n ${infraNamespace} | grep etcd | awk 'NR==1{print \$1}')
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/MIB_Alpha.json \$etcd_container:/tmp/MIB_Alpha.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/MIB_Alpha.json | ETCDCTL_API=3 etcdctl put service/voltha/omci_mibs/go_templates/BRCM/BVM4K00BRA0915-0083/5023_020O02414'
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/MIB_Alpha.json | ETCDCTL_API=3 etcdctl put service/voltha/omci_mibs/templates/BRCM/BVM4K00BRA0915-0083/5023_020O02414'
+ kubectl cp -n ${infraNamespace} $WORKSPACE/voltha-system-tests/tests/data/MIB_Scom.json \$etcd_container:/tmp/MIB_Scom.json
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/MIB_Scom.json | ETCDCTL_API=3 etcdctl put service/voltha/omci_mibs/go_templates/SCOM/Glasfaser-Modem/090140.1.0.304'
+ kubectl exec -n ${infraNamespace} -it \$etcd_container -- /bin/sh -c 'cat /tmp/MIB_Scom.json | ETCDCTL_API=3 etcdctl put service/voltha/omci_mibs/templates/SCOM/Glasfaser-Modem/090140.1.0.304'
+ """
+ }
+ }
+ stage('Push Sadis-config') {
+ steps {
+ timeout(1) {
+ sh returnStatus: true, script: """
+ if [[ "${workFlow}" == "DT" ]]; then
+ curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-sadis-DT.json
+ elif [[ "${workFlow}" == "TT" ]]; then
+ curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-sadis-TT.json
+ else
+ # this is the ATT case, rename the file in *-sadis-ATT.json so that we can avoid special cases and just load the file
+ curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-sadis.json
+ fi
+ """
+ }
+ }
+ }
+ stage('Switch Configurations in ONOS') {
+ steps {
+ script {
+ if ( deployment_config.fabric_switches.size() > 0 ) {
+ timeout(1) {
+ def netcfg = "$WORKSPACE/${configBaseDir}/${configToscaDir}/voltha/${configFileName}-onos-netcfg-switch.json"
+ if (params.inBandManagement){
+ netcfg = "$WORKSPACE/${configBaseDir}/${configToscaDir}/voltha/${configFileName}-onos-netcfg-switch-inband.json"
+ }
+ sh """
+ curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @${netcfg}
+ curl -sSL --user karaf:karaf -X POST http://${deployment_config.nodes[0].ip}:30120/onos/v1/applications/org.onosproject.segmentrouting/active
+ """
+ }
+ timeout(1) {
+ waitUntil {
+ sr_active_out = sh returnStatus: true, script: """
+ sshpass -p karaf ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.dhcpl2relay"
+ sshpass -p karaf ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.aaa"
+ sshpass -p karaf ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.olt"
+ sshpass -p karaf ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set DEBUG org.onosproject.net.flowobjective.impl.FlowObjectiveManager"
+ sshpass -p karaf ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set DEBUG org.onosproject.net.flowobjective.impl.InOrderFlowObjectiveManager"
+ curl -sSL --user karaf:karaf -X GET http://${deployment_config.nodes[0].ip}:30120/onos/v1/applications/org.onosproject.segmentrouting | jq '.state' | grep ACTIVE
+ sshpass -p karaf ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "cfg set org.onosproject.provider.lldp.impl.LldpLinkProvider enabled false"
+ sshpass -p karaf ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "cfg set org.onosproject.net.flow.impl.FlowRuleManager purgeOnDisconnection false"
+ sshpass -p karaf ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "cfg set org.onosproject.net.meter.impl.MeterManager purgeOnDisconnection false"
+ """
+ return sr_active_out == 0
+ }
+ }
+ timeout(7) {
+ for(int i=0; i < deployment_config.hosts.src.size(); i++) {
+ for(int j=0; j < deployment_config.olts.size(); j++) {
+ def aggPort = -1
+ if(deployment_config.olts[j].serial == deployment_config.hosts.src[i].olt){
+ aggPort = deployment_config.olts[j].aggPort
+ if(aggPort == -1){
+ throw new Exception("Upstream port for the olt is not configured, field aggPort is empty")
+ }
+ sh """
+ sleep 30 # NOTE why are we sleeping?
+ curl -X POST --user karaf:karaf --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"deviceId": "${deployment_config.fabric_switches[0].device_id}", "vlanId": "${deployment_config.hosts.src[i].s_tag}", "endpoints": [${deployment_config.fabric_switches[0].bngPort},${aggPort}]}' 'http://${deployment_config.nodes[0].ip}:30120/onos/segmentrouting/xconnect'
+ """
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ stage('Reinstall OLT software') {
+ steps {
+ script {
+ if ( params.reinstallOlt ) {
+ for(int i=0; i < deployment_config.olts.size(); i++) {
+ // NOTE what is oltDebVersion23? is that for VOLTHA-2.3? do we still need this differentiation?
+ sh returnStdout: true, script: """
+ if [[ "${branch}" != "master" ]] && [[ "${params.inBandManagement}" == "true" ]]; then
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'kill -9 `pgrep -f "[b]ash /opt/openolt/openolt_dev_mgmt_daemon_process_watchdog"` || true'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} "dpkg --install ${deployment_config.olts[i].oltDebVersion23}"
+ fi
+ if [[ "${branch}" != "master" ]] && [[ "${params.inBandManagement}" == "false" ]]; then
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} "dpkg --install ${deployment_config.olts[i].oltDebVersion23}"
+ fi
+ if [[ "${branch}" == "master" ]] && [[ "${params.inBandManagement}" == "true" ]]; then
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'kill -9 `pgrep -f "[b]ash /opt/openolt/openolt_dev_mgmt_daemon_process_watchdog"` || true'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} "dpkg --install ${deployment_config.olts[i].oltDebVersion}"
+ fi
+ if [[ "${branch}" == "master" ]] && [[ "${params.inBandManagement}" == "false" ]]; then
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} "dpkg --install ${deployment_config.olts[i].oltDebVersion}"
+ fi
+ sleep 10
+ """
+ timeout(5) {
+ waitUntil {
+ olt_sw_present = sh returnStdout: true, script: """
+ if [ "${deployment_config.olts[i].oltDebVersion}" == *"asfvolt16"* ]; then
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'dpkg --list | grep asfvolt16 | wc -l'
+ else
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'dpkg --list | grep asgvolt64 | wc -l'
+ fi
+ if (${deployment_config.olts[i].fortygig}); then
+ if [[ "${params.inBandManagement}" == "true" ]]; then
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'mkdir -p /opt/openolt/'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'cp /root/watchdog-script/* /opt/openolt/'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'cp /root/bal_cli_appl/example_user_appl /broadcom'
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'cp in-band-startup-script/* /etc/init.d/'
+ fi
+ fi
+ """
+ return olt_sw_present.toInteger() > 0
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ stage('Restart OLT processes') {
+ steps {
+ script {
+ for(int i=0; i < deployment_config.olts.size(); i++) {
+ int waitTimerForOltUp = 360
+ if ( params.inBandManagement ) {
+ waitTimerForOltUp = 540
+ }
+ timeout(15) {
+ sh returnStdout: true, script: """
+ ssh-keyscan -H ${deployment_config.olts[i].sship} >> ~/.ssh/known_hosts
+ sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'rm -f /var/log/openolt.log; rm -f /var/log/dev_mgmt_daemon.log; rm -f /var/log/openolt_process_watchdog.log; reboot > /dev/null &' || true
+ sleep ${waitTimerForOltUp}
+ """
+ }
+ timeout(15) {
+ waitUntil {
+ devprocess = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'ps -ef | grep dev_mgmt_daemon | wc -l'"
+ return devprocess.toInteger() > 0
+ }
+ }
+ timeout(15) {
+ waitUntil {
+ openoltprocess = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].sship} 'ps -ef | grep openolt | wc -l'"
+ return openoltprocess.toInteger() > 0
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ post {
+ aborted {
+ getPodsInfo("$WORKSPACE/failed")
+ sh """
+ kubectl logs -n voltha -l app.kubernetes.io/part-of=voltha > $WORKSPACE/failed/voltha.log || true
+ """
+ archiveArtifacts artifacts: '**/*.log,**/*.txt'
+ }
+ failure {
+ getPodsInfo("$WORKSPACE/failed")
+ sh """
+ kubectl logs -n voltha -l app.kubernetes.io/part-of=voltha > $WORKSPACE/failed/voltha.logs || true
+ """
+ archiveArtifacts artifacts: '**/*.log,**/*.txt'
+ }
+ always {
+ archiveArtifacts artifacts: '*.txt'
+ }
+ }
+}
diff --git a/jjb/pipeline/voltha/voltha-2.7/software-upgrades.groovy b/jjb/pipeline/voltha/voltha-2.8/software-upgrades.groovy
similarity index 87%
rename from jjb/pipeline/voltha/voltha-2.7/software-upgrades.groovy
rename to jjb/pipeline/voltha/voltha-2.8/software-upgrades.groovy
index 596f25a..285fac1 100644
--- a/jjb/pipeline/voltha/voltha-2.7/software-upgrades.groovy
+++ b/jjb/pipeline/voltha/voltha-2.8/software-upgrades.groovy
@@ -23,16 +23,14 @@
def test_software_upgrade(name) {
stage('Deploy Voltha - '+ name) {
def extraHelmFlags = "${extraHelmFlags} --set global.log_level=DEBUG,onu=1,pon=1 --set onos-classic.replicas=3,onos-classic.atomix.replicas=3 "
+ if ("${name}" == "onos-app-upgrade" || "${name}" == "onu-software-upgrade") {
+ extraHelmFlags = extraHelmFlags + "--set global.image_tag=master --set onos-classic.image.tag=master "
+ }
+ if ("${name}" == "voltha-component-upgrade") {
+ extraHelmFlags = extraHelmFlags + "--set images.onos_config_loader.tag=master-onos-config-loader --set onos-classic.image.tag=master "
+ }
extraHelmFlags = extraHelmFlags + " --set onos-classic.onosSshPort=30115 --set onos-classic.onosApiPort=30120 "
- extraHelmFlags = extraHelmFlags + """ --set voltha.services.controller[0].service=voltha-infra-onos-classic-0.voltha-infra-onos-classic-hs.infra.svc \
- --set voltha.services.controller[0].port=6653 \
- --set voltha.services.controller[0].address=voltha-infra-onos-classic-0.voltha-infra-onos-classic-hs.infra.svc:6653 \
- --set voltha.services.controller[1].service=voltha-infra-onos-classic-1.voltha-infra-onos-classic-hs.infra.svc \
- --set voltha.services.controller[1].port=6653 \
- --set voltha.services.controller[1].address=voltha-infra-onos-classic-1.voltha-infra-onos-classic-hs.infra.svc:6653 \
- --set voltha.services.controller[2].service=voltha-infra-onos-classic-2.voltha-infra-onos-classic-hs.infra.svc \
- --set voltha.services.controller[2].port=6653 \
- --set voltha.services.controller[2].address=voltha-infra-onos-classic-2.voltha-infra-onos-classic-hs.infra.svc:6653 """
+ extraHelmFlags = extraHelmFlags + " --set voltha.onos_classic.replicas=3"
//ONOS custom image handling
if ( onosImg.trim() != '' ) {
String[] split;
@@ -40,11 +38,13 @@
split = onosImg.split(':')
extraHelmFlags = extraHelmFlags + "--set onos-classic.image.repository=" + split[0] +",onos-classic.image.tag=" + split[1] + " "
}
-
+ def localCharts = false
+ if (branch != "master") {
+ localCharts = true
+ }
// Currently only testing with ATT workflow
// TODO: Support for other workflows
- // NOTE localCharts is set to "true" so that we use the locally cloned version of the chart (set to voltha-2.7)
- volthaDeploy([workflow: "att", extraHelmFlags: extraHelmFlags, localCharts: true])
+ volthaDeploy([workflow: "att", extraHelmFlags: extraHelmFlags, localCharts: localCharts])
// start logging
sh """
rm -rf $WORKSPACE/${name} || true
@@ -109,7 +109,7 @@
export TARGET=voltha-comp-upgrade-test
fi
if [[ ${name} == 'onu-software-upgrade' ]]; then
- export ROBOT_MISC_ARGS="-d \$ROBOT_LOGS_DIR -v onu_image_name:${onuImageName.trim()} -v onu_image_url:${onuImageUrl.trim()} -v onu_image_version:${onuImageVersion.trim()} -v onu_image_crc:${onuImageCrc.trim()} -v onu_image_local_dir:${onuImageLocalDir.trim()} -e PowerSwitch"
+ export ROBOT_MISC_ARGS="-d \$ROBOT_LOGS_DIR -v image_version:${onuImageVersion.trim()} -v image_url:${onuImageUrl.trim()} -v image_vendor:${onuImageVendor.trim()} -v image_activate_on_success:${onuImageActivateOnSuccess.trim()} -v image_commit_on_success:${onuImageCommitOnSuccess.trim()} -v image_crc:${onuImageCrc.trim()} -e PowerSwitch"
export TARGET=onu-upgrade-test
fi
export VOLTCONFIG=$HOME/.volt/config-minimal
@@ -237,7 +237,8 @@
outputPath: '.',
passThreshold: 100,
reportFileName: 'RobotLogs/*/report*.html',
- unstableThreshold: 0]);
+ unstableThreshold: 0,
+ onlyCritical: true]);
archiveArtifacts artifacts: '*.log,**/*.log,**/*.gz,*.gz,*.txt,**/*.txt'
}
}
diff --git a/jjb/pipeline/voltha/voltha-2.8/tucson-build-and-test.groovy b/jjb/pipeline/voltha/voltha-2.8/tucson-build-and-test.groovy
new file mode 100644
index 0000000..629ed74
--- /dev/null
+++ b/jjb/pipeline/voltha/voltha-2.8/tucson-build-and-test.groovy
@@ -0,0 +1,364 @@
+
+// Copyright 2017-present Open Networking Foundation
+//
+// 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.
+// used to deploy VOLTHA and configure ONOS physical PODs
+// NOTE we are importing the library even if it's global so that it's
+// easier to change the keywords during a replay
+library identifier: 'cord-jenkins-libraries@master',
+ retriever: modernSCM([
+ $class: 'GitSCMSource',
+ remote: 'https://gerrit.opencord.org/ci-management.git'
+])
+def infraNamespace = "infra"
+def volthaNamespace = "voltha"
+def clusterName = "kind-ci"
+pipeline {
+ /* no label, executor is determined by JJB */
+ agent {
+ label "${params.buildNode}"
+ }
+ options {
+ timeout(time: 120, unit: 'MINUTES')
+ }
+ environment {
+ PATH="$PATH:$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
+ KUBECONFIG="$HOME/.kube/kind-${clusterName}"
+ VOLTCONFIG="$HOME/.volt/config"
+ LOG_FOLDER="$WORKSPACE/${workflow}/"
+ APPS_TO_LOG="etcd kafka onos-classic adapter-open-onu adapter-open-olt rw-core ofagent bbsim radius bbsim-sadis-server onos-config-loader"
+
+ }
+ stages{
+ stage('Download Code') {
+ steps {
+ getVolthaCode([
+ branch: "${branch}",
+ gerritProject: "${gerritProject}",
+ gerritRefspec: "${gerritRefspec}",
+ volthaSystemTestsChange: "${volthaSystemTestsChange}",
+ volthaHelmChartsChange: "${volthaHelmChartsChange}",
+ ])
+ }
+ }
+ stage ("Parse deployment configuration file") {
+ steps {
+ sh returnStdout: true, script: "rm -rf ${configBaseDir}"
+ sh returnStdout: true, script: "git clone -b master ${cordRepoUrl}/${configBaseDir}"
+ script {
+
+ if (params.workflow.toUpperCase() == "TT") {
+ error("The Tucson POD does not support TT workflow at the moment")
+ }
+
+ if ( params.workflow.toUpperCase() == "DT" ) {
+ deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml"
+ }
+ else if ( params.workflow.toUpperCase() == "TT" ) {
+ deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}-TT.yaml"
+ }
+ else {
+ deployment_config = readYaml file: "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
+ }
+ }
+ }
+ }
+ stage('Clean up') {
+ steps {
+ timeout(15) {
+ script {
+ helmTeardown(["default", infraNamespace, volthaNamespace])
+ }
+ timeout(1) {
+ sh returnStdout: false, script: '''
+ # remove orphaned port-forward from different namespaces
+ ps aux | grep port-forw | grep -v grep | awk '{print $2}' | xargs --no-run-if-empty kill -9 || true
+ '''
+ }
+ }
+ }
+ }
+ stage('Build patch') {
+ steps {
+ // NOTE that the correct patch has already been checked out
+ // during the getVolthaCode step
+ buildVolthaComponent("${gerritProject}")
+ }
+ }
+ stage('Create K8s Cluster') {
+ steps {
+ script {
+ def clusterExists = sh returnStdout: true, script: """
+ kind get clusters | grep ${clusterName} | wc -l
+ """
+ if (clusterExists.trim() == "0") {
+ createKubernetesCluster([nodes: 3, name: clusterName])
+ }
+ }
+ }
+ }
+ stage('Load image in kind nodes') {
+ steps {
+ loadToKind()
+ }
+ }
+ stage('Install Voltha') {
+ steps {
+ timeout(20) {
+ script {
+ imageFlags = getVolthaImageFlags(gerritProject)
+ // if we're downloading a voltha-helm-charts patch, then install from a local copy of the charts
+ def localCharts = false
+ if (volthaHelmChartsChange != "" || gerritProject == "voltha-helm-charts" || branch != "master") {
+ localCharts = true
+ }
+ def flags = "-f $WORKSPACE/${configBaseDir}/${configKubernetesDir}/voltha/${configFileName}.yml ${imageFlags} "
+ // NOTE temporary workaround expose ONOS node ports (pod-config needs to be updated to contain these values)
+ flags = flags + "--set onos-classic.onosSshPort=30115 " +
+ "--set onos-classic.onosApiPort=30120 " +
+ "--set onos-classic.onosOfPort=31653 " +
+ "--set onos-classic.individualOpenFlowNodePorts=true " + extraHelmFlags
+ volthaDeploy([
+ workflow: workFlow.toLowerCase(),
+ extraHelmFlags: flags,
+ localCharts: localCharts,
+ kubeconfig: "$WORKSPACE/${configBaseDir}/${configKubernetesDir}/${configFileName}.conf",
+ onosReplica: 3,
+ atomixReplica: 3,
+ kafkaReplica: 3,
+ etcdReplica: 3,
+ ])
+ }
+ // start logging
+ sh """
+ rm -rf $WORKSPACE/${workFlow}/
+ mkdir -p $WORKSPACE/${workFlow}
+ _TAG=kail-${workFlow} kail -n infra -n voltha > $WORKSPACE/${workFlow}/onos-voltha-combined.log &
+ """
+ sh returnStdout: false, script: '''
+ # start logging with kail
+
+ mkdir -p $LOG_FOLDER
+
+ list=($APPS_TO_LOG)
+ for app in "${list[@]}"
+ do
+ echo "Starting logs for: ${app}"
+ _TAG=kail-$app kail -l app=$app --since 1h > $LOG_FOLDER/$app.log&
+ done
+ '''
+ sh """
+ JENKINS_NODE_COOKIE="dontKillMe" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${volthaNamespace} svc/voltha-voltha-api 55555:55555; done"&
+ JENKINS_NODE_COOKIE="dontKillMe" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-etcd 2379:2379; done"&
+ JENKINS_NODE_COOKIE="dontKillMe" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-kafka 9092:9092; done"&
+ ps aux | grep port-forward
+ """
+ getPodsInfo("$WORKSPACE")
+ }
+ }
+ }
+ stage('Deploy Kafka Dump Chart') {
+ steps {
+ script {
+ sh returnStdout: false, script: """
+ helm repo add cord https://charts.opencord.org
+ helm repo update
+ if helm version -c --short|grep v2 -q; then
+ helm install -n voltha-kafka-dump cord/voltha-kafka-dump
+ else
+ helm install voltha-kafka-dump cord/voltha-kafka-dump
+ fi
+ """
+ }
+ }
+ }
+ stage('Push Tech-Profile') {
+ when {
+ expression { params.profile != "Default" }
+ }
+ steps {
+ sh returnStdout: false, script: """
+ etcd_container=\$(kubectl get pods -n voltha | grep voltha-etcd-cluster | awk 'NR==1{print \$1}')
+ kubectl cp $WORKSPACE/voltha-system-tests/tests/data/TechProfile-${profile}.json voltha/\$etcd_container:/tmp/flexpod.json
+ kubectl exec -it \$etcd_container -n voltha -- /bin/sh -c 'cat /tmp/flexpod.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/XGS-PON/64'
+ """
+ }
+ }
+
+ stage('Push Sadis-config') {
+ steps {
+ sh returnStdout: false, script: """
+ ssh-keygen -R [${deployment_config.nodes[0].ip}]:30115
+ ssh-keyscan -p 30115 -H ${deployment_config.nodes[0].ip} >> ~/.ssh/known_hosts
+ sshpass -p karaf ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.dhcpl2relay"
+ sshpass -p karaf ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.aaa"
+ sshpass -p karaf ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set TRACE org.opencord.olt"
+ sshpass -p karaf ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set DEBUG org.onosproject.net.flowobjective.impl.FlowObjectiveManager"
+ sshpass -p karaf ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@${deployment_config.nodes[0].ip} "log:set DEBUG org.onosproject.net.flowobjective.impl.InOrderFlowObjectiveManager"
+
+ if [[ "${workFlow.toUpperCase()}" == "DT" ]]; then
+ curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-sadis-DT.json
+ elif [[ "${workFlow.toUpperCase()}" == "TT" ]]; then
+ curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-sadis-TT.json
+ else
+ # this is the ATT case, rename the file in *-sadis-ATT.json so that we can avoid special cases and just load the file
+ curl -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://${deployment_config.nodes[0].ip}:30120/onos/v1/network/configuration --data @$WORKSPACE/voltha-system-tests/tests/data/${configFileName}-sadis.json
+ fi
+ """
+ }
+ }
+ stage('Reinstall OLT software') {
+ when {
+ expression { params.reinstallOlt }
+ }
+ steps {
+ script {
+ deployment_config.olts.each { olt ->
+ sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --remove asfvolt16 && dpkg --purge asfvolt16'"
+ waitUntil {
+ olt_sw_present = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --list | grep asfvolt16 | wc -l'"
+ return olt_sw_present.toInteger() == 0
+ }
+ if ( params.branch == 'voltha-2.3' ) {
+ oltDebVersion = oltDebVersionVoltha23
+ } else {
+ oltDebVersion = oltDebVersionMaster
+ }
+ sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --install ${oltDebVersion}'"
+ waitUntil {
+ olt_sw_present = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'dpkg --list | grep asfvolt16 | wc -l'"
+ return olt_sw_present.toInteger() == 1
+ }
+ if ( olt.fortygig ) {
+ // If the OLT is connected to a 40G switch interface, set the NNI port to be downgraded
+ sh returnStdout: false, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'echo port ce128 sp=40000 >> /broadcom/qax.soc ; /opt/bcm68620/svk_init.sh'"
+ }
+ }
+ }
+ }
+ }
+
+ stage('Restart OLT processes') {
+ steps {
+ script {
+ deployment_config.olts.each { olt ->
+ sh returnStdout: false, script: """
+ ssh-keyscan -H ${olt.ip} >> ~/.ssh/known_hosts
+ sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'rm -f /var/log/openolt.log; rm -f /var/log/dev_mgmt_daemon.log; reboot'
+ sleep 120
+ """
+ waitUntil {
+ onu_discovered = sh returnStdout: true, script: "sshpass -p ${olt.pass} ssh -l ${olt.user} ${olt.ip} 'grep \"onu discover indication\" /var/log/openolt.log | wc -l'"
+ return onu_discovered.toInteger() > 0
+ }
+ }
+ }
+ }
+ }
+ stage('Run E2E Tests') {
+ steps {
+ script {
+ // different workflows need different make targets and different robot files
+ if ( params.workflow.toUpperCase() == "DT" ) {
+ robotConfigFile = "${configBaseDir}/${configDeploymentDir}/${configFileName}-DT.yaml"
+ robotFile = "Voltha_DT_PODTests.robot"
+ makeTarget = "voltha-dt-test"
+ robotFunctionalKeyword = "-i functionalDt"
+ robotDataplaneKeyword = "-i dataplaneDt"
+ }
+ else if ( params.workflow.toUpperCase() == "TT" ) {
+ // TODO the TT tests have diffent tags, address once/if TT is support on the Tucson POD
+ robotConfigFile = "${configBaseDir}/${configDeploymentDir}/${configFileName}-TT.yaml"
+ robotFile = "Voltha_TT_PODTests.robot"
+ makeTarget = "voltha-tt-test"
+ robotFunctionalKeyword = "-i functionalTt"
+ robotDataplaneKeyword = "-i dataplaneTt"
+ }
+ else {
+ robotConfigFile = "${configBaseDir}/${configDeploymentDir}/${configFileName}.yaml"
+ robotFile = "Voltha_PODTests.robot"
+ makeTarget = "voltha-test"
+ robotFunctionalKeyword = "-i functional"
+ robotDataplaneKeyword = "-i dataplane"
+ }
+ }
+ sh returnStdout: false, script: """
+ mkdir -p $WORKSPACE/RobotLogs
+
+ export ROBOT_CONFIG_FILE="$WORKSPACE/${robotConfigFile}"
+ export ROBOT_MISC_ARGS="${params.extraRobotArgs} --removekeywords wuks -d $WORKSPACE/RobotLogs -v container_log_dir:$WORKSPACE "
+ export ROBOT_FILE="${robotFile}"
+
+ # If the Gerrit comment contains a line with "functional tests" then run the full
+ # functional test suite. This covers tests tagged either 'sanity' or 'functional'.
+ # Note: Gerrit comment text will be prefixed by "Patch set n:" and a blank line
+ REGEX="functional tests"
+ if [[ "${gerritComment}" =~ \$REGEX ]]; then
+ ROBOT_MISC_ARGS+="${robotFunctionalKeyword} "
+ fi
+ # Likewise for dataplane tests
+ REGEX="dataplane tests"
+ if [[ "${gerritComment}" =~ \$REGEX ]]; then
+ ROBOT_MISC_ARGS+="${robotDataplaneKeyword}"
+ fi
+
+ make -C $WORKSPACE/voltha-system-tests ${makeTarget} || true
+ """
+ }
+ }
+ }
+ post {
+ always {
+ // stop logging
+ sh """
+ P_IDS="\$(ps e -ww -A | grep "_TAG=kail-${workFlow}" | grep -v grep | awk '{print \$1}')"
+ if [ -n "\$P_IDS" ]; then
+ echo \$P_IDS
+ for P_ID in \$P_IDS; do
+ kill -9 \$P_ID
+ done
+ fi
+ gzip $WORKSPACE/${workFlow}/onos-voltha-combined.log || true
+ """
+ sh '''
+ # stop the kail processes
+ list=($APPS_TO_LOG)
+ for app in "${list[@]}"
+ do
+ echo "Stopping logs for: ${app}"
+ _TAG="kail-$app"
+ P_IDS="$(ps e -ww -A | grep "_TAG=$_TAG" | grep -v grep | awk '{print $1}')"
+ if [ -n "$P_IDS" ]; then
+ echo $P_IDS
+ for P_ID in $P_IDS; do
+ kill -9 $P_ID
+ done
+ fi
+ done
+ '''
+ step([$class: 'RobotPublisher',
+ disableArchiveOutput: false,
+ logFileName: 'RobotLogs/log*.html',
+ otherFiles: '',
+ outputFileName: 'RobotLogs/output*.xml',
+ outputPath: '.',
+ passThreshold: 100,
+ reportFileName: 'RobotLogs/report*.html',
+ unstableThreshold: 0,
+ onlyCritical: true]);
+ archiveArtifacts artifacts: '**/*.txt,**/*.gz,*.gz,**/*.log'
+ }
+ }
+}
+
+// refs/changes/06/24206/5
diff --git a/jjb/pipeline/voltha/voltha-2.8/voltha-scale-multi-stack.groovy b/jjb/pipeline/voltha/voltha-2.8/voltha-scale-multi-stack.groovy
new file mode 100644
index 0000000..6d75846
--- /dev/null
+++ b/jjb/pipeline/voltha/voltha-2.8/voltha-scale-multi-stack.groovy
@@ -0,0 +1,476 @@
+// Copyright 2019-present Open Networking Foundation
+//
+// 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.
+
+// deploy VOLTHA using kind-voltha and performs a scale test
+
+// NOTE we are importing the library even if it's global so that it's
+// easier to change the keywords during a replay
+library identifier: 'cord-jenkins-libraries@master',
+ retriever: modernSCM([
+ $class: 'GitSCMSource',
+ remote: 'https://gerrit.opencord.org/ci-management.git'
+])
+
+def ofAgentConnections(numOfOnos, releaseName, namespace) {
+ def params = " "
+ numOfOnos.times {
+ params += "--set voltha.services.controller[${it}].address=${releaseName}-onos-classic-${it}.${releaseName}-onos-classic-hs.${namespace}.svc:6653 "
+ }
+ return params
+}
+
+pipeline {
+
+ /* no label, executor is determined by JJB */
+ agent {
+ label "${params.buildNode}"
+ }
+ options {
+ timeout(time: 120, unit: 'MINUTES')
+ }
+ environment {
+ JENKINS_NODE_COOKIE="dontKillMe" // do not kill processes after the build is done
+ KUBECONFIG="$HOME/.kube/config"
+ SSHPASS="karaf"
+ PATH="$PATH:$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
+
+ APPS_TO_LOG="etcd kafka onos-onos-classic adapter-open-onu adapter-open-olt rw-core ofagent bbsim radius bbsim-sadis-server"
+ LOG_FOLDER="$WORKSPACE/logs"
+ }
+
+ stages {
+ stage ('Cleanup') {
+ steps {
+ timeout(time: 11, unit: 'MINUTES') {
+ sh """
+ # remove orphaned port-forward from different namespaces
+ ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 || true
+ """
+ script {
+ def namespaces = ["infra"]
+ // FIXME we may have leftovers from more VOLTHA stacks (eg: run1 had 10 stacks, run2 had 2 stacks)
+ volthaStacks.toInteger().times {
+ namespaces += "voltha${it + 1}"
+ }
+ helmTeardown(namespaces)
+ }
+ sh returnStdout: false, script: """
+ helm repo add onf https://charts.opencord.org
+ helm repo add cord https://charts.opencord.org
+ helm repo update
+
+ # remove all port-forward from different namespaces
+ ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 || true
+ """
+ }
+ }
+ }
+ stage('Download Code') {
+ steps {
+ getVolthaCode([
+ branch: "${release}",
+ volthaSystemTestsChange: "${volthaSystemTestsChange}",
+ volthaHelmChartsChange: "${volthaHelmChartsChange}",
+ ])
+ }
+ }
+ stage('Deploy common infrastructure') {
+ // includes monitoring
+ steps {
+ sh '''
+ if [ ${withMonitoring} = true ] ; then
+ helm install -n infra nem-monitoring cord/nem-monitoring \
+ -f $HOME/voltha-scale/grafana.yaml \
+ --set prometheus.alertmanager.enabled=false,prometheus.pushgateway.enabled=false \
+ --set kpi_exporter.enabled=false,dashboards.xos=false,dashboards.onos=false,dashboards.aaa=false,dashboards.voltha=false
+ fi
+ '''
+ }
+ }
+ stage('Deploy VOLTHA infrastructure') {
+ steps {
+ sh returnStdout: false, script: '''
+
+ kubectl create configmap -n infra kube-config "--from-file=kube_config=\$KUBECONFIG" || true
+
+ export EXTRA_HELM_FLAGS+=' '
+
+ # No persistent-volume-claims in Atomix
+ EXTRA_HELM_FLAGS+="--set onos-classic.atomix.persistence.enabled=false "
+ # disable the securityContext, this is a development cluster
+ EXTRA_HELM_FLAGS+='--set securityContext.enabled=false '
+
+ echo \$EXTRA_HELM_FLAGS
+
+ helm upgrade --install -n infra voltha-infra onf/voltha-infra \
+ -f $WORKSPACE/voltha-helm-charts/examples/${workflow}-values.yaml \
+ --set onos-classic.replicas=${onosReplicas},onos-classic.atomix.replicas=${atomixReplicas} \
+ --set radius.enabled=${withEapol} \
+ --set global.log_level=${logLevel} \
+ --set onos-classic.onosSshPort=30115 \
+ --set onos-classic.onosApiPort=30120 \
+ --set kafka.replicaCount=3,kafka.zookeeper.replicaCount=3 \
+ --set etcd.statefulset.replicaCount=3 \$EXTRA_HELM_FLAGS
+ '''
+ }
+ }
+ stage('Deploy Voltha') {
+ steps {
+ deploy_voltha_stacks(params.volthaStacks)
+ }
+ }
+ stage('Start logging') {
+ //FIXME this collects the logs all in one file for all the 10 stacks
+ steps {
+ sh returnStdout: false, script: '''
+ # start logging with kail
+
+ mkdir -p $LOG_FOLDER
+
+ list=($APPS_TO_LOG)
+ for app in "${list[@]}"
+ do
+ echo "Starting logs for: ${app}"
+ _TAG=kail-$app kail -l app=$app --since 1h > $LOG_FOLDER/$app.log&
+ done
+ '''
+ }
+ }
+ stage('Configuration') {
+ steps {
+ script {
+ sh returnStdout: false, script: """
+
+ # forward ETCD port
+ JENKINS_NODE_COOKIE="dontKillMe" _TAG=etcd-port-forward /bin/bash -c "while true; do kubectl -n infra port-forward --address 0.0.0.0 service/etcd 9999:2379; done 2>&1 " &
+
+ # forward ONOS ports
+ JENKINS_NODE_COOKIE="dontKillMe" _TAG=onos-port-forward /bin/bash -c "while true; do kubectl -n infra port-forward --address 0.0.0.0 service/voltha-infra-onos-classic-hs 8101:8101; done 2>&1 " &
+ JENKINS_NODE_COOKIE="dontKillMe" _TAG=onos-port-forward /bin/bash -c "while true; do kubectl -n infra port-forward --address 0.0.0.0 service/voltha-infra-onos-classic-hs 8181:8181; done 2>&1 " &
+
+ # make sure the the port-forward has started before moving forward
+ sleep 5
+ """
+ sh returnStdout: false, script: """
+ # TODO this needs to be repeated per stack
+ # kubectl exec \$(kubectl get pods | grep -E "bbsim[0-9]" | awk 'NR==1{print \$1}') -- bbsimctl log ${logLevel.toLowerCase()} false
+
+ #Setting link discovery
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.provider.lldp.impl.LldpLinkProvider enabled ${withLLDP}
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.net.flow.impl.FlowRuleManager allowExtraneousRules true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.net.flow.impl.FlowRuleManager importExtraneousRules true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.net.flowobjective.impl.InOrderFlowObjectiveManager accumulatorMaxBatchMillis 900
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.net.flowobjective.impl.InOrderFlowObjectiveManager accumulatorMaxIdleMillis 500
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.opencord.olt.impl.Olt provisionDelay 1000
+
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg log:set ${logLevel} org.onosproject
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg log:set ${logLevel} org.opencord
+
+ # Set Flows/Ports/Meters poll frequency
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.provider.of.flow.impl.OpenFlowRuleProvider flowPollFrequency ${onosStatInterval}
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg set org.onosproject.provider.of.device.impl.OpenFlowDeviceProvider portStatsPollFrequency ${onosStatInterval}
+
+ #SR is not needed in scale tests and not currently used by operators in production, can be disabled.
+ sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.onosproject.segmentrouting
+
+
+ if [ ${withFlows} = false ]; then
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.olt
+ fi
+ """
+ }
+ }
+ }
+ stage('Setup Test') {
+ steps {
+ sh '''
+ mkdir -p $WORKSPACE/RobotLogs
+ cd $WORKSPACE/voltha-system-tests
+ make vst_venv
+ '''
+ }
+ }
+ stage('Run Test') {
+ steps {
+ test_voltha_stacks(params.volthaStacks)
+ }
+ }
+ }
+ post {
+ always {
+ // collect result, done in the "post" step so it's executed even in the
+ // event of a timeout in the tests
+ sh '''
+
+ # stop the kail processes
+ list=($APPS_TO_LOG)
+ for app in "${list[@]}"
+ do
+ echo "Stopping logs for: ${app}"
+ _TAG="kail-$app"
+ P_IDS="$(ps e -ww -A | grep "_TAG=$_TAG" | grep -v grep | awk '{print $1}')"
+ if [ -n "$P_IDS" ]; then
+ echo $P_IDS
+ for P_ID in $P_IDS; do
+ kill -9 $P_ID
+ done
+ fi
+ done
+ '''
+ // compressing the logs to save space on Jenkins
+ sh '''
+ cd $LOG_FOLDER
+ tar -czf logs.tar.gz *.log
+ rm *.log
+ '''
+ plot([
+ csvFileName: 'scale-test.csv',
+ csvSeries: [
+ [file: 'plots/plot-voltha-onus.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
+ [file: 'plots/plot-onos-ports.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
+ [file: 'plots/plot-voltha-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
+ [file: 'plots/plot-voltha-openolt-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
+ [file: 'plots/plot-onos-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
+ [file: 'plots/plot-onos-auth.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
+ [file: 'plots/plot-voltha-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
+ [file: 'plots/plot-voltha-openolt-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
+ [file: 'plots/plot-onos-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
+ [file: 'plots/plot-onos-dhcp.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
+ ],
+ group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Scale Test (Stacks: ${params.volthaStacks}, OLTs: ${olts}, PONs: ${pons}, ONUs: ${onus})", yaxis: 'Time (s)', useDescr: true
+ ])
+ step([$class: 'RobotPublisher',
+ disableArchiveOutput: false,
+ logFileName: 'RobotLogs/**/log.html',
+ otherFiles: '',
+ outputFileName: 'RobotLogs/**/output.xml',
+ outputPath: '.',
+ passThreshold: 100,
+ reportFileName: 'RobotLogs/**/report.html',
+ onlyCritical: true,
+ unstableThreshold: 0]);
+ // get all the logs from kubernetes PODs
+ sh returnStdout: false, script: '''
+
+ # store information on running charts
+ helm ls --all-namespaces > $LOG_FOLDER/helm-list.txt || true
+
+ # store information on the running pods
+ kubectl get pods --all-namespaces -o wide > $LOG_FOLDER/pods.txt || true
+ kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-images.txt || true
+ kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-imagesId.txt || true
+
+ # copy the ONOS logs directly from the container to avoid the color codes
+ printf '%s\n' $(kubectl get pods -n infra -l app=onos-classic -o=jsonpath="{.items[*]['metadata.name']}") | xargs --no-run-if-empty -I# bash -c "kubectl cp #:${karafHome}/data/log/karaf.log $LOG_FOLDER/#.log" || true
+
+ '''
+ // dump all the BBSim(s) ONU information
+ script {
+ for (int i = 1; i <= params.volthaStacks.toInteger(); i++) {
+ stack_ns="voltha"+i
+ sh """
+ mkdir -p \$LOG_FOLDER/${stack_ns}
+ BBSIM_IDS=\$(kubectl -n ${stack_ns} get pods | grep bbsim | grep -v server | awk '{print \$1}')
+ IDS=(\$BBSIM_IDS)
+
+ for bbsim in "\${IDS[@]}"
+ do
+ kubectl -n ${stack_ns} exec -t \$bbsim -- bbsimctl onu list > \$LOG_FOLDER/${stack_ns}/\$bbsim-device-list.txt || true
+ kubectl -n ${stack_ns} exec -t \$bbsim -- bbsimctl service list > \$LOG_FOLDER/${stack_ns}/\$bbsim-service-list.txt || true
+ kubectl -n ${stack_ns} exec -t \$bbsim -- bbsimctl olt resources GEM_PORT > \$LOG_FOLDER/${stack_ns}/\$bbsim-flows-gem-ports.txt || true
+ kubectl -n ${stack_ns} exec -t \$bbsim -- bbsimctl olt resources ALLOC_ID > \$LOG_FOLDER/${stack_ns}/\$bbsim-flows-alloc-ids.txt || true
+ kubectl -n ${stack_ns} exec -t \$bbsim -- bbsimctl olt pons > \$LOG_FOLDER/${stack_ns}/\$bbsim-pon-resources.txt || true
+ done
+ """
+ }
+ }
+ // get ONOS debug infos
+ sh '''
+
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 apps -a -s > $LOG_FOLDER/onos-apps.txt || true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 nodes > $LOG_FOLDER/onos-nodes.txt || true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 masters > $LOG_FOLDER/onos-masters.txt || true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 roles > $LOG_FOLDER/onos-roles.txt || true
+
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 ports > $LOG_FOLDER/onos-ports-list.txt || true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 hosts > $LOG_FOLDER/onos-hosts-list.txt || true
+
+ if [ ${withFlows} = true ] ; then
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-olts > $LOG_FOLDER/onos-olt-list.txt || true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 flows -s > $LOG_FOLDER/onos-flows-list.txt || true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 meters > $LOG_FOLDER/onos-meters-list.txt || true
+ fi
+
+ if [ ${provisionSubscribers} = true ]; then
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-programmed-subscribers > $LOG_FOLDER/onos-programmed-subscribers.txt || true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-programmed-meters > $LOG_FOLDER/onos-programmed-meters.txt || true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-bpmeter-mappings > $LOG_FOLDER/onos-bpmeter-mappings.txt || true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-failed-subscribers > $LOG_FOLDER/onos-failed-subscribers.txt || true
+ fi
+
+ if [ ${withEapol} = true ] ; then
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 aaa-users > $LOG_FOLDER/onos-aaa-users.txt || true
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 aaa-statistics > $LOG_FOLDER/onos-aaa-statistics.txt || true
+ fi
+
+ if [ ${withDhcp} = true ] ; then
+ sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 dhcpl2relay-allocations > $LOG_FOLDER/onos-dhcp-allocations.txt || true
+ fi
+ '''
+ // collect etcd metrics
+ sh '''
+ mkdir -p $WORKSPACE/etcd-metrics
+ curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=etcd_debugging_mvcc_keys_total' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-key-count.json || true
+ curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=grpc_server_handled_total{grpc_service="etcdserverpb.KV"}' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-rpc-count.json || true
+ curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=etcd_debugging_mvcc_db_total_size_in_bytes' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-db-size.json || true
+ curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=etcd_disk_backend_commit_duration_seconds_sum' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-backend-write-time.json || true
+ '''
+ // get VOLTHA debug infos
+ script {
+ for (int i = 1; i <= params.volthaStacks.toInteger(); i++) {
+ stack_ns="voltha"+i
+ voltcfg="~/.volt/config-voltha"+i
+ try {
+ sh """
+
+ # _TAG=voltha-port-forward kubectl port-forward --address 0.0.0.0 -n voltha${i} svc/voltha${i}-voltha-api 55555:55555& > /dev/null 2>&1
+ _TAG="voltha-port-forward" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n voltha${i} svc/voltha${i}-voltha-api 55555:55555 > /dev/null 2>&1; done"&
+
+ voltctl -m 8MB device list -o json > $LOG_FOLDER/${stack_ns}/device-list.json || true
+ python -m json.tool $LOG_FOLDER/${stack_ns}/device-list.json > $LOG_FOLDER/${stack_ns}/voltha-devices-list.json || true
+ rm $LOG_FOLDER/${stack_ns}/device-list.json || true
+ voltctl -m 8MB device list > $LOG_FOLDER/${stack_ns}/voltha-devices-list.txt || true
+
+ DEVICE_LIST=
+ printf '%s\n' \$(voltctl -m 8MB device list | grep olt | awk '{print \$1}') | xargs --no-run-if-empty -I# bash -c "voltctl-m 8MB device flows # > $LOG_FOLDER/${stack_ns}/voltha-device-flows-#.txt" || true
+ printf '%s\n' \$(voltctl -m 8MB device list | grep olt | awk '{print \$1}') | xargs --no-run-if-empty -I# bash -c "voltctl -m 8MB device port list --format 'table{{.PortNo}}\t{{.Label}}\t{{.Type}}\t{{.AdminState}}\t{{.OperStatus}}' # > $LOG_FOLDER/${stack_ns}/voltha-device-ports-#.txt" || true
+
+ printf '%s\n' \$(voltctl -m 8MB logicaldevice list -q) | xargs --no-run-if-empty -I# bash -c "voltctl -m 8MB logicaldevice flows # > $LOG_FOLDER/${stack_ns}/voltha-logicaldevice-flows-#.txt" || true
+ printf '%s\n' \$(voltctl -m 8MB logicaldevice list -q) | xargs --no-run-if-empty -I# bash -c "voltctl -m 8MB logicaldevice port list # > $LOG_FOLDER/${stack_ns}/voltha-logicaldevice-ports-#.txt" || true
+
+ # remove VOLTHA port-forward
+ ps aux | grep port-forw | grep voltha-api | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 || true
+ """
+ } catch(e) {
+ println e
+ sh '''
+ echo "Can't get device list from voltctl"
+ '''
+ }
+ }
+ }
+ // get cpu usage by container
+ sh '''
+ if [ ${withMonitoring} = true ] ; then
+ cd $WORKSPACE/voltha-system-tests
+ source ./vst_venv/bin/activate
+ sleep 60 # we have to wait for prometheus to collect all the information
+ python tests/scale/sizing.py -o $WORKSPACE/plots || true
+ fi
+ '''
+ archiveArtifacts artifacts: 'kind-voltha/install-*.log,execution-time-*.txt,logs/**/*.txt,logs/**/*.tar.gz,RobotLogs/**/*,plots/*,etcd-metrics/*'
+ }
+ }
+}
+
+def deploy_voltha_stacks(numberOfStacks) {
+ for (int i = 1; i <= numberOfStacks.toInteger(); i++) {
+ stage("Deploy VOLTHA stack " + i) {
+ // ${logLevel}
+ def extraHelmFlags = "${extraHelmFlags} --set global.log_level=${logLevel},enablePerf=true,onu=${onus},pon=${pons} "
+ extraHelmFlags += " --set securityContext.enabled=false,atomix.persistence.enabled=false "
+
+ // FIXME having to set all of these values is annoying, is there a better solution?
+ def volthaHelmFlags = extraHelmFlags +
+ ofAgentConnections(onosReplicas.toInteger(), "voltha-infra", "infra")
+
+ def localCharts = false
+ if (volthaHelmChartsChange != "") {
+ localCharts = true
+ }
+
+ volthaStackDeploy([
+ bbsimReplica: olts.toInteger(),
+ infraNamespace: "infra",
+ volthaNamespace: "voltha${i}",
+ stackName: "voltha${i}",
+ stackId: i,
+ workflow: workflow,
+ extraHelmFlags: volthaHelmFlags,
+ localCharts: localCharts
+ ])
+ }
+ }
+}
+
+def test_voltha_stacks(numberOfStacks) {
+ for (int i = 1; i <= numberOfStacks.toInteger(); i++) {
+ stage("Test VOLTHA stack " + i) {
+ timeout(time: 15, unit: 'MINUTES') {
+ sh """
+
+ # we are restarting the voltha-api port-forward for each stack, no need to have a different voltconfig file
+ voltctl -s 127.0.0.1:55555 config > $HOME/.volt/config
+ export VOLTCONFIG=$HOME/.volt/config
+
+ # _TAG=voltha-port-forward kubectl port-forward --address 0.0.0.0 -n voltha${i} svc/voltha${i}-voltha-api 55555:55555& > /dev/null 2>&1
+ _TAG="voltha-port-forward" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n voltha${i} svc/voltha${i}-voltha-api 55555:55555 > /dev/null 2>&1; done"&
+
+
+ ROBOT_PARAMS="-v stackId:${i} \
+ -v olt:${olts} \
+ -v pon:${pons} \
+ -v onu:${onus} \
+ -v workflow:${workflow} \
+ -v withEapol:${withEapol} \
+ -v withDhcp:${withDhcp} \
+ -v withIgmp:${withIgmp} \
+ --noncritical non-critical \
+ -e igmp \
+ -e teardown "
+
+ if [ ${withEapol} = false ] ; then
+ ROBOT_PARAMS+="-e authentication "
+ fi
+
+ if [ ${withDhcp} = false ] ; then
+ ROBOT_PARAMS+="-e dhcp "
+ fi
+
+ if [ ${provisionSubscribers} = false ] ; then
+ # if we're not considering subscribers then we don't care about authentication and dhcp
+ ROBOT_PARAMS+="-e authentication -e provision -e flow-after -e dhcp "
+ fi
+
+ if [ ${withFlows} = false ] ; then
+ ROBOT_PARAMS+="-i setup -i activation "
+ fi
+
+ cd $WORKSPACE/voltha-system-tests
+ source ./vst_venv/bin/activate
+ robot -d $WORKSPACE/RobotLogs/voltha${i} \
+ \$ROBOT_PARAMS tests/scale/Voltha_Scale_Tests.robot
+
+ # collect results
+ python tests/scale/collect-result.py -r $WORKSPACE/RobotLogs/voltha${i}/output.xml -p $WORKSPACE/plots > $WORKSPACE/execution-time-voltha${i}.txt || true
+ cat $WORKSPACE/execution-time-voltha${i}.txt
+ """
+ sh """
+ # remove VOLTHA port-forward
+ ps aux | grep port-forw | grep voltha-api | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 2>&1 > /dev/null || true
+ """
+ }
+ }
+ }
+}
diff --git a/jjb/pipeline/voltha/voltha-2.7/voltha-scale-test.groovy b/jjb/pipeline/voltha/voltha-2.8/voltha-scale-test.groovy
similarity index 83%
rename from jjb/pipeline/voltha/voltha-2.7/voltha-scale-test.groovy
rename to jjb/pipeline/voltha/voltha-2.8/voltha-scale-test.groovy
index 11bb1c4..85e32e4 100644
--- a/jjb/pipeline/voltha/voltha-2.7/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha/voltha-2.8/voltha-scale-test.groovy
@@ -14,8 +14,14 @@
// deploy VOLTHA and performs a scale test
+library identifier: 'cord-jenkins-libraries@master',
+ retriever: modernSCM([
+ $class: 'GitSCMSource',
+ remote: 'https://gerrit.opencord.org/ci-management.git'
+])
+
// this function generates the correct parameters for ofAgent
-// to connect to multple ONOS instances
+// to connect to multiple ONOS instances
def ofAgentConnections(numOfOnos, releaseName, namespace) {
def params = " "
numOfOnos.times {
@@ -36,14 +42,14 @@
environment {
JENKINS_NODE_COOKIE="dontKillMe" // do not kill processes after the build is done
KUBECONFIG="$HOME/.kube/config"
- VOLTCONFIG="$HOME/.volt/config-2.7" // voltha-2.7 does not have ingress and still relies on port-forwarding
+ VOLTCONFIG="$HOME/.volt/config"
SSHPASS="karaf"
VOLTHA_LOG_LEVEL="${logLevel}"
NUM_OF_BBSIM="${olts}"
NUM_OF_OPENONU="${openonuAdapterReplicas}"
NUM_OF_ONOS="${onosReplicas}"
NUM_OF_ATOMIX="${atomixReplicas}"
- EXTRA_HELM_FLAGS="${extraHelmFlags} " // note that the trailing space is required to separate the parameters from appends done later
+ EXTRA_HELM_FLAGS=" "
APPS_TO_LOG="etcd kafka onos-classic adapter-open-onu adapter-open-olt rw-core ofagent bbsim radius bbsim-sadis-server onos-config-loader"
LOG_FOLDER="$WORKSPACE/logs"
@@ -55,27 +61,19 @@
stage ('Cleanup') {
steps {
timeout(time: 11, unit: 'MINUTES') {
+ script {
+ helmTeardown(["default"])
+ }
sh returnStdout: false, script: '''
helm repo add onf https://charts.opencord.org
helm repo update
- NAMESPACES="voltha1 voltha2 infra default"
- for NS in $NAMESPACES
- do
- for hchart in $(helm list -n $NS -q | grep -E -v 'docker-registry|kafkacat');
- do
- echo "Purging chart: ${hchart}"
- helm delete -n $NS "${hchart}"
- done
- done
-
- # wait for pods to be removed
- echo -ne "\nWaiting for PODs to be removed..."
- PODS=$(kubectl get pods --all-namespaces --no-headers | grep -v -E "kube|cattle|registry|fleet|ingress-nginx" | wc -l)
- while [[ $PODS != 0 ]]; do
+ # remove all persistent volume claims
+ kubectl delete pvc --all-namespaces --all
+ PVCS=\$(kubectl get pvc --all-namespaces --no-headers | wc -l)
+ while [[ \$PVCS != 0 ]]; do
sleep 5
- echo -ne "."
- PODS=$(kubectl get pods --all-namespaces --no-headers | grep -v -E "kube|cattle|registry|fleet|ingress-nginx" | wc -l)
+ PVCS=\$(kubectl get pvc --all-namespaces --no-headers | wc -l)
done
# remove orphaned port-forward from different namespaces
@@ -87,54 +85,13 @@
}
}
}
- stage('Clone voltha-system-tests') {
+ stage('Download Code') {
steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/voltha-system-tests",
- refspec: "${volthaSystemTestsChange}"
- ]],
- branches: [[ name: "${release}", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
+ getVolthaCode([
+ branch: "${release}",
+ volthaSystemTestsChange: "${volthaSystemTestsChange}",
+ volthaHelmChartsChange: "${volthaHelmChartsChange}",
])
- script {
- sh(script:"""
- if [ '${volthaSystemTestsChange}' != '' ] ; then
- cd $WORKSPACE/voltha-system-tests;
- git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD
- fi
- """)
- }
- }
- }
- stage('Clone voltha-helm-charts') {
- steps {
- checkout([
- $class: 'GitSCM',
- userRemoteConfigs: [[
- url: "https://gerrit.opencord.org/voltha-helm-charts",
- refspec: "${volthaHelmChartsChange}"
- ]],
- branches: [[ name: "${release}", ]],
- extensions: [
- [$class: 'WipeWorkspace'],
- [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-helm-charts"],
- [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
- ],
- ])
- script {
- sh(script:"""
- if [ '${volthaHelmChartsChange}' != '' ] ; then
- cd $WORKSPACE/voltha-helm-charts;
- git fetch https://gerrit.opencord.org/voltha-helm-charts ${volthaHelmChartsChange} && git checkout FETCH_HEAD
- fi
- """)
- }
}
}
stage('Build patch') {
@@ -155,19 +112,8 @@
}
}
stage('Deploy common infrastructure') {
- // includes monitoring, kafka, etcd
steps {
sh '''
- helm install kafka $HOME/teone/helm-charts/kafka --set replicaCount=${kafkaReplicas},replicas=${kafkaReplicas} --set persistence.enabled=false \
- --set zookeeper.replicaCount=${kafkaReplicas} --set zookeeper.persistence.enabled=false \
- --set prometheus.kafka.enabled=true,prometheus.operator.enabled=true,prometheus.jmx.enabled=true,prometheus.operator.serviceMonitor.namespace=default
-
- # the ETCD chart use "auth" for resons different than BBsim, so strip that away
- ETCD_FLAGS=$(echo ${extraHelmFlags} | sed -e 's/--set auth=false / /g') | sed -e 's/--set auth=true / /g'
- ETCD_FLAGS+=" --set auth.rbac.enabled=false,persistence.enabled=false,statefulset.replicaCount=${etcdReplicas}"
- ETCD_FLAGS+=" --set memoryMode=${inMemoryEtcdStorage} "
- helm install --set replicas=${etcdReplicas} etcd $HOME/teone/helm-charts/etcd $ETCD_FLAGS
-
if [ ${withMonitoring} = true ] ; then
helm install nem-monitoring onf/nem-monitoring \
-f $HOME/voltha-scale/grafana.yaml \
@@ -193,7 +139,7 @@
_TAG=kail-$app kail -l app=$app --since 1h > $LOG_FOLDER/$app.log&
done
'''
- sh returnStdout: false, script: """
+ def returned_flags = sh (returnStdout: true, script: """
export EXTRA_HELM_FLAGS+=' '
@@ -248,11 +194,6 @@
# No persistent-volume-claims in Atomix
EXTRA_HELM_FLAGS+="--set onos-classic.atomix.persistence.enabled=false "
- echo "Installing with the following extra arguments:"
- echo $EXTRA_HELM_FLAGS
-
-
-
# Use custom built images
if [ '\$GERRIT_PROJECT' == 'voltha-go' ]; then
@@ -282,43 +223,49 @@
if [ '\$GERRIT_PROJECT' == 'bbsim' ]; then
EXTRA_HELM_FLAGS+="--set images.bbsim.repository=${dockerRegistry}/voltha/bbsim,images.bbsim.tag=voltha-scale "
fi
+ echo \$EXTRA_HELM_FLAGS
- helm upgrade --install voltha-infra onf/voltha-infra \$EXTRA_HELM_FLAGS \
- --set onos-classic.replicas=${onosReplicas},onos-classic.atomix.replicas=${atomixReplicas} \
- --set etcd.enabled=false,kafka.enabled=false \
- --set global.log_level=${logLevel} \
- -f $WORKSPACE/voltha-helm-charts/examples/${workflow}-values.yaml \
- --set onos-classic.onosSshPort=30115 --set onos-classic.onosApiPort=30120 \
- --version 0.1.13
+ """).trim()
- helm upgrade --install voltha1 onf/voltha-stack \$EXTRA_HELM_FLAGS \
- --set global.stack_name=voltha1 \
- --set global.voltha_infra_name=voltha-infra \
- --set global.voltha_infra_namespace=default \
- --set global.log_level=${logLevel} \
- ${ofAgentConnections(onosReplicas.toInteger(), "voltha-infra", "default")} \
- --set voltha.services.kafka.adapter.address=kafka.default.svc:9092 \
- --set voltha.services.kafka.cluster.address=kafka.default.svc:9092 \
- --set voltha.services.etcd.address=etcd.default.svc:2379 \
- --set voltha-adapter-openolt.services.kafka.adapter.address=kafka.default.svc:9092 \
- --set voltha-adapter-openolt.services.kafka.cluster.address=kafka.default.svc:9092 \
- --set voltha-adapter-openolt.services.etcd.address=etcd.default.svc:2379 \
- --set voltha-adapter-openonu.services.kafka.adapter.address=kafka.default.svc:9092 \
- --set voltha-adapter-openonu.services.kafka.cluster.address=kafka.default.svc:9092 \
- --set voltha-adapter-openonu.services.etcd.address=etcd.default.svc:2379 \
- --version 0.1.17
+ def extraHelmFlags = returned_flags
+ // The added space before params.extraHelmFlags is required due to the .trim() above
+ def infraHelmFlags =
+ " --set global.log_level=${logLevel} " +
+ "--set onos-classic.onosSshPort=30115 " +
+ "--set onos-classic.onosApiPort=30120 " +
+ extraHelmFlags + " " + params.extraHelmFlags
+ println "Passing the following parameters to the VOLTHA infra deploy: ${infraHelmFlags}."
- for i in {0..${olts.toInteger() - 1}}; do
- stackId=1
- helm upgrade --install bbsim\$i onf/bbsim \$EXTRA_HELM_FLAGS \
- --set olt_id="\${stackId}\${i}" \
- --set onu=${onus},pon=${pons} \
- --set global.log_level=${logLevel.toLowerCase()} \
- -f $WORKSPACE/voltha-helm-charts/examples/${workflow}-values.yaml \
- --version 4.2.0
- done
- """
+ def localCharts = false
+ if (volthaHelmChartsChange != "" || branch != "master") {
+ localCharts = true
+ }
+
+ volthaInfraDeploy([
+ workflow: workflow,
+ infraNamespace: "default",
+ extraHelmFlags: infraHelmFlags,
+ localCharts: localCharts,
+ onosReplica: onosReplicas,
+ atomixReplica: atomixReplicas,
+ kafkaReplica: kafkaReplicas,
+ etcdReplica: etcdReplicas,
+ ])
+
+ stackHelmFlags = " --set onu=${onus},pon=${pons} --set global.log_level=${logLevel.toLowerCase()} "
+ stackHelmFlags += " --set voltha.ingress.enabled=true --set voltha.ingress.enableVirtualHosts=true --set voltha.fullHostnameOverride=voltha.scale1.dev "
+ stackHelmFlags += extraHelmFlags + " " + params.extraHelmFlags
+
+ volthaStackDeploy([
+ bbsimReplica: olts.toInteger(),
+ infraNamespace: "default",
+ volthaNamespace: "default",
+ stackName: "voltha1", // TODO support custom charts
+ workflow: workflow,
+ extraHelmFlags: stackHelmFlags,
+ localCharts: localCharts,
+ ])
sh """
set +x
@@ -365,24 +312,31 @@
# sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 log:set DEBUG org.onosproject.mcast
# sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 log:set DEBUG org.opencord.igmpproxy
# sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 log:set DEBUG org.opencord.olt
+ # sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 log:set DEBUG org.onosproject.net.flowobjective.impl.FlowObjectiveManager
kubectl exec \$(kubectl get pods | grep -E "bbsim[0-9]" | awk 'NR==1{print \$1}') -- bbsimctl log ${logLevel.toLowerCase()} false
- # Set Flows/Ports/Meters poll frequency
+ # Set Flows/Ports/Meters/Groups poll frequency
sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 cfg set org.onosproject.provider.of.flow.impl.OpenFlowRuleProvider flowPollFrequency ${onosStatInterval}
sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 cfg set org.onosproject.provider.of.device.impl.OpenFlowDeviceProvider portStatsPollFrequency ${onosStatInterval}
+ sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 cfg set org.onosproject.provider.of.group.impl.OpenFlowGroupProvider groupPollInterval ${onosGroupInterval}
+ sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 cfg set org.onosproject.net.flowobjective.impl.FlowObjectiveManager numThreads ${flowObjWorkerThreads}
+ sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 cfg set org.onosproject.net.flowobjective.impl.InOrderFlowObjectiveManager objectiveTimeoutMs 300000
+
+ #SR is not needed in scale tests and not currently used by operators in production, can be disabled.
+ sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 app deactivate org.onosproject.segmentrouting
if [ ${withFlows} = false ]; then
sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 app deactivate org.opencord.olt
fi
if [ '${workflow}' = 'tt' ]; then
- etcd_container=\$(kubectl get pods --all-namespaces | grep etcd | awk 'NR==1{print \$2}')
+ etcd_container=\$(kubectl get pods --all-namespaces | grep etcd-0 | awk 'NR==1{print \$2}')
kubectl cp $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-HSIA.json \$etcd_container:/tmp/hsia.json
put_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'cat /tmp/hsia.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/64')
kubectl cp $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-VoIP.json \$etcd_container:/tmp/voip.json
put_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'cat /tmp/voip.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/65')
- kubectl cp $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-MCAST.json \$etcd_container:/tmp/mcast.json
+ kubectl cp $WORKSPACE/voltha-system-tests/tests/data/TechProfile-TT-MCAST-AdditionalBW-NA.json \$etcd_container:/tmp/mcast.json
put_result=\$(kubectl exec -it \$etcd_container -- /bin/sh -c 'cat /tmp/mcast.json | ETCDCTL_API=3 etcdctl put service/voltha/technology_profiles/${tech_prof_directory}/66')
fi
@@ -423,7 +377,7 @@
sh """
# load MIB template
wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter-go/master/templates/BBSM-12345123451234512345-00000000000001-v1.json
- cat BBSM-12345123451234512345-00000000000001-v1.json | kubectl exec -it \$(kubectl get pods |grep etcd | awk 'NR==1{print \$1}') -- etcdctl put service/voltha/omci_mibs/go_templates/BBSM/12345123451234512345/00000000000001
+ cat BBSM-12345123451234512345-00000000000001-v1.json | kubectl exec -it \$(kubectl get pods |grep etcd-0 | awk 'NR==1{print \$1}') -- etcdctl put service/voltha/omci_mibs/go_templates/BBSM/12345123451234512345/00000000000001
"""
}
}
@@ -477,12 +431,12 @@
-v olt:${olts} \
-v pon:${pons} \
-v onu:${onus} \
+ -v ONOS_SSH_PORT:30115 \
+ -v ONOS_REST_PORT:30120 \
-v workflow:${workflow} \
-v withEapol:${withEapol} \
-v withDhcp:${withDhcp} \
-v withIgmp:${withIgmp} \
- -v ONOS_SSH_PORT:30115 \
- -v ONOS_REST_PORT:30120 \
--noncritical non-critical \
-e igmp -e teardown "
@@ -521,6 +475,9 @@
}
}
steps {
+ sh returnStdout: false, script: """
+ # sshpass -e ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@127.0.0.1 log:set DEBUG org.onosproject.store.group.impl
+ """
sh '''
set +e
mkdir -p $ROBOT_LOGS_DIR
@@ -537,6 +494,8 @@
-v withEapol:${withEapol} \
-v withDhcp:${withDhcp} \
-v withIgmp:${withIgmp} \
+ -v ONOS_SSH_PORT:30115 \
+ -v ONOS_REST_PORT:30120 \
--noncritical non-critical \
-i igmp \
-e setup -e activation -e flow-before \
@@ -610,7 +569,7 @@
fi
cd voltha-system-tests
- source ./vst_venv/bin/activate
+ source ./vst_venv/bin/activate || true
python tests/scale/collect-result.py -r $WORKSPACE/RobotLogs/output.xml -p $WORKSPACE/plots > $WORKSPACE/execution-time.txt || true
cat $WORKSPACE/execution-time.txt
'''
@@ -650,6 +609,7 @@
outputPath: 'RobotLogs',
passThreshold: 100,
reportFileName: '**/report*.html',
+ onlyCritical: true,
unstableThreshold: 0]);
// get all the logs from kubernetes PODs
sh returnStdout: false, script: '''
@@ -666,8 +626,13 @@
printf '%s\n' $(kubectl get pods -l app=onos-classic -o=jsonpath="{.items[*]['metadata.name']}") | xargs --no-run-if-empty -I# bash -c "kubectl cp #:${karafHome}/data/log/karaf.log $LOG_FOLDER/#.log" || true
# get ONOS cfg from the 3 nodes
- printf '%s\n' $(kubectl get pods -l app=onos-classic -o=jsonpath="{.items[*]['metadata.name']}") | xargs --no-run-if-empty -I# bash -c "kubectl exec -it # -- ${karafHome}/bin/client cfg get > $LOG_FOLDER/#.cfg" || true
+ # kubectl exec -t voltha-infra-onos-classic-0 -- sh /root/onos/apache-karaf-4.2.9/bin/client cfg get > ~/voltha-infra-onos-classic-0-cfg.txt || true
+ # kubectl exec -t voltha-infra-onos-classic-1 -- sh /root/onos/apache-karaf-4.2.9/bin/client cfg get > ~/voltha-infra-onos-classic-1-cfg.txt || true
+ # kubectl exec -t voltha-infra-onos-classic-2 -- sh /root/onos/apache-karaf-4.2.9/bin/client cfg get > ~/voltha-infra-onos-classic-2-cfg.txt || true
+ # kubectl exec -t voltha-infra-onos-classic-0 -- sh /root/onos/apache-karaf-4.2.9/bin/client obj-next-ids > ~/voltha-infra-onos-classic-0-next-objs.txt || true
+ # kubectl exec -t voltha-infra-onos-classic-1 -- sh /root/onos/apache-karaf-4.2.9/bin/client obj-next-ids > ~/voltha-infra-onos-classic-1-next-objs.txt || true
+ # kubectl exec -t voltha-infra-onos-classic-2 -- sh /root/onos/apache-karaf-4.2.9/bin/client obj-next-ids > ~/voltha-infra-onos-classic-2-next-objs.txt || true
# get radius logs out of the container
kubectl cp $(kubectl get pods -l app=radius --no-headers | awk '{print $1}'):/var/log/freeradius/radius.log $LOG_FOLDER/radius.log || true
@@ -751,6 +716,10 @@
curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=etcd_disk_backend_commit_duration_seconds_bucket' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-backend-write-time-bucket.json || true
curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=etcd_disk_wal_fsync_duration_seconds_bucket' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-wal-fsync-time-bucket.json || true
curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=etcd_network_peer_round_trip_time_seconds_bucket' | jq '.data' > $WORKSPACE/etcd-metrics/etcd-network-peer-round-trip-time-seconds.json || true
+ etcd_namespace=\$(kubectl get pods --all-namespaces | grep etcd-0 | awk 'NR==1{print \$1}')
+ etcd_container=\$(kubectl get pods --all-namespaces | grep etcd-0 | awk 'NR==1{print \$2}')
+ kubectl exec -it -n \$etcd_namespace \$etcd_container -- etcdctl defrag --cluster || true
+ kubectl exec -it -n \$etcd_namespace \$etcd_container -- etcdctl endpoint status -w table > $WORKSPACE/etcd-metrics/etcd-status-table.txt || true
'''
// get VOLTHA debug infos
@@ -778,7 +747,7 @@
sh '''
if [ ${withMonitoring} = true ] ; then
cd $WORKSPACE/voltha-system-tests
- source ./vst_venv/bin/activate
+ source ./vst_venv/bin/activate || true
sleep 60 # we have to wait for prometheus to collect all the information
python tests/scale/sizing.py -o $WORKSPACE/plots || true
fi
@@ -790,8 +759,6 @@
def start_port_forward(olts) {
sh """
- daemonize -E JENKINS_NODE_COOKIE="dontKillMe" /usr/local/bin/kubectl port-forward --address 0.0.0.0 -n default svc/voltha1-voltha-api 55555:55555
-
bbsimRestPortFwd=50071
for i in {0..${olts.toInteger() - 1}}; do
daemonize -E JENKINS_NODE_COOKIE="dontKillMe" /usr/local/bin/kubectl port-forward --address 0.0.0.0 -n default svc/bbsim\${i} \${bbsimRestPortFwd}:50071