Skip to content

Commit

Permalink
Update the Azure Pipeline build to use Bookworm and Ubuntu 22.04
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
saiarcot895 committed Oct 30, 2024
1 parent 352234a commit 35a7a46
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 32 deletions.
1 change: 0 additions & 1 deletion .azure-pipelines/build-sairedis-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
69 changes: 38 additions & 31 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}:
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 35a7a46

Please sign in to comment.