Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [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 { |
| 24 | timeout(time: 30, unit: 'MINUTES') |
| 25 | } |
| 26 | environment { |
| 27 | KUBECONFIG="$HOME/.kube/config" |
| 28 | VOLTCONFIG="$HOME/.volt/config" |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 29 | SSHPASS="karaf" |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 30 | PATH="$PATH:$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 31 | TYPE="minimal" |
| 32 | FANCY=0 |
| 33 | WITH_SIM_ADAPTERS="no" |
| 34 | WITH_RADIUS="yes" |
| 35 | WITH_BBSIM="yes" |
| 36 | LEGACY_BBSIM_INDEX="no" |
| 37 | DEPLOY_K8S="no" |
| 38 | CONFIG_SADIS="external" |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 39 | WITH_KAFKA="kafka.default.svc.cluster.local" |
Matteo Scandolo | a8afe12 | 2020-05-11 10:45:56 -0700 | [diff] [blame] | 40 | WITH_ETCD="etcd-cluster-client.default.svc.cluster.local" |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 41 | |
| 42 | // install everything in the default namespace |
| 43 | VOLTHA_NS="default" |
| 44 | ADAPTER_NS="default" |
| 45 | INFRA_NS="default" |
| 46 | BBSIM_NS="default" |
| 47 | |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 48 | // configurable options |
| 49 | WITH_EAPOL="${withEapol}" |
| 50 | WITH_DHCP="${withDhcp}" |
| 51 | WITH_IGMP="${withIgmp}" |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 52 | VOLTHA_LOG_LEVEL="${logLevel}" |
| 53 | NUM_OF_BBSIM="${olts}" |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 54 | NUM_OF_OPENONU="${openonuAdapterReplicas}" |
| 55 | NUM_OF_ONOS="${onosReplicas}" |
| 56 | NUM_OF_ATOMIX="${atomixReplicas}" |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 57 | WITH_PPROF="${withProfiling}" |
Matteo Scandolo | 3136cca | 2020-05-15 14:14:27 -0700 | [diff] [blame] | 58 | EXTRA_HELM_FLAGS="${extraHelmFlags} " // note that the trailing space is required to separate the parameters from appends done later |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 59 | |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 60 | VOLTHA_CHART="${volthaChart}" |
| 61 | VOLTHA_BBSIM_CHART="${bbsimChart}" |
| 62 | VOLTHA_ADAPTER_OPEN_OLT_CHART="${openoltAdapterChart}" |
| 63 | VOLTHA_ADAPTER_OPEN_ONU_CHART="${openonuAdapterChart}" |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | stages { |
| 67 | stage ('Cleanup') { |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 68 | steps { |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 69 | timeout(time: 11, unit: 'MINUTES') { |
| 70 | sh returnStdout: false, script: """ |
| 71 | test -e $WORKSPACE/kind-voltha/voltha && cd $WORKSPACE/kind-voltha && ./voltha down |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 72 | |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 73 | for hchart in \$(helm list -q | grep -E -v 'docker-registry|kafkacat|etcd-operator'); |
| 74 | do |
| 75 | echo "Purging chart: \${hchart}" |
| 76 | helm delete --purge "\${hchart}" |
| 77 | done |
| 78 | bash /home/cord/voltha-scale/wait_for_pods.sh |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 79 | |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 80 | cd $WORKSPACE |
| 81 | rm -rf $WORKSPACE/* |
| 82 | """ |
| 83 | } |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 84 | } |
| 85 | } |
| 86 | stage('Clone kind-voltha') { |
| 87 | steps { |
| 88 | checkout([ |
| 89 | $class: 'GitSCM', |
| 90 | userRemoteConfigs: [[ url: "https://gerrit.opencord.org/kind-voltha", ]], |
| 91 | branches: [[ name: "master", ]], |
| 92 | extensions: [ |
| 93 | [$class: 'WipeWorkspace'], |
| 94 | [$class: 'RelativeTargetDirectory', relativeTargetDir: "kind-voltha"], |
| 95 | [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false], |
| 96 | ], |
| 97 | ]) |
| 98 | } |
| 99 | } |
| 100 | stage('Clone voltha-system-tests') { |
| 101 | steps { |
| 102 | checkout([ |
| 103 | $class: 'GitSCM', |
| 104 | userRemoteConfigs: [[ url: "https://gerrit.opencord.org/voltha-system-tests", ]], |
| 105 | branches: [[ name: "master", ]], |
| 106 | extensions: [ |
| 107 | [$class: 'WipeWorkspace'], |
| 108 | [$class: 'RelativeTargetDirectory', relativeTargetDir: "voltha-system-tests"], |
| 109 | [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false], |
| 110 | ], |
| 111 | ]) |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 112 | script { |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 113 | sh(script:""" |
| 114 | if [ ${volthaSystemTestsChange} != '' ] ; then |
| 115 | cd voltha-system-tests; |
| 116 | git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD |
| 117 | fi |
| 118 | """) |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 119 | } |
| 120 | } |
| 121 | } |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 122 | stage('Deploy common infrastructure') { |
Matteo Scandolo | a8afe12 | 2020-05-11 10:45:56 -0700 | [diff] [blame] | 123 | // includes monitoring, kafka, etcd |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 124 | steps { |
| 125 | sh ''' |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 126 | helm install -n kafka incubator/kafka --version 0.13.3 --set replicas=3 --set persistence.enabled=false --set zookeeper.replicaCount=3 --set zookeeper.persistence.enabled=false --version=0.15.3 |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 127 | |
Matteo Scandolo | 683b144 | 2020-05-21 15:30:57 -0700 | [diff] [blame] | 128 | helm install --set clusterName=etcd-cluster --set autoCompactionRetention=1 --set clusterSize=3 --set defaults.log_level=WARN --namespace default -n etcd-cluster onf/voltha-etcd-cluster ${extraHelmFlags} |
Matteo Scandolo | a8afe12 | 2020-05-11 10:45:56 -0700 | [diff] [blame] | 129 | |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 130 | if [ ${withMonitoring} = true ] ; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 131 | helm install -n nem-monitoring cord/nem-monitoring \ |
| 132 | --set prometheus.alertmanager.enabled=false,prometheus.pushgateway.enabled=false \ |
| 133 | --set kpi_exporter.enabled=false,dashboards.xos=false,dashboards.onos=false,dashboards.aaa=false,dashboards.voltha=false |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 134 | fi |
| 135 | |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 136 | # TODO download this file from https://github.com/opencord/helm-charts/blob/master/scripts/wait_for_pods.sh |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 137 | bash /home/cord/voltha-scale/wait_for_pods.sh |
| 138 | ''' |
| 139 | } |
| 140 | } |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 141 | stage('Deploy Voltha') { |
| 142 | steps { |
| 143 | script { |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 144 | // TODO install etcd outside kind-voltha (no need to redeploy the operator everytime) |
| 145 | sh returnStdout: false, script: """ |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 146 | export EXTRA_HELM_FLAGS+='--set enablePerf=true,pon=${pons},onu=${onus} ' |
| 147 | |
| 148 | # BBSim custom image handling |
| 149 | IFS=: read -r bbsimRepo bbsimTag <<< ${bbsimImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 150 | EXTRA_HELM_FLAGS+="--set images.bbsim.repository=\$bbsimRepo,images.bbsim.tag=\$bbsimTag " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 151 | |
| 152 | # VOLTHA and ofAgent custom image handling |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 153 | IFS=: read -r rwCoreRepo rwCoreTag <<< ${rwCoreImg} |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 154 | IFS=: read -r ofAgentRepo ofAgentTag <<< ${ofAgentImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 155 | EXTRA_HELM_FLAGS+="--set images.rw_core.repository=\$rwCoreRepo,images.rw_core.tag=\$rwCoreTag,images.ofagent_go.repository=\$ofAgentRepo,images.ofagent_go.tag=\$ofAgentTag " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 156 | |
| 157 | # OpenOLT custom image handling |
| 158 | IFS=: read -r openoltAdapterRepo openoltAdapterTag <<< ${openoltAdapterImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 159 | EXTRA_HELM_FLAGS+="--set images.adapter_open_olt.repository=\$openoltAdapterRepo,images.adapter_open_olt.tag=\$openoltAdapterTag " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 160 | |
| 161 | # OpenONU custom image handling |
| 162 | IFS=: read -r openonuAdapterRepo openonuAdapterTag <<< ${openonuAdapterImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 163 | EXTRA_HELM_FLAGS+="--set images.adapter_open_onu.repository=\$openonuAdapterRepo,images.adapter_open_onu.tag=\$openonuAdapterTag " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 164 | |
| 165 | # ONOS custom image handling |
| 166 | IFS=: read -r onosRepo onosTag <<< ${onosImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 167 | EXTRA_HELM_FLAGS+="--set images.onos.repository=\$onosRepo,images.onos.tag=\$onosTag " |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 168 | |
| 169 | |
| 170 | cd $WORKSPACE/kind-voltha/ |
| 171 | |
| 172 | ./voltha up |
| 173 | """ |
| 174 | } |
Matteo Scandolo | ac94652 | 2020-05-27 15:20:59 -0700 | [diff] [blame] | 175 | // bbsim-sadis server takes a while to cache the subscriber entries |
| 176 | // wait for that before starting the tests |
| 177 | sleep(120) |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 178 | } |
| 179 | } |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 180 | stage('Configuration') { |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 181 | steps { |
| 182 | sh ''' |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 183 | # Always deactivate org.opencord.kafka |
| 184 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.kafka |
| 185 | |
| 186 | #Setting link discovery |
| 187 | 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} |
| 188 | |
| 189 | #Setting LOG level to ${logLevel} |
| 190 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 log:set ${logLevel} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 191 | kubectl exec $(kubectl get pods | grep -E "bbsim[0-9]" | awk 'NR==1{print $1}') -- bbsimctl log ${logLevel} false |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 192 | |
Matteo Scandolo | 3136cca | 2020-05-15 14:14:27 -0700 | [diff] [blame] | 193 | # Set Flows/Ports/Meters poll frequency |
| 194 | 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} |
| 195 | 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} |
| 196 | |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 197 | if [ ${withEapol} = false ] || [ ${withFlows} = false ]; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 198 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.aaa |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 199 | fi |
| 200 | |
| 201 | if [ ${withDhcp} = false ] || [ ${withFlows} = false ]; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 202 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.dhcpl2relay |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 203 | fi |
| 204 | |
| 205 | if [ ${withIgmp} = false ] || [ ${withFlows} = false ]; then |
| 206 | # FIXME will actually affected the tests only after VOL-3054 is addressed |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 207 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.igmpproxy |
| 208 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.mcast |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 209 | fi |
| 210 | |
| 211 | if [ ${withFlows} = false ]; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 212 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.olt |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 213 | fi |
| 214 | |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 215 | if [ ${withMibTemplate} = true ] ; then |
| 216 | rm -f BBSM-12345123451234512345-00000000000001-v1.json |
| 217 | wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter/master/templates/BBSM-12345123451234512345-00000000000001-v1.json |
| 218 | 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 |
| 219 | fi |
Matteo Scandolo | 679ced2 | 2020-05-19 15:15:58 -0700 | [diff] [blame] | 220 | |
| 221 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 log:set DEBUG org.onosproject.net.device.impl.DeviceManager |
| 222 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 log:set DEBUG org.onosproject.openflow.controller.impl.OpenFlowControllerImpl |
| 223 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 log:set DEBUG org.onosproject.openflow.controller.impl.OFChannelHandler |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 224 | ''' |
| 225 | } |
| 226 | } |
| 227 | stage('Run Test') { |
| 228 | steps { |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 229 | sh ''' |
| 230 | mkdir -p $WORKSPACE/RobotLogs |
| 231 | cd $WORKSPACE/voltha-system-tests |
| 232 | make vst_venv |
| 233 | ''' |
| 234 | sh ''' |
| 235 | if [ ${withProfiling} = true ] ; then |
| 236 | mkdir -p $WORKSPACE/logs/pprof |
| 237 | echo $PATH |
| 238 | #Creating Python script for ONU Detection |
| 239 | cat << EOF > $WORKSPACE/pprof.sh |
Matteo Scandolo | 3ddd3fb | 2020-05-12 14:31:14 -0700 | [diff] [blame] | 240 | timestamp() { |
| 241 | date +"%T" |
| 242 | } |
| 243 | |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 244 | i=0 |
| 245 | while [[ true ]]; do |
| 246 | ((i++)) |
Matteo Scandolo | 3ddd3fb | 2020-05-12 14:31:14 -0700 | [diff] [blame] | 247 | ts=$(timestamp) |
Matteo Scandolo | 41cbc54 | 2020-05-12 13:59:12 -0700 | [diff] [blame] | 248 | go tool pprof -png http://127.0.0.1:6060/debug/pprof/heap > $WORKSPACE/logs/pprof/rw-core-heap-\\$i-\\$ts.png |
| 249 | go tool pprof -png http://127.0.0.1:6060/debug/pprof/goroutine > $WORKSPACE/logs/pprof/rw-core-goroutine-\\$i-\\$ts.png |
| 250 | curl -o $WORKSPACE/logs/pprof/rw-core-profile-\\$i-\\$ts.pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=10 |
| 251 | go tool pprof -png $WORKSPACE/logs/pprof/rw-core-profile-\\$i-\\$ts.pprof > $WORKSPACE/logs/pprof/rw-core-profile-\\$i-\\$ts.png |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 252 | |
Matteo Scandolo | 41cbc54 | 2020-05-12 13:59:12 -0700 | [diff] [blame] | 253 | go tool pprof -png http://127.0.0.1:6061/debug/pprof/heap > $WORKSPACE/logs/pprof/openolt-heap-\\$i-\\$ts.png |
| 254 | go tool pprof -png http://127.0.0.1:6061/debug/pprof/goroutine > $WORKSPACE/logs/pprof/openolt-goroutine-\\$i-\\$ts.png |
| 255 | curl -o $WORKSPACE/logs/pprof/openolt-profile-\\$i-\\$ts.pprof http://127.0.0.1:6061/debug/pprof/profile?seconds=10 |
| 256 | go tool pprof -png $WORKSPACE/logs/pprof/openolt-profile-\\$i-\\$ts.pprof > $WORKSPACE/logs/pprof/openolt-profile-\\$i-\\$ts.png |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 257 | |
Matteo Scandolo | 731d12c | 2020-05-13 14:33:26 -0700 | [diff] [blame] | 258 | go tool pprof -png http://127.0.0.1:6062/debug/pprof/heap > $WORKSPACE/logs/pprof/ofagent-heap-\\$i-\\$ts.png |
| 259 | go tool pprof -png http://127.0.0.1:6062/debug/pprof/goroutine > $WORKSPACE/logs/pprof/ofagent-goroutine-\\$i-\\$ts.png |
| 260 | curl -o $WORKSPACE/logs/pprof/ofagent-profile-\\$i-\\$ts.pprof http://127.0.0.1:6062/debug/pprof/profile?seconds=10 |
| 261 | go tool pprof -png $WORKSPACE/logs/pprof/ofagent-profile-\\$i-\\$ts.pprof > $WORKSPACE/logs/pprof/ofagent-profile-\\$i-\\$ts.png |
| 262 | |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 263 | sleep 10 |
| 264 | done |
| 265 | EOF |
| 266 | |
| 267 | _TAG="pprof" |
| 268 | _TAG=$_TAG bash $WORKSPACE/pprof.sh & |
| 269 | fi |
| 270 | ''' |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 271 | timeout(time: 11, unit: 'MINUTES') { |
| 272 | sh ''' |
| 273 | ROBOT_PARAMS="-v olt:${olts} \ |
| 274 | -v pon:${pons} \ |
| 275 | -v onu:${onus} \ |
| 276 | -v workflow:${workflow} \ |
| 277 | -v withEapol:${withEapol} \ |
| 278 | -v withDhcp:${withDhcp} \ |
| 279 | -v withIgmp:${withIgmp} \ |
| 280 | --noncritical non-critical \ |
| 281 | -e teardown " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 282 | |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 283 | if [ ${withEapol} = false ] ; then |
| 284 | ROBOT_PARAMS+="-e authentication " |
| 285 | fi |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 286 | |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 287 | if [ ${withDhcp} = false ] ; then |
| 288 | ROBOT_PARAMS+="-e dhcp " |
| 289 | fi |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 290 | |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 291 | if [ ${provisionSubscribers} = false ] ; then |
Matteo Scandolo | cd59fd0 | 2020-05-12 15:00:35 -0700 | [diff] [blame] | 292 | # if we're not considering subscribers then we don't care about authentication and dhcp |
Matteo Scandolo | 111c893 | 2020-05-12 18:28:05 -0700 | [diff] [blame] | 293 | ROBOT_PARAMS+="-e authentication -e provision -e flow-after -e dhcp " |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 294 | fi |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 295 | |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 296 | if [ ${withFlows} = false ] ; then |
| 297 | ROBOT_PARAMS+="-i setup -i activation " |
| 298 | fi |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 299 | |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 300 | cd $WORKSPACE/voltha-system-tests |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 301 | source ./vst_venv/bin/activate |
| 302 | robot -d $WORKSPACE/RobotLogs \ |
| 303 | $ROBOT_PARAMS tests/scale/Voltha_Scale_Tests.robot |
| 304 | ''' |
| 305 | } |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 306 | } |
| 307 | } |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 308 | } |
| 309 | post { |
| 310 | always { |
Matteo Scandolo | 157f66c | 2020-05-12 09:26:19 -0700 | [diff] [blame] | 311 | // collect result, done in the "post" step so it's executed even in the |
| 312 | // event of a timeout in the tests |
| 313 | sh ''' |
| 314 | cd voltha-system-tests |
| 315 | source ./vst_venv/bin/activate |
| 316 | python tests/scale/collect-result.py -r $WORKSPACE/RobotLogs/output.xml -p $WORKSPACE/plots > $WORKSPACE/execution-time.txt |
| 317 | cat $WORKSPACE/execution-time.txt |
| 318 | ''' |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 319 | sh ''' |
| 320 | if [ ${withProfiling} = true ] ; then |
| 321 | _TAG="pprof" |
| 322 | P_IDS="$(ps e -ww -A | grep "_TAG=$_TAG" | grep -v grep | awk '{print $1}')" |
| 323 | if [ -n "$P_IDS" ]; then |
| 324 | echo $P_IDS |
| 325 | for P_ID in $P_IDS; do |
| 326 | kill -9 $P_ID |
| 327 | done |
| 328 | fi |
| 329 | fi |
| 330 | ''' |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 331 | plot([ |
| 332 | csvFileName: 'scale-test.csv', |
| 333 | csvSeries: [ |
Matteo Scandolo | 272aed4 | 2020-05-08 15:05:57 -0700 | [diff] [blame] | 334 | [file: 'plots/plot-voltha-onus.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 335 | [file: 'plots/plot-onos-ports.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 336 | [file: 'plots/plot-voltha-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
Matteo Scandolo | 6496676 | 2020-05-13 11:51:38 -0700 | [diff] [blame] | 337 | [file: 'plots/plot-voltha-openolt-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
Matteo Scandolo | 272aed4 | 2020-05-08 15:05:57 -0700 | [diff] [blame] | 338 | [file: 'plots/plot-onos-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 339 | [file: 'plots/plot-onos-auth.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 340 | [file: 'plots/plot-voltha-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
Matteo Scandolo | 6496676 | 2020-05-13 11:51:38 -0700 | [diff] [blame] | 341 | [file: 'plots/plot-voltha-openolt-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
Matteo Scandolo | 272aed4 | 2020-05-08 15:05:57 -0700 | [diff] [blame] | 342 | [file: 'plots/plot-onos-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 343 | [file: 'plots/plot-onos-dhcp.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 344 | ], |
| 345 | group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Scale Test (OLTs: ${olts}, PONs: ${pons}, ONUs: ${onus})", yaxis: 'Time (s)', useDescr: true |
| 346 | ]) |
| 347 | step([$class: 'RobotPublisher', |
| 348 | disableArchiveOutput: false, |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 349 | logFileName: 'RobotLogs/log.html', |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 350 | otherFiles: '', |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 351 | outputFileName: 'RobotLogs/output.xml', |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 352 | outputPath: '.', |
| 353 | passThreshold: 100, |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 354 | reportFileName: 'RobotLogs/report.html', |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 355 | unstableThreshold: 0]); |
Matteo Scandolo | 502644b | 2020-05-18 08:56:18 -0700 | [diff] [blame] | 356 | // get all the logs from kubernetes PODs |
Matteo Scandolo | ede5abd | 2020-05-22 10:57:10 -0700 | [diff] [blame] | 357 | sh returnStdout: false, script: ''' |
| 358 | LOG_FOLDER=$WORKSPACE/logs |
| 359 | mkdir -p $LOG_FOLDER |
| 360 | |
| 361 | # store information on the running pods |
| 362 | kubectl get pods -o wide > $LOG_FOLDER/pods.txt |
| 363 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-images.txt |
| 364 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-imagesId.txt |
| 365 | |
| 366 | # log in individual files for all the container that match the selector app=$APP_TO_LOG |
| 367 | |
| 368 | APPS_TO_LOG=(etcd kafka onos onos-onos-classic adapter-open-onu adapter-open-olt rw-core ofagent bbsim) |
| 369 | for app in "${APPS_TO_LOG[@]}" |
| 370 | do |
| 371 | echo "Getting logs for: ${app}" |
| 372 | kubectl get pods -l app=${app} -o=jsonpath=\"{.items[*]['metadata.name']}\" |
Andrea Campanella | 743f52e | 2020-05-27 10:07:33 +0200 | [diff] [blame] | 373 | printf '%s\n' $(kubectl get pods -l app=$app -o=jsonpath="{.items[*]['metadata.name']}") | xargs -I@ bash -c "kubectl logs @ > $LOG_FOLDER/@.log" |
Matteo Scandolo | ede5abd | 2020-05-22 10:57:10 -0700 | [diff] [blame] | 374 | done |
Matteo Scandolo | 502644b | 2020-05-18 08:56:18 -0700 | [diff] [blame] | 375 | ''' |
| 376 | // count how many ONUs have been activated |
| 377 | sh ''' |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 378 | echo "#-of-ONUs" > $WORKSPACE/logs/voltha-devices-count.txt |
| 379 | echo $(voltctl device list | grep -v OLT | grep ACTIVE | wc -l) >> $WORKSPACE/logs/voltha-devices-count.txt |
| 380 | ''' |
| 381 | // count how many ports have been discovered |
| 382 | sh ''' |
| 383 | echo "#-of-ports" > $WORKSPACE/logs/onos-ports-count.txt |
| 384 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 ports -e | grep BBSM | wc -l) >> $WORKSPACE/logs/onos-ports-count.txt |
| 385 | ''' |
| 386 | // count how many flows have been provisioned |
| 387 | sh ''' |
| 388 | echo "#-of-flows" > $WORKSPACE/logs/onos-flows-count.txt |
| 389 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 flows -s | grep ADDED | wc -l) >> $WORKSPACE/logs/onos-flows-count.txt |
| 390 | ''' |
| 391 | // dump and count the authenticated users |
| 392 | sh ''' |
| 393 | if [ ${withOnosApps} = true ] && [ ${bbsimAuth} ] ; then |
| 394 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 aaa-users) >> $WORKSPACE/logs/onos-aaa-users.txt |
| 395 | |
| 396 | echo "#-of-authenticated-users" > $WORKSPACE/logs/onos-aaa-count.txt |
| 397 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 aaa-users | grep AUTHORIZED_STATE | wc -l) >> $WORKSPACE/logs/onos-aaa-count.txt |
| 398 | fi |
| 399 | ''' |
| 400 | // dump and count the dhcp users |
| 401 | sh ''' |
| 402 | if [ ${withOnosApps} = true ] && [ ${bbsimDhcp} ] ; then |
| 403 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 dhcpl2relay-allocations) >> $WORKSPACE/logs/onos-dhcp-allocations.txt |
| 404 | |
| 405 | echo "#-of-dhcp-allocations" > $WORKSPACE/logs/onos-dhcp-count.txt |
| 406 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 dhcpl2relay-allocations | grep DHCPACK | wc -l) >> $WORKSPACE/logs/onos-dhcp-count.txt |
| 407 | fi |
| 408 | ''' |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 409 | // dump all the BBSim(s) ONU informations |
| 410 | sh ''' |
| 411 | BBSIM_IDS=$(kubectl get pods | grep bbsim | grep -v server | awk '{print $1}') |
| 412 | IDS=($BBSIM_IDS) |
| 413 | |
| 414 | for bbsim in "${IDS[@]}" |
| 415 | do |
| 416 | kubectl exec -t $bbsim bbsimctl onu list > $WORKSPACE/logs/$bbsim-device-list.txt |
| 417 | done |
| 418 | ''' |
| 419 | // get ports and flows from ONOS |
| 420 | sh ''' |
| 421 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 ports > $WORKSPACE/logs/onos-ports-list.txt |
| 422 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 flows -s > $WORKSPACE/logs/onos-flows-list.txt |
| 423 | ''' |
Shrey Baid | cf652c8 | 2020-05-21 13:35:04 +0530 | [diff] [blame] | 424 | // get cpu usage by container |
| 425 | sh ''' |
| 426 | curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=avg(rate(container_cpu_usage_seconds_total[10m])*100) by (pod_name)' | jq . > $WORKSPACE/cpu-usage.json |
| 427 | ''' |
| 428 | // collect etcd metrics |
| 429 | sh ''' |
| 430 | mkdir $WORKSPACE/etcd-metrics |
| 431 | curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=etcd_debugging_mvcc_keys_total' | jq '.data.result[0].value[1]' > $WORKSPACE/etcd-metrics/etcd-key-count.json |
| 432 | curl -s -X GET -G http://10.90.0.101:31301/api/v1/query --data-urlencode 'query=grpc_server_handled_total{grpc_code="OK",grpc_service="etcdserverpb.KV"}' | jq . > $WORKSPACE/etcd-metrics/etcd-rpc-count.json |
| 433 | 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.result[0].value[1]' > $WORKSPACE/etcd-metrics/etcd-db-size.json |
| 434 | ''' |
Matteo Scandolo | 502644b | 2020-05-18 08:56:18 -0700 | [diff] [blame] | 435 | // dump all the VOLTHA devices informations |
| 436 | script { |
| 437 | try { |
| 438 | sh ''' |
| 439 | voltctl device list -o json > $WORKSPACE/logs/device-list.json |
| 440 | python -m json.tool $WORKSPACE/logs/device-list.json > $WORKSPACE/logs/voltha-devices-list.json |
| 441 | ''' |
| 442 | } catch(e) { |
| 443 | sh ''' |
| 444 | echo "Can't get device list from voltclt" |
| 445 | ''' |
| 446 | } |
| 447 | } |
Matteo Scandolo | 0dc72af | 2020-05-12 10:14:57 -0700 | [diff] [blame] | 448 | archiveArtifacts artifacts: 'kind-voltha/install-minimal.log,execution-time.txt,logs/*,logs/pprof/*,RobotLogs/*,plots/*.txt' |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 449 | } |
| 450 | } |
| 451 | } |