From dc4f4856be97d6fdf26b1996c298011668225b3f Mon Sep 17 00:00:00 2001 From: shilongliu Date: Mon, 26 Dec 2022 17:05:07 +0800 Subject: [PATCH 01/10] fix --- .azure-pipelines/docker-sonic-slave-template.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index abc955457fd3..c89f99dc1ece 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -55,6 +55,8 @@ jobs: - bash: | set -ex image_tag=$(BLDENV=${{ parameters.dist }} make -f Makefile.work showtag PLATFORM=generic PLATFORM_ARCH=${{ parameters.arch }} | grep sonic-slave | tail -n 1) + echo $image_tag + exit 1 image_latest=$(echo $(echo $image_tag | awk -F: '{print$1}'):latest) image_branch=$(echo $(echo $image_tag | awk -F: '{print$1}'):$(Build.SourceBranchName)) docker rmi $image_tag || true From 49bb04fe1c9fc80dac430a5e515801ee5db23c10 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Mon, 26 Dec 2022 17:15:13 +0800 Subject: [PATCH 02/10] fix --- .azure-pipelines/docker-sonic-slave.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index 833a0d9606e7..df11b8292598 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -61,7 +61,7 @@ stages: - ${{ each dist in parameters.dists }}: - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: - ${{ each arch in parameters.arches }}: - - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage + - template: docker-sonic-slave-template.yml parameters: pool: sonicbld arch: ${{ arch }} @@ -73,7 +73,7 @@ stages: - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: - ${{ each arch in parameters.arches }}: - ${{ if ne(arch, 'amd64') }}: - - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage + - template: docker-sonic-slave-template.yml parameters: pool: sonicbld-${{ arch }} arch: ${{ arch }} From 7e9a38b9b747bb4c4ff727166ab55bf378b42cc2 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Tue, 27 Dec 2022 11:11:31 +0800 Subject: [PATCH 03/10] fix --- .azure-pipelines/docker-sonic-slave-template.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index c89f99dc1ece..e783d0db63ff 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -55,9 +55,10 @@ jobs: - bash: | set -ex image_tag=$(BLDENV=${{ parameters.dist }} make -f Makefile.work showtag PLATFORM=generic PLATFORM_ARCH=${{ parameters.arch }} | grep sonic-slave | tail -n 1) - echo $image_tag - exit 1 image_latest=$(echo $(echo $image_tag | awk -F: '{print$1}'):latest) + if grep ${{ parameters.arch }} ${{ parameters.pool }};then + image_latest=$(echo ${image_tag} | sed 's/:/-${{ parameters.arch }}:/') + fi image_branch=$(echo $(echo $image_tag | awk -F: '{print$1}'):$(Build.SourceBranchName)) docker rmi $image_tag || true @@ -74,7 +75,7 @@ jobs: docker push ${REGISTRY_SERVER}/${image_tag} docker tag ${image_tag} ${REGISTRY_SERVER}/${image_branch} docker push ${REGISTRY_SERVER}/${image_branch} - if [[ "${{ parameters.arch }}" == "amd64" ]] && [[ "$(Build.SourceBranchName)" == "master" ]];then + if [[ "$(Build.SourceBranchName)" == "master" ]];then docker tag ${image_tag} ${REGISTRY_SERVER}/${image_latest} docker push ${REGISTRY_SERVER}/${image_latest} fi From fccf44ce59c8c167c14a93bb72ae451246cd180b Mon Sep 17 00:00:00 2001 From: shilongliu Date: Tue, 27 Dec 2022 11:21:48 +0800 Subject: [PATCH 04/10] fix --- .azure-pipelines/docker-sonic-slave-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index e783d0db63ff..5868adef025d 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -56,7 +56,7 @@ jobs: set -ex image_tag=$(BLDENV=${{ parameters.dist }} make -f Makefile.work showtag PLATFORM=generic PLATFORM_ARCH=${{ parameters.arch }} | grep sonic-slave | tail -n 1) image_latest=$(echo $(echo $image_tag | awk -F: '{print$1}'):latest) - if grep ${{ parameters.arch }} ${{ parameters.pool }};then + if echo ${{ parameters.pool }} | grep ${{ parameters.arch }};then image_latest=$(echo ${image_tag} | sed 's/:/-${{ parameters.arch }}:/') fi image_branch=$(echo $(echo $image_tag | awk -F: '{print$1}'):$(Build.SourceBranchName)) From 9aabd17efa639c989c083d84364d0af0d87d7934 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Tue, 27 Dec 2022 11:28:12 +0800 Subject: [PATCH 05/10] fix --- .azure-pipelines/docker-sonic-slave-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 5868adef025d..807ec8e3ebcf 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -57,7 +57,7 @@ jobs: image_tag=$(BLDENV=${{ parameters.dist }} make -f Makefile.work showtag PLATFORM=generic PLATFORM_ARCH=${{ parameters.arch }} | grep sonic-slave | tail -n 1) image_latest=$(echo $(echo $image_tag | awk -F: '{print$1}'):latest) if echo ${{ parameters.pool }} | grep ${{ parameters.arch }};then - image_latest=$(echo ${image_tag} | sed 's/:/-${{ parameters.arch }}:/') + image_latest=$(echo ${image_latest} | sed 's/:/-${{ parameters.arch }}:/') fi image_branch=$(echo $(echo $image_tag | awk -F: '{print$1}'):$(Build.SourceBranchName)) docker rmi $image_tag || true From fcf8d821c005a79807fc4a39e820ff545db00601 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Tue, 27 Dec 2022 11:29:42 +0800 Subject: [PATCH 06/10] fix --- .azure-pipelines/docker-sonic-slave-template.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 807ec8e3ebcf..48de020fea5d 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -46,7 +46,6 @@ jobs: - template: /.azure-pipelines/template-clean-sonic-slave.yml@buildimage - checkout: self clean: true - submodules: recursive - task: Docker@2 displayName: Login to ACR inputs: From bcb6ead3bdd483abff5c6ef39b8167336dd4b476 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Tue, 27 Dec 2022 11:37:53 +0800 Subject: [PATCH 07/10] fix --- .azure-pipelines/docker-sonic-slave.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index df11b8292598..e28926f8f5b7 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -56,7 +56,7 @@ parameters: default: sonicdev stages: -- stage: Build +- stage: Build_in_amd64 jobs: - ${{ each dist in parameters.dists }}: - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: @@ -66,7 +66,9 @@ stages: pool: sonicbld arch: ${{ arch }} dist: ${{ dist }} -- stage: Build_march + ${{ if ne(arch, 'amd64') }}: + march: march_ +- stage: Build_native_arm dependsOn: [] jobs: - ${{ each dist in parameters.dists }}: @@ -78,4 +80,3 @@ stages: pool: sonicbld-${{ arch }} arch: ${{ arch }} dist: ${{ dist }} - march: march_ From e35941b7188bdeec580dfacfd30e347a6ca82755 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Tue, 27 Dec 2022 11:42:39 +0800 Subject: [PATCH 08/10] fix --- .azure-pipelines/docker-sonic-slave-template.yml | 2 +- .azure-pipelines/docker-sonic-slave.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 48de020fea5d..9665d2bf1a23 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -35,7 +35,7 @@ parameters: - sonicbld-armhf jobs: -- job: Build_${{ parameters.dist }}_${{ parameters.march }}${{ parameters.arch }} +- job: sonic_slave_${{ parameters.dist }}_${{ parameters.march }} timeoutInMinutes: 360 variables: - template: /.azure-pipelines/template-variables.yml@buildimage diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index e28926f8f5b7..a9bcdfec6541 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -67,7 +67,7 @@ stages: arch: ${{ arch }} dist: ${{ dist }} ${{ if ne(arch, 'amd64') }}: - march: march_ + march: march_${{ arch }} - stage: Build_native_arm dependsOn: [] jobs: @@ -80,3 +80,4 @@ stages: pool: sonicbld-${{ arch }} arch: ${{ arch }} dist: ${{ dist }} + march: ${{ arch }} From 68cf2e6e3dffd60e2d6a37a0fe0e4d887334b491 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Tue, 27 Dec 2022 11:44:06 +0800 Subject: [PATCH 09/10] fix --- .azure-pipelines/docker-sonic-slave-template.yml | 2 +- .azure-pipelines/docker-sonic-slave.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave-template.yml b/.azure-pipelines/docker-sonic-slave-template.yml index 9665d2bf1a23..c3a33917e03e 100644 --- a/.azure-pipelines/docker-sonic-slave-template.yml +++ b/.azure-pipelines/docker-sonic-slave-template.yml @@ -35,7 +35,7 @@ parameters: - sonicbld-armhf jobs: -- job: sonic_slave_${{ parameters.dist }}_${{ parameters.march }} +- job: sonic_slave_${{ parameters.dist }}${{ parameters.march }} timeoutInMinutes: 360 variables: - template: /.azure-pipelines/template-variables.yml@buildimage diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index a9bcdfec6541..8e370862e80e 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -67,7 +67,7 @@ stages: arch: ${{ arch }} dist: ${{ dist }} ${{ if ne(arch, 'amd64') }}: - march: march_${{ arch }} + march: _march_${{ arch }} - stage: Build_native_arm dependsOn: [] jobs: @@ -80,4 +80,4 @@ stages: pool: sonicbld-${{ arch }} arch: ${{ arch }} dist: ${{ dist }} - march: ${{ arch }} + march: _${{ arch }} From 4d19e80e63f588f1ef741f38d601e9abe4d412d9 Mon Sep 17 00:00:00 2001 From: shilongliu Date: Tue, 27 Dec 2022 11:50:12 +0800 Subject: [PATCH 10/10] fix --- .azure-pipelines/docker-sonic-slave.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml index 8e370862e80e..4c679f7f9518 100644 --- a/.azure-pipelines/docker-sonic-slave.yml +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -61,7 +61,7 @@ stages: - ${{ each dist in parameters.dists }}: - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: - ${{ each arch in parameters.arches }}: - - template: docker-sonic-slave-template.yml + - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage parameters: pool: sonicbld arch: ${{ arch }} @@ -75,7 +75,7 @@ stages: - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: - ${{ each arch in parameters.arches }}: - ${{ if ne(arch, 'amd64') }}: - - template: docker-sonic-slave-template.yml + - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage parameters: pool: sonicbld-${{ arch }} arch: ${{ arch }}