blob: c97ecd479a2a5a2fbd438c17e296de3fe2692623 [file] [log] [blame]
Matteo Scandolofbcbdb82020-05-06 15:41:32 -07001// Copyright 2019-present Open Networking Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// deploy VOLTHA using kind-voltha and performs a scale test
16
17pipeline {
18
19 /* no label, executor is determined by JJB */
20 agent {
21 label "${params.buildNode}"
22 }
23 options {
24 timeout(time: 30, unit: 'MINUTES')
25 }
26 environment {
27 KUBECONFIG="$HOME/.kube/config"
28 VOLTCONFIG="$HOME/.volt/config"
29 PATH="$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
30 TYPE="minimal"
31 FANCY=0
32 WITH_SIM_ADAPTERS="no"
33 WITH_RADIUS="yes"
34 WITH_BBSIM="yes"
35 LEGACY_BBSIM_INDEX="no"
36 DEPLOY_K8S="no"
37 CONFIG_SADIS="external"
38
39 // install everything in the default namespace
40 VOLTHA_NS="default"
41 ADAPTER_NS="default"
42 INFRA_NS="default"
43 BBSIM_NS="default"
44
45 // TODO make configurable
46 VOLTHA_LOG_LEVEL="${logLevel}"
47 NUM_OF_BBSIM="${olts}"
48 NUM_OF_OPENONU=4
49 NUM_OF_ONOS=1
50 NUM_OF_ATOMIX=0
51
52 // TODO make charts configurable (low priority)
53 VOLTHA_CHART="onf/voltha"
54 VOLTHA_CHART_VERSION="latest"
55 VOLTHA_BBSIM_CHART="onf/bbsim"
56 VOLTHA_BBSIM_CHART_VERSION="latest"
57 VOLTHA_ADAPTER_SIM_CHART="onf/voltha-adapter-simulated"
58 VOLTHA_ADAPTER_SIM_CHART_VERSION="latest"
59 VOLTHA_ADAPTER_OPEN_OLT_CHART="onf/voltha-adapter-openolt"
60 VOLTHA_ADAPTER_OPEN_OLT_CHART_VERSION="latest"
61 VOLTHA_ADAPTER_OPEN_ONU_CHART="onf/voltha-adapter-openonu"
62 VOLTHA_ADAPTER_OPEN_ONU_CHART_VERSION="latest"
63 }
64
65 stages {
66 stage ('Cleanup') {
67 // TODO remove plot files
68 steps {
69 sh returnStdout: false, script: """
70 test -e $WORKSPACE/kind-voltha/voltha && cd $WORKSPACE/kind-voltha && ./voltha down
71 cd $WORKSPACE
72 rm -rf $WORKSPACE/*
73 """
74 }
75 }
76 stage('Clone kind-voltha') {
77 steps {
78 checkout([
79 $class: 'GitSCM',
80 userRemoteConfigs: [[ url: "https://gerrit.opencord.org/kind-voltha", ]],
81 branches: [[ name: "master", ]],
82 extensions: [
83 [$class: 'WipeWorkspace'],
84 [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"],
85 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
86 ],
87 ])
88 }
89 }
90 stage('Clone voltha-system-tests') {
91 steps {
92 checkout([
93 $class: 'GitSCM',
94 userRemoteConfigs: [[ url: "https://gerrit.opencord.org/voltha-system-tests", ]],
95 branches: [[ name: "master", ]],
96 extensions: [
97 [$class: 'WipeWorkspace'],
98 [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"],
99 [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false],
100 ],
101 ])
102 // TODO use master once the tests are merged
103 script {
104 sh(script:"cd voltha-system-tests; git fetch https://gerrit.opencord.org/voltha-system-tests refs/changes/79/18779/13 && git checkout FETCH_HEAD")
105 }
106 }
107 }
108 // stage('Deploy monitoring infrastructure') {
109 // steps {
110 // sh '''
111 // helm install -n nem-monitoring cord/nem-monitoring --set kpi_exporter.enabled=false,dashboards.xos=false,dashboards.onos=false,dashboards.aaa=false,dashboards.voltha=false
112 // '''
113 // }
114 // }
115 stage('Deploy Voltha') {
116 steps {
117 script {
118 // TODO add support for custom images, see voltha-pyshical-build-and-test.groovy
119 // TODO install kafka outside kind-voltha (can't use 3 instances otherwise)
120 // TODO install etcd outside kind-voltha (no need to redeploy the operator everytime)
121 sh returnStdout: false, script: """
122 export EXTRA_HELM_FLAGS+='--set enablePerf=true,pon=${pons},onu=${onus}'
123
124
125 cd $WORKSPACE/kind-voltha/
126
127 ./voltha up
128 """
129 }
130 }
131 }
132 stage('Push MIB template to ETCD') {
133 steps {
134 sh '''
135 if [ ${withMibTemplate} = true ] ; then
136 rm -f BBSM-12345123451234512345-00000000000001-v1.json
137 wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter/master/templates/BBSM-12345123451234512345-00000000000001-v1.json
138 cat BBSM-12345123451234512345-00000000000001-v1.json | kubectl exec -it $(kubectl get pods | grep etcd-cluster | awk 'NR==1{print $1}') etcdctl put service/voltha/omci_mibs/templates/BBSM/12345123451234512345/00000000000001
139 fi
140 '''
141 }
142 }
143 stage('Run Test') {
144 steps {
145 // TODO use -i/-e in robot to customize runs for:
146 // - runs without flows
147 // - runs without subscriber provisioning
148 sh '''
149 mkdir -p $WORKSPACE/RobotLogs
150 cd voltha-system-tests
151 make vst_venv
152 source ./vst_venv/bin/activate
153 robot -d $WORKSPACE/RobotLogs \
154 -v olt:${olts} \
155 -v pon:${pons} \
156 -v onu:${onus} \
157 -v workflow:att \
158 -e teardown \
159 tests/scale/Voltha_Scale_Tests.robot
160 '''
161 }
162 }
163 stage('Collect results') {
164 steps {
165 sh '''
166 cd voltha-system-tests
167 source ./vst_venv/bin/activate
168 python tests/scale/collect-result.py -r ../RobotLogs/output.xml -p ../plots> execution-time.txt
169 '''
170 }
171 }
172 }
173 post {
174 always {
175 plot([
176 csvFileName: 'scale-test.csv',
177 csvSeries: [
178 [file: 'plots/plot-voltha-onus.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
179 [file: 'plots/plot-onos-ports.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
180 [file: 'plots/plot-voltha-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
181 [file: 'plots/plot-onos-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
182 [file: 'plots/plot-onos-auth.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
183 [file: 'plots/plot-voltha-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
184 [file: 'plots/plot-onos-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
185 [file: 'plots/plot-onos-dhcp.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''],
186 ],
187 group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Scale Test (OLTs: ${olts}, PONs: ${pons}, ONUs: ${onus})", yaxis: 'Time (s)', useDescr: true
188 ])
189 step([$class: 'RobotPublisher',
190 disableArchiveOutput: false,
191 logFileName: 'RobotLogs/log*.html',
192 otherFiles: '',
193 outputFileName: 'RobotLogs/output*.xml',
194 outputPath: '.',
195 passThreshold: 100,
196 reportFileName: 'RobotLogs/report*.html',
197 unstableThreshold: 0]);
198 archiveArtifacts artifacts: 'kind-voltha/install-minimal.log,voltha-system-tests/*.txt'
199 }
200 }
201}