From 35a7a464971299b700ed38addddafc1b7a2dd244 Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Wed, 30 Oct 2024 13:50:05 -0700 Subject: [PATCH] Update the Azure Pipeline build to use Bookworm and Ubuntu 22.04 Update the Azure Pipeline build to build for Bookworm, and also build for Ubuntu 22.04 in addition to the current Ubuntu 20.04 build. This helps developers who are on Ubuntu 22.04 be able to use the built artifacts here. Signed-off-by: Saikrishna Arcot --- .azure-pipelines/build-sairedis-template.yml | 1 - azure-pipelines.yml | 69 +++++++++++--------- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/.azure-pipelines/build-sairedis-template.yml b/.azure-pipelines/build-sairedis-template.yml index b37d2fa44..b57eb9dec 100644 --- a/.azure-pipelines/build-sairedis-template.yml +++ b/.azure-pipelines/build-sairedis-template.yml @@ -66,7 +66,6 @@ jobs: set -ex sudo apt-get update sudo apt-get install -qq -y \ - qtbase5-dev \ libdbus-glib-1-dev \ libpcsclite-dev \ docbook-to-man \ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f5f233262..562fac6cd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -40,7 +40,7 @@ resources: parameters: - name: debian_version type: string - default: bullseye + default: bookworm variables: - name: BUILD_BRANCH ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: @@ -62,7 +62,7 @@ stages: sudo apt-get update sudo apt-get install -y make libtool m4 autoconf dh-exec debhelper cmake pkg-config nlohmann-json3-dev \ libhiredis-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libnl-nf-3-dev swig3.0 \ - libpython2.7-dev libboost-dev libboost-serialization-dev uuid-dev libzmq5 libzmq3-dev + libpython2.7-dev libboost-dev libboost-serialization-dev uuid-dev libzmq3-dev sudo apt-get install -y sudo sudo apt-get install -y redis-server redis-tools sudo apt-get install -y python3-pip @@ -88,6 +88,42 @@ stages: artifact: sonic-swss-common.amd64.ubuntu20_04 displayName: "Archive swss common debian packages" + - job: + displayName: "amd64/ubuntu-22.04" + pool: + vmImage: 'ubuntu-22.04' + + steps: + - script: | + sudo apt-get update + sudo apt-get install -y make libtool m4 autoconf dh-exec debhelper cmake pkg-config nlohmann-json3-dev \ + libhiredis-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libnl-nf-3-dev swig4.0 \ + libpython3-dev libboost-dev libboost-serialization-dev uuid-dev libzmq3-dev + sudo apt-get install -y sudo + sudo apt-get install -y redis-server redis-tools + sudo apt-get install -y python3-pip + sudo pip3 install pytest + sudo apt-get install -y python + sudo apt-get install cmake libgtest-dev libgmock-dev libyang-dev + cd /usr/src/gtest && sudo cmake . && sudo make + ARCH=$(dpkg --print-architecture) + set -x + sudo curl -fsSL -o /usr/local/bin/bazel \ + https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-${ARCH} + sudo chmod 755 /usr/local/bin/bazel + displayName: "Install dependencies" + - script: | + ./autogen.sh + dpkg-buildpackage -rfakeroot -us -uc -b -j$(nproc) && cp ../*.deb . + displayName: "Compile sonic swss common" + - script: | + bazel build //... + bazel test //... + displayName: "Compile and test all Bazel targets" + - publish: $(System.DefaultWorkingDirectory)/ + artifact: sonic-swss-common.amd64.ubuntu22_04 + displayName: "Archive swss common debian packages" + - template: .azure-pipelines/build-template.yml parameters: arch: amd64 @@ -119,35 +155,6 @@ stages: artifact_name: sonic-swss-common.arm64 debian_version: ${{ parameters.debian_version }} -- stage: BuildBookworm - dependsOn: BuildArm - condition: succeeded('BuildArm') - jobs: - - template: .azure-pipelines/build-template.yml - parameters: - arch: amd64 - sonic_slave: sonic-slave-bookworm:$(BUILD_BRANCH) - artifact_name: sonic-swss-common-bookworm - debian_version: ${{ parameters.debian_version }} - - - template: .azure-pipelines/build-template.yml - parameters: - arch: armhf - timeout: 180 - pool: sonicbld-armhf - sonic_slave: sonic-slave-bookworm-armhf:$(BUILD_BRANCH) - artifact_name: sonic-swss-common-bookworm.armhf - debian_version: ${{ parameters.debian_version }} - - - template: .azure-pipelines/build-template.yml - parameters: - arch: arm64 - timeout: 180 - pool: sonicbld-arm64 - sonic_slave: sonic-slave-bookworm-arm64:$(BUILD_BRANCH) - artifact_name: sonic-swss-common-bookworm.arm64 - debian_version: ${{ parameters.debian_version }} - - stage: BuildSairedis dependsOn: Build condition: succeeded('Build')