Skip to content

[ci][broadcom] Build syncd-rpc docker for legacy-th image#26340

Merged
StormLiangMS merged 5 commits intosonic-net:masterfrom
lipxu:dev/xuliping/20260323_master_rpcdocker
Mar 26, 2026
Merged

[ci][broadcom] Build syncd-rpc docker for legacy-th image#26340
StormLiangMS merged 5 commits intosonic-net:masterfrom
lipxu:dev/xuliping/20260323_master_rpcdocker

Conversation

@lipxu
Copy link
Copy Markdown
Contributor

@lipxu lipxu commented Mar 23, 2026

Why I did it

The legacy-th (Tomahawk) platform requires a dedicated syncd-rpc docker to enable RPC-based SAI testing. Previously only docker-syncd-brcm-rpc was built for the standard broadcom image; there was no equivalent for the legacy-th image variant. This adds docker-syncd-brcm-legacy-th-rpc to support RPC-based SAI testing on Tomahawk legacy platforms.

Work item tracking
  • Microsoft ADO (number only):
  • 37047628

How I did it

  • Added platform/broadcom/docker-syncd-brcm-legacy-th-rpc.mk — Makefile for the new docker image
  • Added platform/broadcom/docker-syncd-brcm-legacy-th-rpc/Dockerfile.j2 — Dockerfile template
  • Added platform/broadcom/docker-syncd-brcm-legacy-th-rpc/base_image_files/bcmcmd — bcmcmd script
  • Added platform/broadcom/docker-syncd-brcm-legacy-th-rpc/base_image_files/bcmsh — bcmsh script
  • Added platform/broadcom/docker-syncd-brcm-legacy-th-rpc/ptf_nn_agent.conf — PTF NN agent config
  • Updated platform/broadcom/rules.mk to include the new docker in the build

How to verify it

  1. Build the broadcom legacy-th image with the new code
  2. Confirm docker-syncd-brcm-legacy-th-rpc image is produced alongside docker-syncd-brcm-rpc
  3. Boot a Tomahawk legacy-th device with the new image
  4. Verify the syncd-rpc container starts successfully

Which release branch to backport (provide reason below if selected)

Tested branch (Please provide the tested image version)

Description for the changelog

Add docker-syncd-brcm-legacy-th-rpc docker to support RPC-based SAI testing on Tomahawk legacy platforms.

Link to config_db schema for YANG module changes

N/A

lipxu and others added 5 commits March 23, 2026 21:36
Add docker-syncd-brcm-legacy-th-rpc docker and build it in the pipeline
alongside the existing docker-syncd-brcm-rpc build step.

Cherry-picked from internal commit f2ff21395671ea0b75354604e84b3d007be57ab4
Note: .pipelines/template-stages.yml excluded (ADO-internal only)

Signed-off-by: Liping Xu <xuliping@microsoft.com>
Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com>
- Move \ inside ifeq (INSTALL_DEBUG_TOOLS) block to align
  with docker-syncd-brcm-rpc.mk (only needed for debug builds)
- Add _AFTER = \ to enforce build ordering
  and prevent race conditions with the base image
- Add docker-syncd-brcm-legacy-th-rpc.dep for cache invalidation support,
  following the same pattern as docker-syncd-brcm-rpc.dep

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com>
Replace bcmcmd/bcmsh with the simpler single-ASIC versions used by
docker-syncd-brcm-rpc, and remove bcm_common. The RPC container is
used for SAI testing on single-ASIC setups, so the multi-ASIC capable
scripts from the non-RPC legacy-th base are unnecessary. This aligns
all RPC containers to use consistent, simpler host-side BCM scripts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com>
…ncd-brcm-legacy-th-rpc.mk

_LOAD_DOCKERS already implies build ordering dependency on the base image,
consistent with docker-syncd-brcm-rpc.mk which also uses _LOAD_DOCKERS
without any _AFTER directive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com>
Use the rsync_from_builder_stage() Jinja2 macro instead of the inline
rsync command to apply builder stage changes. The macro also includes
the --omit-dir-times flag which was missing from the raw command.

Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lipxu lipxu requested a review from lguohan as a code owner March 23, 2026 21:36
Copilot AI review requested due to automatic review settings March 23, 2026 21:36
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a Broadcom legacy-th (Tomahawk) variant of the syncd RPC container image so RPC-based SAI testing can be enabled on legacy-th builds.

Changes:

  • Adds new docker image definition docker-syncd-brcm-legacy-th-rpc (Makefile + Dockerfile template + supporting files).
  • Adds a new dpkg-cache dependency file for the new docker image.
  • Wires the new image into the Broadcom platform build includes.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
platform/broadcom/rules.mk Includes the new legacy-th RPC syncd docker make rules in the Broadcom platform build.
platform/broadcom/docker-syncd-brcm-legacy-th-rpc.mk Defines the new docker-syncd-brcm-legacy-th-rpc image build/install behavior and runtime options.
platform/broadcom/docker-syncd-brcm-legacy-th-rpc/Dockerfile.j2 Dockerfile template to layer RPC/test dependencies onto the legacy-th syncd base image.
platform/broadcom/docker-syncd-brcm-legacy-th-rpc/ptf_nn_agent.conf Supervisor program config to run ptf_nn_agent for RPC-based testing.
platform/broadcom/docker-syncd-brcm-legacy-th-rpc/base_image_files/bcmcmd Host wrapper to run bcmcmd inside the syncd container.
platform/broadcom/docker-syncd-brcm-legacy-th-rpc/base_image_files/bcmsh Host wrapper to run bcmsh inside the syncd container.
platform/broadcom/docker-syncd-brcm-legacy-th-rpc.dep Declares dpkg-cache dependency inputs for the new docker image.

include $(PLATFORM_PATH)/docker-syncd-brcm-rpc.mk
include $(PLATFORM_PATH)/docker-saiserver-brcm.mk
include $(PLATFORM_PATH)/docker-syncd-brcm-legacy-th.mk
include $(PLATFORM_PATH)/docker-syncd-brcm-legacy-th-rpc.mk
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

platform/broadcom/rules.mk includes the new docker-syncd-brcm-legacy-th-rpc.mk, but the corresponding .dep file (platform/broadcom/docker-syncd-brcm-legacy-th-rpc.dep) is not added to the platform dep include list. Other Broadcom docker additions keep rules.mk and rules.dep in sync (e.g., docker-syncd-brcm-rpc.dep is included in platform/broadcom/rules.dep). Please add an include $(PLATFORM_PATH)/docker-syncd-brcm-legacy-th-rpc.dep entry so dpkg-cache dependency tracking works for this new image.

Suggested change
include $(PLATFORM_PATH)/docker-syncd-brcm-legacy-th-rpc.mk
include $(PLATFORM_PATH)/docker-syncd-brcm-legacy-th-rpc.mk
include $(PLATFORM_PATH)/docker-syncd-brcm-legacy-th-rpc.dep

Copilot uses AI. Check for mistakes.
@lipxu lipxu requested a review from StormLiangMS March 24, 2026 05:05
Copy link
Copy Markdown
Contributor

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

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

LGTM

@StormLiangMS StormLiangMS merged commit f61fb0d into sonic-net:master Mar 26, 2026
20 checks passed
lipxu added a commit to lipxu/sonic-buildimage that referenced this pull request Mar 26, 2026
…rcm-legacy-th-rpc.mk

Now that docker-syncd-brcm-legacy-th-rpc.mk exists (added by PR sonic-net#26340),
apply the same warmboot mount fix: remove the static -v /host/warmboot:/var/warmboot
in favour of the dynamic mount generated at runtime via docker_image_ctl.j2
(consistent with PR sonic-net#25071 and the companion fix in docker-syncd-brcm-legacy-th.mk).

Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com>
StormLiangMS pushed a commit that referenced this pull request Mar 31, 2026
…rcm-legacy-th.mk (#26292)

* [platform/broadcom]: Remove static warmboot mount from docker-syncd-brcm-legacy-th.mk

PR #25071 migrated warmboot mounts from the static -v /host/warmboot:/var/warmboot
in .mk files to a dynamic -v /host/warmbootDEV:/var/warmboot generated at runtime
via docker_image_ctl.j2 to support multi-ASIC devices. However, it missed updating
docker-syncd-brcm-legacy-th.mk. This commit applies the same fix to align with
the changes introduced in PR #25071.

Note: docker-syncd-brcm-legacy-th-rpc.mk will be updated in a follow-up commit
once PR #26215 is merged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com>

* [platform/broadcom]: Remove static warmboot mount from docker-syncd-brcm-legacy-th-rpc.mk

Now that docker-syncd-brcm-legacy-th-rpc.mk exists (added by PR #26340),
apply the same warmboot mount fix: remove the static -v /host/warmboot:/var/warmboot
in favour of the dynamic mount generated at runtime via docker_image_ctl.j2
(consistent with PR #25071 and the companion fix in docker-syncd-brcm-legacy-th.mk).

Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com>

---------

Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants