[ci]: build vs image in official build (#6768)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
parent
d3072cdd0d
commit
7475b98eda
@ -3,9 +3,10 @@ parameters:
|
|||||||
type: string
|
type: string
|
||||||
values:
|
values:
|
||||||
- broadcom
|
- broadcom
|
||||||
- mellanox
|
|
||||||
- marvell-armhf
|
|
||||||
- centec-arm64
|
- centec-arm64
|
||||||
|
- marvell-armhf
|
||||||
|
- mellanox
|
||||||
|
- vs
|
||||||
|
|
||||||
- name: platform_arch
|
- name: platform_arch
|
||||||
type: string
|
type: string
|
||||||
@ -19,9 +20,10 @@ parameters:
|
|||||||
type: string
|
type: string
|
||||||
values:
|
values:
|
||||||
- brcm
|
- brcm
|
||||||
- mlnx
|
|
||||||
- marvell-armhf
|
|
||||||
- centec-arm64
|
- centec-arm64
|
||||||
|
- marvell-armhf
|
||||||
|
- mlnx
|
||||||
|
- vs
|
||||||
|
|
||||||
- name: cache_mode
|
- name: cache_mode
|
||||||
type: string
|
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 }}"
|
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 }}
|
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=${{ parameters.platform }} PLATFORM_ARCH=${{ parameters.platform_arch }}
|
||||||
trap "sudo rm -rf fsroot" EXIT
|
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 && \
|
if [ ${{ parameters.platform }} == vs ]; then
|
||||||
mv target/sonic-${{ parameters.platform }}.bin target/sonic-${{ parameters.platform }}-dbg.bin
|
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
|
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'
|
displayName: 'Build sonic image'
|
||||||
- template: cleanup.yml
|
- template: cleanup.yml
|
||||||
- publish: $(System.DefaultWorkingDirectory)/
|
- publish: $(System.DefaultWorkingDirectory)/
|
||||||
|
@ -28,6 +28,13 @@ stages:
|
|||||||
raw_image: true
|
raw_image: true
|
||||||
sync_rpc_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
|
- template: build-template.yml
|
||||||
parameters:
|
parameters:
|
||||||
timeout: 3600
|
timeout: 3600
|
||||||
|
@ -15,8 +15,8 @@ steps:
|
|||||||
|
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
inputs:
|
inputs:
|
||||||
artifact: sonic-buildimage.kvm
|
artifact: sonic-buildimage.vs
|
||||||
displayName: "Download sonic-buildimage.kvm artifact"
|
displayName: "Download sonic-buildimage.vs artifact"
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -x
|
set -x
|
||||||
|
@ -48,37 +48,11 @@ stages:
|
|||||||
cache_mode: rcache
|
cache_mode: rcache
|
||||||
sync_rpc_image: true
|
sync_rpc_image: true
|
||||||
|
|
||||||
- job:
|
- template: .azure-pipelines/build-template.yml
|
||||||
displayName: "kvm"
|
parameters:
|
||||||
timeoutInMinutes: 600
|
platform: vs
|
||||||
steps:
|
platform_short: vs
|
||||||
- script: |
|
cache_mode: rcache
|
||||||
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"
|
|
||||||
|
|
||||||
- stage: Test
|
- stage: Test
|
||||||
variables:
|
variables:
|
||||||
@ -110,8 +84,8 @@ stages:
|
|||||||
|
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
inputs:
|
inputs:
|
||||||
artifact: sonic-buildimage.kvm
|
artifact: sonic-buildimage.vs
|
||||||
displayName: "Download sonic-buildimage.kvm artifact"
|
displayName: "Download sonic-buildimage.vs artifact"
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
set -x
|
set -x
|
||||||
|
Reference in New Issue
Block a user