Skip to content

Commit 7475b98

Browse files
authored
[ci]: build vs image in official build (#6768)
Signed-off-by: Guohan Lu <[email protected]>
1 parent d3072cd commit 7475b98

File tree

4 files changed

+46
-52
lines changed

4 files changed

+46
-52
lines changed

.azure-pipelines/build-template.yml

+30-17
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ parameters:
33
type: string
44
values:
55
- broadcom
6-
- mellanox
7-
- marvell-armhf
86
- centec-arm64
7+
- marvell-armhf
8+
- mellanox
9+
- vs
910

1011
- name: platform_arch
1112
type: string
@@ -19,9 +20,10 @@ parameters:
1920
type: string
2021
values:
2122
- brcm
22-
- mlnx
23-
- marvell-armhf
2423
- centec-arm64
24+
- marvell-armhf
25+
- mlnx
26+
- vs
2527

2628
- name: cache_mode
2729
type: string
@@ -82,20 +84,31 @@ jobs:
8284
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=${{ parameters.cache_mode }} SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/${{ parameters.platform }}"
8385
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=${{ parameters.platform }} PLATFORM_ARCH=${{ parameters.platform_arch }}
8486
trap "sudo rm -rf fsroot" EXIT
85-
if [ ${{ parameters.dbg_image }} == true ];then
86-
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-${{ parameters.platform }}.bin && \
87-
mv target/sonic-${{ parameters.platform }}.bin target/sonic-${{ parameters.platform }}-dbg.bin
88-
fi
89-
if [ ${{ parameters.swi_image }} == true ];then
90-
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-${{ parameters.platform }}.swi
91-
fi
92-
if [ ${{ parameters.raw_image }} == true ];then
93-
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.raw
94-
fi
95-
if [ ${{ parameters.sync_rpc_image }} == true ];then
96-
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y target/docker-syncd-${{ parameters.platform_short }}-rpc.gz
87+
88+
if [ ${{ parameters.platform }} == vs ]; then
89+
if [ ${{ parameters.dbg_image }} == true ]; then
90+
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-vs.img.gz && \
91+
mv target/sonic-vs.img.gz target/sonic-vs-dbg.img.gz
92+
fi
93+
94+
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz
95+
else
96+
if [ ${{ parameters.dbg_image }} == true ]; then
97+
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-${{ parameters.platform }}.bin && \
98+
mv target/sonic-${{ parameters.platform }}.bin target/sonic-${{ parameters.platform }}-dbg.bin
99+
fi
100+
if [ ${{ parameters.swi_image }} == true ]; then
101+
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-${{ parameters.platform }}.swi
102+
fi
103+
if [ ${{ parameters.raw_image }} == true ]; then
104+
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.raw
105+
fi
106+
if [ ${{ parameters.sync_rpc_image }} == true ]; then
107+
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y target/docker-syncd-${{ parameters.platform_short }}-rpc.gz
108+
fi
109+
110+
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.bin
97111
fi
98-
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.bin
99112
displayName: 'Build sonic image'
100113
- template: cleanup.yml
101114
- publish: $(System.DefaultWorkingDirectory)/

.azure-pipelines/official-build.yml

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ stages:
2828
raw_image: true
2929
sync_rpc_image: true
3030

31+
- template: build-template.yml
32+
parameters:
33+
platform: vs
34+
platform_short: vs
35+
dbg_image: true
36+
cache_mode: wcache
37+
3138
- template: build-template.yml
3239
parameters:
3340
timeout: 3600

.azure-pipelines/run-test-template.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ steps:
1515

1616
- task: DownloadPipelineArtifact@2
1717
inputs:
18-
artifact: sonic-buildimage.kvm
19-
displayName: "Download sonic-buildimage.kvm artifact"
18+
artifact: sonic-buildimage.vs
19+
displayName: "Download sonic-buildimage.vs artifact"
2020

2121
- script: |
2222
set -x

azure-pipelines.yml

+7-33
Original file line numberDiff line numberDiff line change
@@ -48,37 +48,11 @@ stages:
4848
cache_mode: rcache
4949
sync_rpc_image: true
5050

51-
- job:
52-
displayName: "kvm"
53-
timeoutInMinutes: 600
54-
steps:
55-
- script: |
56-
sudo rm -rf fsroot
57-
username=$(id -un)
58-
sudo chown -R ${username}.${username} .
59-
displayName: 'Cleanup'
60-
- checkout: self
61-
clean: true
62-
submodules: recursive
63-
displayName: 'Checkout code'
64-
65-
- script: |
66-
git submodule foreach --recursive git clean -xfdf
67-
git submodule foreach --recursive git reset --hard
68-
git submodule update --init --recursive
69-
displayName: 'reset submodules'
70-
- script: |
71-
echo $(Build.BuildNumber)
72-
sudo modprobe overlay
73-
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=rcache SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/vs"
74-
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=vs
75-
trap "sudo rm -rf fsroot" EXIT
76-
make USERNAME=admin SONIC_BUILD_JOBS=$(nproc) $CACHE_OPTIONS \
77-
target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz
78-
displayName: 'Build sonic image'
79-
- publish: $(System.DefaultWorkingDirectory)/
80-
artifact: sonic-buildimage.kvm
81-
displayName: "Archive sonic image"
51+
- template: .azure-pipelines/build-template.yml
52+
parameters:
53+
platform: vs
54+
platform_short: vs
55+
cache_mode: rcache
8256

8357
- stage: Test
8458
variables:
@@ -110,8 +84,8 @@ stages:
11084

11185
- task: DownloadPipelineArtifact@2
11286
inputs:
113-
artifact: sonic-buildimage.kvm
114-
displayName: "Download sonic-buildimage.kvm artifact"
87+
artifact: sonic-buildimage.vs
88+
displayName: "Download sonic-buildimage.vs artifact"
11589

11690
- script: |
11791
set -x

0 commit comments

Comments
 (0)