[202511][ci][broadcom] Build syncd-rpc docker for legacy-th image#26215
Conversation
|
/azp run Azure.sonic-buildimage |
|
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>
bbc33db to
b011dbb
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
XuChen-MSFT
left a comment
There was a problem hiding this comment.
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>
|
/azp run Azure.sonic-buildimage |
|
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>
|
/azp run Azure.sonic-buildimage |
|
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>
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@XuChen-MSFT Thank you for the thorough review! Here's how each item was addressed: 1. Missing 2. 3. |
…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>
XuChen-MSFT
left a comment
There was a problem hiding this comment.
All 3 review items have been addressed:
- Missing .dep file — ✅ docker-syncd-brcm-legacy-th-rpc.dep added following docker-syncd-brcm-rpc.dep pattern
- ** placement** — ✅ Moved inside ifeq (, y) block, consistent with docker-syncd-brcm-rpc.mk
- _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.
XuChen-MSFT
left a comment
There was a problem hiding this comment.
All 3 review items have been addressed:
- Missing .dep file — Added
docker-syncd-brcm-legacy-th-rpc.depfollowingdocker-syncd-brcm-rpc.deppattern - SSWSYNCD placement — Moved inside
ifeq (INSTALL_DEBUG_TOOLS)block, consistent withdocker-syncd-brcm-rpc.mk - _AFTER build ordering — Not needed —
_LOAD_DOCKERSalready implies build ordering, consistent with standard RPC docker
Code is correct and consistent with codebase patterns. Approving.
XuChen-MSFT
left a comment
There was a problem hiding this comment.
All review comments have been addressed. Approving.
XuChen-MSFT
left a comment
There was a problem hiding this comment.
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/ / |
There was a problem hiding this comment.
Use the rsync_from_builder_stage here.
There was a problem hiding this comment.
Thank you for the suggestion! Fixed in commit cd3c343e4.
XuChen-MSFT
left a comment
There was a problem hiding this comment.
All review comments have been addressed. Approving.
XuChen-MSFT
left a comment
There was a problem hiding this comment.
All review comments have been addressed. Approving.
|
/azp run Azure.sonic-buildimage |
|
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>
c0e0208 to
cd3c343
Compare
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…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>
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-rpcwas built for the standard broadcom image; there was no equivalent for thelegacy-thimage variant. This addsdocker-syncd-brcm-legacy-th-rpcto support RPC-based SAI testing on Tomahawk legacy platforms.Work item tracking
How I did it
platform/broadcom/docker-syncd-brcm-legacy-th-rpc.mk— Makefile for the new docker imageplatform/broadcom/docker-syncd-brcm-legacy-th-rpc/Dockerfile.j2— Dockerfile templateplatform/broadcom/docker-syncd-brcm-legacy-th-rpc/base_image_files/bcm_common— BCM common scriptplatform/broadcom/docker-syncd-brcm-legacy-th-rpc/base_image_files/bcmcmd— bcmcmd scriptplatform/broadcom/docker-syncd-brcm-legacy-th-rpc/base_image_files/bcmsh— bcmsh scriptplatform/broadcom/docker-syncd-brcm-legacy-th-rpc/ptf_nn_agent.conf— PTF NN agent configplatform/broadcom/rules.mkto include the new docker in the buildHow to verify it
docker-syncd-brcm-legacy-th-rpcimage is produced alongsidedocker-syncd-brcm-rpcWhich 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
A picture of a cute animal (not mandatory but encouraged)
🐧