Commit Graph

156 Commits

Author SHA1 Message Date
Liu Shilong
459ba257a4
[ci] Add job to cleanup nfs in armhf and arm64 agents. (#16270)
Why I did it
Clean old cached file in nfs disk for armhf/arm64

Work item tracking
Microsoft ADO (number only): 24930879
2023-08-29 19:14:45 +08:00
Liu Shilong
104ae5d185
[ci] Fix pipeline 'Check if vstest is needed.' issue. (#15958)
Why I did it
Line:7 will exit when k8s file didn't change.
Use 'System.PullRequest.TargetBranchName' instead of 'System.PullRequest.TargetBranch'. Because git server in AzDevOps don't support 'System.PullRequest.TargetBranch'.
Work item tracking
Microsoft ADO (number only): 24636791
How I did it
How to verify it
2023-07-25 18:24:57 +08:00
lixiaoyuner
10b65d9826
Add k8s master code new (#15716)
Why I did it
Currently, k8s master image is generated from a separate branch which we created by ourselves, not release ones. We need to commit these k8s master related code to master branch for a better way to do k8s master image build out.

Work item tracking
Microsoft ADO (number only):
19998138
How I did it
Install k8s dashboard docker images
Install geneva mds and mdsd and fluentd docker images and tag them as latest, tagging latest will help create container always with the latest version
Install azure-storage-blob and azure-identity, this will help do etcd backup and restore.
Install kubernetes python client packages, this will help read worker and container state, we can send these metric to Geneva.
Remove mdm debian package, will replace it with the mdm docker image
Add k8s master entrance script, this script will be called by rc-local service when system startup. we have some master systemd services in compute-move repo, when VMM service create master VM, VMM will copy all master service files inside VM, the entrance script will setup all services according to the service files.
When the entrance script content changed, the PR build will set include_kubernetes_master=y to help do validation for k8s master related code change. The default value of include_kubernetes_master should be always n for public master branch. We will generate master image from internal master branch
How to verify it
Build with INCLUDE_KUBERNETES_MASTER = y
2023-07-25 07:44:59 +08:00
Chun'ang Li
c07447ae61
Refine PR test template format (#15636)
Why I did it
Refine PR test template format.

How I did it
Refine PR test template format.

How to verify it
PR test executed normally.

Signed-off-by: Chun'ang Li <chunangli@microsoft.com>
2023-07-10 10:47:40 +08:00
Ze Gan
2f8994999b
[dash-api]: Add dash-api and related protobuf library (#14515)
Why I did it
For the DASH scenario, the APP_DB will be optimized by protobuf message for less memory consumption.

How I did it
Download the Debian package of protobuf 3.21.12 and create a corresponding rule for building it.
Add a submodule of sonic-dash-api and generated its Debian package which includes C++ library and Python library

How to verify it
Check artifacts of Azp that the protobuf-related and dash-api deb packages should be generated.

Signed-off-by: Ze Gan <ganze718@gmail.com>
2023-07-05 09:59:35 -07:00
Ye Jianquan
4449d473ae
[CI/CD] Refine t0 sonic and remove SPECIFIED_PARAMS (#15625)
Why I did it
t0-sonic's specific params has been set on sonic-mgmt repo, remove useless SPECIFIED_PARAMS usage
2023-06-27 11:01:41 +08:00
Liu Shilong
d2915969d4
[ci] Add OVERRIDE_BUILD_OPTIONS in image build template. (#15309)
Why I did it
Set build options in pipeline UI.
Support setting reproducible build options to py2,py3 in release branch and none in master branch.

Work item tracking
Microsoft ADO (number only): 22335854
How I did it
How to verify it
2023-06-05 18:42:06 +08:00
Ye Jianquan
d86aa20ef5
[CI/CD] Refine pr test definition, remove old test jobs and testbedv2 flags (#15302) 2023-06-02 16:33:30 +08:00
Ye Jianquan
f4ef94c38b
[CI/CD] Refine PR test templates and test_plan.py to be ready to migrate to Elastictest (#15256) 2023-05-31 09:37:51 +08:00
Liu Shilong
3b10334e10
[ci] Remove saiserverv2 build in official build. (#15191)
Why I did it
libsaithriftv2 build fails and nobody is maintaining saiserverv2's build.
Remove them from official build.

Work item tracking
Microsoft ADO (number only): 23764652
How I did it
How to verify it
2023-05-23 10:22:31 +00:00
Liu Shilong
2505dac8fb
[ci] Enable kvm test when upgrading package versions. (#15111)
Why I did it
Run kvmtest when update package versions to avoid test break.

Work item tracking
Microsoft ADO (number only): 22335854
How I did it
How to verify it
2023-05-18 16:02:22 +08:00
Liu Shilong
b9c25ec006
Add OVERRIDE_BUILD_OPTIONS options in UpgrateVersion pipeline. (#15088)
Why I did it
Provide a method to override build options in webUI.
We can stop python dependency upgrade version.

Work item tracking
Microsoft ADO (number only): 22335854
How I did it
Add a variable at the tail of make command.
2023-05-17 11:07:35 +08:00
xumia
50fb266c16
[Ci] Support marvell/marvell-arm64 build (#14875)
Why I did it
Support marvell/marvell-arm64 build

Work item tracking
Microsoft ADO (number only): 19995559
How I did it
2023-05-05 12:40:35 +08:00
xumia
09bd333b63
[Build] Fix the reproducible build variable display error in the slave container (#14543)
Why I did it
Enable the reproducible build for PR build for master branch

Fix the reproducible build variable display error in the slave container.
The below config is none, although the config is set and takes effect.

"SONIC_VERSION_CONTROL_COMPONENTS": "none"
How I did it
Passing the variable through the slave container command line.
The variable has been passed to the slave container and the other docker container by a config file, it is only used to display the value during the build.

How to verify it
See https://dev.azure.com/mssonic/build/_build/results?buildId=247960&view=logs&j=88ce9a53-729c-5fa9-7b6e-3d98f2488e3f&t=88f376cf-c35d-5783-0a48-9ad83a873284

"SONIC_VERSION_CONTROL_COMPONENTS": "deb,py2,py3,web,git,docker"
2023-04-10 14:56:30 +08:00
xumia
46cb2ad03d
[Ci] Fix the wrong SONIC_BUILD_JOBS build variable used issue in Azp (#14071)
Why I did it
[Ci] Fix the no parallel jobs in some of the platforms issue
We observed some of the pipelines running more time than expected. The issue is the SONIC_BUILD_JOBS using the wrong value 1. It is caused by the runtime variable issue, there is additional single quota mark character added in the make command line.

make 'SONIC_BUILD_JOBS=$(nproc)' targe/xxxx
Need to change to

make SONIC_BUILD_JOBS=$(nproc) targe/xxxx
It is to improve the build performance for some of the platforms using the variable SONIC_BUILD_JOBS=1.
Good one vs: https://dev.azure.com/mssonic/build/_build/results?buildId=227986&view=logs&j=cef3d8a9-152e-5193-620b-567dc18af272&t=cf595088-5c84-5cf1-9d7e-03331f31d795

"SONIC_BUILD_JOBS"                : "8"
Bad one barefoot: https://dev.azure.com/mssonic/build/_build/results?buildId=227379&view=logs&j=993d6e22-aeec-5c03-fa19-35ecba587dd9&t=7be0d2ec-661f-5569-462c-2d9b7ca4ca5d

"SONIC_BUILD_JOBS"                : "1"
How I did it
Expand the BUILD_OPTIONS variable for all platforms.
2023-04-07 09:35:02 +08:00
Ye Jianquan
7509eb3bcd
Refine testbedv2 pr template (#14371)
Description for 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.
2023-03-29 18:35:08 +08:00
Liu Shilong
f19c8a7be5
[ci] Fix build issue for vs vhdx image. #14427
Why I did it
sonic-slave-stretch build failed for mmh3 version update to 3.10 on Mar 24.

How I did it
Enable reproducible build for vhdx image.

How to verify it
2023-03-27 16:58:37 +00:00
Liu Shilong
36f3745988
[ci] Fix SONiC cache build pipeline, which breaks for template change. (#13945)
Why I did it
It is affected by recent PR which changed pipeline template reference.
pipeline failed.

How I did it
2023-02-27 14:34:23 +08:00
xumia
39c3f650a7
[Ci] Support the SONiC reproducible build in Azure Pipelines (#13986)
Why I did it
[Ci] Support the SONiC reproducible build in Azure Pipelines
Enable the reproducible build on master branch
Enable the mirror snapshot based build on 202205+ which support snapshot build.

How I did it
Enable the build flag on Azure Pipelines.

How to verify it
2023-02-27 12:26:14 +08:00
Liu Shilong
5a2a95998c
[ci] Fix docker hang issue and change template reference branch (#13894)
Why I did it
Azure pipeline change.
Use common template to make it easy to change common steps.
Fix docker hang issue.

How I did it
2023-02-22 13:00:06 +08:00
xumia
5e4826ebf7
[Ci] Support to use the same snapshot for all platform builds (#13913)
IBGP
2023-02-22 11:18:09 +08:00
Liu Shilong
22e46207c8
[ci] Kill hanged docker build process to avoid build timeout issue. (#13726)
Why I did it
Docker build has a low rate of hanging up.
It hangs on different steps. So, it looks like a bug in docker daemon.

How I did it
Start a daemon process to scan running time more than 1 hours, and kill the process.

How to verify it
2023-02-16 21:58:14 +08:00
Liu Shilong
8867deee13
[ci] Disable DOCKER_BUILDKIT in pipeline build for OOM issue. (#13702)
Why I did it
New docker release v23.0 uses BUILDKIT by default.
It leads to OOM issue in pipeline build.

##[error]Exit code 137 returned from process: file name '/agent/externals/node16/bin/node',
How I did it
Disable BUILDKIT when building sonic-slave-* image.
Keep checking if there are issues when building docker image inside sonic-slave-*.

How to verify it
Check docker build logs.
Disable BUILDKIT log:

Step 1/80 : FROM publicmirror.azurecr.io/debian:buster
 ---> ff5db168d4c5
2023-02-08 15:31:22 +08:00
Liu Shilong
20f47bb5ac
Update docker-sonic-mgmt to buster (#13287)
Why I did it
docker-sonic-mgmt build is failing.

How I did it
stretch docker is disabled recently. Update docker-sonic-mgmt to buster.
Migrate from sonictest to sonicbld. Because Azure requires migrate vm from uswest2 to uswest3.
Fix a build issue when build image.
How to verify it
2023-01-11 16:00:47 +08:00
Liu Shilong
a5d71576db
[ci] Fix docker-sonic-slave pipeline template build options. (#13290)
Why I did it
docker-sonic-slave pipeline has a different tag with PR build.
It leads to ENABLE_DOCKER_BASE_PUll=y not work.

How I did it
set reproducible build option in bash.

How to verify it
2023-01-09 13:27:15 +08:00
Yutong Zhang
24758dfe0a
Improve the display of pipeline. (#13123)
The display of azure pipeline is not specific now, such as when the step Run test fails, the display of itself shows successful, but the display of step Kvmdump shows fails, but actually, the step Kvmdump doesn't fail. I improve the display of azure pipeline in this pr, each step has its own success or failure, and is shown in azure pipeline.

Why I did it
The display of azure pipeline is not specific now, such as when the step Run test fails, the display of itself shows successful, but the display of step Kvmdump shows fails, but actually, the step Kvmdump doesn't fail. I improve the display of azure pipeline in this pr, each step has its own success or failure, and is shown in azure pipeline.

How I did it
1. Each step has its own signature of success or failure.
2. Using the chain of responsibility pattern to manage all status.
3. Modify the expected-state in each step.
2023-01-09 10:10:17 +08:00
Richard.Yu
689f7d2c43
[SAI-PTF][BFN]Enable saiserver test container on bfn container (#13166)
Why I did it
Enable Test sai api on bfn container with a lightweight container(saiserver).

How I did it
enable saiserver container on barefoot platform.

add docker-saiserver-bfn.mk for building saiserver container
in platform/barefoot/docker-saiserver-bfn, add necessary files that needs in saiserver container
How to verify it
Tested on Intel platform ec9516

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>
2023-01-06 11:45:03 +08:00
Liu Shilong
e0c29aabe0
[ci] Fix docker sonic slave tag issue. (#13179) 2022-12-28 10:56:50 +08:00
Liu Shilong
550cd6649f
Fix sonic slave pipeline to set correct tag on sonic slave image. (#13177)
Why I did it
Currently sonic-slave-* tag is confusing. Set correct tag on sonic-slave-* image.
Fix job name to fit the build.

How I did it
build amd image in amd64:
sonic-slave-bullseye:cfe29bff67c
sonic-slave-bullseye:latest
sonic-slave-bullseye:master

build armhf image in amd64:
sonic-slave-bullseye-march-armhf:33614806dc3
sonic-slave-bullseye-march-armhf:latest
sonic-slave-bullseye-march-armhf:master

build arm64 image in amd64:
sonic-slave-bullseye-march-arm64:f3b1b16c801
sonic-slave-bullseye-march-arm64:latest
sonic-slave-bullseye-march-arm64:master

build arm64 image in arm64:
sonic-slave-bullseye:75cb326c9a7
sonic-slave-bullseye-arm64:latest
sonic-slave-bullseye:master

build armhf image in armhf:
sonic-slave-bullseye:64d178951fc
sonic-slave-bullseye-armhf:latest
sonic-slave-bullseye:master

How to verify it
2022-12-27 15:40:15 +08:00
Liu Shilong
449ae1332f
[ci] Add branch tag on sonic-slave-bullseye image. (#13151)
Why I did it
tag sonic-slave-* image with branch.
Only keep sonic-slave-* latest tag when it is master branch and amd64 arch.

How I did it
How to verify it
2022-12-26 10:35:15 +08:00
Liu Shilong
364045cfe5
[build] Add retry when make SONiC image to improve success rate. (#12325)
Why I did it
Makefile needs some dependencies from the Internet. It will fail for network related issue.
Retries will fix most of these issues.

How I did it
Add retries when running commands which maybe related with networking.

How to verify it
2022-12-19 12:18:36 +08:00
Liu Shilong
d9eec94c18
[build] Remove sonic-build-hooks in slave base tag. (#12966) 2022-12-09 16:12:59 +08:00
Liu Shilong
82cbe6b029
[ci] Disable Shallow fetch in pipeline build. (#12964) 2022-12-09 16:12:43 +08:00
wenyiz2021
5073dc0f8b
[MASIC] [azp] remove official-build-multi-asic.yml (#12973)
remove ..multi-asic.yml file as original purpose was to test stability before multi_asic PR check were brought up
2022-12-07 15:12:12 -08:00
Yutong Zhang
cb354a5af2
[TestbedV2][master] Remove timeout in each step. (#12915)
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.
2022-12-03 22:30:03 -08:00
zitingguo-ms
b774ebfdc2
[SAI-PTF] Publish docker saiserverv2 in master branch (#12842)
Why I did it
Publish docker saiserverv2 in the build pipeline.

How I did it
Add docker saiserverv2 target in the build template.

How to verify it
Test this by running this pipeline: https://dev.azure.com/mssonic/build/_build/results?buildId=182134&view=results
2022-11-30 22:26:54 -08:00
Yutong Zhang
df4312f7ef
Support passing the instance numbers of a testplan. (#12879)
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-11-30 22:36:55 +08:00
Richard.Yu
47d63bcd06
[SAI PTF] SAI PTF docker support sai-ptf v2 (#12719)
* [SAI PTF] SAI PTF docker support sai-ptf v2

Publish the sai-ptf docker.

Take part of the change from previous PR #11610 (already reverted as some cache issue)
Cause in #11610, added two new target in it, one is sai-ptf another one is syncd-rpc with sai-ptf v2, to make the upgrade with more clear target, use this one take the sai-ptf one.

Test one:
NOSTRETCH=y NOJESSIE=y make configure PLATFORM=vs
NOSTRETCH=y NOJESSIE=y NOBULLSEYE=y SAITHRIFT_V2=y make target/docker-ptf-sai.gz

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove useless change

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove useless parameters

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove useless change

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* Update azure-pipelines-build.yml

remove a useless option

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>
2022-11-17 04:42:51 -08:00
Liu Shilong
6d78199d6f
Revert "[SAI PTF]Syncd-rpc and PTF docker support sai ptf v2 (#11610)" (#12677)
This reverts commit f0873f29d8.
2022-11-14 09:56:10 +08:00
Yutong Zhang
5aa03246fc
[master][TestbedV2] Migrate multi-asic test jobs to TestbedV2. (#12668)
Migrate multi-asic test jobs to TestbedV2.

Why I did it
Migrate multi-asic test jobs to TestbedV2.

How I did it
Add one parameter num_asic to create testplan.
Modify azure-pipelines.yml to run multi-asic on tbv2.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
2022-11-11 10:54:37 +08:00
Yutong Zhang
7c746e67d2
[master][TestbedV2] migrate t0-sonic test jobs to TestbedV2. (#12651)
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 15:27:31 +08:00
Richard.Yu
f0873f29d8
[SAI PTF]Syncd-rpc and PTF docker support sai ptf v2 (#11610)
* support sai-ptf-v2 in libsaithrift vs

* add build target docker-ptf-sai syncd-rpcv2 and saiserverv2

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* add docker ptf sai

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* add build condition for broadcom

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* add docker syncd dbg and add debug symbol to docker-saiserverv2

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* correct the build option

* change the azure pipeline build template

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* change build option for docker-ptf-sai

* enable ptf-sai docker build

* remove the build for syncd-rpcv2

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* fix issue in build tempalte

* ignore useless package build when build sai-ptf

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove scapy version contraint

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove duplicated target docker-ptf

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* change template for testing the pipeline

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* remove duplicated target

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* fix error in make script

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* add shel to setup env

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* replace with certain platform name

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* disable cache for syncd-rpcv2

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* test without cache

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* disable cache

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* testing: disable the cache for build syncd-rpcv2

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* add cache back and get the code ready for testing

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* refactor code

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* add workaround for issue in rules/sairedis.dep

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

* refactor code

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>

Signed-off-by: richardyu-ms <richard.yu@microsoft.com>
2022-11-07 21:47:52 +08:00
Yutong Zhang
dc0ceaa500
[TestbedV2] Add dualtor test using TestbedV2. (#12601)
Add dualtor test using TestbedV2 in buildimage repo.

Why I did it
Add dualtor test using TestbedV2 in buildimage repo.

How I did it
Add dualtor test using TestbedV2 in buildimage repo.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
2022-11-07 19:48:06 +08:00
xumia
d7a9f18d18
[ci] Upload the debian packages (#12582)
Why I did it
[ci] Upload the debian packages
2022-11-04 15:40:16 +08:00
Liu Shilong
3df031c9b1
[ci] Add azp trigger for future release branches. (#12508) 2022-10-27 17:36:43 +08:00
xumia
158371de38
[Ci] clean up the old artifacts in the agent before downloading the new artifacts (#12391)
Ci] clean up the old artifacts in the agent before downloading the new artifacts
2022-10-25 15:45:01 +08:00
Ye Jianquan
d7b9c64757
Fix the issue that test plan can't be canceled by KVM dump stage (#12469)
Why I did it
Fix the issue that test plan can't be canceled by KVM dump stage

How I did it
Fix the issue that test plan can't be canceled by KVM dump stage
2022-10-22 01:04:17 +08:00
Liu Shilong
1dec49005b
[ci] Fix test job issue on checkout step (#12445) 2022-10-20 13:06:10 +08:00
Ye Jianquan
ef0559c030
[TestbedV2]Migrate t0 and t1-lag to TestbedV2 (#12383)
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.
2022-10-19 13:33:17 +08:00
Ye Jianquan
2bf2e02719
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-19 12:26:50 +08:00