summaryrefslogtreecommitdiffstats
path: root/jjb/functest/xtesting-pi.yaml
blob: f07a1058124b23d09c4a925c790ac99b02505ed4 (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
---
- xtesting-pi-containers: &xtesting-pi-containers
    name: 'xtesting-pi-containers'
    repo: '{repo}'
    port: '{port}'
    container: '{container}'
    tag: '{tag}'

- xtesting-pi-params: &xtesting-pi-params
    name: 'xtesting-pi-params'
    repo: 'ollivier'
    port:
    tag:
      - latest:
          slave: lf-virtual1
      - leguer:
          slave: lf-virtual1
      - kali:
          slave: lf-virtual1
      - jerma:
          slave: lf-virtual1
      - iruya:
          slave: lf-virtual1
      - hunter:
          slave: lf-virtual1
      - arm-latest:
          slave: lf-virtual1
      - arm-leguer:
          slave: lf-virtual1
      - arm-kali:
          slave: lf-virtual1
      - arm-jerma:
          slave: lf-virtual1
      - arm-iruya:
          slave: lf-virtual1
      - arm-hunter:
          slave: lf-virtual1
      - arm64-latest:
          slave: lf-virtual1
      - arm64-leguer:
          slave: lf-virtual1
      - arm64-kali:
          slave: lf-virtual1
      - arm64-jerma:
          slave: lf-virtual1
      - arm64-iruya:
          slave: lf-virtual1
      - arm64-hunter:
          slave: lf-virtual1

- xtesting-pi-jobs: &xtesting-pi-jobs
    name: 'xtesting-pi-jobs'
    current-parameters: true

- parameter:
    name: xtesting-pi-slave
    parameters:
      - label:
          name: slave
          default: '{slave}'

- parameter:
    name: xtesting-pi-build_tag
    parameters:
      - random-string:
          name: build_tag


- xtesting-pi-run-containers: &xtesting-pi-run-containers
    name: 'xtesting-pi-run-containers'
    <<: *xtesting-pi-containers
    test: '{test}'
    privileged: '{privileged}'
    network: '{network}'

- builder:
    name: xtesting-pi-pull-containers
    builders:
      - shell: |
          set +x
          if [ "{repo}" = "_" ]; then
            image={container}:{tag}
          elif [ "{port}" = "None" ]; then
            image={repo}/{container}:{tag}
          else
            image={repo}:{port}/{container}:{tag}
          fi
          sudo docker pull $image

- builder:
    name: xtesting-pi-run-containers
    builders:
      - shell: |
          set +x
          [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
          if [ "{repo}" = "_" ]; then
            image={container}:{tag}
          elif [ "{port}" = "None" ]; then
            image={repo}/{container}:{tag}
          else
            image={repo}:{port}/{container}:{tag}
          fi
          sudo docker run --rm \
            --privileged={privileged} \
            --network={network} \
            -e S3_ENDPOINT_URL=https://storage.googleapis.com \
            -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
            -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
            -v /home/opnfv/xtesting/.boto:/root/.boto \
            -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
            -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
            -e NODE_NAME=$slave \
            -e BUILD_TAG=$BUILD_TAG \
            -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
            $image run_tests -t {test} -p -r

- builder:
    name: xtesting-pi-remove-images
    builders:
      - shell: |
          set +x
          if [ "{repo}" = "_" ]; then
            image={container}:{tag}
          elif [ "{port}" = "None" ]; then
            image={repo}/{container}:{tag}
          else
            image={repo}:{port}/{container}:{tag}
          fi
          sudo docker rmi $image || true

- job-template:
    name: 'xtesting-pi-{repo}-{container}-{tag}-pull'
    parameters:
      - xtesting-pi-slave:
          slave: '{slave}'
    builders:
      - xtesting-pi-pull-containers:
          <<: *xtesting-pi-containers

- project:
    name: 'xtesting-pi-ollivier-xtesting-pull'
    <<: *xtesting-pi-params
    container: 'xtesting'
    jobs:
      - 'xtesting-pi-{repo}-{container}-{tag}-pull'

- project:
    name: 'xtesting-pi-ollivier-xtesting-mts-pull'
    <<: *xtesting-pi-params
    container: 'xtesting-mts'
    jobs:
      - 'xtesting-pi-{repo}-{container}-{tag}-pull'

- job-template:
    name: 'xtesting-pi-{repo}-{container}-{tag}-rmi'
    parameters:
      - xtesting-pi-slave:
          slave: '{slave}'
    builders:
      - xtesting-pi-remove-images:
          <<: *xtesting-pi-containers

- project:
    name: 'xtesting-pi-ollivier-xtesting-rmi'
    <<: *xtesting-pi-params
    container: 'xtesting'
    jobs:
      - 'xtesting-pi-{repo}-{container}-{tag}-rmi'

- project:
    name: 'xtesting-pi-ollivier-xtesting-mts-rmi'
    <<: *xtesting-pi-params
    container: 'xtesting-mts'
    jobs:
      - 'xtesting-pi-{repo}-{container}-{tag}-rmi'

- job-template:
    name: 'xtesting-pi-{repo}-{container}-{tag}-{test}-run'
    parameters:
      - xtesting-pi-slave:
          slave: '{slave}'
      - xtesting-pi-build_tag:
          build_tag: ''
    builders:
      - xtesting-pi-run-containers:
          <<: *xtesting-pi-run-containers

- project:
    name: 'xtesting-pi-ollivier-xtesting'
    <<: *xtesting-pi-params
    container: 'xtesting'
    test:
      - first
      - second
      - third
      - fourth
      - fifth
      - sixth
    privileged: 'false'
    network: bridge
    jobs:
      - 'xtesting-pi-{repo}-{container}-{tag}-{test}-run'

- project:
    name: 'xtesting-pi-ollivier-xtesting-mts'
    <<: *xtesting-pi-params
    container: 'xtesting-mts'
    test:
      - seventh
    privileged: 'false'
    network: bridge
    jobs:
      - 'xtesting-pi-{repo}-{container}-{tag}-{test}-run'


- builder:
    name: xtesting-pi-zip
    builders:
      - shell: |
          set +x
          [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
          if [ "{repo}" = "_" ]; then
            image={container}:{tag}
          elif [ "{port}" = "None" ]; then
            image={repo}/{container}:{tag}
          else
            image={repo}:{port}/{container}:{tag}
          fi
          sudo docker run --rm \
            -e S3_ENDPOINT_URL=https://storage.googleapis.com \
            -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
            -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
            -v /home/opnfv/xtesting/.boto:/root/.boto \
            -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
            -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
            -e BUILD_TAG=$BUILD_TAG \
            -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
            $image zip_campaign

- job-template:
    name: 'xtesting-pi-{tag}-zip'
    parameters:
      - xtesting-pi-slave:
          slave: '{slave}'
      - xtesting-pi-build_tag:
          build_tag: ''
    builders:
      - xtesting-pi-zip:
          <<: *xtesting-pi-containers

- project:
    name: 'xtesting-pi-{tag}-zip'
    <<: *xtesting-pi-params
    container: 'xtesting'
    jobs:
      - 'xtesting-pi-{tag}-zip'

- job-template:
    name: 'xtesting-pi-{tag}-daily'
    project-type: multijob
    triggers:
      - timed: '@daily'
    parameters:
      - xtesting-pi-slave:
          slave: '{slave}'
      - xtesting-pi-build_tag:
          build_tag: ''
    properties:
      - build-blocker:
          use-build-blocker: true
          blocking-level: 'NODE'
          blocking-jobs:
            - '^xtesting-pi-{tag}-(daily|docker|review)$'
    builders:
      - multijob:
          name: remove former images
          projects:
            - name: 'xtesting-pi-ollivier-xtesting-{tag}-rmi'
              <<: *xtesting-pi-jobs
            - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-rmi'
              <<: *xtesting-pi-jobs
      - multijob:
          name: pull containers
          projects:
            - name: 'xtesting-pi-ollivier-xtesting-{tag}-pull'
              <<: *xtesting-pi-jobs
            - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-pull'
              <<: *xtesting-pi-jobs
      - multijob:
          name: ollivier/xtesting:{tag}
          projects:
            - name: 'xtesting-pi-ollivier-xtesting-{tag}-first-run'
              <<: *xtesting-pi-jobs
            - name: 'xtesting-pi-ollivier-xtesting-{tag}-second-run'
              <<: *xtesting-pi-jobs
            - name: 'xtesting-pi-ollivier-xtesting-{tag}-third-run'
              <<: *xtesting-pi-jobs
            - name: 'xtesting-pi-ollivier-xtesting-{tag}-fourth-run'
              <<: *xtesting-pi-jobs
            - name: 'xtesting-pi-ollivier-xtesting-{tag}-fifth-run'
              <<: *xtesting-pi-jobs
            - name: 'xtesting-pi-ollivier-xtesting-{tag}-sixth-run'
              <<: *xtesting-pi-jobs
      - multijob:
          name: ollivier/xtesting-mts:{tag}
          projects:
            - name: 'xtesting-pi-ollivier-xtesting-mts-{tag}-seventh-run'
              <<: *xtesting-pi-jobs
      - multijob:
          name: dump all campaign data
          projects:
            - name: 'xtesting-pi-{tag}-zip'
              <<: *xtesting-pi-jobs

- project:
    name: 'xtesting-pi-daily'
    <<: *xtesting-pi-params
    jobs:
      - 'xtesting-pi-{tag}-daily'

- view:
    name: xtesting-pi
    view-type: list
    columns:
      - status
      - weather
      - job
      - last-success
      - last-failure
      - last-duration
    regex: ^xtesting-pi-[a-z-0-9.]+-daily$