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