Commit Graph

78 Commits

Author SHA1 Message Date
Liu Shilong
a46c615260
[ci] Remove innovium in upgrate version pipeline. (#14842)
Why I did it
Innovium platform has build issue.
Remove it from upgrade version pipeline.

Work item tracking
Microsoft ADO (number only):
How I did it
How to verify it
2023-04-26 17:46:45 +08:00
xumia
ae0a47dc6e
[Build][202012] Support Debian snapshot mirror to improve build stability (#14558)
#### Why I did it
Cherry-pick commits from master to support the snapshot based mirror, and fix the code conflicts. And add the last commit to fix the build broken issue according to the mirror change.

ad162ae0e [Build] Optimize the version control for Debian packages (https://github.com/sonic-net/sonic-buildimage/pull/14557)
38c5d7fce [Build] Support j2 template for debian sources for docker ptf (https://github.com/sonic-net/sonic-buildimage/pull/13198)
5e4826ebf  [Ci] Support to use the same snapshot for all platform builds (#13913)
820692563 [Build] Change the default mirror version config file (#13786)
5e4a866e3 [Build] Support Debian snapshot mirror to improve build stability (#13097)
ac5d89c6a  [Build] Support j2 template for debian sources (#12557)
2023-04-20 22:45:33 -07:00
xumia
69951f368b [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-20 14:34:43 +08:00
Liu Shilong
1d0a5ed9bf [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-28 18:35:13 +08:00
Liu Shilong
0cc6f1ca82 [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 18:36:50 +08:00
Liu Shilong
d046712b25
[ci] Kill hanged docker build process to avoid build timeout issue. (#13726) (#13731)
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-20 18:16:25 +08:00
Yutong Zhang
e848e3616f
Improve the display of pipeline. (#13124)
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
Each step has its own signature of success or failure.
Using the chain of responsibility pattern to manage all status.
Modify the expected-state in each step.
2023-01-04 17:11:55 +08:00
Liu Shilong
9175ebad0a
Fix sonic slave pipeline to set correct tag on sonic slave image. (#13177) (#13244)
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
2023-01-04 16:29:42 +08:00
Liu Shilong
8bb5e19c52
[build] Add retry when make SONiC image to improve success rate. (#12325) (#13132)
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-23 18:52:19 +08:00
Yutong Zhang
8fc4b05036
[TestbedV2][202012]Remove timeout in each step. (#12916)
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.

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
2022-12-05 13:56:54 +08:00
zitingguo-ms
e377b03a94
Publish docker saiserverv2 in 202012 branch (#12903)
# 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
Run test in #12836 and the target has been built out successfully.

Signed-off-by: zitingguo-ms <zitingguo@microsoft.com>
2022-12-02 16:01:40 +08:00
Yutong Zhang
09a4854716
Support passing the instance numbers of a testplan. (#12880)
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:37:08 +08:00
Yutong Zhang
10c2d601ed
[202012][TestbedV2] Add dualtor test jobs using TestbedV2. (#12672)
Add dualtor test jobs using TestbedV2 in 202012 branch.

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

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

Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
2022-11-16 13:48:19 +08:00
Ye Jianquan
95b979dfc1
[202012][TestbedV2]Migrate t0 and t1-lag to TestbedV2 (#12383) (#12454)
* [TestbedV2]Migrate t0 and t1-lag to TestbedV2 (#12383)

signed-off-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 202012 branch as sonic-mgmt branch

* Modify template to use 202012 branch
2022-10-27 08:13:13 +08:00
Ye Jianquan
8e7a491f3b 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 18:53:40 +00:00
Liu Shilong
a00773a6ec
[ci] Update docker sonic slave pipeline to build slave base docker (#11908) (#12405)
* [ci] Update docker sonic slave pipeline to build slave base docker
2022-10-18 13:53:43 +08:00
Liu Shilong
1e812cd990
[ci] Update azp reference to support transfering organization from Azure to sonic-net (#11605)
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:22:26 +08:00
Ying Xie
84a8bad821
[202012][prtest] use matching sonic-mgmt branch for 202012 branch PR tests (#11575)
Why I did it
202012 PR test is failing due to some recent change in sonic-mgmt master branch.

How I did it
Use matching sonic-mgmt branch to run 202012 branch PR tests.

How to verify it
this PR test.

Signed-off-by: Ying Xie ying.xie@microsoft.com
2022-07-29 11:09:12 -07:00
xumia
14f67b130d [ci] Fix some not sai package removed issue (#11544)
Only replace the file name starts with "cisco-".
2022-07-27 23:28:15 +00:00
Liu Shilong
54de99ba23
[build] Add version files to docker image dependencies (#11192)
* [build] Add version files to docker image dependencies

* [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
2022-06-21 20:28:50 +08:00
Shilong Liu
4f19945b48
[ci] Enable default ACR in official/PR/UpgradeVersion pipelines. (#11052) 2022-06-09 15:58:39 +08:00
xumia
1a6cb0f409 [Ci]: Fix the target directory not empty issue when publishing artifacts #10972
Why I did it
Fix the target directory not empty issue when publishing artifacts.
Some of the artifacts are published to $(Build.ArtifactStagingDirectory)/target/ before source code checked out.
2022-06-08 01:21:49 +00:00
Saikrishna Arcot
3289598ea4
Split kvmtest t0 job into two jobs and run in parallel (#10044) (#10858)
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>
(cherry picked from commit 44028723ef)

Co-authored-by: Zhaohui Sun <94606222+ZhaohuiS@users.noreply.github.com>
2022-06-03 09:39:30 -07:00
Shilong Liu
5d2ae332d4
[ci] Add arm artifacts in common lib azure pipeline (#10892) 2022-06-03 12:20:49 +08:00
xumia
455d44efea [Ci]: Fix to trigger the publish pipeline in failure build issue (#10847)
Why I did it
It is not necessary to trigger the publish pipeline when build is failed.

How I did it
Remove the condition in the azp task, change to use template condition.
2022-05-24 23:14:29 +00:00
xumia
f6a52e31ec [Ci] Support to trigger a pipeline to download and publish artifacts to storage (#10820)
Why I did it
Support to trigger a pipeline to download and publish artifacts to storage and container registry.
Support to specify the patterns which docker images to upload.

How I did it
Pass the pipeline information and the artifact information by pipeline parameters to the pipeline which will be triggered a new build. It is to decouple the artifacts generation and the publish logic, how and where the artifacts/docker images will be published, depends on the triggered pipeline.

How to verify it
2022-05-16 23:28:06 +00:00
Shilong Liu
5779a92d99
[ci] Fix PR checker archieve artifacts step (#9357) (#10652)
Why I did it
When a failed job retry. Publish artifact will fail for duplicated name
2022-04-23 13:57:50 +08:00
xumia
55a6faf925 [Ci]: Support to sign image for cisco-8000 uefi secure boot (#10616)
Why I did it
[Ci]: Support to sign image for cisco-8000 uefi secure boot
2022-04-21 22:00:47 +00:00
Qi Luo
3fa538e58c
Revert "[ci] Set default ACR in UpgrateVersion/PR/official pipeline. (#10341)" (#10535)
This reverts commit f4bbcd1cf1. The original one was missing one file ".azure-pipelines/azure-pipelines-repd-build-variables.yml" and break the Azure pipeline.
2022-04-11 23:53:42 -07:00
xumia
fc727f0538 [Ci]: check if there is a sonic dirty version issue (#10445)
Why I did it
[Ci]: check if there is a sonic dirty version issue
If there is a dirty version issue in PR build, the build will be failed.
2022-04-11 23:10:06 +00:00
Shilong Liu
f4bbcd1cf1 [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-08 11:19:10 +08:00
Lawrence Lee
a081d04807 [azp]: Fix type in slave container cleanup (#10424)
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
2022-04-03 18:20:04 +00:00
Shilong Liu
1c24f2e9df [ci] Add azure pipeline to build common libs. (#10367)
Why I did it
To remove reference on Azure.sonic-buildimage artifacts.
Azure.sonic-buildimage has a higher failure rate.
2022-03-31 20:39:49 +08:00
Shilong Liu
5b22cba8ca [build] Fix issues found in reproducible build. (#10407) 2022-03-31 20:39:49 +08:00
Shilong Liu
615b0d8d1b [ci] Use template from master branch in UpgrateVersion/sonic-slave pipeline (#10380) 2022-03-31 20:39:49 +08:00
Shilong Liu
f0000efff1 [ci] Fix remove sonic-slave-* docker image issue when building sonic-slave* (#10296) 2022-03-31 20:39:49 +08:00
Shilong Liu
491562b74b
[ci] Fix remove sonic-slave-* docker image issue when building sonic-slave* (#10296) (#10378) 2022-03-30 16:08:32 +08:00
xumia
db3c695bf1 [Build][Ci]: Support to use the cisco sai packages built by azp (#10102)
Why I did it
Support to use the cisco sai packages built by azp
2022-03-08 02:17:16 +00:00
xumia
6a6512246d
[Bug][Build]: fix the file not found issue caused by the relative path (#9450)
#### Why I did it
Merged from master branch: https://github.com/Azure/sonic-buildimage/pull/9443
Fix the nodesource.list cannot read issue, it is cased by the full path not used.

```
2021-12-03T06:59:26.0019306Z Removing intermediate container 77cfe980cd36
2021-12-03T06:59:26.0020872Z  ---> 528fd40e60f6
2021-12-03T06:59:26.0021457Z Step 81/81 : RUN post_run_buildinfo
2021-12-03T06:59:26.0841136Z  ---> Running in d804bd7e1b06
2021-12-03T06:59:29.1626594Z DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
2021-12-03T06:59:34.2960105Z /usr/bin/sed: can't read nodesource.list: No such file or directory
2021-12-03T06:59:34.5094880Z The command '/bin/sh -c post_run_buildinfo' returned a non-zero code: 2
```
2021-12-07 23:42:33 -08:00
xumia
05351731d5
[Build]: Enable arm pr check #9362
Support marvell-armhf dpkg cache and the azp check.
Waiting for merging PR #9381 to 202012 branch, so only azp template change in this PR.

Move the VS build to a new stage BuildVS, change the Test stage only depending on BuildVS, running the BuildVS and the other platform's build in parallel. The Test stage do not has dependency on the marvel-armhf build, reduce the overall build time caused by longer build time of marvel-armhf build.
2021-12-04 09:31:53 +08:00
Shilong Liu
4533e64fb4 [CI] Fix Azure pipeline set -e not work. (#9282)
In azure pipeline template 'set -e' not works as expected.
2021-11-20 00:45:00 +00:00
Guohan Lu
bf1ed42588 [ci]: build centec arm64 to sonicbld-arm64 pool
Signed-off-by: Guohan Lu <lguohan@gmail.com>
2021-10-29 09:10:13 -07:00
xumia
027a35d7e5
[ci]: Change to build marvell-armhf on armhf pool (#8467) 2021-10-25 07:38:18 -07:00
xumia
967d8abe07 Fix failed to download cisco artifacts issue (#8942)
Why I did it
Fix the failure to download cisco artifacts issue
2021-10-15 00:40:10 +00:00
xumia
63037a20f9 [ci]: Support azp for cisco 8000 (#8654)
Why I did it
Setup Azure pipeline for cisco 8000.
2021-10-12 09:23:55 +00:00
Shilong Liu
040d5f343d Add pipeline to build vhdx image. (#8665)
* Add pipeline to build vhdx image
2021-10-06 09:04:57 -07:00
Shilong Liu
5ea763f60a Fix azp pipeline file which is involved by former PR (#8616) 2021-08-30 10:55:16 +08:00
Shilong Liu
6b69ddc861 [build] Fix reproducible build issues (#8548)
* [build] Fix reproducible build issues
2021-08-26 10:22:02 +00:00
Shilong Liu
7aad616832
[build]: Enable reproducible build for git docker (#8331) 2021-08-04 09:59:02 -07:00
Shilong Liu
a90280faa5
Add auto-version-upgrade for arm image (#8244) 2021-07-22 19:39:56 +08:00