Commit Graph

55 Commits

Author SHA1 Message Date
Yutong Zhang
f1fa8a6c8e
[TestbedV2][202205]Set all jobs mandatory in pipeline. (#12939)
Recently, the job of t0-sonic runs stably in 202205 branch, so in this pr, I set it mandatory in azure pipeline.

Why I did it
Recently, the job of t0-sonic runs stably in 202205 branch, so in this pr, I set it mandatory in azure pipeline.

How I did it
Modify the value of continueOnError in this job from `true` to `false`.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
2022-12-06 10:18:49 +08:00
Yutong Zhang
8e4b9bc031
[TestbedV2][202205] Remove timeout in each step. (#12917)
Previously, we set timeout in each step such as Lock testbed, Prepare testbed, Run test and KVM dump. When some issue suck like retry happens in one step, it will cause timeout error, but actually, it only needs more time to success. In this pr, we remove the timeout limit in each step and control the timeout outside in each job. When the job runs more than four hours, it will be cancelled.

Why I did it
Previously, we set timeout in each step such as Lock testbed, Prepare testbed, Run test and KVM dump. When some issue suck like retry happens in one step, it will cause timeout error, but actually, it only needs more time to success. In this pr, we remove the timeout limit in each step and control the timeout outside in each job. When the job runs more than four hours, it will be cancelled.

How I did it
Remove the timeout parameter in each step, and control the timeout outside in each job.

How to verify it
Set the timeout of one job to 4 hours, and when timeout happens, azure pipeline will cancel this job.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
2022-12-05 14:49:02 +08:00
Yutong Zhang
d14621563f
Support passing the instance numbers of a testplan. (#12881)
Previously, we hard code the min and max numbers of instance in a plan. In this pr, we support passing the instance numbers of a testplan.

Why I did it
Previously, we hard code the min and max numbers of instance in a plan. In this pr, we support passing the instance numbers of a testplan.

How I did it
Use a variable to set the instance number.
2022-12-01 08:48:57 +08:00
SuvarnaMeenakshi
37cff8be2b [multi-asic]: Add build param to build multi-asic KVM image. (#11453)
Why I did it
[multi-asic]: Add build param to build multi-asic KVM image.
Require sonic-4asic-vs.img.gz to run multi-asic tests.
BUILD_MULTIASIC_KVM=y has to be added to build parameter to generate multi-asic KVM image which can be eventually used in multi-asic VS testbed.
This is a pipeline that we currently have to generate multi-asic KVM image:
https://github.com/Azure/sonic-buildimage/blob/master/.azure-pipelines/official-build-multi-asic.yml

How I did it
Add BUILD_MULTIASIC_KVM=y to build parameter in pipeline script to generate multi-asic KVM image.

How to verify it
The build param is already used in official-build-multi-asic.yml pipeline.
2022-11-27 04:19:32 +00:00
Yutong Zhang
91b6d2c938
[202205][TestbedV2] Add dualtor test jobs using TestbedV2. (#12673)
Add dualtor test jobs using TestbedV2 in 202205 branch.

Why I did it
Add dualtor test jobs using TestbedV2 in 202205 branch.

How I did it
Add dualtor test jobs using TestbedV2 in 202205 branch.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
2022-11-12 11:03:36 +08:00
Yutong Zhang
4e3a0bb4ab
[202205][TestbedV2] migrate t0-sonic test jobs to TestbedV2 (#12650)
Migrate t0-sonic test jobs to TestbedV2.

Why I did it
Migrate t0-sonic test jobs to TestbedV2.

How I did it
Add two parameters to create testplan.
Modify azure-pipelines.yml to run t0-sonic on tbv2.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
2022-11-10 17:28:51 +08:00
Ye Jianquan
e91e38810a Enable to cancel pipeline jobs during checkout code and tests (#12436)
co-authorized by: jianquanye@microsoft.com

Why I did it
Now, checkout code step and KVM test job can't be cancelled even though the whole build is cancelled.
That's because by using Azure Pipeline Conditions, we customized the running condition, and we need to react to the Cancel action explicitly by asserting 'succeeded'
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#succeeded
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&tabs=yaml#ive-got-a-conditional-step-that-runs-even-when-a-job-is-canceled-how-do-i-manage-to-cancel-all-jobs-at-once

How I did it
Assert 'succeeded' condition explicitly.

How to verify it
Verified by cancelling and rerunning the azure pipeline.
2022-10-25 20:46:33 +00:00
Ye Jianquan
ab8fc11a88
[TestbedV2]Migrate t0 and t1-lag to TestbedV2 (#12383) (#12474)
co-authorized by: jianquanye@microsoft.com

Migrate the t0 and t1-lag test jobs in buildimage repo to TestbedV2.

Why I did it
Migrate the t0 and t1-lag test jobs in buildimage repo to TestbedV2.

How I did it
Migrate the t0 and t1-lag test jobs in buildimage repo to TestbedV2.

Remove ceos type setting

Use 202205 branch as sonic-mgmt branch
2022-10-24 13:25:18 -07:00
Hua Liu
a5c9602bff [AzurePipeline] Fix vstest step failed by libyang missing. (#12240)
Why I did it
Fix PR merge failed because 'vstest' step does not install libyang.

How I did it
Install libyang in azure pipeline.

How to verify it
Pass vstest step.
2022-10-03 18:33:42 +00:00
Stephen Sun
6391b0a8ee Extend t1-lag timeout to 360 (#11478)
Signed-off-by: Stephen Sun <stephens@nvidia.com>
2022-08-10 17:18:35 +00:00
Liu Shilong
6771f44f5c
[ci] Update azp reference to support transfering organization from Azure to sonic-net (#11602)
Why I did it
When transfer repo to another organization, azp reference also need change.
Change azp reference to avoid pipeline failure.
2022-08-02 16:24:46 +08:00
Liu Shilong
71f47ed15b
[ci] Transfer organization from Azure to sonic-net for sonic-mgmt (#11559) (#11560)
Why I did it
Transfer organization from Azure to sonic-net for sonic-mgmt
2022-07-28 15:31:02 +08:00
Liu Shilong
be4501493e
[ci] Fix test stage dependency issue. (#11386) (#11390)
Why I did it
When any of the test job failed in the test stage, the rerun will not work, the test stage will be skipped automaticall, so we do not have chance to rerun the test stage again, and the checks of the test will be always in failed status, block the PR to merge forever.

It should be caused by the condition in the Test stage, we should specify the status of the BuildVS stage.

How I did it
Fix stage dependency logic.
2022-07-08 14:27:29 +08:00
Liu Shilong
57244dd24a
[build] Add version files to docker image dependencies (#11195)
* [ci] Support to skip vstest using include/exclude config file. (#11086)

example:
├── folderA
│  ├──  fileA (skip vstest)
│  ├──  fileB
│  └──  fileC
If we want to skip vstest when changing /folderA/fileA, and not skip vstest when changing fileB or fileC.

vstest-include:
^folderA/fileA

vstest-exclude:
^folderA

* [build] Add version files to docker image dependencies
2022-06-22 14:12:25 +08:00
Ying Xie
dbb4a98046 [pr test] increase T1-lag PR test timeout to 5 hours (#11029)
Why I did it
Some PR test are timing out on T1-lag kvm test.

How I did it
Increase the timeout to 5 hours.

How to verify it
Test on this PR.

Signed-off-by: Ying Xie ying.xie@microsoft.com
2022-06-05 15:23:45 +00:00
Ying Xie
0514923ea1
[azure pipeline] enable PR test for 202205 branch (#11017)
Signed-off-by: Ying Xie <ying.xie@microsoft.com>
2022-06-02 12:00:50 -07:00
Ze Gan
992d233090
Add pool: sonictest-sonic-t0 (#10635)
Signed-off-by: Ze Gan <ganze718@gmail.com>

Existing pools cannot test MACsec scenario, So I add sonictest-sonic-t0 pool that can run MACsec testcases.
2022-05-12 13:21:25 +08:00
xumia
8ec8900d31
Support SONiC OpenSSL FIPS 140-3 based on SymCrypt engine (#9573)
Why I did it
Support OpenSSL FIPS 140-3, see design doc: https://github.com/Azure/SONiC/blob/master/doc/fips/SONiC-OpenSSL-FIPS-140-3.md.

How I did it
Install the fips packages.
To build the fips packages, see https://github.com/Azure/sonic-fips
Azure pipelines: https://dev.azure.com/mssonic/build/_build?definitionId=412

How to verify it
Validate the SymCrypt engine:

admin@sonic:~$ dpkg-query -W | grep openssl
openssl 1.1.1k-1+deb11u1+fips
symcrypt-openssl        0.1

admin@sonic:~$ openssl engine -v | grep -i symcrypt
(symcrypt) SCOSSL (SymCrypt engine for OpenSSL)
admin@sonic:~$
2022-05-06 07:21:30 +08:00
Shilong Liu
12cfb2b8f4
[ci] Set default ACR in UpgrateVersion/PR/official pipeline. (#10341)
Why I did it
docker hub will limit the pull rate.
Use ACR instead to pull debian related docker image.

How I did it
Set DEFAULT_CONTAINER_REGISTRY in pipeline.
2022-04-02 07:48:44 +08:00
xumia
8f418bb652
[Build]: Enable marvell-armhf PR check (#10259)
Why I did it
[Build]: Enable marvell-armhf PR check
Improve the azp dependencies, make the Test stage only depended on BuildVS stage. The Test stage will be triggered once the BuildVS stage finished, reduce the waiting time.
2022-03-23 22:36:53 +08:00
Zhaohui Sun
44028723ef
Split kvmtest t0 job into two jobs and run in parallel (#10044)
Why I did it
Introduce 2 sub jobs for kvmtest t0 job in sonic-mgmt repo in PR Azure/sonic-mgmt#4861
But in sonic-buildimage repo, because section parameter is null, it always run the part 2 test scripts in kvmtest t0 job.
It missed the part 1 test scripts in kvmtest.sh.

How I did it
Split kvmtest t0 job into two sub jobs such as sonic-mgmt repo and run them in parallel to save time.

How to verify it
Submit PR will trigger the pipeline to run.

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
2022-02-24 10:20:24 +08:00
xumia
faab7d5991
[Build]: Support reproducible build for release branches (#9426)
[Build]: Support reproducible build for release branches #9426
2021-12-23 16:16:55 +08:00
Stephen Sun
0aebad9fe9
[ci]: Extend timeout for kvm-t0 test from 300 minutes to 360 minutes (#9336)
Recently a lot of PRs didn't pass azure pipeline kvm v0 test due to timeout

Signed-off-by: Stephen Sun <stephens@nvidia.com>
2021-11-22 09:54:27 -08:00
Guohan Lu
53e4280df1 [ci]: increase the t0 kvm test limit to 5 hours
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-09-02 01:23:37 -07:00
Shilong Liu
c44dbf0fe0
[build] Fix reproducible build issues (#8548)
* [build] Fix reproducible build issues
2021-08-26 18:21:18 +08:00
Guohan Lu
51fce2ae99
[ci]: fix artifact download syntax error for vstest (#8547)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-08-21 14:30:04 -07:00
Saikrishna Arcot
dc0b03ef3f Enable CI builds on PRs going to the Bullseye branch
Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
2021-08-12 23:18:01 -07:00
lguohan
15be15392d
[ci]: build swi on broadcom platform for pr (#7522)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-05-05 15:42:33 -07:00
xumia
39d877c1ad
[ci] Fix the boolean value case sensitive issue in Azure Pipelines (#7399)
Why I did it
Fix the boolean value case sensitive issue in Azure Pipelines

When passing parameters to a template, the "true" or "false" will have case sensitive issue, it should be a type casting issue.
To fix it, we change the true/false to yes/no, to escape the trap.

Support to override the job groups in the template, so PR build has chance to use different build parameters, only build simple targets. For example, for broadcom, we only build target/sonic-broadcom.bin, the other images, such as swi, debug bin, etc, will not be built.
2021-04-23 09:26:16 +08:00
Shilong Liu
38f65c8fd0
[CI] Update azure PR pipeline file. Not affect pipeline running (#7397)
Signed-off-by: Shilong Liu <shilongliu@microsoft.com>
2021-04-22 08:36:25 -07:00
liushilongbuaa
6bc660e11b [CI] Use the same template in PR-build pipeline and official-build pipeline
Signed-off-by: liushilongbuaa <shilongliu@microsoft.com>
2021-04-21 09:03:11 -07:00
lguohan
7475b98eda
[ci]: build vs image in official build (#6768)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-02-11 23:34:05 -08:00
Guohan Lu
092f5378bb [ci]: use build-template for pr build
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-02-07 02:09:44 -08:00
Guohan Lu
c591efc4a1 [ci]: further clean up the source directory before checkout
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-02-03 10:32:27 -08:00
lguohan
70a6d7618a
[ci]: exclude .github from trigger build (#6661)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-02-03 10:17:13 -08:00
xumia
aae96647ff
[ci]: Cleanup fsroot before checking out code (#6639)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
Co-authored-by: Guohan Lu <lguohan@gmail.com>
2021-02-03 07:27:51 -08:00
lguohan
dbfdab7c4e
[ci]: add t1-lag testbed (#6619)
introduce run-test template 

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-31 19:47:10 -08:00
Guohan Lu
c041d25f92 [ci]: cleanup source directory upon checkout
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-30 17:38:33 -08:00
Guohan Lu
3ffa352ac7 [ci]: reset the repo
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-30 06:27:40 -08:00
Guohan Lu
fb0b999361 [ci]: append job.attempt in memdump/log artifacts
azure pipepline does not allow upload same artifacts again.
thus, use job.attempt to uniquely name the test artifacts

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-28 01:05:44 -08:00
lguohan
7d01613300
[ci]: correct ownership of artifacts (#6582)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-27 20:57:17 -08:00
Qi Luo
69c5832153
[ci]: Download artifact instead of using nfs storage (#6570)
I notice that I rerun a failed job (not the stages), the nfs store is already cleaned by previous failed jobs.
2021-01-27 19:58:58 -08:00
Guohan Lu
f3a901c41e [ci]: build docker-ptf on vs platform
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-27 08:28:21 -08:00
Qi Luo
e616a32950
[ci]: add master and 202012 into azure-pipelines trigger (#6560) 2021-01-26 15:42:04 -08:00
lguohan
a9a0e3062c
[ci]: archive kvmtest artifacts (#6567)
- archive logs
- archive kvm memdump when failed
- publish kvm test results

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-26 13:09:56 -08:00
lguohan
30ae46ea7f
[ci]: add -k ceos option to setup t0 testbed (#6565)
this is due to command line change in
1e12790a93

this is due to command line change in
Azure/sonic-mgmt@1e12790

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-26 02:28:27 -08:00
lguohan
6957e376be
[ci]: reset the owner for all files under working directory (#6557)
reset the owner for all files under working directory. some files were owned by root after build, which cause
next build to fail since directory cannot be cleanned.

Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-25 19:05:01 -08:00
lguohan
3bc82e5556
[ci]: add vs tests (#6506)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-24 21:01:19 -08:00
lguohan
0daad0b51d
[ci]: build syncd-rpc for broadcom and mellanox (#6522)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-24 17:31:47 -08:00
lguohan
53c2a0a606 [ci]: build docker-sonic-vs.gz in kvm build pipeline (#6494)
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-01-19 09:35:19 -08:00