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 { |
Matteo Scandolo | 7b3fde9 | 2020-02-26 16:17:16 -0800 | [diff] [blame] | 28 | currentBuild.description = "${onuPerPon} ONU x ${ponPorts} PON - BBSIM Delay ${BBSIMdelay}" |
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 ''' |
Matteo Scandolo | 151e35c | 2020-02-28 15:45:15 -0800 | [diff] [blame] | 35 | for hchart in \$(helm list -q | grep -E -v 'docker-registry|cord-kafka|etcd-operator'); |
| 36 | do |
| 37 | echo "Purging chart: \${hchart}" |
| 38 | helm delete --purge "\${hchart}" |
| 39 | done |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 40 | bash /home/cord/voltha-scale/wait_for_pods.sh |
| 41 | bash /home/cord/voltha-scale/stop_port_forward.sh |
| 42 | ''' |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 43 | } |
| 44 | } |
| 45 | stage('start') { |
| 46 | steps { |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 47 | sh ''' |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 48 | #!/usr/bin/env bash |
| 49 | set -euo pipefail |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 50 | ''' |
| 51 | } |
| 52 | } |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 53 | stage('deploy-voltha') { |
| 54 | steps { |
| 55 | sh ''' |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 56 | helm install -n onos onf/onos --set images.onos.repository=voltha/voltha-onos --set images.onos.tag=4.0.1 |
| 57 | helm install -n voltha onf/voltha -f /home/cord/voltha-scale/voltha-values.yaml |
| 58 | helm install -n openolt onf/voltha-adapter-openolt -f /home/cord/voltha-scale/voltha-values.yaml |
| 59 | helm install -n openonu onf/voltha-adapter-openonu -f /home/cord/voltha-scale/voltha-values.yaml |
| 60 | |
| 61 | helm install -n bbsim onf/bbsim --set pon=${ponPorts},onu=${onuPerPon},auth=${bbsimAuth},dhcp=${bbsimDhcp},delay=${BBSIMdelay} |
| 62 | helm install -n radius onf/freeradius |
| 63 | |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 64 | if [ ! -z ${bbsimImg} ]; |
| 65 | then |
| 66 | IFS=: read -r bbsimRepo bbsimTag <<< ${bbsimImg} |
| 67 | EXTRA_HELM_FLAGS+=",images.bbsim.repository=${bbsimRepo},images.bbsim.tag=${bbsimTag}" |
| 68 | fi |
| 69 | if [ ! -z ${volthaImg} ]; |
| 70 | then |
| 71 | IFS=: read -r volthaRepo volthaTag <<< ${volthaImg} |
| 72 | EXTRA_HELM_FLAGS+=",images.voltha.repository=${volthaRepo},images.voltha.tag=${volthaTag}" |
| 73 | fi |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 74 | bash /home/cord/voltha-scale/wait_for_pods.sh |
| 75 | bash /home/cord/voltha-scale/start_port_forward.sh |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 76 | ''' |
| 77 | } |
| 78 | } |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 79 | stage('MIB-template') { |
| 80 | steps { |
| 81 | sh ''' |
| 82 | if [ ${withMibTemplate} = true ] ; then |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 83 | rm -f BBSM-12345123451234512345-00000000000001-v1.json |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 84 | 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] | 85 | 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] | 86 | fi |
| 87 | ''' |
Shrey Baid | 0d4e31d | 2020-02-11 13:28:47 -0800 | [diff] [blame] | 88 | } |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 89 | } |
| 90 | stage('disable-ONOS-apps') { |
| 91 | steps { |
| 92 | sh ''' |
| 93 | #Check withOnosApps and disable apps accordingly |
| 94 | if [ ${withOnosApps} = false ] ; then |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 95 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost app deactivate org.opencord.olt |
| 96 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost app deactivate org.opencord.aaa |
| 97 | 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] | 98 | fi |
| 99 | ''' |
Shrey Baid | 0d4e31d | 2020-02-11 13:28:47 -0800 | [diff] [blame] | 100 | } |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 101 | } |
| 102 | stage('configuration') { |
| 103 | steps { |
| 104 | sh ''' |
| 105 | #Setting LOG level to WARN |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 106 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost log:set WARN |
| 107 | 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] | 108 | #Setting link discovery |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 109 | 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] | 110 | #Setting the flow stats collection interval |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 111 | 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] | 112 | #Setting the ports stats collection interval |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 113 | 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] | 114 | # extending voltctl timeout |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 115 | sed -i 's/timeout: 10s/timeout: 5m/g' /home/cord/.volt/config |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 116 | ''' |
| 117 | } |
| 118 | } |
| 119 | stage('execute') { |
| 120 | options { |
| 121 | timeout(time:10) |
| 122 | } |
| 123 | stages { |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 124 | stage('ONUs-enabled') { |
| 125 | steps { |
| 126 | sh ''' |
| 127 | if [ -z ${expectedOnus} ] |
| 128 | then |
| 129 | echo -e "You need to set the target ONU number\n" |
| 130 | exit 1 |
| 131 | fi |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 132 | |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 133 | voltctl device create -t openolt -H bbsim:50060 |
| 134 | voltctl device enable $(voltctl device list --filter Type~openolt -q) |
| 135 | # check ONUs reached Active State in VOLTHA |
| 136 | i=$(voltctl device list | grep -v OLT | grep ACTIVE | wc -l) |
| 137 | until [ $i -eq ${expectedOnus} ] |
| 138 | do |
| 139 | echo "$i ONUs ACTIVE of ${expectedOnus} expected (time: $SECONDS)" |
| 140 | sleep ${pollInterval} |
| 141 | i=$(voltctl device list | grep -v OLT | grep ACTIVE | wc -l) |
| 142 | done |
| 143 | echo "${expectedOnus} ONUs Activated in $SECONDS seconds (time: $SECONDS)" |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 144 | echo $SECONDS > activation-time.txt |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 145 | ''' |
| 146 | } |
| 147 | } |
| 148 | stage('ONOS-ports') { |
| 149 | steps { |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 150 | sh ''' |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 151 | # Check ports showed up in ONOS |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 152 | 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] | 153 | until [ $z -eq ${expectedOnus} ] |
| 154 | do |
| 155 | echo "${z} enabled ports of ${expectedOnus} expected (time: $SECONDS)" |
| 156 | sleep ${pollInterval} |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 157 | 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] | 158 | done |
| 159 | echo "${expectedOnus} ports enabled in $SECONDS seconds (time: $SECONDS)" |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 160 | echo $SECONDS > port-recognition.txt |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 161 | echo "ONOS-Duration(s)" > total-time.txt |
| 162 | echo "VOLTHA-Duration(s)" > onu-activation.txt |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 163 | cat activation-time.txt >> onu-activation.txt |
| 164 | paste activation-time.txt port-recognition.txt | awk '{print ($1 + $2)}' >> total-time.txt |
Shrey Baid | a3b8aa6 | 2020-02-13 11:22:51 -0800 | [diff] [blame] | 165 | ''' |
| 166 | } |
| 167 | } |
Shrey Baid | b001c71 | 2020-02-11 11:12:46 -0800 | [diff] [blame] | 168 | } |
| 169 | } |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 170 | } |
| 171 | post { |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 172 | always { |
| 173 | plot([ |
| 174 | csvFileName: 'plot-onu-activation.csv', |
Shrey Baid | b044718 | 2020-02-27 16:39:35 -0800 | [diff] [blame] | 175 | csvSeries: [[displayTableFlag: false, exclusionValues: '', file: 'onu-activation.txt', inclusionFlag: 'OFF', url: ''], [displayTableFlag: false, exclusionValues: '', file: 'total-time.txt', inclusionFlag: 'OFF', url: '']], |
| 176 | group: 'Voltha-Scale-Numbers', numBuilds: '100', style: 'line', title: 'Time (200ms Delay)', useDescr: true, yaxis: 'Time (s)' |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 177 | ]) |
Shrey Baid | 18165a3 | 2020-02-27 11:01:13 -0800 | [diff] [blame] | 178 | script { |
| 179 | sh ''' |
| 180 | kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\t'}{.imageID}{'\\n'}" | sort | uniq -c |
Shrey Baid | 704373e | 2020-03-03 14:08:02 -0800 | [diff] [blame] | 181 | voltctl device list -o json > device-list.json |
| 182 | python -m json.tool device-list.json > volt-device-list.json |
| 183 | rm device-list.json |
| 184 | rm port-recognition.txt |
| 185 | rm activation-time.txt |
| 186 | sshpass -e ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 30115 karaf@localhost ports > onos-ports.txt |
Shrey Baid | 18165a3 | 2020-02-27 11:01:13 -0800 | [diff] [blame] | 187 | ''' |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 188 | } |
Shrey Baid | 704373e | 2020-03-03 14:08:02 -0800 | [diff] [blame] | 189 | archiveArtifacts artifacts: '*.log,*.json,*txt' |
Shrey Baid | 18165a3 | 2020-02-27 11:01:13 -0800 | [diff] [blame] | 190 | } |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 191 | success { |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 192 | sh ''' |
Shrey Baid | 00ff5c4 | 2020-02-07 15:14:08 -0800 | [diff] [blame] | 193 | #!/usr/bin/env bash |
Shrey Baid | e7614d0 | 2020-02-25 10:26:42 -0800 | [diff] [blame] | 194 | set +e |
Matteo Scandolo | 51b7630 | 2020-02-05 12:07:23 -0800 | [diff] [blame] | 195 | ''' |
| 196 | } |
| 197 | } |
Matteo Scandolo | 151e35c | 2020-02-28 15:45:15 -0800 | [diff] [blame] | 198 | } |