Skip to content

Commit

Permalink
Cherry-pick PRs in master branch to unblock PR checks. (#762)
Browse files Browse the repository at this point in the history
cherry-pick PRs:

43e6827 Update path to sairedis tests (#747)
8491082 [ci] Continue on error when running test. (#757)
5000aa1 [ci] Fix apt-get install unable locate package issue. (#753)
e50ee9e Simplify azure pipeline build template (#729)
7d30c9f Fix sonic-slave docker image environment issue. (#727)
  • Loading branch information
liushilongbuaa authored Mar 10, 2023
1 parent e732ed0 commit 416ca70
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 28 deletions.
6 changes: 4 additions & 2 deletions .azure-pipelines/build-sairedis-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
vmImage: 'ubuntu-20.04'

container:
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}
options: "--privileged"

steps:
Expand All @@ -63,6 +63,8 @@ jobs:
git status
displayName: Set up sonic-sairedis branch
- script: |
set -ex
sudo apt-get update
sudo apt-get install -qq -y \
qtbase5-dev \
libdbus-glib-1-2 \
Expand Down Expand Up @@ -129,7 +131,7 @@ jobs:
./autogen.sh
DEB_BUILD_OPTIONS=nocheck fakeroot dpkg-buildpackage -b -us -uc -Tbinary-syncd-vs -j$(nproc)
# Add SYS_TIME capability for settimeofday ok in syncd test
sudo setcap "cap_sys_time=eip" syncd/.libs/tests
sudo setcap "cap_sys_time=eip" syncd/.libs/syncd_tests
make check
mv ../*.deb .
displayName: "Compile sonic sairedis"
Expand Down
4 changes: 3 additions & 1 deletion .azure-pipelines/build-swss-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
vmImage: 'ubuntu-20.04'

container:
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}

steps:
- checkout: sonic-swss
Expand All @@ -58,6 +58,8 @@ jobs:
git status
displayName: Set up sonic-swss branch
- script: |
set -ex
sudo apt-get update
sudo apt-get install -y libhiredis0.14 libhiredis-dev
sudo apt-get install -y libzmq5 libzmq3-dev
sudo apt-get install -qq -y \
Expand Down
27 changes: 8 additions & 19 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ jobs:
vmImage: 'ubuntu-20.04'

container:
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}

steps:
- checkout: self
clean: true
- script: |
set -ex
sudo apt-get update
sudo apt-get install -qq -y \
libhiredis-dev \
libnl-3-dev \
Expand All @@ -68,34 +70,21 @@ jobs:
swig
displayName: "Install dependencies"
- task: DownloadPipelineArtifact@2
# amd64 artifact name does not has arch suffix
condition: eq('${{ parameters.arch }}', 'amd64')
inputs:
source: specific
project: build
pipeline: Azure.sonic-buildimage.common_libs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
artifact: common-lib
patterns: |
target/debs/${{ parameters.debian_version }}/libyang-*.deb
target/debs/${{ parameters.debian_version }}/libyang_*.deb
displayName: "Download libyang from amd64 common lib"
- task: DownloadPipelineArtifact@2
condition: ne('${{ parameters.arch }}', 'amd64')
inputs:
source: specific
project: build
pipeline: Azure.sonic-buildimage.common_libs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
artifact: common-lib.${{ parameters.arch }}
${{ if eq(parameters.arch, 'amd64') }}:
artifact: common-lib
${{ else }}:
artifact: common-lib.${{ parameters.arch }}
patterns: |
target/debs/${{ parameters.debian_version }}/libyang-*.deb
target/debs/${{ parameters.debian_version }}/libyang_*.deb
displayName: "Download libyang from common lib"
displayName: "Download libyang from ${{ parameters.arch }} common lib"
- script: |
set -ex
sudo dpkg -i $(find ./download -name *.deb)
Expand Down
1 change: 1 addition & 0 deletions .azure-pipelines/build_and_install_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function build_and_install_kmodule()
SUBLEVEL=$(echo $KERNEL_MAINVERSION | cut -d. -f3)

# Install the required debian packages to build the kernel modules
apt-get update
apt-get install -y build-essential linux-headers-${KERNEL_RELEASE} autoconf pkg-config fakeroot
apt-get install -y flex bison libssl-dev libelf-dev
apt-get install -y libnl-route-3-200 libnl-route-3-dev libnl-cli-3-200 libnl-cli-3-dev libnl-3-dev
Expand Down
2 changes: 2 additions & 0 deletions .azure-pipelines/test-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ jobs:
rm -rf $(Build.ArtifactStagingDirectory)/download
displayName: "Run vs tests"
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
continueOnError: true
- task: PublishTestResults@2
inputs:
Expand Down
12 changes: 6 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ stages:
- template: .azure-pipelines/build-template.yml
parameters:
arch: amd64
sonic_slave: sonic-slave-${{ parameters.debian_version }}
sonic_slave: sonic-slave-${{ parameters.debian_version }}:$(BUILD_BRANCH)
artifact_name: sonic-swss-common
run_unit_test: true
archive_gcov: true
Expand All @@ -106,7 +106,7 @@ stages:
arch: armhf
timeout: 180
pool: sonicbld-armhf
sonic_slave: sonic-slave-${{ parameters.debian_version }}-armhf
sonic_slave: sonic-slave-${{ parameters.debian_version }}-armhf:$(BUILD_BRANCH)
artifact_name: sonic-swss-common.armhf
debian_version: ${{ parameters.debian_version }}

Expand All @@ -115,7 +115,7 @@ stages:
arch: arm64
timeout: 180
pool: sonicbld-arm64
sonic_slave: sonic-slave-${{ parameters.debian_version }}-arm64
sonic_slave: sonic-slave-${{ parameters.debian_version }}-arm64:$(BUILD_BRANCH)
artifact_name: sonic-swss-common.arm64
debian_version: ${{ parameters.debian_version }}

Expand All @@ -127,7 +127,7 @@ stages:
parameters:
arch: amd64
timeout: 180
sonic_slave: sonic-slave-bullseye
sonic_slave: sonic-slave-bullseye:$(BUILD_BRANCH)
artifact_name: sonic-swss-common.bullseye.amd64
debian_version: bullseye

Expand All @@ -138,7 +138,7 @@ stages:
- template: .azure-pipelines/build-sairedis-template.yml
parameters:
arch: amd64
sonic_slave: sonic-slave-${{ parameters.debian_version }}
sonic_slave: sonic-slave-${{ parameters.debian_version }}:$(BUILD_BRANCH)
swss_common_artifact_name: sonic-swss-common
artifact_name: sonic-sairedis
syslog_artifact_name: sonic-sairedis.syslog
Expand All @@ -151,7 +151,7 @@ stages:
- template: .azure-pipelines/build-swss-template.yml
parameters:
arch: amd64
sonic_slave: sonic-slave-${{ parameters.debian_version }}
sonic_slave: sonic-slave-${{ parameters.debian_version }}:$(BUILD_BRANCH)
swss_common_artifact_name: sonic-swss-common
sairedis_artifact_name: sonic-sairedis
artifact_name: sonic-swss
Expand Down

0 comments on commit 416ca70

Please sign in to comment.