Skip to content

Migrate CI pipeline from bookworm to trixie#372

Merged
yxieca merged 21 commits into
sonic-net:masterfrom
yxieca:feat/trixie-ci
Apr 20, 2026
Merged

Migrate CI pipeline from bookworm to trixie#372
yxieca merged 21 commits into
sonic-net:masterfrom
yxieca:feat/trixie-ci

Conversation

@yxieca

@yxieca yxieca commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

- What I did
Migrated the Azure Pipelines CI from the bookworm slave container to trixie.

- How I did it

  • Container image: sonic-slave-bookworm:latestsonic-slave-trixie:latest
  • Artifact paths: debs/bookworm/debs/trixie/, python-wheels/bookworm/python-wheels/trixie/
  • hiredis: libhiredis0.14libhiredis1.1.0 (trixie ships hiredis 1.1.0)
  • Unit tests: python3 setup.py testpython3 -m pytest (setup.py test is deprecated)
  • .NET repo: packages.microsoft.com/debian/12/proddebian/13/prod

- How to verify it
CI pipeline should pass with trixie slave and trixie artifacts.

- Description for the changelog
Migrate CI pipeline from bookworm to trixie slave container and artifacts.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

libyang_1.0.73 (SONiC custom build) depends on libpcre3 which is not
installed by default on trixie. Install it alongside libhiredis.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

libpcre3 is not available in trixie repos. SONiC builds it from source
(src/libpcre3), so install it from the pipeline 142 trixie debs before
installing libyang which depends on it.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

yxieca added 2 commits April 16, 2026 15:30
Replace assertEquals with assertEqual in test_lldp.py and
namespace/test_lldp.py. Replace failIf with assertFalse in
test_PDUHeader.py. These aliases were deprecated since Python 3.1
and removed in Python 3.12.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
Add load_database_config() call in TestQueueCounters.setUpClass().
When running with pytest instead of 'python3 setup.py test', test
discovery order differs and the global DB config may not be loaded
by a previously-run test module. This caused RuntimeError:
'Load the global DB config first using API load_sonic_global_db_config'.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

On pytest 8 (trixie/Python 3.13), test collection order changed to
fully alphabetical paths, causing tests/namespace/ to run before
tests/. The namespace tests call load_namespace_config() which sets
multi-namespace SonicDBConfig state, but tests/test_lldp.py never
reset this, causing its updaters to load from global_db/ mock data
instead of the root mock data.

Add load_database_config() and importlib.reload(ieee802_1ab) to
test_lldp.py's setUpClass to explicitly initialize single-namespace
DB config, matching the pattern used by namespace/test_lldp.py.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

pytest 8 (trixie) does not guarantee test file ordering. When
namespace tests run before test_queues_stat.py, the Namespace class
retains db_config_loaded=True from the multi-namespace setup. This
causes ciscoSwitchQosMIB to attempt namespace validation for asic0
against a single-namespace config, triggering RuntimeError.

Fix by resetting Namespace.db_config_loaded and reloading the
ciscoSwitchQosMIB module in setUpClass, matching the pattern used
in the test_lldp.py fix.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

apt-key was removed in Debian trixie. Use the modern gpg keyring
approach instead.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Microsoft's Debian 13 apt repo is not signed/available yet.
Use the official dotnet-install.sh script which works on any distro.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread azure-pipelines.yml Outdated
Comment on lines +72 to +75
curl -sSL https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 8.0
export PATH="$HOME/.dotnet:$PATH"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use https://packages.microsoft.com/keys/microsoft-2025.asc for downloading the public key and try using that for the Trixie repo.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — switched to microsoft-2025.asc in commit 88f0b68. Thanks for the pointer!

Per reviewer suggestion, use the new 2025 signing key for Microsoft's
Debian 13 apt repository.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread azure-pipelines.yml Outdated
Comment on lines +52 to +53
sudo apt-get -y purge libhiredis-dev libnl-3-dev libnl-route-3-dev
sudo apt-get -y install libhiredis0.14
sudo dpkg -i ../target/debs/bookworm/{libyang_1.0.73_amd64.deb,libswsscommon_1.0.0_amd64.deb,python3-swsscommon_1.0.0_amd64.deb,libnl-3-200_*.deb,libnl-genl-3-200_*.deb,libnl-nf-3-200_*.deb,libnl-route-3-200_*.deb}
sudo python3 -m pip install ../target/python-wheels/bookworm/swsssdk*-py3-*.whl
sudo python3 -m pip install ../target/python-wheels/bookworm/sonic_py_common-1.0-py3-none-any.whl
sudo apt-get -y install libhiredis1.1.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In these two lines, try removing the libhiredis-dev from the sudo apt-get -y purge command, and remove the sudo apt-get -y install libhiredis1.1.0 line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — verified the trixie slave already has libhiredis-dev (1.2.0-6+b3) and libhiredis1.1.0 pre-installed. Removed both lines in commit 68d1618.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

…ments conflict

Verified locally in trixie slave container:
- diff-cover not available via apt on trixie
- pip install fails due to Pygments RECORD file missing (debian-managed)
- pip install --break-system-packages --ignore-installed works
- /usr/bin/python already exists in trixie slave (no symlink needed)
- Removed debug step

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Trixie slave already has libhiredis-dev and libhiredis1.1.0 installed.
No need to purge and reinstall.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread azure-pipelines.yml Outdated
# 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/12/prod
curl -sSL https://packages.microsoft.com/keys/microsoft-2025.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not install this key into /usr/share/keyrings. Use either /etc/apt/keyrings or /etc/apt/trusted.gpg.d.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — moved to /etc/apt/keyrings in commit 23aa88d. Verified locally in trixie slave.

Comment thread azure-pipelines.yml
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@yxieca yxieca merged commit 6bc7412 into sonic-net:master Apr 20, 2026
6 checks passed
@yxieca yxieca deleted the feat/trixie-ci branch April 20, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants