Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Azure Pipeline build to use Bookworm and Ubuntu 22.04 #937

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
14 changes: 2 additions & 12 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,6 @@ jobs:
mv ../*.deb .
displayName: "Compile sonic swss common with coverage enabled"
- ${{ if eq(parameters.run_unit_test, true) }}:
- script: |
set -ex
git clone https://github.com/gcovr/gcovr.git
cd gcovr/
git checkout 5.2
sudo pip3 install setuptools
sudo python3 setup.py install
cd ..
sudo rm -rf gcovr
displayName: "Install gcovr 5.2 (for --exclude-throw-branches support)"
- script: |
set -ex
sudo pip install Pympler==0.8 pytest
Expand Down Expand Up @@ -142,9 +132,9 @@ jobs:
set -ex
# Install .NET CORE
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/debian/11/prod
sudo apt-add-repository https://packages.microsoft.com/debian/12/prod
sudo apt-get update
sudo apt-get install -y dotnet-sdk-6.0
sudo apt-get install -y dotnet-sdk-8.0
displayName: "Install .NET CORE"
- task: PublishCodeCoverageResults@1
inputs:
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 -Pnopython2 -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
Loading