Skip to content

Commit faa26db

Browse files
Fix random failure in PR/CI build. (sonic-net#2006)
*step to clean work space, to avoid random failure in azure pipeline.
1 parent e03edb6 commit faa26db

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.azure-pipelines/build-template.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ parameters:
2626

2727
- name: buildimage_pipeline
2828
type: number
29-
default: 1
3029

3130
- name: sairedis_artifact_name
3231
type: string
@@ -56,6 +55,9 @@ jobs:
5655
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest
5756

5857
steps:
58+
- checkout: self
59+
clean: true
60+
submodules: true
5961
- script: |
6062
sudo apt-get install -y libhiredis0.14 libhiredis-dev
6163
sudo apt-get install -y libzmq5 libzmq3-dev
@@ -75,6 +77,7 @@ jobs:
7577
artifact: ${{ parameters.swss_common_artifact_name }}
7678
runVersion: 'latestFromBranch'
7779
runBranch: 'refs/heads/master'
80+
path: '$(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}'
7881
displayName: "Download sonic swss common deb packages"
7982
- task: DownloadPipelineArtifact@2
8083
inputs:
@@ -84,6 +87,7 @@ jobs:
8487
artifact: ${{ parameters.sairedis_artifact_name }}
8588
runVersion: 'latestFromBranch'
8689
runBranch: 'refs/heads/master'
90+
path: '$(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}'
8791
displayName: "Download sonic sairedis deb packages"
8892
- task: DownloadPipelineArtifact@2
8993
inputs:
@@ -93,8 +97,10 @@ jobs:
9397
artifact: ${{ parameters.buildimage_artifact_name }}
9498
runVersion: 'latestFromBranch'
9599
runBranch: 'refs/heads/master'
100+
path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}'
96101
displayName: "Download sonic buildimage deb packages"
97102
- script: |
103+
cd $(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}
98104
sudo dpkg -i target/debs/buster/libnl-3-200_*.deb
99105
sudo dpkg -i target/debs/buster/libnl-3-dev_*.deb
100106
sudo dpkg -i target/debs/buster/libnl-genl-3-200_*.deb
@@ -103,8 +109,10 @@ jobs:
103109
sudo dpkg -i target/debs/buster/libnl-route-3-dev_*.deb
104110
sudo dpkg -i target/debs/buster/libnl-nf-3-200_*.deb
105111
sudo dpkg -i target/debs/buster/libnl-nf-3-dev_*.deb
112+
cd $(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}
106113
sudo dpkg -i libswsscommon_1.0.0_${{ parameters.arch }}.deb
107114
sudo dpkg -i libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
115+
cd $(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}
108116
sudo dpkg -i libsaivs_*.deb
109117
sudo dpkg -i libsaivs-dev_*.deb
110118
sudo dpkg -i libsairedis_*.deb
@@ -114,8 +122,6 @@ jobs:
114122
sudo dpkg -i syncd-vs_*.deb
115123
workingDirectory: $(Pipeline.Workspace)
116124
displayName: "Install libnl3, sonic swss common and sairedis"
117-
- checkout: self
118-
submodules: true
119125
- script: |
120126
set -x
121127
tar czf pytest.tgz tests

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ stages:
1717
arch: amd64
1818
sonic_slave: sonic-slave-buster
1919
buildimage_artifact_name: sonic-buildimage.vs
20-
buildimage_pipeline: 1
20+
buildimage_pipeline: 142
2121
swss_common_artifact_name: sonic-swss-common
2222
sairedis_artifact_name: sonic-sairedis
2323
artifact_name: sonic-swss

0 commit comments

Comments
 (0)