From a3f8e95c6ebac2b1796c8baf695141e4c48ebf6d Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Thu, 2 Mar 2023 13:36:46 +0800 Subject: [PATCH 1/5] [ci] Fix apt-get install unable locate package issue. (#1212) --- .azure-pipelines/build-swss-template.yml | 2 ++ .azure-pipelines/build-template.yml | 2 ++ .azure-pipelines/build_and_install_module.sh | 1 + .azure-pipelines/test-docker-sonic-vs-template.yml | 1 + 4 files changed, 6 insertions(+) diff --git a/.azure-pipelines/build-swss-template.yml b/.azure-pipelines/build-swss-template.yml index 96c4c9fe3..c6d190db7 100644 --- a/.azure-pipelines/build-swss-template.yml +++ b/.azure-pipelines/build-swss-template.yml @@ -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 \ diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index c6b6fbaa9..ea3055a19 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -62,6 +62,8 @@ jobs: clean: true submodules: true - script: | + set -ex + sudo apt-get update sudo apt-get install -qq -y \ qtbase5-dev \ libdbus-glib-1-2 \ diff --git a/.azure-pipelines/build_and_install_module.sh b/.azure-pipelines/build_and_install_module.sh index 493a2f04e..35c519634 100755 --- a/.azure-pipelines/build_and_install_module.sh +++ b/.azure-pipelines/build_and_install_module.sh @@ -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 diff --git a/.azure-pipelines/test-docker-sonic-vs-template.yml b/.azure-pipelines/test-docker-sonic-vs-template.yml index 1447c34e5..d28791c32 100644 --- a/.azure-pipelines/test-docker-sonic-vs-template.yml +++ b/.azure-pipelines/test-docker-sonic-vs-template.yml @@ -48,6 +48,7 @@ jobs: set -ex sudo sonic-sairedis/.azure-pipelines/build_and_install_module.sh + sudo apt-get update sudo apt-get install -y libhiredis0.14 sudo dpkg -i --force-confask,confnew $(Build.ArtifactStagingDirectory)/download/libswsscommon_1.0.0_amd64.deb || apt-get install -f sudo dpkg -i $(Build.ArtifactStagingDirectory)/download/python3-swsscommon_1.0.0_amd64.deb From 6d5a12fc2a0b585dc3fd82e5710a159ea0256fcb Mon Sep 17 00:00:00 2001 From: shilongliu Date: Thu, 9 Mar 2023 15:51:36 +0800 Subject: [PATCH 2/5] [ci] Continue on error when running test. --- .azure-pipelines/test-docker-sonic-vs-template.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.azure-pipelines/test-docker-sonic-vs-template.yml b/.azure-pipelines/test-docker-sonic-vs-template.yml index d28791c32..c0ea833ec 100644 --- a/.azure-pipelines/test-docker-sonic-vs-template.yml +++ b/.azure-pipelines/test-docker-sonic-vs-template.yml @@ -68,6 +68,8 @@ jobs: sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) rm -rf $(Build.ArtifactStagingDirectory)/download displayName: "Run vs tests" + ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + continueOnError: true - task: PublishTestResults@2 inputs: From 70fb82e4f223e3a568a2449232ad01dfd78a498b Mon Sep 17 00:00:00 2001 From: shilongliu Date: Thu, 9 Mar 2023 18:42:39 +0800 Subject: [PATCH 3/5] [ci] Allow partially succeeded builds when downaloading swss-common --- .azure-pipelines/build-docker-sonic-vs-template.yml | 1 + .azure-pipelines/build-swss-template.yml | 1 + .azure-pipelines/build-template.yml | 1 + .azure-pipelines/test-docker-sonic-vs-template.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/.azure-pipelines/build-docker-sonic-vs-template.yml b/.azure-pipelines/build-docker-sonic-vs-template.yml index 163230a66..16042c74f 100644 --- a/.azure-pipelines/build-docker-sonic-vs-template.yml +++ b/.azure-pipelines/build-docker-sonic-vs-template.yml @@ -43,6 +43,7 @@ jobs: path: $(Build.ArtifactStagingDirectory)/download runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(BUILD_BRANCH)' + allowPartiallySucceededBuilds: true displayName: "Download sonic swss common deb packages" - task: DownloadPipelineArtifact@2 inputs: diff --git a/.azure-pipelines/build-swss-template.yml b/.azure-pipelines/build-swss-template.yml index c6d190db7..a6ebb68cc 100644 --- a/.azure-pipelines/build-swss-template.yml +++ b/.azure-pipelines/build-swss-template.yml @@ -78,6 +78,7 @@ jobs: artifact: ${{ parameters.swss_common_artifact_name }} runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(BUILD_BRANCH)' + allowPartiallySucceededBuilds: true path: $(Build.ArtifactStagingDirectory)/download patterns: | libswsscommon_1.0.0_*.deb diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index ea3055a19..e4d57eadf 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -103,6 +103,7 @@ jobs: artifact: ${{ parameters.swss_common_artifact_name }} runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(BUILD_BRANCH)' + allowPartiallySucceededBuilds: true path: $(Build.ArtifactStagingDirectory)/download displayName: "Download sonic swss common deb packages" - script: | diff --git a/.azure-pipelines/test-docker-sonic-vs-template.yml b/.azure-pipelines/test-docker-sonic-vs-template.yml index c0ea833ec..8e426374f 100644 --- a/.azure-pipelines/test-docker-sonic-vs-template.yml +++ b/.azure-pipelines/test-docker-sonic-vs-template.yml @@ -42,6 +42,7 @@ jobs: path: $(Build.ArtifactStagingDirectory)/download runVersion: 'latestFromBranch' runBranch: 'refs/heads/$(BUILD_BRANCH)' + allowPartiallySucceededBuilds: true displayName: "Download sonic swss common deb packages" - script: | From d890b422fd0e30136c4844d46394e270ea2f5a9d Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 20 Dec 2022 09:52:52 -0800 Subject: [PATCH 4/5] Switch to using stock gcovr 5.2 (#1174) * Test using stock gcovr Signed-off-by: Saikrishna Arcot * Use gcovr 5.2 Signed-off-by: Saikrishna Arcot Signed-off-by: Saikrishna Arcot --- .azure-pipelines/build-template.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml index e4d57eadf..8a7eb9b04 100644 --- a/.azure-pipelines/build-template.yml +++ b/.azure-pipelines/build-template.yml @@ -127,14 +127,14 @@ jobs: - ${{ if eq(parameters.run_unit_test, true) }}: - script: | set -ex - git clone https://github.com/Spacetown/gcovr.git + git clone https://github.com/gcovr/gcovr.git cd gcovr/ - git checkout origin/recursive_search_file + git checkout 5.2 sudo pip3 install setuptools sudo python3 setup.py install cd .. sudo rm -rf gcovr - displayName: "Install gcovr 5.0 with recursive fix" + displayName: "Install gcovr 5.2 (for --exclude-throw-branches support)" - script: | set -ex make check From b90354f34db4c61ddffa4024ef2783e65ea34d44 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Fri, 3 Jun 2022 23:23:45 -0700 Subject: [PATCH 5/5] Purge package sonic-db-cli which depends on libswsscommon (#1057) Since sonic-db-cli depends on libswsscommon, we could not simply only purge libswsscommon, so we purge both together. --- .azure-pipelines/docker-sonic-vs/Dockerfile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.azure-pipelines/docker-sonic-vs/Dockerfile b/.azure-pipelines/docker-sonic-vs/Dockerfile index 174fc9285..de02bdefc 100644 --- a/.azure-pipelines/docker-sonic-vs/Dockerfile +++ b/.azure-pipelines/docker-sonic-vs/Dockerfile @@ -4,14 +4,7 @@ ARG docker_container_name ADD ["debs", "/debs"] -RUN dpkg --purge python-swsscommon -RUN dpkg --purge python3-swsscommon -RUN dpkg --purge swss -RUN dpkg --purge libsairedis -RUN dpkg --purge libswsscommon -RUN dpkg --purge libsaimetadata -RUN dpkg --purge libsaivs -RUN dpkg --purge syncd-vs +RUN dpkg --purge python-swsscommon python3-swsscommon swss libsairedis sonic-db-cli libswsscommon libsaimetadata libsaivs syncd-vs RUN dpkg -i /debs/libswsscommon_1.0.0_amd64.deb RUN dpkg -i /debs/python-swsscommon_1.0.0_amd64.deb