Skip to content

[202511] Backport docker-sonic-mgmt dependency and security updates from master#28537

Open
lunyue-ms wants to merge 2 commits into
sonic-net:202511from
lunyue-ms:lunyue/backport-docker-sonic-mgmt-202511
Open

[202511] Backport docker-sonic-mgmt dependency and security updates from master#28537
lunyue-ms wants to merge 2 commits into
sonic-net:202511from
lunyue-ms:lunyue/backport-docker-sonic-mgmt-202511

Conversation

@lunyue-ms

@lunyue-ms lunyue-ms commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Why I did it

dockers/docker-sonic-mgmt/ and .azure-pipelines/docker-sonic-mgmt.yml on 202511 were behind master. This aligns the docker-sonic-mgmt image and its build pipeline on 202511 with master — without SBOM (see "Why no SBOM" below).

Work item tracking
  • Microsoft ADO (number only):

How I did it

Took master's version of the affected files directly (rather than per-commit cherry-picks) and adjusted the branch-specific bits, as a single signed-off commit:

  • dockers/docker-sonic-mgmt/Dockerfile.j2 and dockers/docker-sonic-mgmt/0001-Fix-getattr-AttributeError-in-multi-thread-scenario.patch are taken from master (byte-identical to master).
  • .azure-pipelines/docker-sonic-mgmt.yml is aligned with master minus SBOM: the two ENABLE_SBOM=y build flags and the sbom_vuln_scan job are removed. Vulnerability scanning is instead provided by a self-contained Trivy trivy_scan job in a dedicated, non-gating SecurityScan stage (runs in parallel with Test, does not block Publish), mirroring the Trivy scan already used by docker-ptf.yml on 202511 — only the pipeline YAML is needed, no repo scripts. No changes to slave.mk/Makefile.work/rules/config.
  • The pr_test_template.yml@sonic-mgmt call drops INCLUDE_JOBS: sonic-mgmt@202511's pr_test_template.yml does not declare that parameter (job selection there is impacted-area driven), so passing it fails YAML compilation with Unexpected parameter 'INCLUDE_JOBS'. Only CHECKOUT_SONIC_MGMT and OVERRIDE_PARAMS (both supported by the 202511 template) are passed.
  • Branch-specific fields target this branch: the schedules/pr branch filters and the sonic-mgmt resource ref202511.
  • The published image is tagged with the branch namedocker-sonic-mgmt:202511 and docker-sonic-mgmt:202511-lastbuild — instead of :latest/:lastbuild, so a 202511 build never overwrites master's shared docker-sonic-mgmt:latest/:lastbuild in the registry. (The local build image tag docker-sonic-mgmt:latest is left unchanged.)

Why no SBOM: the SBOM feature was introduced on master by #27455 (merged 2026-05-28). 202511 was branched from master on 2025-11-19, ~6 months earlier, and #27455 was never backported to 202511, so this branch lacks the ENABLE_SBOM build machinery + scripts/build_sbom.py + scripts/sbom_vuln_scan.py + vex/. Backporting the whole SBOM feature into 202511's build core is out of scope for this PR. Instead, 202511 does vulnerability scanning with Trivy, not SBOM — the pre-SBOM Trivy scan already present on this branch (e.g. docker-ptf.yml) is reused for docker-sonic-mgmt, needing only the pipeline YAML and none of the scripts/sbom_*.py machinery.

Squashed into one commit authored & signed off by me so DCO passes.

How to verify it

Build docker-sonic-mgmt on 202511; confirm the pip package versions match master and the ansible 13.6.0 patch (ansible-core 2.20.5) applies. The pipeline publishes docker-sonic-mgmt:202511.

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

This PR is itself the backport to 202511.

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • 202608

Tested branch

  • 202511

Test result

Pending a build; will update with the tested image version.

Description for the changelog

Align docker-sonic-mgmt image and build pipeline on 202511 with master (without SBOM); publish the image under a branch-qualified tag (docker-sonic-mgmt:202511).

Link to config_db schema for YANG module changes

N/A. No YANG or config_db schema changes.

@lunyue-ms
lunyue-ms requested a review from lguohan as a code owner July 21, 2026 09:09
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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

@lunyue-ms
lunyue-ms force-pushed the lunyue/backport-docker-sonic-mgmt-202511 branch from 12351f5 to bc4744f Compare July 23, 2026 02:35
Align the docker-sonic-mgmt image (Dockerfile.j2 and the ansible getattr
patch) and its build pipeline (.azure-pipelines/docker-sonic-mgmt.yml) with
master. SBOM generation/scan is intentionally left out because 202511 does not
carry the SBOM build machinery (the SBOM feature sonic-net#27455 was never backported to
this branch). The pr_test_template call drops INCLUDE_JOBS because
sonic-mgmt@202511's pr_test_template.yml does not declare that parameter (job
selection there is impacted-area driven). Branch-specific fields (schedule/pr
branch filters and the sonic-mgmt resource ref) target 202511, and the
published image is tagged with the branch name (docker-sonic-mgmt:202511 and
:202511-lastbuild) instead of :latest/:lastbuild so it never overwrites
master's published mgmt image.

Signed-off-by: Lun Yue <17232861+lunyue-ms@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lunyue-ms
lunyue-ms force-pushed the lunyue/backport-docker-sonic-mgmt-202511 branch from bc4744f to 2cf905b Compare July 23, 2026 02:47
@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).

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request for branch(es): 202511.
Added label(s) for branch(es) 202511.

---Powered by SONiC BuildBot

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request label(s) for branch(es): 202511, but is missing required test information. Please make sure you tick the tested branch(es) in the Tested branch section and provide test evidence (e.g., 202511: <test result>) in the Test result section as well in your PR description.

---Powered by SONiC BuildBot

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

202511 does not carry the SBOM-based vulnerability scan (scripts/sbom_*.py
are master-only). Reuse the branch's existing self-contained Trivy scan
(already used by docker-ptf.yml on 202511) for docker-sonic-mgmt: a new
optional trivy_scan job downloads the built image artifact, installs Trivy,
and scans it for MEDIUM/HIGH/CRITICAL vulnerabilities. Only the pipeline
YAML changes; no repo scripts are required.

Signed-off-by: Lun Yue <17232861+lunyue-ms@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lunyue-ms
lunyue-ms force-pushed the lunyue/backport-docker-sonic-mgmt-202511 branch from 5416bff to d0ea30f Compare July 23, 2026 08:49
@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).

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.

2 participants