Commit Graph

24 Commits

Author SHA1 Message Date
Liu Shilong
e30782b0fe
[ci] Enable cache for marvell-arm64 build in PR checks. (#15449)
Why I did it
Enable build cache for marvell-arm64 build to decrease PR check duration.

Work item tracking
Microsoft ADO (number only): 26340500
How I did it
How to verify it
2024-01-09 20:28:31 +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
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
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
Liu Shilong
82cbe6b029
[ci] Disable Shallow fetch in pipeline build. (#12964) 2022-12-09 16:12:43 +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
xumia
5072315c89
[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-05-30 16:50:06 +08:00
Shilong Liu
650b00e41e
[ci] Publish logs when building image job is canceled by timeout. (#10919) 2022-05-30 16:02:27 +08:00
xumia
f6927606b3
[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-20 14:32:53 +08:00
xumia
3567888b03
[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 08:57:26 +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
Qi Luo
c9cf4d9ff0
sonic-slave-buster pins the versions of Jinja2 and MarkupSafe in py3 (#10043)
#### Why I did it
Upstream breaking change, ref discussion https://github.com/pallets/markupsafe/issues/282
2022-02-24 17:00:13 -08:00
Mohamed Ghoneim
f21a45b68a
[build] fix build exception and revert #9136 (#10037)
#### Why I did it

1. Fix Build exception [example](https://dev.azure.com/mssonic/build/_build/results?buildId=73911&view=logs&jobId=88ce9a53-729c-5fa9-7b6e-3d98f2488e3f&j=cef3d8a9-152e-5193-620b-567dc18af272&t=ac3bce9f-b126-5a26-3fee-28ce0ec1679d)

```
2022-02-19T01:54:23.4200556Z ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.8/dist-packages/markupsafe/__init__.py)
```

This is because Jinja2 uses MarkupSafe without specifying an upper limit to the version, MarkupSafe version that was released today removed 'soft_unicode'. So now Jinja2 is complaining.

Related issues:
https://github.com/pallets/jinja/issues/1591
https://github.com/aws/aws-sam-cli/issues/3661


2. Reverts #9136

Fixing build failures in SONiC utils [example](https://dev.azure.com/mssonic/build/_build/results?buildId=73784&view=logs&jobId=83516c17-6666-5250-abde-63983ce72a49&j=83516c17-6666-5250-abde-63983ce72a49&t=6177235f-d4f1-5f72-835a-90ebb93a1784)

One of the errors:
```
 TestPathAddressing.test_find_ref_paths__ref_is_the_whole_key__returns_ref_paths 

self = <tests.generic_config_updater.gu_common_test.TestPathAddressing testMethod=test_find_ref_paths__ref_is_the_whole_key__returns_ref_paths>

    def test_find_ref_paths__ref_is_the_whole_key__returns_ref_paths(self):
        # Arrange
        path = "/PORT/Ethernet0"
        expected = [
            "/ACL_TABLE/NO-NSW-PACL-V4/ports/0",
            "/VLAN_MEMBER/Vlan1000|Ethernet0",
        ]
    
        # Act
        actual = self.path_addressing.find_ref_paths(path, Files.CROPPED_CONFIG_DB_AS_JSON)
    
        # Assert
>       self.assertEqual(expected, actual)
E       AssertionError: Lists differ: ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0', '/VLAN_MEMBER/Vlan1000|Ethernet0'] != ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0']
E       
E       First list contains 1 additional elements.
E       First extra element 1:
E       '/VLAN_MEMBER/Vlan1000|Ethernet0'
E       
E       - ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0', '/VLAN_MEMBER/Vlan1000|Ethernet0']
E       + ['/ACL_TABLE/NO-NSW-PACL-V4/ports/0']
```

The VLAN_MEMBER backlink (can be called referrer link or ref link) is not found.

Issue introduced by https://github.com/Azure/sonic-buildimage/pull/9136
I don't know how this PR passed the build system, it should have failed.

Known YANG issue https://github.com/Azure/sonic-buildimage/issues/9312

#### How I did it
The import to `sonic-vlan` is breaking the build
```
    import sonic-vlan {
        prefix vlan;
    }
```

I am not sure if that's the only issue, so I think reverting the whole PR should be the safer option.

#### How to verify it
Ran sonic-utils tests locally.
2022-02-21 11:07:29 -08:00
Shilong Liu
51a0aed02a
[ci] Fix PR checker archieve artifacts step (#9357)
Why I did it
When a failed job retry. Publish artifact will fail for duplicated name
2021-11-24 14:10:04 +08:00
Shilong Liu
1025296cb4
Add artifacts for failure build to debug. (#9213) 2021-11-10 23:15:06 +08:00
xumia
3855ce2849
[ci]: Support azp for cisco 8000 (#8654)
Why I did it
Setup Azure pipeline for cisco 8000.
2021-10-08 15:31:49 +08:00
Shilong Liu
31c5797015
Enable reproducible build in base docker image sonic-slave-* (#8116) 2021-07-09 14:51:17 +08:00
xumia
e8582ac6b1
Improve the PR build version (#7381)
Why I did it
Improve the version of the Pull Request build by changing the local branch name.

How I did it
Change the default branch name merge to [target_branch_name]-[pullrequestid].

How to verify it
For official build, the version is not changed.
For pull request build, the version as below:
2021-04-23 10:24:00 +08:00
liushilongbuaa
d7fc384b6f [CI] Fix pipeline template artifacts struct bug and cleanup bug
Signed-off-by: liushilongbuaa <shilongliu@microsoft.com>
2021-04-21 09:03:11 -07:00
xumia
ac99b8fee8
[ci] Fix no enough space issue in docker root in multi arch build (#7321)
Why I did it
Failed to build the centec-arm64 for no space in docker data root.

How I did it
Change to use the data root to the folder under /data.
See detail info about DOCKER_DATA_ROOT_FOR_MULTIARCH in the file Makefile.work.

How to verify it
Set the environment variable, then the /data used as docker root.
2021-04-15 14:32:08 +08:00
xumia
f5703825e3
Fix the SONiC version starting with HEAD issue (#7319) 2021-04-14 21:18:43 +08:00
xumia
7df4c0ad7c
[ci] Fix the wrong build options issue (#7287)
Why I did it
Fix the wrong build options and improve display name for some tasks
1. Fix the wrong build architecture for arm64 and armhf
2. Fix the build timeout parameter
2021-04-12 07:43:06 +08:00
Shilong Liu
1c220d923a
[CI] Fix the wrong environment variable PLATFORM passing into the slave container issue (#7262)
* fix

* fix
2021-04-09 07:36:53 +08:00
Shilong Liu
dcb9ef3d44
[CI] Update sonic image official build template. (#7198)
* draft

* fix

* Update new-build-template.yml

* Update azure-pipelines-build.yml

* Update azure-pipelines-job-groups.yml

* fix

* fix

* draft

* fix

* fix

* fix

* fix

* fix

* fix

Signed-off-by: Shilong Liu <shilongliu@microsoft.com>

Co-authored-by: Sonic Automation <svc-acs@microsoft.com>
2021-04-08 07:05:31 +08:00