[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
This commit is contained in:
Liu Shilong 2023-02-22 13:00:06 +08:00 committed by GitHub
parent 5e4826ebf7
commit 5a2a95998c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -108,8 +108,8 @@ jobs:
platform_rpc: nephos platform_rpc: nephos
buildSteps: buildSteps:
- template: template-skipvstest.yml - template: .azure-pipelines/template-skipvstest.yml@buildimage
- template: template-daemon.yml - template: .azure-pipelines/template-daemon.yml@buildimage
- bash: | - bash: |
set -ex set -ex
if [ $(GROUP_NAME) == vs ]; then if [ $(GROUP_NAME) == vs ]; then
@ -169,4 +169,4 @@ jobs:
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin
fi fi
displayName: "Build sonic image" displayName: "Build sonic image"
- template: check-dirty-version.yml - template: .azure-pipelines/check-dirty-version.yml@buildimage

View File

@ -25,7 +25,7 @@ jobs:
jobFilters: ${{ parameters.jobFilters }} jobFilters: ${{ parameters.jobFilters }}
jobVariables: ${{ parameters.jobVariables }} jobVariables: ${{ parameters.jobVariables }}
preSteps: preSteps:
- template: cleanup.yml - template: .azure-pipelines/cleanup.yml@buildimage
- ${{ parameters.preSteps }} - ${{ parameters.preSteps }}
- script: | - script: |
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then
@ -67,6 +67,6 @@ jobs:
artifactName: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)' artifactName: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
publishPrefix: '$(Build.DefinitionName)/$(Build.SourceBranchName)/$(GROUP_NAME)' publishPrefix: '$(Build.DefinitionName)/$(Build.SourceBranchName)/$(GROUP_NAME)'
- ${{ parameters.postSteps }} - ${{ parameters.postSteps }}
- template: cleanup.yml - template: .azure-pipelines/cleanup.yml@buildimage
jobGroups: ${{ parameters.jobGroups }} jobGroups: ${{ parameters.jobGroups }}
buildSteps: ${{ parameters.buildSteps }} buildSteps: ${{ parameters.buildSteps }}

View File

@ -5,7 +5,7 @@ steps:
do do
sleep 120 sleep 120
now=$(date +%s) now=$(date +%s)
pids=$(ps -C docker -o pid,etime,args | grep "docker build" | cut -d" " -f1) pids=$(ps -C docker -o pid,etime,args | grep "docker build" | cut -d" " -f2)
for pid in $pids for pid in $pids
do do
start=$(date --date="$(ls -dl /proc/$pid --time-style full-iso | awk '{print$6,$7}')" +%s) start=$(date --date="$(ls -dl /proc/$pid --time-style full-iso | awk '{print$6,$7}')" +%s)