Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 1 | // 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 | |
| 17 | pipeline { |
| 18 | |
| 19 | /* no label, executor is determined by JJB */ |
| 20 | agent { |
| 21 | label "${params.buildNode}" |
| 22 | } |
| 23 | options { |
Matteo Scandolo | f7ca631 | 2020-11-16 15:57:15 -0800 | [diff] [blame] | 24 | timeout(time: 120, unit: 'MINUTES') |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 25 | } |
| 26 | environment { |
| 27 | JENKINS_NODE_COOKIE="dontKillMe" // do not kill processes after the build is done |
| 28 | KUBECONFIG="$HOME/.kube/config" |
| 29 | SSHPASS="karaf" |
| 30 | PATH="$PATH:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 31 | SCHEDULE_ON_CONTROL_NODES="yes" |
| 32 | FANCY=0 |
| 33 | WAIT_ON_DOWN="yes" |
| 34 | WITH_SIM_ADAPTERS="no" |
| 35 | WITH_RADIUS="${withRadius}" |
| 36 | WITH_BBSIM="yes" |
| 37 | LEGACY_BBSIM_INDEX="no" |
| 38 | DEPLOY_K8S="no" |
| 39 | CONFIG_SADIS="external" |
| 40 | WITH_KAFKA="yes" |
| 41 | WITH_ETCD="yes" |
| 42 | VOLTHA_ETCD_PORT=9999 |
| 43 | |
| 44 | // VOLTHA namespaces are defined at runtime depending on the stack we're installing |
| 45 | // VOLTHA_NS="default" |
| 46 | // ADAPTER_NS="default" |
| 47 | // BBSIM_NS="default" |
| 48 | INFRA_NS="infra" |
| 49 | |
| 50 | // configurable options |
| 51 | WITH_EAPOL="${withEapol}" |
| 52 | WITH_DHCP="${withDhcp}" |
| 53 | WITH_IGMP="${withIgmp}" |
| 54 | VOLTHA_LOG_LEVEL="${logLevel}" |
| 55 | NUM_OF_BBSIM="${olts}" |
| 56 | NUM_OF_OPENONU="${openonuAdapterReplicas}" |
| 57 | NUM_OF_ONOS="${onosReplicas}" |
| 58 | NUM_OF_ATOMIX="${atomixReplicas}" |
| 59 | NUM_OF_KAFKA="${kafkaReplicas}" |
| 60 | NUM_OF_ETCD="${etcdReplicas}" |
| 61 | WITH_PPROF="${withProfiling}" |
| 62 | EXTRA_HELM_FLAGS="${extraHelmFlags} " // note that the trailing space is required to separate the parameters from appends done later |
| 63 | VOLTHA_CHART="${volthaChart}" |
| 64 | VOLTHA_BBSIM_CHART="${bbsimChart}" |
| 65 | VOLTHA_ADAPTER_OPEN_OLT_CHART="${openoltAdapterChart}" |
| 66 | VOLTHA_ADAPTER_OPEN_ONU_CHART="${openonuAdapterChart}" |
| 67 | ONOS_CLASSIC_CHART="${onosChart}" |
| 68 | RADIUS_CHART="${radiusChart}" |
| 69 | |
| 70 | APPS_TO_LOG="etcd kafka onos-onos-classic adapter-open-onu adapter-open-olt rw-core ofagent bbsim radius" |
| 71 | LOG_FOLDER="$WORKSPACE/logs" |
| 72 | |
| 73 | GERRIT_PROJECT="${GERRIT_PROJECT}" |
| 74 | } |
| 75 | |
| 76 | stages { |
| 77 | stage ('Cleanup') { |
| 78 | steps { |
| 79 | timeout(time: 11, unit: 'MINUTES') { |
| 80 | sh returnStdout: false, script: """ |
Matteo Scandolo | be82324 | 2020-11-20 13:48:13 -0800 | [diff] [blame] | 81 | helm repo add stable https://charts.helm.sh/stable |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 82 | helm repo add onf https://charts.opencord.org |
| 83 | helm repo add cord https://charts.opencord.org |
| 84 | helm repo add onos https://charts.onosproject.org |
| 85 | helm repo add atomix https://charts.atomix.io |
| 86 | helm repo add bbsim-sadis https://ciena.github.io/bbsim-sadis-server/charts |
| 87 | helm repo update |
| 88 | |
| 89 | # removing ETCD port forward |
| 90 | P_ID="\$(ps e -ww -A | grep "_TAG=etcd-port-forward" | grep -v grep | awk '{print \$1}')" |
| 91 | if [ -n "\$P_ID" ]; then |
| 92 | kill -9 \$P_ID |
| 93 | fi |
| 94 | |
Matteo Scandolo | 9fe8cad | 2020-11-13 12:54:19 -0800 | [diff] [blame] | 95 | NAMESPACES="voltha1 voltha2 infra default" |
| 96 | for NS in \$NAMESPACES |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 97 | do |
Matteo Scandolo | 9fe8cad | 2020-11-13 12:54:19 -0800 | [diff] [blame] | 98 | for hchart in \$(helm list -n \$NS -q | grep -E -v 'docker-registry|kafkacat'); |
| 99 | do |
| 100 | echo "Purging chart: \${hchart}" |
| 101 | helm delete -n \$NS "\${hchart}" |
| 102 | done |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 103 | done |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 104 | |
| 105 | test -e $WORKSPACE/kind-voltha/voltha && cd $WORKSPACE/kind-voltha && ./voltha down |
| 106 | |
Matteo Scandolo | be82324 | 2020-11-20 13:48:13 -0800 | [diff] [blame] | 107 | ps aux | grep port-forw | grep -v grep | awk '{print \$2}' | xargs --no-run-if-empty kill -9 |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 108 | |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 109 | cd $WORKSPACE |
| 110 | rm -rf $WORKSPACE/* |
| 111 | """ |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | stage('Clone kind-voltha') { |
| 116 | steps { |
| 117 | checkout([ |
| 118 | $class: 'GitSCM', |
| 119 | userRemoteConfigs: [[ |
| 120 | url: "https://gerrit.opencord.org/kind-voltha", |
| 121 | refspec: "${kindVolthaChange}" |
| 122 | ]], |
| 123 | branches: [[ name: "master", ]], |
| 124 | extensions: [ |
| 125 | [$class: 'WipeWorkspace'], |
| 126 | [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"], |
| 127 | [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false], |
| 128 | ], |
| 129 | ]) |
| 130 | script { |
| 131 | sh(script:""" |
| 132 | if [ '${kindVolthaChange}' != '' ] ; then |
| 133 | cd $WORKSPACE/kind-voltha; |
| 134 | git fetch https://gerrit.opencord.org/kind-voltha ${kindVolthaChange} && git checkout FETCH_HEAD |
| 135 | fi |
| 136 | """) |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | stage('Clone voltha-system-tests') { |
| 141 | steps { |
| 142 | checkout([ |
| 143 | $class: 'GitSCM', |
| 144 | userRemoteConfigs: [[ |
| 145 | url: "https://gerrit.opencord.org/voltha-system-tests", |
| 146 | refspec: "${volthaSystemTestsChange}" |
| 147 | ]], |
| 148 | branches: [[ name: "${release}", ]], |
| 149 | extensions: [ |
| 150 | [$class: 'WipeWorkspace'], |
| 151 | [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"], |
| 152 | [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false], |
| 153 | ], |
| 154 | ]) |
| 155 | script { |
| 156 | sh(script:""" |
| 157 | if [ '${volthaSystemTestsChange}' != '' ] ; then |
| 158 | cd $WORKSPACE/voltha-system-tests; |
| 159 | git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD |
| 160 | fi |
| 161 | """) |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | stage('Build patch') { |
| 166 | when { |
| 167 | expression { |
| 168 | return params.GERRIT_PROJECT |
| 169 | } |
| 170 | } |
| 171 | steps { |
| 172 | sh """ |
| 173 | git clone https://\$GERRIT_HOST/\$GERRIT_PROJECT |
| 174 | cd \$GERRIT_PROJECT |
| 175 | git fetch https://\$GERRIT_HOST/\$GERRIT_PROJECT \$GERRIT_REFSPEC && git checkout FETCH_HEAD |
| 176 | |
| 177 | DOCKER_REGISTRY=${dockerRegistry}/ DOCKER_REPOSITORY=voltha/ DOCKER_TAG=voltha-scale make docker-build |
| 178 | DOCKER_REGISTRY=${dockerRegistry}/ DOCKER_REPOSITORY=voltha/ DOCKER_TAG=voltha-scale make docker-push |
| 179 | """ |
| 180 | } |
| 181 | } |
| 182 | stage('Deploy common infrastructure') { |
| 183 | // includes monitoring, kafka, etcd |
| 184 | steps { |
| 185 | sh ''' |
| 186 | if [ ${withMonitoring} = true ] ; then |
Matteo Scandolo | d4d55b7 | 2020-11-25 12:29:07 -0800 | [diff] [blame] | 187 | helm install -n $INFRA_NS nem-monitoring cord/nem-monitoring \ |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 188 | -f $HOME/voltha-scale/grafana.yaml \ |
| 189 | --set prometheus.alertmanager.enabled=false,prometheus.pushgateway.enabled=false \ |
| 190 | --set kpi_exporter.enabled=false,dashboards.xos=false,dashboards.onos=false,dashboards.aaa=false,dashboards.voltha=false |
| 191 | fi |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 192 | ''' |
| 193 | } |
| 194 | } |
| 195 | stage('Deploy VOLTHA infrastructure') { |
| 196 | steps { |
| 197 | sh returnStdout: false, script: ''' |
| 198 | cd $WORKSPACE/kind-voltha/ |
| 199 | |
Matteo Scandolo | f665656 | 2020-11-16 14:45:44 -0800 | [diff] [blame] | 200 | export ETCD_CHART=$HOME/teone/helm-charts/etcd |
| 201 | export KAFKA_CHART=$HOME/teone/helm-charts/kafka |
Matteo Scandolo | b28a97b | 2020-11-13 10:58:32 -0800 | [diff] [blame] | 202 | |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 203 | # KAFKA config |
Matteo Scandolo | f665656 | 2020-11-16 14:45:44 -0800 | [diff] [blame] | 204 | export NUM_OF_KAFKA=${kafkaReplicas} |
| 205 | export EXTRA_HELM_FLAGS+=' --set prometheus.kafka.enabled=true,prometheus.operator.enabled=true,prometheus.jmx.enabled=true,prometheus.operator.serviceMonitor.namespace=default ' |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 206 | |
| 207 | # ETCD config |
Matteo Scandolo | f665656 | 2020-11-16 14:45:44 -0800 | [diff] [blame] | 208 | export EXTRA_HELM_FLAGS+=" --set memoryMode=${inMemoryEtcdStorage} " |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 209 | |
| 210 | NAME=infra JUST_INFRA=y ./voltha up |
| 211 | |
| 212 | # Forward the ETCD port onto $VOLTHA_ETCD_PORT |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 213 | _TAG=etcd-port-forward kubectl -n \$INFRA_NS port-forward --address 0.0.0.0 -n default service/etcd $VOLTHA_ETCD_PORT:2379& |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 214 | ''' |
| 215 | } |
| 216 | } |
| 217 | stage('Deploy Voltha') { |
| 218 | steps { |
| 219 | deploy_voltha_stacks(params.volthaStacks) |
| 220 | } |
| 221 | } |
| 222 | stage('Start logging') { |
| 223 | steps { |
| 224 | sh returnStdout: false, script: ''' |
| 225 | # start logging with kail |
| 226 | |
| 227 | mkdir -p $LOG_FOLDER |
| 228 | |
| 229 | list=($APPS_TO_LOG) |
| 230 | for app in "${list[@]}" |
| 231 | do |
| 232 | echo "Starting logs for: ${app}" |
| 233 | _TAG=kail-$app kail -l app=$app --since 1h > $LOG_FOLDER/$app.log& |
| 234 | done |
| 235 | ''' |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 236 | } |
| 237 | } |
| 238 | stage('Configuration') { |
| 239 | steps { |
| 240 | script { |
| 241 | sh returnStdout: false, script: """ |
Matteo Scandolo | ffe19c9 | 2020-11-24 15:25:25 -0800 | [diff] [blame] | 242 | # TODO this needs to be repeated per stack |
| 243 | # kubectl exec \$(kubectl get pods | grep -E "bbsim[0-9]" | awk 'NR==1{print \$1}') -- bbsimctl log ${logLevel.toLowerCase()} false |
| 244 | |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 245 | #Setting link discovery |
| 246 | 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} |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 247 | 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 |
| 248 | 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 |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 249 | 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 1000 |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 250 | 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 |
| 251 | |
Matteo Scandolo | ffe19c9 | 2020-11-24 15:25:25 -0800 | [diff] [blame] | 252 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg log:set ${logLevel} org.onosproject |
| 253 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 cfg log:set ${logLevel} org.opencord |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 254 | |
| 255 | # Set Flows/Ports/Meters poll frequency |
| 256 | 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} |
| 257 | 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} |
| 258 | |
| 259 | if [ ${withFlows} = false ]; then |
| 260 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.olt |
| 261 | fi |
| 262 | |
| 263 | if [ ${withMibTemplate} = true ] ; then |
| 264 | rm -f BBSM-12345123451234512345-00000000000001-v1.json |
| 265 | wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter/master/templates/BBSM-12345123451234512345-00000000000001-v1.json |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 266 | cat BBSM-12345123451234512345-00000000000001-v1.json | kubectl -n \$INFRA_NS exec -it \$(kubectl -n \$INFRA_NS get pods -l app=etcd | awk 'NR==2{print \$1}') -- etcdctl put service/voltha/omci_mibs/templates/BBSM/12345123451234512345/00000000000001 |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 267 | fi |
| 268 | |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 269 | if [ ${withPcap} = true ] && [ ${volthaStacks} -eq 1 ] ; then |
| 270 | # FIXME ofagent pcap has to be replicated per stack |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 271 | # Start the tcp-dump in ofagent |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 272 | export OF_AGENT=\$(kubectl -n \$INFRA_NS get pods -l app=ofagent -o name) |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 273 | kubectl exec \$OF_AGENT -- apk update |
| 274 | kubectl exec \$OF_AGENT -- apk add tcpdump |
| 275 | kubectl exec \$OF_AGENT -- mv /usr/sbin/tcpdump /usr/bin/tcpdump |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 276 | _TAG=ofagent-tcpdump kubectl -n \$INFRA_NS exec \$OF_AGENT -- tcpdump -nei eth0 -w out.pcap& |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 277 | |
| 278 | # Start the tcp-dump in radius |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 279 | export RADIUS=\$(kubectl -n \$INFRA_NS get pods -l app=radius -o name) |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 280 | kubectl exec \$RADIUS -- apt-get update |
| 281 | kubectl exec \$RADIUS -- apt-get install -y tcpdump |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 282 | _TAG=radius-tcpdump kubectl -n \$INFRA_NS exec \$RADIUS -- tcpdump -w out.pcap& |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 283 | |
| 284 | # Start the tcp-dump in ONOS |
| 285 | for i in \$(seq 0 \$ONOSES); do |
| 286 | INSTANCE="onos-onos-classic-\$i" |
| 287 | kubectl exec \$INSTANCE -- apt-get update |
| 288 | kubectl exec \$INSTANCE -- apt-get install -y tcpdump |
| 289 | kubectl exec \$INSTANCE -- mv /usr/sbin/tcpdump /usr/bin/tcpdump |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 290 | _TAG=\$INSTANCE kubectl -n \$INFRA_NS exec \$INSTANCE -- /usr/bin/tcpdump -nei eth0 port 1812 -w out.pcap& |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 291 | done |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 292 | else |
| 293 | echo "PCAP not supported for multiple VOLTHA stacks" |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 294 | fi |
| 295 | """ |
| 296 | } |
| 297 | } |
| 298 | } |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 299 | stage('Setup Test') { |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 300 | steps { |
| 301 | sh ''' |
| 302 | mkdir -p $WORKSPACE/RobotLogs |
| 303 | cd $WORKSPACE/voltha-system-tests |
| 304 | make vst_venv |
| 305 | ''' |
| 306 | sh ''' |
| 307 | if [ ${withProfiling} = true ] ; then |
| 308 | mkdir -p $LOG_FOLDER/pprof |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 309 | cat << EOF > $WORKSPACE/pprof.sh |
| 310 | timestamp() { |
| 311 | date +"%T" |
| 312 | } |
| 313 | |
| 314 | i=0 |
| 315 | while [[ true ]]; do |
| 316 | ((i++)) |
| 317 | ts=$(timestamp) |
| 318 | go tool pprof -png http://127.0.0.1:6060/debug/pprof/heap > $LOG_FOLDER/pprof/rw-core-heap-\\$i-\\$ts.png |
| 319 | go tool pprof -png http://127.0.0.1:6060/debug/pprof/goroutine > $LOG_FOLDER/pprof/rw-core-goroutine-\\$i-\\$ts.png |
| 320 | curl -o $LOG_FOLDER/pprof/rw-core-profile-\\$i-\\$ts.pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=10 |
| 321 | go tool pprof -png $LOG_FOLDER/pprof/rw-core-profile-\\$i-\\$ts.pprof > $LOG_FOLDER/pprof/rw-core-profile-\\$i-\\$ts.png |
| 322 | |
| 323 | go tool pprof -png http://127.0.0.1:6061/debug/pprof/heap > $LOG_FOLDER/pprof/openolt-heap-\\$i-\\$ts.png |
| 324 | go tool pprof -png http://127.0.0.1:6061/debug/pprof/goroutine > $LOG_FOLDER/pprof/openolt-goroutine-\\$i-\\$ts.png |
| 325 | curl -o $LOG_FOLDER/pprof/openolt-profile-\\$i-\\$ts.pprof http://127.0.0.1:6061/debug/pprof/profile?seconds=10 |
| 326 | go tool pprof -png $LOG_FOLDER/pprof/openolt-profile-\\$i-\\$ts.pprof > $LOG_FOLDER/pprof/openolt-profile-\\$i-\\$ts.png |
| 327 | |
| 328 | go tool pprof -png http://127.0.0.1:6062/debug/pprof/heap > $LOG_FOLDER/pprof/ofagent-heap-\\$i-\\$ts.png |
| 329 | go tool pprof -png http://127.0.0.1:6062/debug/pprof/goroutine > $LOG_FOLDER/pprof/ofagent-goroutine-\\$i-\\$ts.png |
| 330 | curl -o $LOG_FOLDER/pprof/ofagent-profile-\\$i-\\$ts.pprof http://127.0.0.1:6062/debug/pprof/profile?seconds=10 |
| 331 | go tool pprof -png $LOG_FOLDER/pprof/ofagent-profile-\\$i-\\$ts.pprof > $LOG_FOLDER/pprof/ofagent-profile-\\$i-\\$ts.png |
| 332 | |
| 333 | sleep 10 |
| 334 | done |
| 335 | EOF |
| 336 | |
| 337 | _TAG="pprof" |
| 338 | _TAG=$_TAG bash $WORKSPACE/pprof.sh & |
| 339 | fi |
| 340 | ''' |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 341 | // bbsim-sadis server takes a while to cache the subscriber entries |
| 342 | // wait for that before starting the tests |
| 343 | sleep(60) |
| 344 | } |
| 345 | } |
| 346 | stage('Run Test') { |
| 347 | steps { |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 348 | test_voltha_stacks(params.volthaStacks) |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 349 | } |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 350 | } |
| 351 | } |
| 352 | post { |
| 353 | always { |
| 354 | // collect result, done in the "post" step so it's executed even in the |
| 355 | // event of a timeout in the tests |
| 356 | sh ''' |
| 357 | |
| 358 | # stop the kail processes |
| 359 | list=($APPS_TO_LOG) |
| 360 | for app in "${list[@]}" |
| 361 | do |
| 362 | echo "Stopping logs for: ${app}" |
| 363 | _TAG="kail-$app" |
| 364 | P_IDS="$(ps e -ww -A | grep "_TAG=$_TAG" | grep -v grep | awk '{print $1}')" |
| 365 | if [ -n "$P_IDS" ]; then |
| 366 | echo $P_IDS |
| 367 | for P_ID in $P_IDS; do |
| 368 | kill -9 $P_ID |
| 369 | done |
| 370 | fi |
| 371 | done |
| 372 | |
| 373 | if [ ${withPcap} = true ] ; then |
| 374 | # stop ofAgent tcpdump |
| 375 | P_ID="\$(ps e -ww -A | grep "_TAG=ofagent-tcpdump" | grep -v grep | awk '{print \$1}')" |
| 376 | if [ -n "\$P_ID" ]; then |
| 377 | kill -9 \$P_ID |
| 378 | fi |
| 379 | |
| 380 | # stop radius tcpdump |
| 381 | P_ID="\$(ps e -ww -A | grep "_TAG=radius-tcpdump" | grep -v grep | awk '{print \$1}')" |
| 382 | if [ -n "\$P_ID" ]; then |
| 383 | kill -9 \$P_ID |
| 384 | fi |
| 385 | |
| 386 | # stop onos tcpdump |
| 387 | LIMIT=$(($NUM_OF_ONOS - 1)) |
| 388 | for i in $(seq 0 $LIMIT); do |
| 389 | INSTANCE="onos-onos-classic-$i" |
| 390 | P_ID="\$(ps e -ww -A | grep "_TAG=$INSTANCE" | grep -v grep | awk '{print \$1}')" |
| 391 | if [ -n "\$P_ID" ]; then |
| 392 | kill -9 \$P_ID |
| 393 | fi |
| 394 | done |
| 395 | |
| 396 | # copy the file |
| 397 | export OF_AGENT=$(kubectl get pods -l app=ofagent | awk 'NR==2{print $1}') || true |
| 398 | kubectl cp $OF_AGENT:out.pcap $LOG_FOLDER/ofagent.pcap || true |
| 399 | |
| 400 | export RADIUS=$(kubectl get pods -l app=radius | awk 'NR==2{print $1}') || true |
| 401 | kubectl cp $RADIUS:out.pcap $LOG_FOLDER/radius.pcap || true |
| 402 | |
| 403 | LIMIT=$(($NUM_OF_ONOS - 1)) |
| 404 | for i in $(seq 0 $LIMIT); do |
| 405 | INSTANCE="onos-onos-classic-$i" |
| 406 | kubectl cp $INSTANCE:out.pcap $LOG_FOLDER/$INSTANCE.pcap || true |
| 407 | done |
| 408 | fi |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 409 | ''' |
| 410 | sh ''' |
| 411 | if [ ${withProfiling} = true ] ; then |
| 412 | _TAG="pprof" |
| 413 | P_IDS="$(ps e -ww -A | grep "_TAG=$_TAG" | grep -v grep | awk '{print $1}')" |
| 414 | if [ -n "$P_IDS" ]; then |
| 415 | echo $P_IDS |
| 416 | for P_ID in $P_IDS; do |
| 417 | kill -9 $P_ID |
| 418 | done |
| 419 | fi |
| 420 | fi |
| 421 | ''' |
| 422 | plot([ |
| 423 | csvFileName: 'scale-test.csv', |
| 424 | csvSeries: [ |
| 425 | [file: 'plots/plot-voltha-onus.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 426 | [file: 'plots/plot-onos-ports.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 427 | [file: 'plots/plot-voltha-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 428 | [file: 'plots/plot-voltha-openolt-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 429 | [file: 'plots/plot-onos-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 430 | [file: 'plots/plot-onos-auth.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 431 | [file: 'plots/plot-voltha-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 432 | [file: 'plots/plot-voltha-openolt-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 433 | [file: 'plots/plot-onos-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 434 | [file: 'plots/plot-onos-dhcp.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 435 | ], |
| 436 | group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Scale Test (OLTs: ${olts}, PONs: ${pons}, ONUs: ${onus})", yaxis: 'Time (s)', useDescr: true |
| 437 | ]) |
| 438 | step([$class: 'RobotPublisher', |
| 439 | disableArchiveOutput: false, |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 440 | logFileName: 'RobotLogs/**/log.html', |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 441 | otherFiles: '', |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 442 | outputFileName: 'RobotLogs/**/output.xml', |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 443 | outputPath: '.', |
| 444 | passThreshold: 100, |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 445 | reportFileName: 'RobotLogs/**/report.html', |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 446 | unstableThreshold: 0]); |
| 447 | // get all the logs from kubernetes PODs |
| 448 | sh returnStdout: false, script: ''' |
| 449 | |
| 450 | # store information on running charts |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 451 | helm ls --all-namespaces > $LOG_FOLDER/helm-list.txt || true |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 452 | |
| 453 | # store information on the running pods |
Matteo Scandolo | d4d55b7 | 2020-11-25 12:29:07 -0800 | [diff] [blame] | 454 | kubectl get pods --all-namespaces -o wide > $LOG_FOLDER/pods.txt || true |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 455 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-images.txt || true |
| 456 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-imagesId.txt || true |
| 457 | |
| 458 | # copy the ONOS logs directly from the container to avoid the color codes |
Matteo Scandolo | be82324 | 2020-11-20 13:48:13 -0800 | [diff] [blame] | 459 | printf '%s\n' $(kubectl -n \$INFRA_NS get pods -l app=onos-onos-classic -o=jsonpath="{.items[*]['metadata.name']}") | xargs --no-run-if-empty -I# bash -c "kubectl -n \$INFRA_NS cp #:${karafHome}/data/log/karaf.log $LOG_FOLDER/#.log" || true |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 460 | |
| 461 | # get radius logs out of the container |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 462 | kubectl -n \$INFRA_NS cp $(kubectl -n \$INFRA_NS get pods -l app=radius --no-headers | awk '{print $1}'):/var/log/freeradius/radius.log $LOG_FOLDER//radius.log || true |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 463 | ''' |
| 464 | // dump all the BBSim(s) ONU information |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 465 | script { |
| 466 | for (int i = 1; i <= params.volthaStacks.toInteger(); i++) { |
| 467 | stack_ns="voltha"+i |
| 468 | sh """ |
| 469 | BBSIM_IDS=\$(kubectl -n ${stack_ns} get pods | grep bbsim | grep -v server | awk '{print \$1}') |
| 470 | IDS=(\$BBSIM_IDS) |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 471 | |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 472 | for bbsim in "\${IDS[@]}" |
| 473 | do |
Matteo Scandolo | f665656 | 2020-11-16 14:45:44 -0800 | [diff] [blame] | 474 | kubectl -n ${stack_ns} exec -t \$bbsim -- bbsimctl onu list > $LOG_FOLDER/\$bbsim-device-list.txt || true |
| 475 | kubectl -n ${stack_ns} exec -t \$bbsim -- bbsimctl service list > $LOG_FOLDER/\$bbsim-service-list.txt || true |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 476 | done |
| 477 | """ |
| 478 | } |
| 479 | } |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 480 | // get ONOS debug infos |
| 481 | sh ''' |
| 482 | |
| 483 | 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 |
| 484 | 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 |
| 485 | 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 |
| 486 | 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 |
| 487 | |
| 488 | 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 |
| 489 | 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 |
| 490 | |
| 491 | if [ ${withFlows} = true ] ; then |
| 492 | 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 |
| 493 | 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 |
| 494 | 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 |
| 495 | fi |
| 496 | |
| 497 | if [ ${provisionSubscribers} = true ]; then |
| 498 | 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 |
| 499 | 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 |
| 500 | 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 |
| 501 | 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 |
| 502 | fi |
| 503 | |
| 504 | if [ ${withEapol} = true ] ; then |
| 505 | 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 |
| 506 | 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 |
| 507 | fi |
| 508 | |
| 509 | if [ ${withDhcp} = true ] ; then |
| 510 | 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 |
| 511 | fi |
| 512 | ''' |
| 513 | // collect etcd metrics |
| 514 | sh ''' |
| 515 | mkdir -p $WORKSPACE/etcd-metrics |
| 516 | 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 |
| 517 | 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 |
| 518 | 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 |
| 519 | 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 |
| 520 | ''' |
| 521 | // get VOLTHA debug infos |
| 522 | script { |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 523 | for (int i = 1; i <= params.volthaStacks.toInteger(); i++) { |
| 524 | stack_ns="voltha"+i |
| 525 | voltcfg="~/.volt/config-voltha"+i |
| 526 | println stack_ns |
| 527 | try { |
| 528 | sh """ |
| 529 | voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB device list -o json > $LOG_FOLDER/device-list.json || true |
| 530 | python -m json.tool $LOG_FOLDER/device-list.json > $LOG_FOLDER/voltha-devices-list.json || true |
| 531 | rm $LOG_FOLDER/device-list.json || true |
| 532 | voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB device list > $LOG_FOLDER/voltha-devices-list.txt || true |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 533 | |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 534 | DEVICE_LIST= |
Matteo Scandolo | be82324 | 2020-11-20 13:48:13 -0800 | [diff] [blame] | 535 | printf '%s\n' \$(voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB device list | grep olt | awk '{print \$1}') | xargs --no-run-if-empty -I# bash -c "voltctl -c $HOME/.volt/config-${stack_ns}-m 8MB device flows # > $LOG_FOLDER/voltha-device-flows-#.txt" || true |
| 536 | printf '%s\n' \$(voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB device list | grep olt | awk '{print \$1}') | xargs --no-run-if-empty -I# bash -c "voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB device port list --format 'table{{.PortNo}}\t{{.Label}}\t{{.Type}}\t{{.AdminState}}\t{{.OperStatus}}' # > $LOG_FOLDER/voltha-device-ports-#.txt" || true |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 537 | |
Matteo Scandolo | be82324 | 2020-11-20 13:48:13 -0800 | [diff] [blame] | 538 | printf '%s\n' \$(voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB logicaldevice list -q) | xargs --no-run-if-empty -I# bash -c "voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB logicaldevice flows # > $LOG_FOLDER/voltha-logicaldevice-flows-#.txt" || true |
| 539 | printf '%s\n' \$(voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB logicaldevice list -q) | xargs --no-run-if-empty -I# bash -c "voltctl -c $HOME/.volt/config-${stack_ns} -m 8MB logicaldevice port list # > $LOG_FOLDER/voltha-logicaldevice-ports-#.txt" || true |
Matteo Scandolo | d406449 | 2020-11-13 10:48:30 -0800 | [diff] [blame] | 540 | """ |
| 541 | } catch(e) { |
| 542 | sh ''' |
| 543 | echo "Can't get device list from voltclt" |
| 544 | ''' |
| 545 | } |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 546 | } |
| 547 | } |
| 548 | // get cpu usage by container |
| 549 | sh ''' |
| 550 | if [ ${withMonitoring} = true ] ; then |
| 551 | cd $WORKSPACE/voltha-system-tests |
| 552 | source ./vst_venv/bin/activate |
| 553 | sleep 60 # we have to wait for prometheus to collect all the information |
| 554 | python tests/scale/sizing.py -o $WORKSPACE/plots || true |
| 555 | fi |
| 556 | ''' |
Matteo Scandolo | ffe19c9 | 2020-11-24 15:25:25 -0800 | [diff] [blame] | 557 | archiveArtifacts artifacts: 'kind-voltha/install-*.log,execution-time.txt,logs/*,logs/pprof/*,RobotLogs/**/*,plots/*,etcd-metrics/*' |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 558 | } |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | def deploy_voltha_stacks(numberOfStacks) { |
| 563 | for (int i = 1; i <= numberOfStacks.toInteger(); i++) { |
| 564 | stage("Deploy VOLTHA stack " + i) { |
| 565 | sh returnStdout: false, script: """ |
| 566 | cd $WORKSPACE/kind-voltha/ |
| 567 | |
| 568 | export NAME=voltha${i} |
| 569 | export VOLTHA_NS=voltha${i} |
| 570 | export ADAPTER_NS=voltha${i} |
| 571 | export BBSIM_NS=voltha${i} |
| 572 | export BBSIM_BASE_INDEX=${i} |
| 573 | export WITH_ETCD=etcd.\$INFRA_NS.svc:2379 |
| 574 | export WITH_KAFKA=kafka.\$INFRA_NS.svc:9092 |
| 575 | export WITH_ONOS=onos-onos-classic-hs.\$INFRA_NS.svc:6653 |
| 576 | |
| 577 | export EXTRA_HELM_FLAGS+=' ' |
| 578 | |
| 579 | # Load the release defaults |
| 580 | if [ '${release.trim()}' != 'master' ]; then |
| 581 | source $WORKSPACE/kind-voltha/releases/${release} |
| 582 | EXTRA_HELM_FLAGS+=" ${extraHelmFlags} " |
| 583 | fi |
| 584 | |
| 585 | # BBSim custom image handling |
| 586 | if [ '${bbsimImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'bbsim' ]; then |
| 587 | IFS=: read -r bbsimRepo bbsimTag <<< '${bbsimImg.trim()}' |
| 588 | EXTRA_HELM_FLAGS+="--set images.bbsim.repository=\$bbsimRepo,images.bbsim.tag=\$bbsimTag " |
| 589 | fi |
| 590 | |
| 591 | # VOLTHA and ofAgent custom image handling |
| 592 | # NOTE to override the rw-core image in a released version you must set the ofAgent image too |
| 593 | # TODO split ofAgent and voltha-go |
| 594 | if [ '${rwCoreImg.trim()}' != '' ] && [ '${ofAgentImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'voltha-go' ]; then |
| 595 | IFS=: read -r rwCoreRepo rwCoreTag <<< '${rwCoreImg.trim()}' |
| 596 | IFS=: read -r ofAgentRepo ofAgentTag <<< '${ofAgentImg.trim()}' |
| 597 | EXTRA_HELM_FLAGS+="--set images.rw_core.repository=\$rwCoreRepo,images.rw_core.tag=\$rwCoreTag,images.ofagent.repository=\$ofAgentRepo,images.ofagent.tag=\$ofAgentTag " |
| 598 | fi |
| 599 | |
| 600 | # OpenOLT custom image handling |
| 601 | if [ '${openoltAdapterImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'voltha-openolt-adapter' ]; then |
| 602 | IFS=: read -r openoltAdapterRepo openoltAdapterTag <<< '${openoltAdapterImg.trim()}' |
| 603 | EXTRA_HELM_FLAGS+="--set images.adapter_open_olt.repository=\$openoltAdapterRepo,images.adapter_open_olt.tag=\$openoltAdapterTag " |
| 604 | fi |
| 605 | |
| 606 | # OpenONU custom image handling |
| 607 | if [ '${openonuAdapterImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'voltha-openonu-adapter' ]; then |
| 608 | IFS=: read -r openonuAdapterRepo openonuAdapterTag <<< '${openonuAdapterImg.trim()}' |
| 609 | EXTRA_HELM_FLAGS+="--set images.adapter_open_onu.repository=\$openonuAdapterRepo,images.adapter_open_onu.tag=\$openonuAdapterTag " |
| 610 | fi |
| 611 | |
Andrea Campanella | 2876308 | 2020-11-18 10:55:31 +0100 | [diff] [blame] | 612 | # OpenONU Go custom image handling |
| 613 | if [ '${openonuAdapterGoImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'voltha-openonu-adapter-go' ]; then |
| 614 | IFS=: read -r openonuAdapterGoRepo openonuAdapterGoTag <<< '${openonuAdapterGoImg.trim()}' |
Andrea Campanella | ed02698 | 2020-11-20 10:06:42 +0100 | [diff] [blame] | 615 | EXTRA_HELM_FLAGS+="--set images.adapter_open_onu_go.repository=\$openonuAdapterGoRepo,images.adapter_open_onu_go.tag=\$openonuAdapterGoTag " |
Andrea Campanella | 2876308 | 2020-11-18 10:55:31 +0100 | [diff] [blame] | 616 | fi |
| 617 | |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 618 | # ONOS custom image handling |
| 619 | if [ '${onosImg.trim()}' != '' ] && [ '\$GERRIT_PROJECT' != 'voltha-onos' ]; then |
| 620 | IFS=: read -r onosRepo onosTag <<< '${onosImg.trim()}' |
| 621 | EXTRA_HELM_FLAGS+="--set images.onos.repository=\$onosRepo,images.onos.tag=\$onosTag " |
| 622 | fi |
| 623 | |
| 624 | # set BBSim parameters |
| 625 | EXTRA_HELM_FLAGS+='--set enablePerf=true,pon=${pons},onu=${onus} ' |
| 626 | |
| 627 | # disable the securityContext, this is a development cluster |
| 628 | EXTRA_HELM_FLAGS+='--set securityContext.enabled=false ' |
| 629 | |
| 630 | # No persistent-volume-claims in Atomix |
| 631 | EXTRA_HELM_FLAGS+="--set atomix.persistence.enabled=false " |
| 632 | |
| 633 | echo "Installing with the following extra arguments:" |
| 634 | echo $EXTRA_HELM_FLAGS |
| 635 | |
| 636 | # if it's newer than voltha-2.4 set the correct BBSIM_CFG |
| 637 | if [ '${release.trim()}' != 'voltha-2.4' ]; then |
| 638 | export BBSIM_CFG="$WORKSPACE/kind-voltha/configs/bbsim-sadis-${workflow}.yaml" |
| 639 | fi |
| 640 | |
| 641 | # Use custom built images |
| 642 | |
| 643 | if [ '\$GERRIT_PROJECT' == 'voltha-go' ]; then |
| 644 | EXTRA_HELM_FLAGS+="--set images.rw_core.repository=${dockerRegistry}/voltha/voltha-rw-core,images.rw_core.tag=voltha-scale " |
| 645 | fi |
| 646 | |
| 647 | if [ '\$GERRIT_PROJECT' == 'voltha-openolt-adapter' ]; then |
| 648 | EXTRA_HELM_FLAGS+="--set images.adapter_open_olt.repository=${dockerRegistry}/voltha/voltha-openolt-adapter,images.adapter_open_olt.tag=voltha-scale " |
| 649 | fi |
| 650 | |
| 651 | if [ '\$GERRIT_PROJECT' == 'voltha-openonu-adapter' ]; then |
| 652 | EXTRA_HELM_FLAGS+="--set images.adapter_open_onu.repository=${dockerRegistry}/voltha/voltha-openonu-adapter,images.adapter_open_onu.tag=voltha-scale " |
| 653 | fi |
| 654 | |
Andrea Campanella | ed02698 | 2020-11-20 10:06:42 +0100 | [diff] [blame] | 655 | if [ '\$GERRIT_PROJECT' == 'voltha-openonu-adapter-go' ]; then |
| 656 | EXTRA_HELM_FLAGS+="--set images.adapter_open_onu_go.repository=${dockerRegistry}/voltha/voltha-openonu-adapter-go,images.adapter_open_onu_go.tag=voltha-scale " |
| 657 | fi |
| 658 | |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 659 | if [ '\$GERRIT_PROJECT' == 'ofagent-go' ]; then |
| 660 | EXTRA_HELM_FLAGS+="--set images.ofagent.repository=${dockerRegistry}/voltha/voltha-ofagent-go,images.ofagent.tag=voltha-scale " |
| 661 | fi |
| 662 | |
| 663 | if [ '\$GERRIT_PROJECT' == 'voltha-onos' ]; then |
| 664 | EXTRA_HELM_FLAGS+="--set images.onos.repository=${dockerRegistry}/voltha/voltha-onos,images.onos.tag=voltha-scale " |
| 665 | fi |
| 666 | |
| 667 | if [ '\$GERRIT_PROJECT' == 'bbsim' ]; then |
| 668 | EXTRA_HELM_FLAGS+="--set images.bbsim.repository=${dockerRegistry}/voltha/bbsim,images.bbsim.tag=voltha-scale " |
| 669 | fi |
| 670 | |
| 671 | ./voltha up |
| 672 | """ |
| 673 | } |
| 674 | } |
| 675 | } |
| 676 | |
| 677 | def test_voltha_stacks(numberOfStacks) { |
| 678 | for (int i = 1; i <= numberOfStacks.toInteger(); i++) { |
| 679 | stage("Test VOLTHA stack " + i) { |
| 680 | timeout(time: 15, unit: 'MINUTES') { |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 681 | sh """ |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 682 | export VOLTCONFIG="$HOME/.volt/config-voltha${i}" |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 683 | ROBOT_PARAMS="-v stackId:${i} \ |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 684 | -v olt:${olts} \ |
| 685 | -v pon:${pons} \ |
| 686 | -v onu:${onus} \ |
| 687 | -v workflow:${workflow} \ |
| 688 | -v withEapol:${withEapol} \ |
| 689 | -v withDhcp:${withDhcp} \ |
| 690 | -v withIgmp:${withIgmp} \ |
| 691 | --noncritical non-critical \ |
| 692 | -e teardown " |
| 693 | |
| 694 | if [ ${withEapol} = false ] ; then |
| 695 | ROBOT_PARAMS+="-e authentication " |
| 696 | fi |
| 697 | |
| 698 | if [ ${withDhcp} = false ] ; then |
| 699 | ROBOT_PARAMS+="-e dhcp " |
| 700 | fi |
| 701 | |
| 702 | if [ ${provisionSubscribers} = false ] ; then |
| 703 | # if we're not considering subscribers then we don't care about authentication and dhcp |
| 704 | ROBOT_PARAMS+="-e authentication -e provision -e flow-after -e dhcp " |
| 705 | fi |
| 706 | |
| 707 | if [ ${withFlows} = false ] ; then |
| 708 | ROBOT_PARAMS+="-i setup -i activation " |
| 709 | fi |
| 710 | |
| 711 | cd $WORKSPACE/voltha-system-tests |
| 712 | source ./vst_venv/bin/activate |
Matteo Scandolo | 5f6c549 | 2020-11-12 17:37:25 -0800 | [diff] [blame] | 713 | robot -d $WORKSPACE/RobotLogs/voltha${i} \ |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 714 | \$ROBOT_PARAMS tests/scale/Voltha_Scale_Tests.robot |
Matteo Scandolo | f7ca631 | 2020-11-16 15:57:15 -0800 | [diff] [blame] | 715 | |
| 716 | # collect results |
| 717 | python tests/scale/collect-result.py -r $WORKSPACE/RobotLogs/voltha${i}/output.xml -p $WORKSPACE/plots > $WORKSPACE/execution-time-voltha${i}.txt || true |
| 718 | cat $WORKSPACE/execution-time-voltha${i}.txt |
Matteo Scandolo | dc4608c | 2020-11-12 16:48:16 -0800 | [diff] [blame] | 719 | """ |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 720 | } |
| 721 | } |
Matteo Scandolo | 4b006ae | 2020-11-09 16:14:40 -0800 | [diff] [blame] | 722 | } |
| 723 | } |