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