Add quick KVM test pipeline for sonic-mgmt PRs#24
Open
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Open
Add quick KVM test pipeline for sonic-mgmt PRs#24devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
devin-ai-integration[bot] wants to merge 1 commit intomasterfrom
Conversation
Adds a new pipeline that runs KVM tests without rebuilding docker-sonic-mgmt or the VS image from scratch. Key features: - Caches docker-sonic-mgmt on the self-hosted agent (sonic-build-01) so only the first run builds from source; subsequent runs reuse the cached image - Downloads pre-built VS image via URL parameter or reuses one already present on the agent - Supports all KVM topologies (t0, t1-lag, dualtor, t2, etc.) - Can run specific test scripts or full test suites - Designed to be added as a Build Validation policy on sonic-mgmt for automatic PR triggering - Publishes JUnit test results and KVM dumps on failure Co-Authored-By: Arthur Poon <arthur.poon@windsurf.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
Currently, running KVM tests for sonic-mgmt changes requires a full BuildVS pipeline run (2-4 hours to build the VS image) plus building docker-sonic-mgmt from scratch (2+ hours). This makes iterating on test changes extremely slow. This PR adds a lightweight pipeline that caches the docker-sonic-mgmt image on the self-hosted agent and reuses a pre-built VS image, reducing test turnaround from 5-8 hours to under 2.5 hours (dominated by actual test runtime).
Designed to be attached as a Build Validation policy on the
arthur-cog-sonic/sonic-mgmtrepo so PRs there automatically trigger KVM tests.Work item tracking
How I did it
Added
.azure-pipelines/kvmtest-quick.yml— a single-job pipeline on thesonic-buildpool (sonic-build-01) with these stages:/data/cache/docker-sonic-mgmt.gz→ builds from source only on first run. Persists across pipeline runs on the self-hosted agent.kvmtest.shfor full suites orrun_tests.shfor specific scripts.How to verify it
.azure-pipelines/kvmtest-quick.ymlin sonic-buildimage.TOPOLOGY=t0and aVS_IMAGE_URLfrom a prior successful BuildVS artifact.masterbranch.Human review checklist
MGMT_IMAGE_SOURCE: Declared (lines ~92-97) with valuescache/buildbut never referenced in any step logic. Should it be wired in, or removed?VS_IMAGE_URLor pre-stage the image on the agent. Consider addingDownloadPipelineArtifact@2integration to auto-fetch from the latest BuildVS run.FORCE_REBUILD_MGMTistype: booleanbut compared as string"False"in bash. Verify ADO renders this correctly (likely asTrue/Falsecapitalized)./data/sonic-mgmt,/data/sonic-vm,/data/cacheassume sonic-build-01's filesystem layout. Acceptable for a self-hosted agent but worth noting.Which release branch to backport (provide reason below if selected)
N/A — this is a CI/CD infrastructure change, not a feature or bugfix for SONiC itself.
Tested branch (Please provide the tested image version)
Description for the changelog
Add quick KVM test pipeline for sonic-mgmt PR validation with cached docker-sonic-mgmt image.
Link to config_db schema for YANG module changes
N/A
Link to Devin run: https://cisco-demo.devinenterprise.com/sessions/9e2b276bb37c49cd8b0f54f73dd66118
Requested by: @arthurkkp-cog