[ci]: build vs image in official build (#6768)

Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
lguohan 2021-02-11 23:34:05 -08:00 committed by GitHub
parent d3072cdd0d
commit 7475b98eda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 52 deletions

View File

@ -3,9 +3,10 @@ parameters:
type: string
values:
- broadcom
- mellanox
- marvell-armhf
- centec-arm64
- marvell-armhf
- mellanox
- vs
- name: platform_arch
type: string
@ -19,9 +20,10 @@ parameters:
type: string
values:
- brcm
- mlnx
- marvell-armhf
- centec-arm64
- marvell-armhf
- mlnx
- vs
- name: cache_mode
type: string
@ -82,20 +84,31 @@ jobs:
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=${{ parameters.cache_mode }} SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/${{ parameters.platform }}"
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=${{ parameters.platform }} PLATFORM_ARCH=${{ parameters.platform_arch }}
trap "sudo rm -rf fsroot" EXIT
if [ ${{ parameters.dbg_image }} == true ];then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-${{ parameters.platform }}.bin && \
mv target/sonic-${{ parameters.platform }}.bin target/sonic-${{ parameters.platform }}-dbg.bin
if [ ${{ parameters.platform }} == vs ]; then
if [ ${{ parameters.dbg_image }} == true ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-vs.img.gz && \
mv target/sonic-vs.img.gz target/sonic-vs-dbg.img.gz
fi
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz
else
if [ ${{ parameters.dbg_image }} == true ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-${{ parameters.platform }}.bin && \
mv target/sonic-${{ parameters.platform }}.bin target/sonic-${{ parameters.platform }}-dbg.bin
fi
if [ ${{ parameters.swi_image }} == true ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-${{ parameters.platform }}.swi
fi
if [ ${{ parameters.raw_image }} == true ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.raw
fi
if [ ${{ parameters.sync_rpc_image }} == true ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y target/docker-syncd-${{ parameters.platform_short }}-rpc.gz
fi
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.bin
fi
if [ ${{ parameters.swi_image }} == true ];then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-${{ parameters.platform }}.swi
fi
if [ ${{ parameters.raw_image }} == true ];then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.raw
fi
if [ ${{ parameters.sync_rpc_image }} == true ];then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y target/docker-syncd-${{ parameters.platform_short }}-rpc.gz
fi
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.bin
displayName: 'Build sonic image'
- template: cleanup.yml
- publish: $(System.DefaultWorkingDirectory)/

View File

@ -28,6 +28,13 @@ stages:
raw_image: true
sync_rpc_image: true
- template: build-template.yml
parameters:
platform: vs
platform_short: vs
dbg_image: true
cache_mode: wcache
- template: build-template.yml
parameters:
timeout: 3600

View File

@ -15,8 +15,8 @@ steps:
- task: DownloadPipelineArtifact@2
inputs:
artifact: sonic-buildimage.kvm
displayName: "Download sonic-buildimage.kvm artifact"
artifact: sonic-buildimage.vs
displayName: "Download sonic-buildimage.vs artifact"
- script: |
set -x

View File

@ -48,37 +48,11 @@ stages:
cache_mode: rcache
sync_rpc_image: true
- job:
displayName: "kvm"
timeoutInMinutes: 600
steps:
- script: |
sudo rm -rf fsroot
username=$(id -un)
sudo chown -R ${username}.${username} .
displayName: 'Cleanup'
- checkout: self
clean: true
submodules: recursive
displayName: 'Checkout code'
- script: |
git submodule foreach --recursive git clean -xfdf
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
displayName: 'reset submodules'
- script: |
echo $(Build.BuildNumber)
sudo modprobe overlay
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=rcache SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/vs"
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=vs
trap "sudo rm -rf fsroot" EXIT
make USERNAME=admin SONIC_BUILD_JOBS=$(nproc) $CACHE_OPTIONS \
target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz
displayName: 'Build sonic image'
- publish: $(System.DefaultWorkingDirectory)/
artifact: sonic-buildimage.kvm
displayName: "Archive sonic image"
- template: .azure-pipelines/build-template.yml
parameters:
platform: vs
platform_short: vs
cache_mode: rcache
- stage: Test
variables:
@ -110,8 +84,8 @@ stages:
- task: DownloadPipelineArtifact@2
inputs:
artifact: sonic-buildimage.kvm
displayName: "Download sonic-buildimage.kvm artifact"
artifact: sonic-buildimage.vs
displayName: "Download sonic-buildimage.vs artifact"
- script: |
set -x