Skip to content

Commit

Permalink
Fix random failure in PR/CI build. (#2006)
Browse files Browse the repository at this point in the history
*step to clean work space, to avoid random failure in azure pipeline.
  • Loading branch information
liushilongbuaa committed Nov 4, 2021
1 parent e03edb6 commit faa26db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ parameters:

- name: buildimage_pipeline
type: number
default: 1

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

steps:
- checkout: self
clean: true
submodules: true
- script: |
sudo apt-get install -y libhiredis0.14 libhiredis-dev
sudo apt-get install -y libzmq5 libzmq3-dev
Expand All @@ -75,6 +77,7 @@ jobs:
artifact: ${{ parameters.swss_common_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: '$(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}'
displayName: "Download sonic swss common deb packages"
- task: DownloadPipelineArtifact@2
inputs:
Expand All @@ -84,6 +87,7 @@ jobs:
artifact: ${{ parameters.sairedis_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: '$(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}'
displayName: "Download sonic sairedis deb packages"
- task: DownloadPipelineArtifact@2
inputs:
Expand All @@ -93,8 +97,10 @@ jobs:
artifact: ${{ parameters.buildimage_artifact_name }}
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}'
displayName: "Download sonic buildimage deb packages"
- script: |
cd $(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}
sudo dpkg -i target/debs/buster/libnl-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-genl-3-200_*.deb
Expand All @@ -103,8 +109,10 @@ jobs:
sudo dpkg -i target/debs/buster/libnl-route-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-nf-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-nf-3-dev_*.deb
cd $(Build.SourcesDirectory)/${{ parameters.swss_common_artifact_name }}
sudo dpkg -i libswsscommon_1.0.0_${{ parameters.arch }}.deb
sudo dpkg -i libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
cd $(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}
sudo dpkg -i libsaivs_*.deb
sudo dpkg -i libsaivs-dev_*.deb
sudo dpkg -i libsairedis_*.deb
Expand All @@ -114,8 +122,6 @@ jobs:
sudo dpkg -i syncd-vs_*.deb
workingDirectory: $(Pipeline.Workspace)
displayName: "Install libnl3, sonic swss common and sairedis"
- checkout: self
submodules: true
- script: |
set -x
tar czf pytest.tgz tests
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stages:
arch: amd64
sonic_slave: sonic-slave-buster
buildimage_artifact_name: sonic-buildimage.vs
buildimage_pipeline: 1
buildimage_pipeline: 142
swss_common_artifact_name: sonic-swss-common
sairedis_artifact_name: sonic-sairedis
artifact_name: sonic-swss
Expand Down

0 comments on commit faa26db

Please sign in to comment.