sonic-buildimage/.azure-pipelines/azure-pipelines-build.yml
Yakiv Huryk fd287b7d24 [ci] add docker-sonic-vs with ASAN build (#11297)
The asan-enabled docker image will be used in other CIs that run DVS tests.

Why I did it
To add a possibility to run DVS tests with ASAN for other CIs (e.g. swss).

How I did it
Added the 'asan_image' flag to the vs job group.

How to verify it
Run the CI and check the docker-sonic-vs-asan.gz artifact.
2022-07-05 16:11:48 +00:00

143 lines
4.4 KiB
YAML

# The azure pipeline template for Official build, and upgrade version build
parameters:
- name: 'jobFilters'
type: object
default: ''
- name: 'buildOptions'
type: string
default: 'SONIC_CONFIG_BUILD_JOBS=1'
- name: 'preSteps'
type: stepList
default: []
- name: 'postSteps'
type: stepList
default: []
- name: 'jobGroups'
type: object
default: ''
jobs:
- template: azure-pipelines-image-template.yml
parameters:
jobFilters: ${{ parameters.jobFilters }}
preSteps: ${{ parameters.preSteps }}
postSteps: ${{ parameters.postSteps }}
jobVariables:
PLATFORM_AZP: $(GROUP_NAME)
PLATFORM_ARCH: amd64
BUILD_NUMBER: $(Build.BuildId)
BUILD_OPTIONS: ${{ parameters.buildOptions }}
DOCKER_DATA_ROOT_FOR_MULTIARCH: /data/march/docker
dbg_image: no
asan_image: no
swi_image: no
raw_image: no
docker_syncd_rpc_image: no
syncd_rpc_image: no
platform_rpc: no
${{ if ne(parameters.jobGroups, '') }}:
jobGroups: ${{ parameters.jobGroups }}
${{ if eq(parameters.jobGroups, '') }}:
jobGroups:
- name: vs
variables:
dbg_image: yes
asan_image: yes
- name: barefoot
variables:
docker_syncd_rpc_image: yes
platform_rpc: bfn
swi_image: yes
- name: broadcom
timeoutInMinutes: 1440
variables:
dbg_image: yes
swi_image: yes
raw_image: yes
docker_syncd_rpc_image: yes
platform_rpc: brcm
- name: centec
variables:
dbg_image: yes
docker_syncd_rpc_image: yes
platform_rpc: centec
- name: centec-arm64
pool: sonicbld-arm64
timeoutInMinutes: 2880
variables:
PLATFORM_ARCH: arm64
- name: generic
variables:
dbg_image: yes
- name: innovium
variables:
dbg_image: yes
- name: marvell-armhf
pool: sonicbld-armhf
timeoutInMinutes: 2880
variables:
PLATFORM_ARCH: armhf
- name: mellanox
variables:
dbg_image: yes
docker_syncd_rpc_image: yes
syncd_rpc_image: yes
platform_rpc: mlnx
- name: nephos
variables:
dbg_image: yes
docker_syncd_rpc_image: yes
platform_rpc: nephos
buildSteps:
- template: template-skipvstest.yml
- bash: |
set -ex
if [ $(GROUP_NAME) == vs ]; then
if [ $(dbg_image) == yes ]; then
make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-vs.img.gz
mv target/sonic-vs.img.gz target/sonic-vs-dbg.img.gz
fi
if [ $(asan_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_ASAN=y target/docker-sonic-vs.gz
mv target/docker-sonic-vs.gz target/docker-sonic-vs-asan.gz
fi
make $BUILD_OPTIONS target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz
if [ $(Build.Reason) != 'PullRequest' ];then
gzip -kd target/sonic-vs.img.gz
SONIC_RUN_CMDS="qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx" make sonic-slave-run
rm target/sonic-vs.img
fi
else
if [ $(dbg_image) == yes ]; then
make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-$(GROUP_NAME).bin
mv target/sonic-$(GROUP_NAME).bin target/sonic-$(GROUP_NAME)-dbg.bin
fi
if [ $(swi_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-$(GROUP_NAME).swi
fi
if [ $(raw_image) == yes ]; then
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).raw
fi
if [ $(docker_syncd_rpc_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-rpc.gz
fi
if [ $(syncd_rpc_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/sonic-$(GROUP_NAME).bin
mv target/sonic-mellanox.bin target/sonic-$(GROUP_NAME)-rpc.bin
fi
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin
fi
displayName: "Build sonic image"
- template: check-dirty-version.yml