Enable fuel nosdn scenario for master and stable/brahmaputra
[releng.git] / jjb / yardstick / yardstick-ci-jobs.yml
1 ###################################
2 # job configuration for functest
3 ###################################
4 - project:
5     name: yardstick
6
7     project: '{name}'
8
9 #--------------------------------
10 # BRANCH ANCHORS
11 #--------------------------------
12     master: &master
13         stream: master
14         branch: '{stream}'
15         gs-pathname: ''
16     brahmaputra: &brahmaputra
17         stream: brahmaputra
18         branch: 'stable/{stream}'
19         gs-pathname: '{stream}'
20 #--------------------------------
21 # POD, INSTALLER, AND BRANCH MAPPING
22 #--------------------------------
23 #        brahmaputra
24 #--------------------------------
25     pod:
26         - opnfv-jump-2:
27             installer: fuel
28             <<: *brahmaputra
29         - intel-pod5:
30             installer: joid
31             <<: *brahmaputra
32 #--------------------------------
33 #        master
34 #--------------------------------
35         - ericsson-pod1:
36             installer: fuel
37             <<: *master
38         - ericsson-pod2:
39             installer: fuel
40             <<: *master
41         - intel-pod6:
42             installer: joid
43             <<: *master
44         - huawei-us-deploy-bare-1:
45             installer: compass
46             <<: *master
47 #--------------------------------
48     loop:
49         - daily
50
51     jobs:
52         - 'yardstick-{installer}-{pod}-{loop}-{stream}'
53
54 ################################
55 # job templates
56 ################################
57 - job-template:
58     name: 'yardstick-{installer}-{pod}-{loop}-{stream}'
59
60     disabled: false
61
62     wrappers:
63         - build-name:
64             name: '$BUILD_NUMBER - SDN: $SDN_CONTROLLER Feature: $OPNFV_FEATURE'
65
66     parameters:
67         - project-parameter:
68             project: '{project}'
69         - '{pod}-defaults'
70         - '{installer}-defaults'
71         - 'yardstick-params-{pod}'
72         - string:
73             name: YARDSTICK_SUITE_NAME
74             default: opnfv_${{NODE_NAME}}_{loop}.yaml
75             description: 'Path to test suite'
76
77     scm:
78         - git-scm:
79             credentials-id: '{ssh-credentials}'
80             refspec: ''
81             branch: '{branch}'
82
83     builders:
84         - 'yardstick-cleanup'
85         - 'yardstick-fetch-os-creds'
86         - 'yardstick-daily'
87
88     publishers:
89         - email:
90             recipients: ana.cunha@ericsson.com jorgen.w.karlsson@ericsson.com
91
92 ########################
93 # builder macros
94 ########################
95 - builder:
96     name: yardstick-daily
97     builders:
98         - shell: |
99             #!/bin/bash
100             set -o errexit
101
102             echo "Yardstick: Run benchmark test suites ..."
103
104             # Pull the latest image
105             docker pull opnfv/yardstick
106
107             docker run \
108                --privileged=true \
109                 --rm \
110                 -t \
111                 -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
112                 -e "INSTALLER_IP=${INSTALLER_IP}" \
113                 -e "POD_NAME=${NODE_NAME}" \
114                 -e "EXTERNAL_NETWORK=${EXTERNAL_NETWORK}" \
115                 -e "YARDSTICK_BRANCH=${GERRIT_BRANCH}" \
116                 opnfv/yardstick \
117                 run_tests.sh $YARDSTICK_DB_BACKEND \
118                 $YARDSTICK_SUITE_NAME
119
120             echo "Yardstick: done!"
121
122 - builder:
123     name: yardstick-fetch-os-creds
124     builders:
125         - shell:
126             !include-raw ../../utils/fetch_os_creds.sh
127
128 - builder:
129     name: yardstick-cleanup
130     builders:
131         - shell: |
132             #!/bin/bash
133
134             echo "Cleaning up docker containers/images..."
135
136             # Remove previous running containers if exist
137             if [[ ! -z $(docker ps -a | grep opnfv/yardstick) ]]; then
138                 echo "Removing existing opnfv/yardstick containers..."
139                 docker ps | grep opnfv/yardstick | awk '{print $1}' | xargs docker stop
140                 docker ps -a | grep opnfv/yardstick | awk '{print $1}' | xargs docker rm
141             fi
142
143             # Remove existing images if exist
144             if [[ ! -z $(docker images | grep opnfv/yardstick) ]]; then
145                 echo "Docker images to remove:"
146                 docker images | head -1 && docker images | grep opnfv/yardstick
147                 image_tags=($(docker images | grep opnfv/yardstick | awk '{print $2}'))
148                 for tag in "${image_tags[@]}"; do
149                     echo "Removing docker image opnfv/yardstick:$tag..."
150                     docker rmi opnfv/yardstick:$tag
151                 done
152             fi
153 ########################
154 # parameter macros
155 ########################
156 - parameter:
157     name: 'yardstick-params-intel-pod5'
158     parameters:
159         - string:
160             name: YARDSTICK_DB_BACKEND
161             default: ''
162             description: 'Arguments to use in order to choose the backend DB'
163
164 - parameter:
165     name: 'yardstick-params-intel-pod6'
166     parameters:
167         - string:
168             name: YARDSTICK_DB_BACKEND
169             default: ''
170             description: 'Arguments to use in order to choose the backend DB'
171
172 - parameter:
173     name: 'yardstick-params-ericsson-pod1'
174     parameters:
175         - string:
176             name: YARDSTICK_DB_BACKEND
177             default: ''
178             description: 'Arguments to use in order to choose the backend DB'
179
180 - parameter:
181     name: 'yardstick-params-ericsson-pod2'
182     parameters:
183         - string:
184             name: YARDSTICK_DB_BACKEND
185             default: ''
186             description: 'Arguments to use in order to choose the backend DB'
187
188 - parameter:
189     name: 'yardstick-params-opnfv-jump-2'
190     parameters:
191         - string:
192             name: YARDSTICK_DB_BACKEND
193             default: '-r 213.77.62.197'
194             description: 'Arguments to use in order to choose the backend DB'
195
196 - parameter:
197     name: 'yardstick-params-huawei-us-deploy-bare-1'
198     parameters:
199         - string:
200             name: YARDSTICK_DB_BACKEND
201             default: ''
202             description: 'Arguments to use in order to choose the backend DB'