Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 1 | /* voltha-scale-measurements pipeline */ |
| 2 | pipeline { |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 3 | /* no label, executor is determined by JJB */ |
| 4 | agent { |
| 5 | label "${params.buildNode}" |
| 6 | } |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 7 | environment { |
| 8 | KUBECONFIG="$HOME/.kube/kind-config-voltha-minimal" |
| 9 | VOLTCONFIG="$HOME/.volt/config-minimal" |
| 10 | PATH="$WORKSPACE/kind-voltha/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 11 | TYPE="minimal" |
| 12 | FANCY=0 |
Shrey Baid | 7cbb06e | 2020-02-11 17:45:07 -0800 | [diff] [blame] | 13 | SECONDS=0 |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 14 | WITH_SIM_ADAPTERS="n" |
| 15 | WITH_RADIUS="y" |
| 16 | WITH_BBSIM="y" |
Shrey Baid | 7cbb06e | 2020-02-11 17:45:07 -0800 | [diff] [blame] | 17 | VOLTHA_LOG_LEVEL="WARN" |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 18 | CONFIG_SADIS="n" |
| 19 | ROBOT_MISC_ARGS="-d $WORKSPACE/RobotLogs -v teardown_device:False" |
Shrey Baid | b001c71 | 2020-02-11 11:12:46 -0800 | [diff] [blame] | 20 | SSHPASS="karaf" |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 21 | DEPLOY_K8S="n" |
Shrey Baid | 6748658 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 22 | EXTRA_HELM_FLAGS="--set onu=${onuPerPon},pon=${ponPorts},delay=${BBSIMdelay},auth=${bbsimAuth},dhcp=${bbsimDhcp}" |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 23 | } |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 24 | stages { |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 25 | stage('set-description') { |
| 26 | steps { |
| 27 | script { |
Shrey Baid | 943e207 | 2020-03-04 10:31:32 -0800 | [diff] [blame] | 28 | currentBuild.description = "$BUILD_TIMESTAMP" |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 29 | } |
| 30 | } |
| 31 | } |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 32 | stage('cleanup') { |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 33 | steps { |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 34 | sh ''' |
Shrey Baid | 49bf8f6 | 2020-03-09 17:52:01 -0700 | [diff] [blame] | 35 | rm -rf voltha-devices-count.txt voltha-devices-time.txt onos-ports-count.txt onos-ports-time.txt onos-ports-list.txt voltha-devices-list.json onos-ports-time-num.txt voltha-devices-time-num.txt |
Matteo Scandolo | 151e35c | 2020-02-28 15:45:15 -0800 | [diff] [blame] | 36 | for hchart in \$(helm list -q | grep -E -v 'docker-registry|cord-kafka|etcd-operator'); |
| 37 | do |
| 38 | echo "Purging chart: \${hchart}" |
| 39 | helm delete --purge "\${hchart}" |
| 40 | done |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 41 | bash /home/cord/voltha-scale/wait_for_pods.sh |
| 42 | bash /home/cord/voltha-scale/stop_port_forward.sh |
| 43 | ''' |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 44 | } |
| 45 | } |
| 46 | stage('start') { |
| 47 | steps { |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 48 | sh ''' |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 49 | #!/usr/bin/env bash |
| 50 | set -euo pipefail |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 51 | ''' |
| 52 | } |
| 53 | } |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 54 | stage('deploy-voltha') { |
Matteo Scandolo | 2fc1dac | 2020-03-09 08:39:53 -0700 | [diff] [blame] | 55 | options { |
| 56 | timeout(time:10) |
| 57 | } |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 58 | steps { |
| 59 | sh ''' |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 60 | helm install -n onos onf/onos --set images.onos.repository=voltha/voltha-onos --set images.onos.tag=4.0.1 |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 61 | |
Matteo Scandolo | a2928e7 | 2020-03-02 16:38:22 -0800 | [diff] [blame] | 62 | IFS=: read -r volthaRepo volthaTag <<< ${volthaImg} |
| 63 | helm install -n voltha onf/voltha -f /home/cord/voltha-scale/voltha-values.yaml --set images.voltha.repository=${volthaRepo},images.voltha.tag=${volthaTag} |
| 64 | |
| 65 | IFS=: read -r openoltAdapterRepo openoltAdapterTag <<< ${openoltAdapterImg} |
| 66 | helm install -n openolt onf/voltha-adapter-openolt -f /home/cord/voltha-scale/voltha-values.yaml --set images.adapter_open_olt.repository=${openoltAdapterRepo},images.adapter_open_olt.tag=${openoltAdapterTag} |
| 67 | |
| 68 | IFS=: read -r openonuAdapterRepo openonuAdapterTag <<< ${openonuAdapterImg} |
| 69 | helm install -n openonu onf/voltha-adapter-openonu -f /home/cord/voltha-scale/voltha-values.yaml --set images.adapter_open_olt.repository=${openonuAdapterRepo},images.adapter_open_olt.tag=${openonuAdapterTag} |
| 70 | |
| 71 | IFS=: read -r bbsimRepo bbsimTag <<< ${bbsimImg} |
| 72 | helm install -n bbsim onf/bbsim --set pon=${ponPorts},onu=${onuPerPon},auth=${bbsimAuth},dhcp=${bbsimDhcp},delay=${BBSIMdelay},images.bbsim.repository=${bbsimRepo},images.bbsim.tag=${bbsimTag} |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 73 | helm install -n radius onf/freeradius |
| 74 | |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 75 | if [ ! -z ${bbsimImg} ]; |
| 76 | then |
| 77 | IFS=: read -r bbsimRepo bbsimTag <<< ${bbsimImg} |
| 78 | EXTRA_HELM_FLAGS+=",images.bbsim.repository=${bbsimRepo},images.bbsim.tag=${bbsimTag}" |
| 79 | fi |
| 80 | if [ ! -z ${volthaImg} ]; |
| 81 | then |
| 82 | IFS=: read -r volthaRepo volthaTag <<< ${volthaImg} |
| 83 | EXTRA_HELM_FLAGS+=",images.voltha.repository=${volthaRepo},images.voltha.tag=${volthaTag}" |
| 84 | fi |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 85 | bash /home/cord/voltha-scale/wait_for_pods.sh |
| 86 | bash /home/cord/voltha-scale/start_port_forward.sh |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 87 | ''' |
| 88 | } |
| 89 | } |
Matteo Scandolo | a711ddf | 2020-03-06 16:41:34 -0800 | [diff] [blame] | 90 | stage('wait for adapters to be registered') { |
Matteo Scandolo | 2fc1dac | 2020-03-09 08:39:53 -0700 | [diff] [blame] | 91 | options { |
| 92 | timeout(time:5) |
| 93 | } |
Matteo Scandolo | a711ddf | 2020-03-06 16:41:34 -0800 | [diff] [blame] | 94 | steps{ |
| 95 | waitUntil { |
| 96 | script { |
| 97 | openolt_res = sh returnStdout: true, script: """ |
| 98 | voltctl adapter list | grep openolt | wc -l |
| 99 | """ |
| 100 | |
| 101 | openonu_res = sh returnStdout: true, script: """ |
| 102 | voltctl adapter list | grep brcm_openomci_onu | wc -l |
| 103 | """ |
| 104 | |
| 105 | return openolt_res.toInteger() == 1 && openonu_res.toInteger() == 1 |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | } |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 110 | stage('MIB-template') { |
| 111 | steps { |
| 112 | sh ''' |
| 113 | if [ ${withMibTemplate} = true ] ; then |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 114 | rm -f BBSM-12345123451234512345-00000000000001-v1.json |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 115 | wget https://raw.githubusercontent.com/opencord/voltha-openonu-adapter/master/templates/BBSM-12345123451234512345-00000000000001-v1.json |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 116 | 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 |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 117 | fi |
| 118 | ''' |
Shrey Baid | 0d4e31d | 2020-02-11 13:28:47 -0800 | [diff] [blame] | 119 | } |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 120 | } |
| 121 | stage('disable-ONOS-apps') { |
| 122 | steps { |
| 123 | sh ''' |
| 124 | #Check withOnosApps and disable apps accordingly |
| 125 | if [ ${withOnosApps} = false ] ; then |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 126 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost app deactivate org.opencord.olt |
| 127 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost app deactivate org.opencord.aaa |
| 128 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost app deactivate org.opencord.dhcpl2relay |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 129 | fi |
| 130 | ''' |
Shrey Baid | 0d4e31d | 2020-02-11 13:28:47 -0800 | [diff] [blame] | 131 | } |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 132 | } |
| 133 | stage('configuration') { |
| 134 | steps { |
| 135 | sh ''' |
| 136 | #Setting LOG level to WARN |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 137 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost log:set WARN |
| 138 | kubectl exec $(kubectl get pods | grep bbsim | awk 'NR==1{print $1}') bbsimctl log warn false |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 139 | #Setting link discovery |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 140 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost cfg set org.onosproject.provider.lldp.impl.LldpLinkProvider enabled ${setLinkDiscovery} |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 141 | #Setting the flow stats collection interval |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 142 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost cfg set org.onosproject.provider.of.flow.impl.OpenFlowRuleProvider flowPollFrequency ${flowStatInterval} |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 143 | #Setting the ports stats collection interval |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 144 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost cfg set org.onosproject.provider.of.device.impl.OpenFlowDeviceProvider portStatsPollFrequency ${portsStatInterval} |
Matteo Scandolo | 7b3fde9 | 2020-02-26 16:17:16 -0800 | [diff] [blame] | 145 | # extending voltctl timeout |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 146 | sed -i 's/timeout: 10s/timeout: 5m/g' /home/cord/.volt/config |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 147 | ''' |
| 148 | } |
| 149 | } |
| 150 | stage('execute') { |
| 151 | options { |
| 152 | timeout(time:10) |
| 153 | } |
| 154 | stages { |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 155 | stage('ONUs-enabled') { |
| 156 | steps { |
| 157 | sh ''' |
| 158 | if [ -z ${expectedOnus} ] |
| 159 | then |
| 160 | echo -e "You need to set the target ONU number\n" |
| 161 | exit 1 |
| 162 | fi |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 163 | |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 164 | voltctl device create -t openolt -H bbsim:50060 |
| 165 | voltctl device enable $(voltctl device list --filter Type~openolt -q) |
| 166 | # check ONUs reached Active State in VOLTHA |
| 167 | i=$(voltctl device list | grep -v OLT | grep ACTIVE | wc -l) |
| 168 | until [ $i -eq ${expectedOnus} ] |
| 169 | do |
| 170 | echo "$i ONUs ACTIVE of ${expectedOnus} expected (time: $SECONDS)" |
| 171 | sleep ${pollInterval} |
| 172 | i=$(voltctl device list | grep -v OLT | grep ACTIVE | wc -l) |
| 173 | done |
| 174 | echo "${expectedOnus} ONUs Activated in $SECONDS seconds (time: $SECONDS)" |
Shrey Baid | 49bf8f6 | 2020-03-09 17:52:01 -0700 | [diff] [blame] | 175 | echo $SECONDS > voltha-devices-time-num.txt |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 176 | ''' |
| 177 | } |
| 178 | } |
| 179 | stage('ONOS-ports') { |
| 180 | steps { |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 181 | sh ''' |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 182 | # Check ports showed up in ONOS |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 183 | z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost ports -e | grep BBSM | wc -l) |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 184 | until [ $z -eq ${expectedOnus} ] |
| 185 | do |
| 186 | echo "${z} enabled ports of ${expectedOnus} expected (time: $SECONDS)" |
| 187 | sleep ${pollInterval} |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 188 | z=$(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost ports -e | grep BBSM | wc -l) |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 189 | done |
| 190 | echo "${expectedOnus} ports enabled in $SECONDS seconds (time: $SECONDS)" |
Shrey Baid | 49bf8f6 | 2020-03-09 17:52:01 -0700 | [diff] [blame] | 191 | echo $SECONDS > temp.txt |
| 192 | paste voltha-devices-time-num.txt temp.txt | awk '{print ($1 + $2)}' > onos-ports-time-num.txt |
| 193 | echo "ONOS-Duration(s)" > onos-ports-time.txt |
| 194 | echo "VOLTHA-Duration(s)" > voltha-devices-time.txt |
| 195 | cat voltha-devices-time-num.txt >> voltha-devices-time.txt |
| 196 | cat onos-ports-time-num.txt >> onos-ports-time.txt |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 197 | ''' |
| 198 | } |
| 199 | } |
Shrey Baid | b001c71 | 2020-02-11 11:12:46 -0800 | [diff] [blame] | 200 | } |
| 201 | } |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 202 | } |
| 203 | post { |
Shrey Baid | 4da57a6 | 2020-03-05 15:49:50 -0800 | [diff] [blame] | 204 | success { |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 205 | plot([ |
| 206 | csvFileName: 'plot-onu-activation.csv', |
Shrey Baid | 49bf8f6 | 2020-03-09 17:52:01 -0700 | [diff] [blame] | 207 | csvSeries: [[displayTableFlag: false, exclusionValues: '', file: 'voltha-devices-time.txt', inclusionFlag: 'OFF', url: ''], [displayTableFlag: false, exclusionValues: '', file: 'onos-ports-time.txt', inclusionFlag: 'OFF', url: '']], |
Shrey Baid | 943e207 | 2020-03-04 10:31:32 -0800 | [diff] [blame] | 208 | group: 'Voltha-Scale-Numbers', numBuilds: '100', style: 'line', title: "Time (${BBSIMdelay}s Delay)", yaxis: 'Time (s)', useDescr: true |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 209 | ]) |
Shrey Baid | 4da57a6 | 2020-03-05 15:49:50 -0800 | [diff] [blame] | 210 | } |
| 211 | always { |
| 212 | sh ''' |
| 213 | echo $(voltctl device list | grep -v OLT | grep ACTIVE | wc -l) > onus.txt |
Shrey Baid | 49bf8f6 | 2020-03-09 17:52:01 -0700 | [diff] [blame] | 214 | echo "#-of-ONUs" > voltha-devices-count.txt |
| 215 | cat onus.txt >> voltha-devices-count.txt |
Shrey Baid | 4da57a6 | 2020-03-05 15:49:50 -0800 | [diff] [blame] | 216 | |
| 217 | echo $(sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost ports -e | grep BBSM | wc -l) > ports.txt |
Shrey Baid | 49bf8f6 | 2020-03-09 17:52:01 -0700 | [diff] [blame] | 218 | echo "#-of-ports" > onos-ports-count.txt |
| 219 | cat ports.txt >> onos-ports-count.txt |
Shrey Baid | 4da57a6 | 2020-03-05 15:49:50 -0800 | [diff] [blame] | 220 | |
| 221 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\t'}{.imageID}{'\\n'}" | sort | uniq -c |
| 222 | voltctl device list -o json > device-list.json |
Shrey Baid | 49bf8f6 | 2020-03-09 17:52:01 -0700 | [diff] [blame] | 223 | python -m json.tool device-list.json > voltha-devices-list.json |
| 224 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost ports > onos-ports-list.txt |
| 225 | |
| 226 | rm -rf BBSM-12345123451234512345-00000000000001-v1.json device-list.json onus.txt ports.txt temp.txt |
Shrey Baid | 4da57a6 | 2020-03-05 15:49:50 -0800 | [diff] [blame] | 227 | ''' |
| 228 | plot([ |
| 229 | csvFileName: 'plot-numbers.csv', |
Shrey Baid | 49bf8f6 | 2020-03-09 17:52:01 -0700 | [diff] [blame] | 230 | csvSeries: [[displayTableFlag: false, exclusionValues: '', file: 'voltha-devices-count.txt', inclusionFlag: 'OFF', url: ''], [displayTableFlag: false, exclusionValues: '', file: 'onos-ports-count.txt', inclusionFlag: 'OFF', url: '']], |
Shrey Baid | 4da57a6 | 2020-03-05 15:49:50 -0800 | [diff] [blame] | 231 | group: 'Voltha-Scale-Numbers', numBuilds: '100', style: 'line', title: "Activated ONUs and Recognized Ports", yaxis: 'Number of Ports/ONUs', useDescr: true |
| 232 | ]) |
| 233 | |
| 234 | archiveArtifacts artifacts: '*.log,*.json,*txt' |
| 235 | |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 236 | } |
| 237 | } |
Shrey Baid | fd1b5cf | 2020-03-09 10:11:50 -0700 | [diff] [blame] | 238 | } |