Skip to content

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

Merged
vmittal-msft merged 5 commits intosonic-net:202511from
lipxu:dev/xuliping/20260317_202511_rpcdocker
Mar 23, 2026
Merged

[202511][ci][broadcom] Build syncd-rpc docker for legacy-th image#26215
vmittal-msft merged 5 commits intosonic-net:202511from
lipxu:dev/xuliping/20260317_202511_rpcdocker

Conversation

@lipxu
Copy link
Copy Markdown
Contributor

@lipxu lipxu commented Mar 17, 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):

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/bcm_common — BCM common script
  • 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)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

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

A picture of a cute animal (not mandatory but encouraged)

🐧

@lipxu lipxu requested a review from lguohan as a code owner March 17, 2026 01:00
@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).

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>
@lipxu lipxu force-pushed the dev/xuliping/20260317_202511_rpcdocker branch from bbc33db to b011dbb Compare March 17, 2026 05:05
@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

@XuChen-MSFT XuChen-MSFT left a comment

Choose a reason for hiding this comment

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

Review Summary

Compared against docker-syncd-brcm-rpc (standard RPC) and docker-syncd-brcm-legacy-th (non-RPC base). Shell scripts (bcm_common, bcmcmd, bcmsh) are byte-identical to the legacy-th base — verified by SHA match. Dockerfile.j2 correctly adapts the brcm-rpc template with proper Jinja2 variable renaming (docker_syncd_brcm_legacy_th_rpc_debs). Overall structure looks good.

Issues

1. Missing .dep file (echoing @saiarcot895)
docker-syncd-brcm-rpc.dep exists for the standard RPC docker. A corresponding docker-syncd-brcm-legacy-th-rpc.dep should be added following the same pattern:

DPATH       := $($(DOCKER_SYNCD_BRCM_LEGACY_TH_RPC)_PATH)
DEP_FILES   := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-brcm-legacy-th-rpc.mk $(PLATFORM_PATH)/docker-syncd-brcm-legacy-th-rpc.dep
DEP_FILES   += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES   += $(shell git ls-files $(DPATH))

$(DOCKER_SYNCD_BRCM_LEGACY_TH_RPC)_CACHE_MODE  := GIT_CONTENT_SHA
$(DOCKER_SYNCD_BRCM_LEGACY_TH_RPC)_DEP_FLAGS   := $(SONIC_COMMON_FLAGS_LIST)
$(DOCKER_SYNCD_BRCM_LEGACY_TH_RPC)_DEP_FILES   := $(DEP_FILES)

2. $(SSWSYNCD) dependency placement inconsistency (docker-syncd-brcm-legacy-th-rpc.mk line 6)
In the standard docker-syncd-brcm-rpc.mk, $(SSWSYNCD) is inside the ifeq ($(INSTALL_DEBUG_TOOLS), y) block (debug-only). In this PR it's an unconditional top-level dependency. The non-RPC legacy-th base also has it unconditional, so this may be intentional — but please confirm whether the RPC container truly needs sswsyncd in non-debug builds.

3. Consider adding _AFTER build ordering (docker-syncd-brcm-legacy-th-rpc.mk)
The non-RPC legacy-th base has $(DOCKER_SYNCD_LEGACY_TH_BASE)_AFTER = $(DOCKER_SYNCD_DNX_BASE) to prevent build race conditions. The RPC variant may need a similar directive (e.g., _AFTER = $(DOCKER_SYNCD_LEGACY_TH_BASE)) to ensure the base image is built first.

- 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>
@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).

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>
@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).

…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>
@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).

@lipxu
Copy link
Copy Markdown
Contributor Author

lipxu commented Mar 20, 2026

@XuChen-MSFT Thank you for the thorough review! Here's how each item was addressed:

1. Missing .dep file — Fixed in commit 0b2ffc238. Added platform/broadcom/docker-syncd-brcm-legacy-th-rpc.dep following the same pattern as docker-syncd-brcm-rpc.dep.

2. $(SSWSYNCD) dependency placement — Fixed in commit 0b2ffc238. Moved $(SSWSYNCD) inside the ifeq ($(INSTALL_DEBUG_TOOLS), y) block to be consistent with docker-syncd-brcm-rpc.mk. The RPC container is used for SAI testing and does not require sswsyncd in non-debug builds.

3. _AFTER build ordering — After further investigation, we found that _LOAD_DOCKERS already implies the build ordering dependency (the base image must be built first). The standard docker-syncd-brcm-rpc.mk also uses _LOAD_DOCKERS without any _AFTER directive, confirming it is not needed. Therefore _AFTER was not added (removed in commit c9fa32809).

lipxu added a commit to lipxu/sonic-buildimage that referenced this pull request Mar 20, 2026
…rcm-legacy-th.mk

PR sonic-net#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 sonic-net#25071.

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

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

@XuChen-MSFT XuChen-MSFT left a comment

Choose a reason for hiding this comment

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

All 3 review items have been addressed:

  1. Missing .dep file — ✅ docker-syncd-brcm-legacy-th-rpc.dep added following docker-syncd-brcm-rpc.dep pattern
  2. ** placement** — ✅ Moved inside ifeq (, y) block, consistent with docker-syncd-brcm-rpc.mk
  3. _AFTER build ordering — ✅ Not needed — _LOAD_DOCKERS already implies build ordering, consistent with standard RPC docker

Code is correct and consistent with codebase patterns. Approving.

Copy link
Copy Markdown
Contributor

@XuChen-MSFT XuChen-MSFT left a comment

Choose a reason for hiding this comment

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

All 3 review items have been addressed:

  1. Missing .dep file — Added docker-syncd-brcm-legacy-th-rpc.dep following docker-syncd-brcm-rpc.dep pattern
  2. SSWSYNCD placement — Moved inside ifeq (INSTALL_DEBUG_TOOLS) block, consistent with docker-syncd-brcm-rpc.mk
  3. _AFTER build ordering — Not needed — _LOAD_DOCKERS already implies build ordering, consistent with standard RPC docker

Code is correct and consistent with codebase patterns. Approving.

Copy link
Copy Markdown
Contributor

@XuChen-MSFT XuChen-MSFT left a comment

Choose a reason for hiding this comment

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

All review comments have been addressed. Approving.

Copy link
Copy Markdown
Contributor

@XuChen-MSFT XuChen-MSFT left a comment

Choose a reason for hiding this comment

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

All review comments have been addressed. Approving.


FROM $BASE

RUN --mount=type=bind,from=base,target=/changes-to-image rsync -axAX --no-D --exclude=/sys --exclude=/proc --exclude=/dev --exclude=resolv.conf /changes-to-image/ /
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 the rsync_from_builder_stage here.

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.

Thank you for the suggestion! Fixed in commit cd3c343e4.

Copy link
Copy Markdown
Contributor

@XuChen-MSFT XuChen-MSFT left a comment

Choose a reason for hiding this comment

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

All review comments have been addressed. Approving.

Copy link
Copy Markdown
Contributor

@XuChen-MSFT XuChen-MSFT left a comment

Choose a reason for hiding this comment

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

All review comments have been addressed. Approving.

@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).

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 force-pushed the dev/xuliping/20260317_202511_rpcdocker branch from c0e0208 to cd3c343 Compare March 21, 2026 09:37
@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).

@vmittal-msft vmittal-msft merged commit c473f31 into sonic-net:202511 Mar 23, 2026
13 checks passed
lipxu added a commit to lipxu/sonic-buildimage that referenced this pull request Mar 26, 2026
…rcm-legacy-th.mk

PR sonic-net#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 sonic-net#25071.

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: xuliping@microsoft.com <xuliping@microsoft.com>
@lipxu lipxu changed the title [ci][broadcom] Build syncd-rpc docker for legacy-th image [202511][ci][broadcom] Build syncd-rpc docker for legacy-th image Mar 26, 2026
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.

5 participants