blob: d82dabec73b3866b6597a89ba985d8ca12c14606 [file] [log] [blame]
Matteo Scandoloecbd6a12019-10-21 10:51:03 -07001/*
2 * Copyright 2018-present Open Networking Foundation
3
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7
8 * http://www.apache.org/licenses/LICENSE-2.0
9
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 pipeline {
18
19 /* no label, executor is determined by JJB */
20 agent {
Zack Williamsce46e7e2019-10-29 11:27:40 -070021 label "${params.buildNode}"
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070022 }
23
24 stages {
Matteo Scandolo68cd1072019-11-06 10:21:10 -080025 stage('Download BBR') {
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070026 steps {
27 sh """
Matteo Scandolo68cd1072019-11-06 10:21:10 -080028 curl -s https://api.github.com/repos/opencord/bbsim/releases/latest | grep "browser_download_url.*bbr-linux-amd" | cut -d : -f 2,3 | tr -d \\" | wget -qi -
29 mv bbr-linux-amd64 bbr
30 chmod a+x bbr
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070031 """
32 }
33 }
Matteo Scandolo68cd1072019-11-06 10:21:10 -080034 stage('Download BBSim') {
Matteo Scandolod3415f62019-10-25 15:58:18 -070035 steps {
36 sh """
37 docker pull voltha/bbsim:master
38 """
39 }
40 }
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070041 stage('64 ONUs (16 ONU x 4 PONs)') {
42 steps {
43 timeout(1) {
44 sh """
Matteo Scandolo13f412d2019-10-25 13:37:27 -070045 docker rm -f bbsim || true
Matteo Scandolo68cd1072019-11-06 10:21:10 -080046 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=master DOCKER_RUN_ARGS="-auth -dhcp -pon 4 -onu 16" make docker-run
Matteo Scandoloba342de2019-10-22 10:41:33 -070047 sleep 5
Matteo Scandolof5c537e2019-10-28 16:45:57 -070048 ./bbr -pon 4 -onu 16 -logfile bbr_16_4.logs
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070049 docker logs bbsim 2>&1 | tee bbsim_16_4.logs
Matteo Scandolo226dcce2019-11-01 13:20:20 -070050 res=\$(cat bbr_16_4.logs | grep Duration | awk '{print \$5}' ); printf "Runtime\n\${res:9:10}" > bbr_16_4.txt
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070051 """
52 }
53 }
54 }
55 stage('128 ONUs (32 ONU x 4 PONs)') {
56 steps {
57 timeout(1) {
58 sh """
Matteo Scandolo13f412d2019-10-25 13:37:27 -070059 docker rm -f bbsim || true
Matteo Scandolo68cd1072019-11-06 10:21:10 -080060 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=master DOCKER_RUN_ARGS="-auth -dhcp -pon 4 -onu 32" make docker-run
Matteo Scandoloba342de2019-10-22 10:41:33 -070061 sleep 5
Matteo Scandolof5c537e2019-10-28 16:45:57 -070062 ./bbr -pon 4 -onu 32 -logfile bbr_32_4.logs
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070063 docker logs bbsim 2>&1 | tee bbsim_32_4.logs
Matteo Scandolo226dcce2019-11-01 13:20:20 -070064 res=\$(cat bbr_32_4.logs | grep Duration | awk '{print \$5}' ); printf "Runtime\n\${res:9:10}" > bbr_32_4.txt
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070065 """
66 }
67 }
68 }
69 stage('256 ONUs (32 ONU x 8 PONs)') {
70 steps {
71 timeout(1) {
72 sh """
Matteo Scandolo13f412d2019-10-25 13:37:27 -070073 docker rm -f bbsim || true
Matteo Scandolo68cd1072019-11-06 10:21:10 -080074 DOCKER_REPOSITORY=voltha/ DOCKER_TAG=master DOCKER_RUN_ARGS="-auth -dhcp -pon 8 -onu 32" make docker-run
Matteo Scandoloba342de2019-10-22 10:41:33 -070075 sleep 5
Matteo Scandolof5c537e2019-10-28 16:45:57 -070076 ./bbr -pon 8 -onu 32 -logfile bbr_32_8.logs
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070077 docker logs bbsim 2>&1 | tee bbsim_32_8.logs
Matteo Scandolo226dcce2019-11-01 13:20:20 -070078 res=\$(cat bbr_32_8.logs | grep Duration | awk '{print \$5}' ); printf "Runtime\n\${res:9:10}" > bbr_32_8.txt
Matteo Scandoloecbd6a12019-10-21 10:51:03 -070079 """
80 }
81 }
82 }
Matteo Scandolo0dfee532019-10-21 16:20:12 -070083 }
84 post {
85 always {
86 archiveArtifacts artifacts: '*.logs'
87 step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "teo@opennetworking.org", sendToIndividuals: false])
88 }
Matteo Scandolo0208caa2019-10-29 14:31:22 -070089 success {
90 plot([
91 csvFileName: 'plot-bbr_16_4.csv',
92 csvSeries: [[file: 'bbr_16_4.txt']],
93 group: 'BBSim',
94 title: '64 ONUs (16 ONUs x 4 PONs)',
95 style: 'line'
96 ])
97 plot([
98 csvFileName: 'plot-bbr_32_4.csv',
99 csvSeries: [[file: 'bbr_32_4.txt']],
100 group: 'BBSim',
101 title: '128 ONUs (32 ONUs x 4 PONs)',
102 style: 'line'
103 ])
104 plot([
105 csvFileName: 'plot-bbr_32_8.csv',
106 csvSeries: [[file: 'bbr_32_8.txt']],
107 group: 'BBSim',
108 title: '256 ONUs (32 ONUs x 8 PONs)',
109 style: 'line'
110 ])
111 }
Matteo Scandolo0dfee532019-10-21 16:20:12 -0700112 failure {
113 sh '''
114 docker logs bbsim 2>&1 | tee bbsim_failed.logs
115 docker cp bbsim:/app/dhcp.logs dhcp_failed.logs
116 docker cp bbsim:/var/lib/dhcp/dhcpd.leases dhcpd_leases_failed.logs
117 docker cp bbsim:/app/tcpdump.logs tcpdump_failed.logs
118 docker exec bbsim bbsimctl onu list > onu_list.logs
119 '''
Matteo Scandoloecbd6a12019-10-21 10:51:03 -0700120 }
121 }
122}