aboutsummaryrefslogtreecommitdiffstats
path: root/.ci/templates/stages-uhd-pipeline.yml
blob: 77d908be7c2a2e1dad2b011399e0f74576f099d6 (plain) (blame)
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
#
# Copyright 2021 Ettus Research, a National Instruments Brand
#
# SPDX-License-Identifier: LGPL-3.0-or-later
#

parameters:
- name: build_linux
  type: string
  default: Auto-detect
- name: build_mac
  type: string
  default: Auto-detect
- name: build_win
  type: string
  default: Auto-detect
- name: custom_boost_version
  type: boolean
  default: false
- name: custom_boost_version_url
  type: string
  default: 'https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2'
- name: release_binaries
  type: boolean
  default: false
- name: testLength
  type: string
- name: run_streaming_tests
  type: string
  default: Auto-detect
- name: build_sdk
  type: boolean
  default: false
- name: cache_sstate
  type: boolean
  default: true
- name: build_e310_sg1
  type: boolean
  default: true
- name: build_e310_sg3
  type: boolean
  default: true
- name: build_e320
  type: boolean
  default: true
- name: build_n3xx
  type: boolean
  default: true
- name: build_x4xx
  type: boolean
  default: true
- name: fpga_imgs_base_url
  type: string
  displayName: FPGA Images Base URL
  default: 'Internal'
- name: skip_analyze_changeset
  type: boolean
  default: false

variables:
- template: ../uhd-pipeline-vars.yml

resources:
  pipelines:
  - pipeline: uhd_build_docker_container
    source: 'uhddev Build Docker Containers'
    branch: master
  - pipeline: usrp-kas-pipeline
    source: 'usrp-kas'
    branch: zeus-ci
  repositories:
  - repository: meta-ettus
    type: github
    name: EttusResearch/meta-ettus-dev
    endpoint: EttusResearch
    ref: zeus-ci
  - repository: gnuradio
    type: github
    name: gnuradio/gnuradio
    endpoint: EttusResearch
    ref: maint-3.8
  - repository: gr-ettus
    type: github
    name: EttusResearch/gr-ettusdev
    endpoint: EttusResearch
    ref: master
  - repository: ettus-rts
    type: github
    endpoint: EttusResearch
    name: EttusResearch/ettus-rts
    ref: master

stages:
  # This stage will analyze code that is being tested, and generate variables
  # that can be used to control conditional execution of future stages. Any
  # stage that shall run conditionally must therefore depend on this stage.
- stage: analyze_changeset
  displayName: Analyze Changeset
  dependsOn: []
  jobs:
  - template: job-analyze-changeset.yml
    parameters:
      skip_analyze_changeset: ${{ parameters.skip_analyze_changeset }}
- stage: build_uhd_stage_linux
  displayName: Build UHD Linux
  dependsOn: analyze_changeset
  # This will make $(UhdTestList) available to jobs/steps/tasks, but not for the
  # condition.
  variables:
    UhdTestList: $[stageDependencies.analyze_changeset.analyze.outputs['gen_testlist.UhdTestList']]
  # This stage is executed if any of these are true:
  # - build_linux is set to Force-yes
  # - build_linux is set to auto, and the UhdTestList contains UHD Linux builds
  condition: >
    and(succeeded(),
    or(
      eq('${{ parameters.build_linux }}', 'Force-yes'),
      and(
        eq('${{ parameters.build_linux }}', 'Auto-detect'),
        or(
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'uhd.build.linux'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'uhd.build.all')
        )
      )
    ))
  jobs:
  - template: job-get-latest-uhd-docker.yml
  - template: job-uhd-build-src.yml
    parameters:
      toolset: make
  - template: job-uhd-build-src.yml
    parameters:
      toolset: make_trace
  - template: job-uhd-build-src.yml
    parameters:
      toolset: ninja
  - ${{ if parameters.custom_boost_version }}:
    - template: job-uhd-build-src.yml
      parameters:
        toolset: make_custom_boost_version
        custom_boost_version_url: ${{ parameters.custom_boost_version_url }}

- stage: build_uhd_stage_win
  displayName: Build UHD Windows
  dependsOn: analyze_changeset
  condition: >
    and(succeeded(),
    or(
      eq('${{ parameters.build_win }}', 'Force-yes'),
      and(
        eq('${{ parameters.build_win }}', 'Auto-detect'),
        or(
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'uhd.build.windows'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'uhd.build.all')
        )
      )
    ))
  jobs:
  - template: job-get-latest-uhd-docker.yml
  - template: job-uhd-build-src.yml
    parameters:
      toolset: msbuild
      release_binaries: ${{ parameters.release_binaries }}
  - template: job-uhd-build-src.yml
    parameters:
      toolset: msbuild_python
      release_binaries: ${{ parameters.release_binaries }}

- stage: build_uhd_stage_mac
  displayName: Build UHD macOS
  dependsOn: analyze_changeset
  condition: >
    and(succeeded(),
    or(
      eq('${{ parameters.build_mac }}', 'Force-yes'),
      and(
        eq('${{ parameters.build_mac }}', 'Auto-detect'),
        or(
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'uhd.build.mac'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'uhd.build.all')
        )
      )
    ))
  jobs:
  - template: job-get-latest-uhd-docker.yml
  - template: job-uhd-build-src.yml
    parameters:
      toolset: make_homebrew_macos

- stage: build_uhd_embedded_system_images
  displayName: Build UHD Embedded System Images
  dependsOn: analyze_changeset
  # If skip_analyze_changeset is true (e.g., during a regular mono pipeline)
  # then we build depending on the checkboxes (e.g., build_x4xx). If
  # skip_analyze_changeset is false (e.g., during a PR mono pipeline) we AND
  # the checkboxes with their respective conditions. This can be improved: Right
  # now, if any embedded condition is true, then all embedded targets with a
  # checkbox will be built.
  condition: >
    and(
      succeeded(),
      or(
        and(
          ${{ parameters.skip_analyze_changeset }},
          or(
            ${{ parameters.build_e310_sg1 }},
            ${{ parameters.build_e310_sg3 }},
            ${{ parameters.build_e320 }},
            ${{ parameters.build_n3xx }},
            ${{ parameters.build_x4xx }}
          )
        ),
        or(
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'uhd.build.all'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'uhd.build.linux'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'mpm.build'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.streaming.all'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.streaming.e3'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.streaming.n3'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.streaming.x4'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.all'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.e3'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.n3'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.x4'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.all'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.e3'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.n3'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.x4')
        )
      )
    )
  variables:
    AUTO_CONF: $(Agent.BuildDirectory)/auto.conf
  jobs:
    - template: .ci/templates/job_build_filesystem.yml@meta-ettus
      parameters:
        build_sdk: ${{ parameters.build_sdk }}
        cache_sstate: ${{ parameters.cache_sstate }}
        cache_downloads: False
        machines:
          - ${{ if parameters.build_e310_sg1 }}:
            - e310_sg1
          - ${{ if parameters.build_e310_sg3 }}:
            - e310_sg3
          - ${{ if parameters.build_e320 }}:
            - e320
          - ${{ if parameters.build_n3xx }}:
            - n3xx
          - ${{ if parameters.build_x4xx }}:
            - x4xx
        auto_conf: $AUTO_CONF
        run_from_external_repo: true
        prebuild_steps:
        - script: |
            rm $(AUTO_CONF)
            touch $(AUTO_CONF)
          displayName: create auto.conf
        - template: .ci/templates/oe_localconf_externalsrc.yml@meta-ettus
          parameters:
            conf_file: $AUTO_CONF
            repository: self
            package_paths:
              - package: uhd
                path: host
              - package: mpmd
                path: mpm
        # If requested, we set a variable "UHD_BASE_URL", which is consumed by
        # the uhd-fpga-images recipe to an internal file server which is closer
        # to the build machines. It is simply appended to auto.conf, where
        # bitbake will pick it up and apply it to the recipe.
        - ${{ if contains(parameters.fpga_imgs_base_url, 'Internal') }}:
          - bash: |
              cat <<EOF >>$AUTO_CONF
              UHD_BASE_URL = "$FILE_SERVER_URL"
              EOF
            env:
              FILE_SERVER_URL: $(InternalFileServerUrl)
        postbuild_steps:
        - script: |
            rm $(AUTO_CONF)
          displayName: delete auto.conf
          condition: always()

- stage: package_uhd_src
  displayName: Package UHD Source
  dependsOn: analyze_changeset
  jobs:
  - template: job-get-latest-uhd-docker.yml
  - template: job-uhd-package-src.yml
    parameters:
      uhdSrcDir: $(Build.SourcesDirectory)
      uhdBuildDir: $(Build.BinariesDirectory)/uhddev/build
      release_binaries: ${{ parameters.release_binaries }}

- stage: build_gnuradio_stage_linux
  displayName: Build gnuradio Linux
  dependsOn:
  - build_uhd_stage_linux
  - analyze_changeset
  # Anytime we build UHD, we also rebuild GNU Radio to see if we broke compat.
  condition: >
    and(succeeded(),
    or(
      eq('${{ parameters.build_linux }}', 'Force-yes'),
      and(
        eq('${{ parameters.build_linux }}', 'Auto-detect'),
        or(
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'uhd.build.linux'),
          contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'uhd.build.all')
        )
      )
    ))
  jobs:
  - template: job-get-latest-uhd-docker.yml
  - template: job-gnuradio-grettus-build-src.yml
    parameters:
      toolset: make

- stage: build_uhd_installer_stage_ubuntu
  displayName: Build UHD Installers Ubuntu
  dependsOn: build_uhd_stage_linux
  jobs:
    - template: job-get-latest-uhd-docker.yml
    - template: job-uhd-build-installer.yml
      parameters:
        toolset: ubuntu_deb
        installer: deb

- stage: build_uhd_installer_stage_fedora
  displayName: Build UHD Installers Fedora
  dependsOn: build_uhd_stage_linux
  jobs:
    - template: job-get-latest-uhd-docker.yml
    - template: job-uhd-build-installer.yml
      parameters:
        toolset: fedora_rpm
        installer: rpm
        releaseBinaries: ${{ parameters.release_binaries }}

- stage: build_uhd_installer_stage_win
  displayName: Build UHD Installers Windows
  dependsOn: build_uhd_stage_win
  jobs:
    - template: job-get-latest-uhd-docker.yml
    - template: job-uhd-build-installer.yml
      parameters:
        toolset: msbuild
        installer: nsis
        releaseBinaries: ${{ parameters.release_binaries }}
        fpga_imgs_base_url: ${{ parameters.fpga_imgs_base_url }}
    - template: job-uhd-build-installer.yml
      parameters:
        toolset: msbuild_python
        installer: nsis
        fpga_imgs_base_url: ${{ parameters.fpga_imgs_base_url }}
    - ${{ if parameters.release_binaries }}:
      - template: job-uhd-build-installer-signing.yml
        parameters:
          toolset: msbuild
          installer: nsis

- stage: devtest_uhd_x3xx_b2xx_stage
  displayName: devtest UHD x3xx b2xx
  dependsOn:
  - build_uhd_stage_linux
  - analyze_changeset
  condition: >
    and(
      succeeded(),
      or(
        ${{ parameters.skip_analyze_changeset }},
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.all'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.b2'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.x3')
      )
    )
  jobs:
  - template: job-uhd-devtest-rhombus.yml
    parameters:
      testOS: ubuntu2004
      uhdSrcDir: $(Build.SourcesDirectory)
      testDevices: 'x3xx,b2xx'

- stage: devtest_uhd_n3xx_e320_stage
  displayName: devtest UHD n3xx e320
  dependsOn:
  - build_uhd_stage_linux
  - build_uhd_embedded_system_images
  - analyze_changeset
  condition: >
    and(
      succeeded(),
      or(
        ${{ parameters.skip_analyze_changeset }},
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.all'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.n3'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.e320')
      )
    )
  jobs:
  - template: job-uhd-devtest-rhombus.yml
    parameters:
      testOS: ubuntu2004
      uhdSrcDir: $(Build.SourcesDirectory)
      testDevices: 'n3xx,e320'

- stage: test_uhd_x4xx_stage
  displayName: Test UHD x4xx
  dependsOn:
  - build_uhd_stage_linux
  - build_uhd_embedded_system_images
  - build_gnuradio_stage_linux
  - analyze_changeset
  # This will make $(UhdTestList) available to jobs/steps/tasks, but not for the
  # condition.
  variables:
    UhdTestList: $[stageDependencies.analyze_changeset.analyze.outputs['gen_testlist.UhdTestList']]
  condition: >
    and(
      succeeded(),
      or(
        ${{ parameters.skip_analyze_changeset }},
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.all'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.x4xx'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.x410'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.x440'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.all'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.x410'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'devtest.x440')
    ))
  jobs:
  - template: tests/job-uhd-x410-hardware-tests-sdr-test0.yml
    parameters:
      testOS: ubuntu1804
  - template: tests/job-uhd-x440-hardware-tests-sdr-test0.yml
    parameters:
      testOS: ubuntu1804
  - template: tests/job-uhd-x410-hardware-tests-pebbles.yml
    parameters:
      testOS: ubuntu1804
      testLength: ${{ parameters.testLength }}
  - template: tests/job-uhd-x440-hardware-tests-pebbles.yml
    parameters:
      testOS: ubuntu1804
      testLength: ${{ parameters.testLength }}
  - template: tests/job-uhd-x440-hardware-tests-saison.yml
    parameters:
      testOS: ubuntu2204
      extra_rf_test_args: --test_selector pytests/test_rx_phase_coherence.py pytests/test_tx_phase_coherence.py
      testLength: ${{ parameters.testLength }}

- stage: test_uhd_rf_test_stage
  displayName: Run rf tests n3xx
  dependsOn:
  - analyze_changeset
  - build_uhd_stage_linux
  - build_uhd_embedded_system_images
  - build_gnuradio_stage_linux
  condition: >
    and(
      succeeded(),
      or(
        ${{ parameters.skip_analyze_changeset }},
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.all'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.n320'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.n310'),
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.rf.n3xx')
    ))
  jobs:
  - template: job-uhd-rf-tests-pebbles.yml
    parameters:
      uhdSrcDir: $(Build.SourcesDirectory)/uhddev
      testOS: ubuntu1804
      testDevices: 'n3xx'

- stage: test_streaming_stage
  displayName: Test UHD Streaming
  dependsOn:
  - analyze_changeset
  - build_uhd_stage_linux
  - build_uhd_embedded_system_images
  condition: >
    and(
      succeeded('build_uhd_stage_linux'),
      succeeded('build_uhd_embedded_system_images'),
      ${{ parameters.run_streaming_tests }},
      or(
        ${{ parameters.skip_analyze_changeset }},
        contains(dependencies.analyze_changeset.outputs['analyze.gen_testlist.UhdTestList'], 'hw.streaming')
      )
    )
  jobs:
  - template: job-uhd-streaming-tests-beauty.yml
    parameters:
      testOS: ubuntu2004
      uhdSrcDir: $(Build.SourcesDirectory)/uhddev
      testLength: ${{ parameters.testLength }}
  - template: job-uhd-streaming-tests-x440.yml
    parameters:
      testOS: ubuntu2204
      uhdSrcDir: $(Build.SourcesDirectory)/uhddev
      testLength: ${{ parameters.testLength }}