Skip to content

Commit 94b7d0f

Browse files
authored
Merge branch 'master' into sched_grp
2 parents d96131a + e04bb43 commit 94b7d0f

File tree

304 files changed

+38947
-7633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+38947
-7633
lines changed

.azure-pipelines/build-docker-sonic-vs-template.yml

+29-13
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ parameters:
2323
- name: artifact_name
2424
type: string
2525

26+
- name: asan
27+
type: boolean
28+
default: false
29+
2630
jobs:
2731
- job:
2832
displayName: ${{ parameters.arch }}
@@ -36,50 +40,62 @@ jobs:
3640
inputs:
3741
source: specific
3842
project: build
39-
pipeline: 9
43+
pipeline: Azure.sonic-swss-common
4044
artifact: ${{ parameters.swss_common_artifact_name }}
4145
runVersion: 'latestFromBranch'
42-
runBranch: 'refs/heads/master'
46+
runBranch: 'refs/heads/$(BUILD_BRANCH)'
47+
path: $(Build.ArtifactStagingDirectory)/download
4348
displayName: "Download sonic swss common deb packages"
4449
- task: DownloadPipelineArtifact@2
4550
inputs:
4651
source: specific
4752
project: build
48-
pipeline: 12
53+
pipeline: Azure.sonic-sairedis
4954
artifact: ${{ parameters.sairedis_artifact_name }}
5055
runVersion: 'latestFromBranch'
51-
runBranch: 'refs/heads/master'
56+
runBranch: 'refs/heads/$(BUILD_BRANCH)'
57+
path: $(Build.ArtifactStagingDirectory)/download
5258
displayName: "Download sonic sairedis deb packages"
5359
- task: DownloadPipelineArtifact@2
5460
inputs:
5561
artifact: ${{ parameters.swss_artifact_name }}
56-
displayName: "Download sonic swss artifact"
62+
path: $(Build.ArtifactStagingDirectory)/download
63+
displayName: "Download pre-stage built ${{ parameters.swss_artifact_name }}"
5764
- task: DownloadPipelineArtifact@2
5865
inputs:
5966
source: specific
6067
project: build
61-
pipeline: 1
68+
pipeline: Azure.sonic-buildimage.official.vs
6269
artifact: sonic-buildimage.vs
6370
runVersion: 'latestFromBranch'
64-
runBranch: 'refs/heads/master'
65-
displayName: "Download sonic buildimage"
71+
runBranch: 'refs/heads/$(BUILD_BRANCH)'
72+
path: $(Build.ArtifactStagingDirectory)/download
73+
patterns: '**/target/${{ parameters.artifact_name }}.gz'
74+
displayName: "Download sonic-buildimage ${{ parameters.artifact_name }}"
6675
- script: |
76+
set -ex
6777
echo $(Build.DefinitionName).$(Build.BuildNumber)
6878
69-
docker load < ../target/docker-sonic-vs.gz
79+
docker load < $(Build.ArtifactStagingDirectory)/download/target/${{ parameters.artifact_name }}.gz
7080
7181
mkdir -p .azure-pipelines/docker-sonic-vs/debs
7282
73-
cp -v ../*.deb .azure-pipelines/docker-sonic-vs/debs
83+
cp -v $(Build.ArtifactStagingDirectory)/download/*.deb .azure-pipelines/docker-sonic-vs/debs
7484
7585
pushd .azure-pipelines
7686
77-
docker build --no-cache -t docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) docker-sonic-vs
87+
build_args=""
88+
if [ '${{ parameters.asan }}' == True ]; then
89+
build_args="--build-arg need_dbg=y"
90+
fi
7891
79-
popd
92+
docker build $build_args --no-cache -t docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber).asan-${{ parameters.asan }} docker-sonic-vs
8093
81-
docker save docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) | gzip -c > $(Build.ArtifactStagingDirectory)/docker-sonic-vs.gz
94+
popd
8295
96+
docker save docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber).asan-${{ parameters.asan }} | gzip -c > $(Build.ArtifactStagingDirectory)/docker-sonic-vs.gz
97+
rm -rf $(Build.ArtifactStagingDirectory)/download
98+
displayName: "Build ${{ parameters.artifact_name }}"
8399
- publish: $(Build.ArtifactStagingDirectory)/
84100
artifact: ${{ parameters.artifact_name }}
85101
displayName: "Archive sonic docker vs image"

.azure-pipelines/build-template.yml

+51-40
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ parameters:
2323
- name: sonic_slave
2424
type: string
2525

26-
- name: buildimage_artifact_name
27-
type: string
28-
29-
- name: buildimage_pipeline
30-
type: number
31-
3226
- name: sairedis_artifact_name
3327
type: string
3428

@@ -46,6 +40,13 @@ parameters:
4640
type: boolean
4741
default: false
4842

43+
- name: common_lib_artifact_name
44+
type: string
45+
46+
- name: asan
47+
type: boolean
48+
default: false
49+
4950
jobs:
5051
- job:
5152
displayName: ${{ parameters.arch }}
@@ -54,7 +55,7 @@ jobs:
5455
pool:
5556
${{ if ne(parameters.pool, 'default') }}:
5657
name: ${{ parameters.pool }}
57-
${{ if eq(parameters.pool, 'default') }}:
58+
${{ else }}:
5859
vmImage: 'ubuntu-20.04'
5960

6061
container:
@@ -79,62 +80,72 @@ jobs:
7980
inputs:
8081
source: specific
8182
project: build
82-
pipeline: 9
83+
pipeline: Azure.sonic-swss-common
8384
artifact: ${{ parameters.swss_common_artifact_name }}
8485
runVersion: 'latestFromBranch'
85-
runBranch: 'refs/heads/master'
86-
path: '$(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}'
86+
runBranch: 'refs/heads/$(BUILD_BRANCH)'
87+
path: $(Build.ArtifactStagingDirectory)/download
88+
patterns: |
89+
libswsscommon_1.0.0_${{ parameters.arch }}.deb
90+
libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
8791
displayName: "Download sonic swss common deb packages"
8892
- task: DownloadPipelineArtifact@2
8993
inputs:
9094
source: specific
9195
project: build
92-
pipeline: 12
96+
pipeline: Azure.sonic-sairedis
9397
artifact: ${{ parameters.sairedis_artifact_name }}
9498
runVersion: 'latestFromBranch'
95-
runBranch: 'refs/heads/master'
96-
path: '$(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}'
99+
runBranch: 'refs/heads/$(BUILD_BRANCH)'
100+
path: $(Build.ArtifactStagingDirectory)/download
101+
patterns: |
102+
libsaivs_*.deb
103+
libsaivs-dev_*.deb
104+
libsairedis_*.deb
105+
libsairedis-dev_*.deb
106+
libsaimetadata_*.deb
107+
libsaimetadata-dev_*.deb
108+
syncd-vs_*.deb
97109
displayName: "Download sonic sairedis deb packages"
98110
- task: DownloadPipelineArtifact@2
99111
inputs:
100112
source: specific
101113
project: build
102-
pipeline: ${{ parameters.buildimage_pipeline }}
103-
artifact: ${{ parameters.buildimage_artifact_name }}
114+
pipeline: Azure.sonic-buildimage.common_libs
115+
artifact: ${{ parameters.common_lib_artifact_name }}
104116
runVersion: 'latestFromBranch'
105-
runBranch: 'refs/heads/master'
106-
path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}'
107-
displayName: "Download sonic buildimage deb packages"
117+
runBranch: 'refs/heads/$(BUILD_BRANCH)'
118+
path: $(Build.ArtifactStagingDirectory)/download
119+
patterns: |
120+
target/debs/buster/libnl-3-200_*.deb
121+
target/debs/buster/libnl-3-dev_*.deb
122+
target/debs/buster/libnl-genl-3-200_*.deb
123+
target/debs/buster/libnl-genl-3-dev_*.deb
124+
target/debs/buster/libnl-route-3-200_*.deb
125+
target/debs/buster/libnl-route-3-dev_*.deb
126+
target/debs/buster/libnl-nf-3-200_*.deb
127+
target/debs/buster/libnl-nf-3-dev_*.deb
128+
target/debs/buster/libyang_*.deb
129+
displayName: "Download common libs"
108130
- script: |
109-
cd $(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}
110-
sudo dpkg -i target/debs/buster/libnl-3-200_*.deb
111-
sudo dpkg -i target/debs/buster/libnl-3-dev_*.deb
112-
sudo dpkg -i target/debs/buster/libnl-genl-3-200_*.deb
113-
sudo dpkg -i target/debs/buster/libnl-genl-3-dev_*.deb
114-
sudo dpkg -i target/debs/buster/libnl-route-3-200_*.deb
115-
sudo dpkg -i target/debs/buster/libnl-route-3-dev_*.deb
116-
sudo dpkg -i target/debs/buster/libnl-nf-3-200_*.deb
117-
sudo dpkg -i target/debs/buster/libnl-nf-3-dev_*.deb
118-
cd $(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}
119-
sudo dpkg -i libswsscommon_1.0.0_${{ parameters.arch }}.deb
120-
sudo dpkg -i libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
121-
cd $(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}
122-
sudo dpkg -i libsaivs_*.deb
123-
sudo dpkg -i libsaivs-dev_*.deb
124-
sudo dpkg -i libsairedis_*.deb
125-
sudo dpkg -i libsairedis-dev_*.deb
126-
sudo dpkg -i libsaimetadata_*.deb
127-
sudo dpkg -i libsaimetadata-dev_*.deb
128-
sudo dpkg -i syncd-vs_*.deb
129-
workingDirectory: $(Pipeline.Workspace)
131+
set -ex
132+
cd download
133+
sudo dpkg -i $(find target/debs/buster -type f)
134+
sudo dpkg -i $(ls *.deb)
135+
cd ..
136+
rm -rf download
137+
workingDirectory: $(Build.ArtifactStagingDirectory)
130138
displayName: "Install libnl3, sonic swss common and sairedis"
131139
- script: |
132-
set -x
140+
set -ex
133141
tar czf pytest.tgz tests
134142
cp -r pytest.tgz $(Build.ArtifactStagingDirectory)/
135143
if [ '${{ parameters.archive_gcov }}' == True ]; then
136144
export ENABLE_GCOV=y
137145
fi
146+
if [ '${{ parameters.asan }}' == True ]; then
147+
export ENABLE_ASAN=y
148+
fi
138149
./autogen.sh
139150
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
140151
displayName: "Compile sonic swss"

.azure-pipelines/docker-sonic-vs/Dockerfile

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
FROM docker-sonic-vs
22

33
ARG docker_container_name
4+
ARG need_dbg
45

56
ADD ["debs", "/debs"]
67

7-
RUN dpkg --purge python-swsscommon
8-
RUN dpkg --purge python3-swsscommon
9-
RUN dpkg --purge swss
10-
RUN dpkg --purge libsairedis
11-
RUN dpkg --purge libswsscommon
12-
RUN dpkg --purge libsaimetadata
13-
RUN dpkg --purge libsaivs
14-
RUN dpkg --purge syncd-vs
8+
RUN dpkg --purge python-swsscommon python3-swsscommon swss libsairedis sonic-db-cli libswsscommon libsaimetadata libsaivs syncd-vs
159

1610
RUN dpkg -i /debs/libswsscommon_1.0.0_amd64.deb
1711
RUN dpkg -i /debs/python-swsscommon_1.0.0_amd64.deb
1812
RUN dpkg -i /debs/python3-swsscommon_1.0.0_amd64.deb
13+
RUN dpkg -i /debs/sonic-db-cli_1.0.0_amd64.deb
1914

2015
RUN dpkg -i /debs/libsaimetadata_1.0.0_amd64.deb
2116
RUN dpkg -i /debs/libsairedis_1.0.0_amd64.deb
@@ -24,6 +19,7 @@ RUN dpkg -i /debs/syncd-vs_1.0.0_amd64.deb
2419

2520
RUN dpkg --purge swss
2621
RUN dpkg -i /debs/swss_1.0.0_amd64.deb
22+
RUN if [ "$need_dbg" = "y" ] ; then dpkg -i /debs/swss-dbg_1.0.0_amd64.deb ; fi
2723

2824
RUN apt-get update
2925

.azure-pipelines/gcov.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parameters:
1414

1515
- name: timeout
1616
type: number
17-
default: 180
17+
default: 240
1818

1919
- name: sonic_slave
2020
type: string
@@ -46,11 +46,23 @@ jobs:
4646
${{ if eq(parameters.pool, 'default') }}:
4747
vmImage: 'ubuntu-20.04'
4848

49+
variables:
50+
DIFF_COVER_CHECK_THRESHOLD: 50
51+
DIFF_COVER_ENABLE: 'true'
52+
4953
container:
5054
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest
5155

5256

5357
steps:
58+
- script: |
59+
set -ex
60+
# Install .NET CORE
61+
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
62+
sudo apt-add-repository https://packages.microsoft.com/debian/10/prod
63+
sudo apt-get update
64+
sudo apt-get install -y dotnet-sdk-5.0
65+
displayName: "Install .NET CORE"
5466
- script: |
5567
sudo apt-get install -y lcov
5668
displayName: "Install dependencies"
@@ -93,6 +105,7 @@ jobs:
93105
sudo ./gcov_support.sh generate
94106
sudo ./gcov_support.sh merge_container_info $(Build.ArtifactStagingDirectory)
95107
sudo cp -rf gcov_output $(Build.ArtifactStagingDirectory)
108+
sudo cp -rf $(Build.ArtifactStagingDirectory)/gcov_output/AllMergeReport/coverage.xml $(System.DefaultWorkingDirectory)/
96109
ls -lh $(Build.ArtifactStagingDirectory)
97110
popd
98111
workingDirectory: $(Pipeline.Workspace)

0 commit comments

Comments
 (0)