Skip to content

Commit 688b708

Browse files
authored
[CI]Add a pipeline to generates daily, successful virtual SONiC images (sonic-net#22368)
<!-- Please make sure you've read and understood our contributing guidelines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md failure_prs.log skip_prs.log Make sure all your commits include a signature generated with `git commit -s` ** If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" or "resolves #xxxx" Please provide the following information: --> [CI]Add a pipeline to generates daily, successful virtual SONiC images #### Why I did it Currently, non-build repos such as sonic-mgmt PR testing is downloading vs images from PR build pipeline of sonic-buildimage, it doesn't make sense. This PR introduces a new pipeline yaml to use the merged code to build daily vs images with full tests. ##### Work item tracking - Microsoft ADO **(32017130)**: #### How I did it [CI]Add a pipeline to generates daily, successful virtual SONiC images with full tests. #### How to verify it This draft pipeline (https://dev.azure.com/mssonic/build/_build/results?buildId=815418&view=results) is to verify the whole procedure works as expceted. After merge: Will set up pipeline (https://dev.azure.com/mssonic/build/_build?definitionId=2925&_a=summary) based on YAML and update sonic-mgmt getbuild script to retrieve successful builds from the new pipeline. <!-- If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012. --> #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 - [ ] 202205 - [ ] 202211 - [ ] 202305 #### Tested branch (Please provide the tested image version) <!-- - Please provide tested image version - e.g. - [x] 20201231.100 --> - [ ] <!-- image version 1 --> - [ ] <!-- image version 2 --> #### Description for the changelog <!-- Write a short (one line) summary that describes the changes in this pull request for inclusion in the changelog: --> <!-- Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --> #### Link to config_db schema for YANG module changes <!-- Provide a link to config_db schema for the table for which YANG model is defined Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md --> #### A picture of a cute animal (not mandatory but encouraged)
1 parent c70a09c commit 688b708

File tree

1 file changed

+151
-0
lines changed

1 file changed

+151
-0
lines changed
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# This pipeline generates daily, successful virtual SONiC images, primarily for PR testing in non-build repositories.
2+
3+
name: $(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)
4+
5+
schedules:
6+
- cron: "0 */8 * * *" # At 0 minutes past the hour, every 8 hours, every day UTC
7+
displayName: "Daily Build and Test SONiC virtual images"
8+
branches:
9+
include:
10+
- master
11+
- 202305
12+
- 202311
13+
- 202405
14+
- 202411
15+
16+
trigger: none
17+
pr: none
18+
19+
resources:
20+
repositories:
21+
- repository: sonic-mgmt
22+
type: github
23+
name: sonic-net/sonic-mgmt
24+
ref: master
25+
endpoint: sonic-net
26+
- repository: buildimage
27+
type: github
28+
name: sonic-net/sonic-buildimage
29+
endpoint: sonic-net
30+
ref: master
31+
32+
variables:
33+
- template: .azure-pipelines/template-variables.yml@buildimage
34+
- name: BUILD_BRANCH
35+
value: $(Build.SourceBranchName)
36+
37+
stages:
38+
- stage: BuildVS
39+
pool: sonicbld-1es
40+
jobs:
41+
- template: azure-pipelines-build.yml
42+
parameters:
43+
buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) BUILD_MULTIASIC_KVM=y INCLUDE_DHCP_SERVER=y ${{ variables.VERSION_CONTROL_OPTIONS }}'
44+
jobGroups:
45+
- name: vs
46+
47+
- stage: Test
48+
dependsOn: BuildVS
49+
condition: and(succeeded(), in(dependencies.BuildVS.result, 'Succeeded', 'SucceededWithIssues'))
50+
variables:
51+
- group: SONiC-Elastictest
52+
53+
jobs:
54+
- job: t0_elastictest
55+
pool: sonic-ubuntu-1c
56+
displayName: "kvmtest-t0 by Elastictest"
57+
timeoutInMinutes: 240
58+
continueOnError: false
59+
steps:
60+
- template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt
61+
parameters:
62+
TOPOLOGY: t0
63+
MIN_WORKER: $(T0_INSTANCE_NUM)
64+
MAX_WORKER: $(T0_INSTANCE_NUM)
65+
MGMT_BRANCH: $(BUILD_BRANCH)
66+
67+
- job: t0_2vlans_elastictest
68+
pool: sonic-ubuntu-1c
69+
displayName: "kvmtest-t0-2vlans by Elastictest"
70+
timeoutInMinutes: 240
71+
continueOnError: false
72+
steps:
73+
- template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt
74+
parameters:
75+
TOPOLOGY: t0
76+
TEST_SET: t0-2vlans
77+
MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM)
78+
MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM)
79+
MGMT_BRANCH: $(BUILD_BRANCH)
80+
DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a"
81+
82+
- job: t1_lag_elastictest
83+
pool: sonic-ubuntu-1c
84+
displayName: "kvmtest-t1-lag by Elastictest"
85+
timeoutInMinutes: 240
86+
continueOnError: false
87+
steps:
88+
- template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt
89+
parameters:
90+
TOPOLOGY: t1-lag
91+
MIN_WORKER: $(T1_LAG_INSTANCE_NUM)
92+
MAX_WORKER: $(T1_LAG_INSTANCE_NUM)
93+
MGMT_BRANCH: $(BUILD_BRANCH)
94+
95+
- job: multi_asic_elastictest
96+
displayName: "kvmtest-multi-asic-t1-lag by Elastictest"
97+
pool: sonic-ubuntu-1c
98+
timeoutInMinutes: 240
99+
continueOnError: false
100+
steps:
101+
- template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt
102+
parameters:
103+
TOPOLOGY: t1-8-lag
104+
TEST_SET: multi-asic-t1-lag
105+
MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
106+
MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
107+
NUM_ASIC: 4
108+
MGMT_BRANCH: $(BUILD_BRANCH)
109+
110+
- job: dualtor_elastictest
111+
pool: sonic-ubuntu-1c
112+
displayName: "kvmtest-dualtor-t0 by Elastictest"
113+
timeoutInMinutes: 240
114+
continueOnError: false
115+
steps:
116+
- template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt
117+
parameters:
118+
TOPOLOGY: dualtor
119+
MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
120+
MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
121+
MGMT_BRANCH: $(BUILD_BRANCH)
122+
COMMON_EXTRA_PARAMS: "--disable_loganalyzer "
123+
124+
- job: sonic_t0_elastictest
125+
displayName: "kvmtest-t0-sonic by Elastictest"
126+
pool: sonic-ubuntu-1c
127+
timeoutInMinutes: 240
128+
continueOnError: false
129+
steps:
130+
- template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt
131+
parameters:
132+
TOPOLOGY: t0-64-32
133+
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM)
134+
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM)
135+
TEST_SET: t0-sonic
136+
MGMT_BRANCH: $(BUILD_BRANCH)
137+
COMMON_EXTRA_PARAMS: "--neighbor_type=sonic "
138+
VM_TYPE: vsonic
139+
140+
- job: dpu_elastictest
141+
displayName: "kvmtest-dpu by Elastictest"
142+
timeoutInMinutes: 240
143+
continueOnError: false
144+
pool: sonic-ubuntu-1c
145+
steps:
146+
- template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt
147+
parameters:
148+
TOPOLOGY: dpu
149+
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM)
150+
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM)
151+
MGMT_BRANCH: $(BUILD_BRANCH)

0 commit comments

Comments
 (0)