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: """ |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 71 | for hchart in \$(helm list -q | grep -E -v 'docker-registry|kafkacat|etcd-operator'); |
| 72 | do |
| 73 | echo "Purging chart: \${hchart}" |
| 74 | helm delete --purge "\${hchart}" |
| 75 | done |
| 76 | bash /home/cord/voltha-scale/wait_for_pods.sh |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 77 | |
Matteo Scandolo | ed41d8a | 2020-06-03 13:13:49 -0700 | [diff] [blame] | 78 | test -e $WORKSPACE/kind-voltha/voltha && cd $WORKSPACE/kind-voltha && ./voltha down |
| 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 |
Matteo Scandolo | 5708e2f | 2020-06-03 14:11:32 -0700 | [diff] [blame] | 115 | cd $WORKSPACE/voltha-system-tests; |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 116 | git fetch https://gerrit.opencord.org/voltha-system-tests ${volthaSystemTestsChange} && git checkout FETCH_HEAD |
| 117 | fi |
Matteo Scandolo | 5708e2f | 2020-06-03 14:11:32 -0700 | [diff] [blame] | 118 | |
| 119 | if [ ${kindVolthaChange} != '' ] ; then |
| 120 | cd $WORKSPACE/kind-voltha; |
| 121 | git fetch https://gerrit.opencord.org/kind-voltha ${volthaSystemTestsChange} && git checkout FETCH_HEAD |
| 122 | fi |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 123 | """) |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 124 | } |
| 125 | } |
| 126 | } |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 127 | stage('Deploy common infrastructure') { |
Matteo Scandolo | a8afe12 | 2020-05-11 10:45:56 -0700 | [diff] [blame] | 128 | // includes monitoring, kafka, etcd |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 129 | steps { |
| 130 | sh ''' |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 131 | 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] | 132 | |
Matteo Scandolo | 683b144 | 2020-05-21 15:30:57 -0700 | [diff] [blame] | 133 | 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] | 134 | |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 135 | if [ ${withMonitoring} = true ] ; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 136 | helm install -n nem-monitoring cord/nem-monitoring \ |
| 137 | --set prometheus.alertmanager.enabled=false,prometheus.pushgateway.enabled=false \ |
| 138 | --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] | 139 | fi |
| 140 | |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 141 | # 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] | 142 | bash /home/cord/voltha-scale/wait_for_pods.sh |
| 143 | ''' |
| 144 | } |
| 145 | } |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 146 | stage('Deploy Voltha') { |
| 147 | steps { |
| 148 | script { |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 149 | // TODO install etcd outside kind-voltha (no need to redeploy the operator everytime) |
| 150 | sh returnStdout: false, script: """ |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 151 | export EXTRA_HELM_FLAGS+='--set enablePerf=true,pon=${pons},onu=${onus} ' |
| 152 | |
| 153 | # BBSim custom image handling |
| 154 | IFS=: read -r bbsimRepo bbsimTag <<< ${bbsimImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 155 | EXTRA_HELM_FLAGS+="--set images.bbsim.repository=\$bbsimRepo,images.bbsim.tag=\$bbsimTag " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 156 | |
| 157 | # VOLTHA and ofAgent custom image handling |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 158 | IFS=: read -r rwCoreRepo rwCoreTag <<< ${rwCoreImg} |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 159 | IFS=: read -r ofAgentRepo ofAgentTag <<< ${ofAgentImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 160 | 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] | 161 | |
| 162 | # OpenOLT custom image handling |
| 163 | IFS=: read -r openoltAdapterRepo openoltAdapterTag <<< ${openoltAdapterImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 164 | 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] | 165 | |
| 166 | # OpenONU custom image handling |
| 167 | IFS=: read -r openonuAdapterRepo openonuAdapterTag <<< ${openonuAdapterImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 168 | 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] | 169 | |
| 170 | # ONOS custom image handling |
| 171 | IFS=: read -r onosRepo onosTag <<< ${onosImg} |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 172 | EXTRA_HELM_FLAGS+="--set images.onos.repository=\$onosRepo,images.onos.tag=\$onosTag " |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 173 | |
| 174 | |
| 175 | cd $WORKSPACE/kind-voltha/ |
| 176 | |
| 177 | ./voltha up |
| 178 | """ |
| 179 | } |
Matteo Scandolo | ac94652 | 2020-05-27 15:20:59 -0700 | [diff] [blame] | 180 | // bbsim-sadis server takes a while to cache the subscriber entries |
| 181 | // wait for that before starting the tests |
| 182 | sleep(120) |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 183 | } |
| 184 | } |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 185 | stage('Configuration') { |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 186 | steps { |
| 187 | sh ''' |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 188 | # Always deactivate org.opencord.kafka |
| 189 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 app deactivate org.opencord.kafka |
| 190 | |
| 191 | #Setting link discovery |
| 192 | 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} |
| 193 | |
| 194 | #Setting LOG level to ${logLevel} |
| 195 | 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] | 196 | 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] | 197 | |
Matteo Scandolo | 3136cca | 2020-05-15 14:14:27 -0700 | [diff] [blame] | 198 | # Set Flows/Ports/Meters poll frequency |
| 199 | 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} |
| 200 | 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} |
| 201 | |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 202 | if [ ${withEapol} = false ] || [ ${withFlows} = false ]; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 203 | 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] | 204 | fi |
| 205 | |
| 206 | if [ ${withDhcp} = false ] || [ ${withFlows} = false ]; then |
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.dhcpl2relay |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 208 | fi |
| 209 | |
| 210 | if [ ${withIgmp} = false ] || [ ${withFlows} = false ]; then |
| 211 | # FIXME will actually affected the tests only after VOL-3054 is addressed |
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.igmpproxy |
| 213 | 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] | 214 | fi |
| 215 | |
| 216 | if [ ${withFlows} = false ]; then |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 217 | 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] | 218 | fi |
| 219 | |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 220 | if [ ${withMibTemplate} = true ] ; then |
| 221 | rm -f BBSM-12345123451234512345-00000000000001-v1.json |
| 222 | wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter/master/templates/BBSM-12345123451234512345-00000000000001-v1.json |
| 223 | 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 |
| 224 | fi |
Matteo Scandolo | 679ced2 | 2020-05-19 15:15:58 -0700 | [diff] [blame] | 225 | |
Matteo Scandolo | 7332d63 | 2020-05-28 15:04:44 -0700 | [diff] [blame] | 226 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 log:set DEBUG org.opencord.olt |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 227 | ''' |
| 228 | } |
| 229 | } |
| 230 | stage('Run Test') { |
| 231 | steps { |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 232 | sh ''' |
| 233 | mkdir -p $WORKSPACE/RobotLogs |
| 234 | cd $WORKSPACE/voltha-system-tests |
| 235 | make vst_venv |
| 236 | ''' |
| 237 | sh ''' |
| 238 | if [ ${withProfiling} = true ] ; then |
| 239 | mkdir -p $WORKSPACE/logs/pprof |
| 240 | echo $PATH |
| 241 | #Creating Python script for ONU Detection |
| 242 | cat << EOF > $WORKSPACE/pprof.sh |
Matteo Scandolo | 3ddd3fb | 2020-05-12 14:31:14 -0700 | [diff] [blame] | 243 | timestamp() { |
| 244 | date +"%T" |
| 245 | } |
| 246 | |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 247 | i=0 |
| 248 | while [[ true ]]; do |
| 249 | ((i++)) |
Matteo Scandolo | 3ddd3fb | 2020-05-12 14:31:14 -0700 | [diff] [blame] | 250 | ts=$(timestamp) |
Matteo Scandolo | 41cbc54 | 2020-05-12 13:59:12 -0700 | [diff] [blame] | 251 | go tool pprof -png http://127.0.0.1:6060/debug/pprof/heap > $WORKSPACE/logs/pprof/rw-core-heap-\\$i-\\$ts.png |
| 252 | go tool pprof -png http://127.0.0.1:6060/debug/pprof/goroutine > $WORKSPACE/logs/pprof/rw-core-goroutine-\\$i-\\$ts.png |
| 253 | curl -o $WORKSPACE/logs/pprof/rw-core-profile-\\$i-\\$ts.pprof http://127.0.0.1:6060/debug/pprof/profile?seconds=10 |
| 254 | 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] | 255 | |
Matteo Scandolo | 41cbc54 | 2020-05-12 13:59:12 -0700 | [diff] [blame] | 256 | go tool pprof -png http://127.0.0.1:6061/debug/pprof/heap > $WORKSPACE/logs/pprof/openolt-heap-\\$i-\\$ts.png |
| 257 | go tool pprof -png http://127.0.0.1:6061/debug/pprof/goroutine > $WORKSPACE/logs/pprof/openolt-goroutine-\\$i-\\$ts.png |
| 258 | curl -o $WORKSPACE/logs/pprof/openolt-profile-\\$i-\\$ts.pprof http://127.0.0.1:6061/debug/pprof/profile?seconds=10 |
| 259 | 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] | 260 | |
Matteo Scandolo | 731d12c | 2020-05-13 14:33:26 -0700 | [diff] [blame] | 261 | go tool pprof -png http://127.0.0.1:6062/debug/pprof/heap > $WORKSPACE/logs/pprof/ofagent-heap-\\$i-\\$ts.png |
| 262 | go tool pprof -png http://127.0.0.1:6062/debug/pprof/goroutine > $WORKSPACE/logs/pprof/ofagent-goroutine-\\$i-\\$ts.png |
| 263 | curl -o $WORKSPACE/logs/pprof/ofagent-profile-\\$i-\\$ts.pprof http://127.0.0.1:6062/debug/pprof/profile?seconds=10 |
| 264 | go tool pprof -png $WORKSPACE/logs/pprof/ofagent-profile-\\$i-\\$ts.pprof > $WORKSPACE/logs/pprof/ofagent-profile-\\$i-\\$ts.png |
| 265 | |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 266 | sleep 10 |
| 267 | done |
| 268 | EOF |
| 269 | |
| 270 | _TAG="pprof" |
| 271 | _TAG=$_TAG bash $WORKSPACE/pprof.sh & |
| 272 | fi |
| 273 | ''' |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 274 | timeout(time: 11, unit: 'MINUTES') { |
| 275 | sh ''' |
| 276 | ROBOT_PARAMS="-v olt:${olts} \ |
| 277 | -v pon:${pons} \ |
| 278 | -v onu:${onus} \ |
| 279 | -v workflow:${workflow} \ |
| 280 | -v withEapol:${withEapol} \ |
| 281 | -v withDhcp:${withDhcp} \ |
| 282 | -v withIgmp:${withIgmp} \ |
| 283 | --noncritical non-critical \ |
| 284 | -e teardown " |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 285 | |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 286 | if [ ${withEapol} = false ] ; then |
| 287 | ROBOT_PARAMS+="-e authentication " |
| 288 | fi |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 289 | |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 290 | if [ ${withDhcp} = false ] ; then |
| 291 | ROBOT_PARAMS+="-e dhcp " |
| 292 | fi |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 293 | |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 294 | if [ ${provisionSubscribers} = false ] ; then |
Matteo Scandolo | cd59fd0 | 2020-05-12 15:00:35 -0700 | [diff] [blame] | 295 | # 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] | 296 | ROBOT_PARAMS+="-e authentication -e provision -e flow-after -e dhcp " |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 297 | fi |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 298 | |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 299 | if [ ${withFlows} = false ] ; then |
| 300 | ROBOT_PARAMS+="-i setup -i activation " |
| 301 | fi |
Matteo Scandolo | 0430f67 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 302 | |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 303 | cd $WORKSPACE/voltha-system-tests |
Matteo Scandolo | 9b0728b | 2020-05-11 08:25:57 -0700 | [diff] [blame] | 304 | source ./vst_venv/bin/activate |
| 305 | robot -d $WORKSPACE/RobotLogs \ |
| 306 | $ROBOT_PARAMS tests/scale/Voltha_Scale_Tests.robot |
| 307 | ''' |
| 308 | } |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 309 | } |
| 310 | } |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 311 | } |
| 312 | post { |
| 313 | always { |
Matteo Scandolo | 157f66c | 2020-05-12 09:26:19 -0700 | [diff] [blame] | 314 | // collect result, done in the "post" step so it's executed even in the |
| 315 | // event of a timeout in the tests |
| 316 | sh ''' |
| 317 | cd voltha-system-tests |
| 318 | source ./vst_venv/bin/activate |
| 319 | python tests/scale/collect-result.py -r $WORKSPACE/RobotLogs/output.xml -p $WORKSPACE/plots > $WORKSPACE/execution-time.txt |
| 320 | cat $WORKSPACE/execution-time.txt |
| 321 | ''' |
Matteo Scandolo | a731f8f | 2020-05-11 10:27:26 -0700 | [diff] [blame] | 322 | sh ''' |
| 323 | if [ ${withProfiling} = true ] ; then |
| 324 | _TAG="pprof" |
| 325 | P_IDS="$(ps e -ww -A | grep "_TAG=$_TAG" | grep -v grep | awk '{print $1}')" |
| 326 | if [ -n "$P_IDS" ]; then |
| 327 | echo $P_IDS |
| 328 | for P_ID in $P_IDS; do |
| 329 | kill -9 $P_ID |
| 330 | done |
| 331 | fi |
| 332 | fi |
| 333 | ''' |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 334 | plot([ |
| 335 | csvFileName: 'scale-test.csv', |
| 336 | csvSeries: [ |
Matteo Scandolo | 272aed4 | 2020-05-08 15:05:57 -0700 | [diff] [blame] | 337 | [file: 'plots/plot-voltha-onus.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 338 | [file: 'plots/plot-onos-ports.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 339 | [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] | 340 | [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] | 341 | [file: 'plots/plot-onos-flows-before.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 342 | [file: 'plots/plot-onos-auth.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 343 | [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] | 344 | [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] | 345 | [file: 'plots/plot-onos-flows-after.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
| 346 | [file: 'plots/plot-onos-dhcp.txt', displayTableFlag: false, exclusionValues: '', inclusionFlag: 'OFF', url: ''], |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 347 | ], |
| 348 | group: 'Voltha-Scale-Numbers', numBuilds: '20', style: 'line', title: "Scale Test (OLTs: ${olts}, PONs: ${pons}, ONUs: ${onus})", yaxis: 'Time (s)', useDescr: true |
| 349 | ]) |
| 350 | step([$class: 'RobotPublisher', |
| 351 | disableArchiveOutput: false, |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 352 | logFileName: 'RobotLogs/log.html', |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 353 | otherFiles: '', |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 354 | outputFileName: 'RobotLogs/output.xml', |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 355 | outputPath: '.', |
| 356 | passThreshold: 100, |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 357 | reportFileName: 'RobotLogs/report.html', |
Matteo Scandolo | fbcbdb8 | 2020-05-06 15:41:32 -0700 | [diff] [blame] | 358 | unstableThreshold: 0]); |
Matteo Scandolo | 502644b | 2020-05-18 08:56:18 -0700 | [diff] [blame] | 359 | // get all the logs from kubernetes PODs |
Matteo Scandolo | ede5abd | 2020-05-22 10:57:10 -0700 | [diff] [blame] | 360 | sh returnStdout: false, script: ''' |
| 361 | LOG_FOLDER=$WORKSPACE/logs |
| 362 | mkdir -p $LOG_FOLDER |
| 363 | |
| 364 | # store information on the running pods |
| 365 | kubectl get pods -o wide > $LOG_FOLDER/pods.txt |
| 366 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-images.txt |
| 367 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq | tee $LOG_FOLDER/pod-imagesId.txt |
| 368 | |
| 369 | # log in individual files for all the container that match the selector app=$APP_TO_LOG |
Matteo Scandolo | 32da27d | 2020-05-29 10:38:31 -0700 | [diff] [blame] | 370 | APPS_TO_LOG=(etcd kafka onos adapter-open-onu adapter-open-olt rw-core ofagent bbsim) |
Matteo Scandolo | ede5abd | 2020-05-22 10:57:10 -0700 | [diff] [blame] | 371 | for app in "${APPS_TO_LOG[@]}" |
| 372 | do |
| 373 | echo "Getting logs for: ${app}" |
| 374 | kubectl get pods -l app=${app} -o=jsonpath=\"{.items[*]['metadata.name']}\" |
Andrea Campanella | 743f52e | 2020-05-27 10:07:33 +0200 | [diff] [blame] | 375 | 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 | 32da27d | 2020-05-29 10:38:31 -0700 | [diff] [blame] | 376 | |
| 377 | # Get the logs from the previous POD if any (useful in case of restarts) |
Matteo Scandolo | f4de496 | 2020-05-29 13:34:20 -0700 | [diff] [blame] | 378 | printf '%s\n' $(kubectl get pods -l app=$app -o=jsonpath="{.items[*]['metadata.name']}") | xargs -I@ bash -c "kubectl logs -p @ > $LOG_FOLDER/@-previous.log" || true |
Matteo Scandolo | ede5abd | 2020-05-22 10:57:10 -0700 | [diff] [blame] | 379 | done |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 380 | |
Matteo Scandolo | 32da27d | 2020-05-29 10:38:31 -0700 | [diff] [blame] | 381 | # copy the ONOS logs directly from the container to avoid the color codes |
| 382 | printf '%s\n' $(kubectl get pods -l app=onos-onos-classic -o=jsonpath="{.items[*]['metadata.name']}") | xargs -I@ bash -c "kubectl cp @:apache-karaf-4.2.8/data/log/karaf.log $LOG_FOLDER/@.log" |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 383 | ''' |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 384 | // dump all the BBSim(s) ONU informations |
| 385 | sh ''' |
| 386 | BBSIM_IDS=$(kubectl get pods | grep bbsim | grep -v server | awk '{print $1}') |
| 387 | IDS=($BBSIM_IDS) |
| 388 | |
| 389 | for bbsim in "${IDS[@]}" |
| 390 | do |
| 391 | kubectl exec -t $bbsim bbsimctl onu list > $WORKSPACE/logs/$bbsim-device-list.txt |
| 392 | done |
| 393 | ''' |
Matteo Scandolo | 32da27d | 2020-05-29 10:38:31 -0700 | [diff] [blame] | 394 | // get ONOS debug infos |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 395 | sh ''' |
| 396 | 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 |
Matteo Scandolo | 32da27d | 2020-05-29 10:38:31 -0700 | [diff] [blame] | 397 | |
| 398 | if [ ${withFlows} = true ] ; then |
| 399 | 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 |
| 400 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 meters > $WORKSPACE/logs/onos-meters-list.txt |
| 401 | fi |
| 402 | |
Matteo Scandolo | 0bf7e9e | 2020-05-29 18:17:50 -0700 | [diff] [blame] | 403 | if [ ${provisionSubscribers} = true ]; then |
Matteo Scandolo | 32da27d | 2020-05-29 10:38:31 -0700 | [diff] [blame] | 404 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-programmed-subscribers > $WORKSPACE/logs/onos-programmed-subscribers.txt |
| 405 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 karaf@127.0.0.1 volt-programmed-meters > $WORKSPACE/logs/onos-programmed-meters.txt |
| 406 | fi |
| 407 | |
| 408 | if [ ${withOnosApps} = true ] && [ ${withEapol} ] ; then |
| 409 | 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 |
| 410 | fi |
| 411 | |
| 412 | if [ ${withOnosApps} = true ] && [ ${withDhcp} ] ; then |
| 413 | 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 |
| 414 | fi |
Matteo Scandolo | b70b3e0 | 2020-05-07 11:50:26 -0700 | [diff] [blame] | 415 | ''' |
Shrey Baid | cf652c8 | 2020-05-21 13:35:04 +0530 | [diff] [blame] | 416 | // get cpu usage by container |
| 417 | sh ''' |
| 418 | 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 |
| 419 | ''' |
| 420 | // collect etcd metrics |
| 421 | sh ''' |
| 422 | mkdir $WORKSPACE/etcd-metrics |
| 423 | 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 |
| 424 | 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 |
| 425 | 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 |
| 426 | ''' |
Matteo Scandolo | 32da27d | 2020-05-29 10:38:31 -0700 | [diff] [blame] | 427 | // get VOLTHA debug infos |
Matteo Scandolo | 502644b | 2020-05-18 08:56:18 -0700 | [diff] [blame] | 428 | script { |
| 429 | try { |
| 430 | sh ''' |
| 431 | voltctl device list -o json > $WORKSPACE/logs/device-list.json |
| 432 | python -m json.tool $WORKSPACE/logs/device-list.json > $WORKSPACE/logs/voltha-devices-list.json |
Matteo Scandolo | 32da27d | 2020-05-29 10:38:31 -0700 | [diff] [blame] | 433 | |
| 434 | printf '%s\n' $(voltctl device list | grep olt | awk '{print $1}') | xargs -I@ bash -c "voltctl device flows @ > $WORKSPACE/logs/voltha-device-flows-@.txt" |
| 435 | printf '%s\n' $(voltctl device list | grep olt | awk '{print $1}') | xargs -I@ bash -c "voltctl device port list --format 'table{{.PortNo}}\t{{.Label}}\t{{.Type}}\t{{.AdminState}}\t{{.OperStatus}}' @ > $WORKSPACE/logs/voltha-device-ports-@.txt" |
| 436 | |
| 437 | printf '%s\n' $(voltctl logicaldevice list -q) | xargs -I@ bash -c "voltctl logicaldevice flows @ > $WORKSPACE/logs/voltha-logicaldevice-flows-@.txt" |
| 438 | printf '%s\n' $(voltctl logicaldevice list -q) | xargs -I@ bash -c "voltctl logicaldevice port list @ > $WORKSPACE/logs/voltha-logicaldevice-ports-@.txt" |
Matteo Scandolo | 502644b | 2020-05-18 08:56:18 -0700 | [diff] [blame] | 439 | ''' |
| 440 | } catch(e) { |
| 441 | sh ''' |
| 442 | echo "Can't get device list from voltclt" |
| 443 | ''' |
| 444 | } |
| 445 | } |
Matteo Scandolo | 0dc72af | 2020-05-12 10:14:57 -0700 | [diff] [blame] | 446 | 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] | 447 | } |
| 448 | } |
| 449 | } |