summaryrefslogtreecommitdiffstats
path: root/jjb/cperf/cperf-ci-jobs.yaml
blob: 59afb89c8393de8e33c0d7b651aaf7af329b5907 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
---
###################################
# job configuration for cperf
###################################
- project:
    name: cperf-ci-jobs
    project: cperf

    # -------------------------------
    # BRANCH ANCHORS
    # -------------------------------
    stream: master
    branch: '{stream}'
    gs-pathname: ''
    docker-tag: 'latest'

    installer: apex

    testsuite:
      - csit
      - cbench

    jobs:
      - 'cperf-{installer}-{testsuite}-{stream}'

################################
# job template
################################
- job-template:
    name: 'cperf-{installer}-{testsuite}-{stream}'

    concurrent: true

    properties:
      - throttle:
          enabled: true
          max-per-node: 1
          option: 'project'

    wrappers:
      - build-name:
          name: '$BUILD_NUMBER Suite: $CPERF_SUITE_NAME ODL BRANCH: $ODL_BRANCH'
      - timeout:
          timeout: 400
          abort: true

    parameters:
      - cperf-parameter:
          testsuite: '{testsuite}'
          gs-pathname: '{gs-pathname}'
          docker-tag: '{docker-tag}'
          stream: '{stream}'

    builders:
      - 'cperf-{testsuite}-builder'

########################
# parameter macros
########################
- parameter:
    name: cperf-parameter
    parameters:
      - string:
          name: CPERF_SUITE_NAME
          default: '{testsuite}'
          description: "Suite name to run"
      - string:
          name: ODL_BRANCH
          default: 'master'
          description: "Branch that OpenDaylight is running"
      - string:
          name: OS_VERSION
          default: 'master'
          description: "OpenStack version (short name, no stable/ prefix)"
      - string:
          name: GS_PATHNAME
          default: '{gs-pathname}'
          description: "Version directory where the opnfv documents will be stored in gs repository"
      - string:
          name: CI_DEBUG
          default: 'false'
          description: "Show debug output information"
      - string:
          name: DOCKER_TAG
          default: '{docker-tag}'
          description: 'Tag to pull docker image'
      - string:
          name: RC_FILE_PATH
          default: ''
          description: "Path to the OS credentials file if given"
      - string:
          name: SSH_KEY_PATH
          default: ''
          description: "Path to the private SSH key to access OPNFV nodes"
      - string:
          name: NODE_FILE_PATH
          default: ''
          description: "Path to the yaml file describing overcloud nodes"
      - string:
          name: ODL_CONTAINERIZED
          default: 'true'
          description: "boolean set true if ODL on overcloud is a container"

########################
# trigger macros
########################

########################
# builder macros
########################
- builder:
    name: cperf-csit-builder
    builders:
      - 'cperf-cleanup'
      - 'cperf-prepare-robot'
      - 'cperf-robot-netvirt-csit'

- builder:
    name: cperf-cbench-builder
    builders:
      - 'cperf-cleanup'
      - 'cperf-prepare-robot'
      - 'cperf-robot-cbench'

- builder:
    name: cperf-prepare-robot
    builders:
      - shell:
          !include-raw: ./cperf-prepare-robot.sh

- builder:
    name: cperf-robot-cbench
    builders:
      - shell: |
          #!/bin/bash
          set -o errexit
          set -o nounset
          set -o pipefail

          # cbench requires the openflow drop test feature to be installed.
          sshpass -p karaf ssh -o StrictHostKeyChecking=no \
                               -o UserKnownHostsFile=/dev/null \
                               -o LogLevel=error \
                               -p 8101 karaf@$SDN_CONTROLLER_IP \
                                feature:install odl-openflowplugin-flow-services-ui odl-openflowplugin-drop-test

          robot_cmd="pybot -e exclude -L TRACE -d /tmp \
                      -v ODL_SYSTEM_1_IP:${SDN_CONTROLLER_IP} \
                      -v ODL_SYSTEM_IP:${SDN_CONTROLLER_IP} \
                      -v BUNDLEFOLDER:/opt/opendaylight \
                      -v RESTCONFPORT:8081 \
                      -v USER_HOME:/tmp \
                      -v USER:heat-admin \
                      -v ODL_SYSTEM_USER:heat-admin \
                      -v TOOLS_SYSTEM_IP:localhost \
                      -v of_port:6653"
          robot_suite="/home/opnfv/repos/odl_test/csit/suites/openflowplugin/Performance/010_Cbench.robot"

          docker run -i -v /tmp:/tmp opnfv/cperf:$DOCKER_TAG ${robot_cmd} ${robot_suite}

- builder:
    name: cperf-robot-netvirt-csit
    builders:
      - shell:
          !include-raw: ./cperf-robot-netvirt-csit.sh

- builder:
    name: cperf-cleanup
    builders:
      - shell: |
          #!/bin/bash
          [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"

          echo "Cleaning up docker containers/images..."
          # Remove previous running containers if exist
          if [[ ! -z $(docker ps -a | grep opnfv/cperf) ]]; then
              echo "Removing existing opnfv/cperf containers..."
              docker ps -a | grep opnfv/cperf | awk '{print $1}' | xargs docker rm -f >${redirect}
          fi

          # Remove existing images if exist
          if [[ ! -z $(docker images | grep opnfv/cperf) ]]; then
              echo "Docker images to remove:"
              docker images | head -1 && docker images | grep opnfv/cperf >${redirect}
              image_tags=($(docker images | grep opnfv/cperf | awk '{print $2}'))
              for tag in "${image_tags[@]}"; do
                  echo "Removing docker image opnfv/cperf:$tag..."
                  docker rmi opnfv/cperf:$tag >/dev/null
              done
          fi