From f44771acb06096ecb371f67e20eda3895ff86796 Mon Sep 17 00:00:00 2001 From: Sonic Automation Date: Wed, 31 Mar 2021 15:21:28 +0800 Subject: [PATCH 01/14] draft --- .azure-pipelines/azure-pipelines-build.yml | 98 ++++++++++--------- .../azure-pipelines-job-groups.yml | 5 +- .azure-pipelines/official-build.yml | 58 +++-------- 3 files changed, 73 insertions(+), 88 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index 550e2ccd979..a4d2079b4c2 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -1,3 +1,5 @@ +# The azure pipeline template for Official build, and upgrade version build + parameters: - name: 'jobFilters' type: object @@ -5,9 +7,9 @@ parameters: - name: 'buildOptions' type: string default: 'SONIC_CONFIG_BUILD_JOBS=1' -- name: 'buildSlave' - type: string - default: 'n' +- name: 'preSteps' + type: stepList + default: [] - name: 'postSteps' type: stepList default: [] @@ -16,57 +18,65 @@ jobs: - template: azure-pipelines-job-groups.yml parameters: jobFilters: ${{ parameters.jobFilters }} - preSteps: - - script: | - containers=$(docker container ls | grep "sonic-slave" | awk '{ print $1 }') - if [ ! -z "$containers" ]; then - docker container kill $containers || true - sleep 5 - fi - if [ "${{ parameters.buildSlave }}" == "y" ]; then - images=$(docker images 'sonic-slave-*' -a -q) - [ ! -z "$images" ] && docker rmi -f $images - fi - sudo rm -rf $(ls -A1) - displayName: 'Init' - - checkout: self - submodules: recursive - displayName: 'Checkout code' - - script: | - make ${{ parameters.buildOptions }} PLATFORM=$GROUP_NAME configure - displayName: 'Make configure' - postSteps: - - ${{ parameters.postSteps }} - - publish: $(System.DefaultWorkingDirectory)/target - artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)' - displayName: "Archive sonic image" + buildOptions: ${{ parameters.buildOptions }} + preSteps: ${{ parameters.preSteps }} + postSteps: ${{ parameters.postSteps }} jobGroups: - name: vs script: | - sudo bash -c "echo 1 > /proc/sys/vm/compact_memory" - make ${{ parameters.buildOptions }} target/sonic-vs.img.gz + make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-vs.img.gz + mv target/sonic-vs.img.gz target/sonic-vs-dbg.img.gz + make $(BUILD_OPTIONS) target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz - name: broadcom script: | - make ${{ parameters.buildOptions }} target/sonic-broadcom.bin target/sonic-aboot-broadcom.swi + make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-broadcom.bin + mv target/sonic-broadcom.bin target/sonic-broadcom-dbg.bin + make $(BUILD_OPTIONS) target/sonic-broadcom.bin + make $(BUILD_OPTIONS) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-broadcom.swi + make $(BUILD_OPTIONS) target/sonic-broadcom.raw + make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/docker-syncd-brcm-rpc.gz + - name: mellanox + script: | + make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-mellanox.bin + mv target/sonic-mellanox.bin target/sonic-mellanox-dbg.bin + make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/sonic-aboot-mlnx-rpc.gz - name: barefoot script: | - make ${{ parameters.buildOptions }} target/sonic-barefoot.bin target/sonic-aboot-barefoot.swi - - name: centec + make $(BUILD_OPTIONS) target/sonic-barefoot.bin + make $(BUILD_OPTIONS) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-barefoot.swi + - name: generic script: | - make ${{ parameters.buildOptions }} INSTALL_DEBUG_TOOLS=y target/sonic-centec.bin - mv target/sonic-centec.bin target/sonic-centec-dbg.bin - make ${{ parameters.buildOptions }} target/sonic-centec.bin - make ${{ parameters.buildOptions }} ENABLE_SYNCD_RPC=y target/docker-syncd-centec-rpc.gz + make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-generic.bin + mv target/sonic-generic.bin target/sonic-generic-dbg.bin + make $(BUILD_OPTIONS) target/sonic-generic.bin - name: innovium script: | - make ${{ parameters.buildOptions }} SONIC_CONFIG_BUILD_JOBS=1 target/sonic-innovium.bin - - name: mellanox + make $(BUILD_OPTIONS) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-innovium.swi + make $(BUILD_OPTIONS) target/sonic-innovium.bin + - name: nephos script: | - make ${{ parameters.buildOptions }} target/sonic-mellanox.bin - - name: mellanox - extName: _rpc + make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-nephos.bin + mv target/sonic-nephos.bin target/sonic-nephos-dbg.bin + make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/docker-syncd-nephos-rpc.gz + make $(BUILD_OPTIONS) target/sonic-nephos.bin + - name: marvell-armhf + pool: sonicbld_8c + timeoutInMinutes: 3600 + variables: + PLATFORM_ARCH: armhf script: | - make ${{ parameters.buildOptions }} ENABLE_SYNCD_RPC=y all - - name: nephos + make $(BUILD_OPTIONS) target/sonic-marvell-armhf.bin + - name: centec + script: | + make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-centec.bin + mv target/sonic-centec.bin target/sonic-centec-dbg.bin + make $(BUILD_OPTIONS) target/sonic-centec.bin + make $(BUILD_OPTIONS) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-centec.swi + - name: centec-arm64 + pool: sonicbld_8c + timeoutInMinutes: 3600 + variables: + PLATFORM_ARCH: arm64 script: | - make ${{ parameters.buildOptions }} target/sonic-nephos.bin + make $(BUILD_OPTIONS) target/sonic-centec-arm64.bin + make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/docker-syncd-centec-arm64-rpc.gz diff --git a/.azure-pipelines/azure-pipelines-job-groups.yml b/.azure-pipelines/azure-pipelines-job-groups.yml index 1ca5c932b0a..aefa5507eb9 100644 --- a/.azure-pipelines/azure-pipelines-job-groups.yml +++ b/.azure-pipelines/azure-pipelines-job-groups.yml @@ -23,7 +23,7 @@ parameters: jobs: - ${{ each jobGroup in parameters.jobGroups }}: - - ${{ if or(eq(parameters.jobFilters, ''), containsValue(parameters.jobFilters, jobGroup.name)) }}: + - ${{ if or(eq(parameters.jobFilters, ''), containsValue(parameters.jobFilters, jobGroup.name), endswith(variables['Build.DefinitionName'], format('.{0}{1}', jobGroup.name, jobGroup.extName))) }}: - job: ${{ replace(format('{0}{1}', jobGroup.name, jobGroup.extName), '-', '_') }} ${{ each pair in jobGroup }}: ${{ if not(in(pair.key, 'job', 'name', 'extName', 'variables', 'steps', 'script', 'scriptEnv')) }}: @@ -43,6 +43,7 @@ jobs: - ${{ parameters.preSteps }} - ${{ if ne(jobGroup.script, '') }}: - script: | + set -e ${{ jobGroup.script }} env: ${{ if ne(parameters.scriptEnv, '') }}: @@ -50,4 +51,4 @@ jobs: displayName: 'JobScript' - ${{ if ne(jobGroup.steps, '') }}: - ${{ jobGroup.steps }} - - ${{ parameters.postSteps }} + - ${{ parameters.postSteps }} \ No newline at end of file diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index 8524027d7b1..5604d572c56 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -9,6 +9,7 @@ schedules: branches: include: - master + - 202012 always: true trigger: none @@ -16,47 +17,20 @@ pr: none stages: - stage: Build - + pool: sonicbld + variables: + CACHE_MODE: wcache + ${{ if eq(variables['Build.SourceBranchName'], '202012') }}: + VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web' jobs: - - template: build-template.yml - parameters: - platform: broadcom - platform_short: brcm - cache_mode: wcache - dbg_image: true - swi_image: true - raw_image: true - sync_rpc_image: true - - - template: build-template.yml - parameters: - platform: mellanox - platform_short: mlnx - cache_mode: wcache - dbg_image: true - sync_rpc_image: true - - - template: build-template.yml - parameters: - platform: vs - platform_short: vs - dbg_image: true - cache_mode: wcache - - - template: build-template.yml - parameters: - timeout: 3600 - platform: marvell-armhf - platform_arch: armhf - platform_short: marvell-armhf - cache_mode: wcache - pool: sonicbld_8c - - - template: build-template.yml + - template: azure-pipelines-build.yml parameters: - timeout: 3600 - platform: centec-arm64 - platform_arch: arm64 - platform_short: centec-arm64 - cache_mode: wcache - pool: sonicbld_8c + buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}' + jobFilters: none + postSteps: + - script: | + make freeze + git status files/build/versions + git add files/build/versions + git diff HEAD files/build/versions + displayName: "Show git diff" From 99c6bc2ab7f7b54a18c2e4e2870b0fd922b8d9c1 Mon Sep 17 00:00:00 2001 From: Sonic Automation Date: Wed, 31 Mar 2021 15:25:36 +0800 Subject: [PATCH 02/14] fix --- .azure-pipelines/azure-pipelines-build.yml | 4 +- .azure-pipelines/new-build-template.yml | 54 ++++++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 .azure-pipelines/new-build-template.yml diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index a4d2079b4c2..30a933df93e 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -15,7 +15,7 @@ parameters: default: [] jobs: -- template: azure-pipelines-job-groups.yml +- template: new-build-template.yml parameters: jobFilters: ${{ parameters.jobFilters }} buildOptions: ${{ parameters.buildOptions }} @@ -79,4 +79,4 @@ jobs: PLATFORM_ARCH: arm64 script: | make $(BUILD_OPTIONS) target/sonic-centec-arm64.bin - make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/docker-syncd-centec-arm64-rpc.gz + make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/docker-syncd-centec-arm64-rpc.gz \ No newline at end of file diff --git a/.azure-pipelines/new-build-template.yml b/.azure-pipelines/new-build-template.yml new file mode 100644 index 00000000000..50c45f137d1 --- /dev/null +++ b/.azure-pipelines/new-build-template.yml @@ -0,0 +1,54 @@ +# The azure pipeline template for PR build, Official build, and upgrade version build + +parameters: +- name: 'jobFilters' + type: object + default: '' +- name: 'buildOptions' + type: string + default: 'SONIC_CONFIG_BUILD_JOBS=1' +- name: 'preSteps' + type: stepList + default: [] +- name: 'postSteps' + type: stepList + default: [] +- name: jobGroups + type: object + default: [] + +jobs: +- template: azure-pipelines-job-groups.yml + parameters: + jobFilters: ${{ parameters.jobFilters }} + jobVariables: + PLATFORM: $(GROUP_NAME) + PLATFORM_ARCH: amd64 + BUILD_OPTIONS: ${{ parameters.buildOptions }} + preSteps: + - template: cleanup.yml + - ${{ parameters. preSteps }} + - script: | + if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM) | grep -E -q "^(vs|broadcom|mellanox)$"; then + CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM)" + BUILD_OPTIONS="$(BUILD_OPTIONS) $CACHE_OPTIONS" + echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS" + fi + displayName: "Make build options" + - checkout: self + submodules: recursive + displayName: 'Checkout code' + - script: | + sudo modprobe overlay + sudo apt-get install -y acl + export DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker + sudo bash -c "echo 1 > /proc/sys/vm/compact_memory" + ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM) PLATFORM_ARCH=$(PLATFORM_ARCH) configure + displayName: 'Make configure' + postSteps: + - publish: $(System.DefaultWorkingDirectory)/target + artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)' + displayName: "Archive sonic image" + - ${{ parameters.postSteps }} + - template: cleanup.yml + jobGroups: ${{ parameters.jobGroups }} \ No newline at end of file From 42943ed59a0d837ffb130b8e0d2d2da4efc15321 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Wed, 31 Mar 2021 15:38:36 +0800 Subject: [PATCH 03/14] Update new-build-template.yml --- .azure-pipelines/new-build-template.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/new-build-template.yml b/.azure-pipelines/new-build-template.yml index 50c45f137d1..2dc5707d7a6 100644 --- a/.azure-pipelines/new-build-template.yml +++ b/.azure-pipelines/new-build-template.yml @@ -51,4 +51,5 @@ jobs: displayName: "Archive sonic image" - ${{ parameters.postSteps }} - template: cleanup.yml - jobGroups: ${{ parameters.jobGroups }} \ No newline at end of file + jobGroups: ${{ parameters.jobGroups }} + From 44c95a25fc95658dc3f14aab6b9a7678babbbdfa Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Wed, 31 Mar 2021 15:39:27 +0800 Subject: [PATCH 04/14] Update azure-pipelines-build.yml --- .azure-pipelines/azure-pipelines-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index 30a933df93e..62eee966f85 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -79,4 +79,4 @@ jobs: PLATFORM_ARCH: arm64 script: | make $(BUILD_OPTIONS) target/sonic-centec-arm64.bin - make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/docker-syncd-centec-arm64-rpc.gz \ No newline at end of file + make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/docker-syncd-centec-arm64-rpc.gz From 08a6729560b35b546fe4b508d41eb8ea16ec9d28 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Wed, 31 Mar 2021 15:40:06 +0800 Subject: [PATCH 05/14] Update azure-pipelines-job-groups.yml --- .azure-pipelines/azure-pipelines-job-groups.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines-job-groups.yml b/.azure-pipelines/azure-pipelines-job-groups.yml index aefa5507eb9..4ed68fc2f23 100644 --- a/.azure-pipelines/azure-pipelines-job-groups.yml +++ b/.azure-pipelines/azure-pipelines-job-groups.yml @@ -51,4 +51,4 @@ jobs: displayName: 'JobScript' - ${{ if ne(jobGroup.steps, '') }}: - ${{ jobGroup.steps }} - - ${{ parameters.postSteps }} \ No newline at end of file + - ${{ parameters.postSteps }} From 12c13eeb6dadc2061f0ec46120bdd175733bfb7d Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 1 Apr 2021 13:49:50 +0800 Subject: [PATCH 06/14] fix --- .azure-pipelines/azure-pipelines-build.yml | 2 +- ...ew-build-template.yml => azure-pipelines-image-template.yml} | 1 - .azure-pipelines/azure-pipelines-job-groups.yml | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) rename .azure-pipelines/{new-build-template.yml => azure-pipelines-image-template.yml} (99%) diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index 62eee966f85..98533894e1e 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -15,7 +15,7 @@ parameters: default: [] jobs: -- template: new-build-template.yml +- template: azure-pipelines-image-template.yml parameters: jobFilters: ${{ parameters.jobFilters }} buildOptions: ${{ parameters.buildOptions }} diff --git a/.azure-pipelines/new-build-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml similarity index 99% rename from .azure-pipelines/new-build-template.yml rename to .azure-pipelines/azure-pipelines-image-template.yml index 2dc5707d7a6..636afbe3169 100644 --- a/.azure-pipelines/new-build-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -52,4 +52,3 @@ jobs: - ${{ parameters.postSteps }} - template: cleanup.yml jobGroups: ${{ parameters.jobGroups }} - diff --git a/.azure-pipelines/azure-pipelines-job-groups.yml b/.azure-pipelines/azure-pipelines-job-groups.yml index 4ed68fc2f23..91ab23d3c02 100644 --- a/.azure-pipelines/azure-pipelines-job-groups.yml +++ b/.azure-pipelines/azure-pipelines-job-groups.yml @@ -43,7 +43,6 @@ jobs: - ${{ parameters.preSteps }} - ${{ if ne(jobGroup.script, '') }}: - script: | - set -e ${{ jobGroup.script }} env: ${{ if ne(parameters.scriptEnv, '') }}: From 25cf1ad0aa8d2f8b949da022a7a69b86f140046f Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Thu, 1 Apr 2021 17:45:39 +0800 Subject: [PATCH 07/14] fix --- .azure-pipelines/official-build.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index 5604d572c56..fa79be96974 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -27,10 +27,3 @@ stages: parameters: buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}' jobFilters: none - postSteps: - - script: | - make freeze - git status files/build/versions - git add files/build/versions - git diff HEAD files/build/versions - displayName: "Show git diff" From 2f53bcb44df71894157b0b944d7e00cebd125aff Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Fri, 2 Apr 2021 16:17:55 +0800 Subject: [PATCH 08/14] draft --- .azure-pipelines/azure-pipelines-build.yml | 111 ++++++++++-------- .../azure-pipelines-image-template.yml | 4 + .../azure-pipelines-job-groups.yml | 11 +- 3 files changed, 74 insertions(+), 52 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index 98533894e1e..bc6af623984 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -23,60 +23,69 @@ jobs: postSteps: ${{ parameters.postSteps }} jobGroups: - name: vs - script: | - make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-vs.img.gz - mv target/sonic-vs.img.gz target/sonic-vs-dbg.img.gz - make $(BUILD_OPTIONS) target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz - - name: broadcom - script: | - make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-broadcom.bin - mv target/sonic-broadcom.bin target/sonic-broadcom-dbg.bin - make $(BUILD_OPTIONS) target/sonic-broadcom.bin - make $(BUILD_OPTIONS) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-broadcom.swi - make $(BUILD_OPTIONS) target/sonic-broadcom.raw - make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/docker-syncd-brcm-rpc.gz - - name: mellanox - script: | - make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-mellanox.bin - mv target/sonic-mellanox.bin target/sonic-mellanox-dbg.bin - make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/sonic-aboot-mlnx-rpc.gz + variables: + dbg_image: true - name: barefoot - script: | - make $(BUILD_OPTIONS) target/sonic-barefoot.bin - make $(BUILD_OPTIONS) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-barefoot.swi + variables: + swi_image: true + - name: broadcom + variables: + platform_rpc: brcm + dbg_image: true + swi_image: true + raw_image: true + sync_rpc_image: true + - name: centec + variables: + platform_rpc: centec + dbg_image: true + sync_rpc_image: true + - name: centec-arm64 + variables: + arch: arm64 + platform_rpc: centec-arm64 + pool: sonicbld_8c + timeoutInMinutes: 1800 - name: generic - script: | - make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-generic.bin - mv target/sonic-generic.bin target/sonic-generic-dbg.bin - make $(BUILD_OPTIONS) target/sonic-generic.bin + variables: + dbg_image: true - name: innovium - script: | - make $(BUILD_OPTIONS) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-innovium.swi - make $(BUILD_OPTIONS) target/sonic-innovium.bin - - name: nephos - script: | - make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-nephos.bin - mv target/sonic-nephos.bin target/sonic-nephos-dbg.bin - make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/docker-syncd-nephos-rpc.gz - make $(BUILD_OPTIONS) target/sonic-nephos.bin + variables: + swi_image: true - name: marvell-armhf - pool: sonicbld_8c - timeoutInMinutes: 3600 variables: - PLATFORM_ARCH: armhf - script: | - make $(BUILD_OPTIONS) target/sonic-marvell-armhf.bin - - name: centec - script: | - make $(BUILD_OPTIONS) INSTALL_DEBUG_TOOLS=y target/sonic-centec.bin - mv target/sonic-centec.bin target/sonic-centec-dbg.bin - make $(BUILD_OPTIONS) target/sonic-centec.bin - make $(BUILD_OPTIONS) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-centec.swi - - name: centec-arm64 - pool: sonicbld_8c - timeoutInMinutes: 3600 + arch: armhf + pool: sonicbld_8c + - name: mellanox + variables: + platform_rpc: mlnx + dbg_image: true + sync_rpc_image: true + - name: nephos variables: - PLATFORM_ARCH: arm64 - script: | - make $(BUILD_OPTIONS) target/sonic-centec-arm64.bin - make $(BUILD_OPTIONS) ENABLE_SYNCD_RPC=y target/docker-syncd-centec-arm64-rpc.gz + platform_rpc: nephos + dbg_image: true + sync_rpc_image: true + buildSteps: + - bash: | + if [ $(GROUP_NAME) == vs ]; then + if [ $(dbg_image) == true ]; then + make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-vs.img.gz && mv target/sonic-vs.img.gz target/sonic-vs-dbg.img.gz + fi + make $BUILD_OPTIONS target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz + else + if [ $(dbg_image) == true ]; then + make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-$(GROUP_NAME).bin && \ + mv target/sonic-$(GROUP_NAME).bin target/sonic-$(GROUP_NAME)-dbg.bin + fi + if [ $(swi_image) == true ]; then + make $BUILD_OPTIONS ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-$(GROUP_NAME).swi + fi + if [ $(raw_image) == true ]; then + make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).raw + fi + if [ $(sync_rpc_image) == true ]; then + make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-rpc.gz + fi + make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin + fi diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index 636afbe3169..df5043cf129 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -10,6 +10,9 @@ parameters: - name: 'preSteps' type: stepList default: [] +- name: 'buildSteps' + type: stepList + default: [] - name: 'postSteps' type: stepList default: [] @@ -52,3 +55,4 @@ jobs: - ${{ parameters.postSteps }} - template: cleanup.yml jobGroups: ${{ parameters.jobGroups }} + buildSteps: ${{ parameters.buildSteps }} diff --git a/.azure-pipelines/azure-pipelines-job-groups.yml b/.azure-pipelines/azure-pipelines-job-groups.yml index 91ab23d3c02..4c97f24f546 100644 --- a/.azure-pipelines/azure-pipelines-job-groups.yml +++ b/.azure-pipelines/azure-pipelines-job-groups.yml @@ -2,6 +2,9 @@ parameters: - name: 'preSteps' type: stepList default: [] +- name: 'buildSteps' + type: stepList + default: [] - name: "postSteps" type: stepList default: [] @@ -16,7 +19,10 @@ parameters: default: '' - name: 'timeoutInMinutes' type: 'number' - default: 1440 + default: 600 +- name: 'pool' + type: string + default: 'sonicbld' - name: 'jobFilters' type: object default: '' @@ -30,6 +36,8 @@ jobs: ${{ pair.key }}: ${{ pair.value }} ${{ if eq(jobGroup.timeoutInMinutes, '') }}: timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + ${{ if eq(jobGroup.pool, '') }}: + pool: ${{ parameters.pool }} variables: GROUP_NAME: ${{ jobGroup.name }} GROUP_EXTNAME: '${{ jobGroup.extName }}' @@ -50,4 +58,5 @@ jobs: displayName: 'JobScript' - ${{ if ne(jobGroup.steps, '') }}: - ${{ jobGroup.steps }} + - ${{ parameters.buildSteps }} - ${{ parameters.postSteps }} From 7cabf2dfd64067fbabc89d8abc37673847c8f70b Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Fri, 2 Apr 2021 16:35:34 +0800 Subject: [PATCH 09/14] fix --- .azure-pipelines/official-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index fa79be96974..6121988ce6b 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -17,7 +17,6 @@ pr: none stages: - stage: Build - pool: sonicbld variables: CACHE_MODE: wcache ${{ if eq(variables['Build.SourceBranchName'], '202012') }}: From b9f015b83193e8fca814a3c9c8e42f9521a020ee Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Fri, 2 Apr 2021 16:43:06 +0800 Subject: [PATCH 10/14] fix --- .azure-pipelines/azure-pipelines-build.yml | 10 +++++++++- .azure-pipelines/azure-pipelines-image-template.yml | 12 ++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index bc6af623984..84edd8019a9 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -18,9 +18,17 @@ jobs: - template: azure-pipelines-image-template.yml parameters: jobFilters: ${{ parameters.jobFilters }} - buildOptions: ${{ parameters.buildOptions }} preSteps: ${{ parameters.preSteps }} postSteps: ${{ parameters.postSteps }} + jobVariables: + PLATFORM: $(GROUP_NAME) + PLATFORM_ARCH: amd64 + BUILD_OPTIONS: ${{ parameters.buildOptions }} + dbg_image: false + swi_image: false + raw_image: false + sync_rpc_image: false + platform_rpc: false jobGroups: - name: vs variables: diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml index df5043cf129..17471fd06e9 100644 --- a/.azure-pipelines/azure-pipelines-image-template.yml +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -4,9 +4,6 @@ parameters: - name: 'jobFilters' type: object default: '' -- name: 'buildOptions' - type: string - default: 'SONIC_CONFIG_BUILD_JOBS=1' - name: 'preSteps' type: stepList default: [] @@ -19,15 +16,14 @@ parameters: - name: jobGroups type: object default: [] - +- name: jobVariables + type: object + default: [] jobs: - template: azure-pipelines-job-groups.yml parameters: jobFilters: ${{ parameters.jobFilters }} - jobVariables: - PLATFORM: $(GROUP_NAME) - PLATFORM_ARCH: amd64 - BUILD_OPTIONS: ${{ parameters.buildOptions }} + jobVariables: ${{ parameters.jobVariables }} preSteps: - template: cleanup.yml - ${{ parameters. preSteps }} From 52eaa983f563bdcc34672526b5870acee7b9dcbf Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Fri, 2 Apr 2021 16:54:17 +0800 Subject: [PATCH 11/14] fix --- .azure-pipelines/azure-pipelines-build.yml | 4 ++-- .azure-pipelines/official-build.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index 84edd8019a9..f44c3212fe6 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -49,10 +49,10 @@ jobs: dbg_image: true sync_rpc_image: true - name: centec-arm64 + pool: sonicbld_8c variables: arch: arm64 platform_rpc: centec-arm64 - pool: sonicbld_8c timeoutInMinutes: 1800 - name: generic variables: @@ -61,9 +61,9 @@ jobs: variables: swi_image: true - name: marvell-armhf + pool: sonicbld_8c variables: arch: armhf - pool: sonicbld_8c - name: mellanox variables: platform_rpc: mlnx diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml index 6121988ce6b..fa79be96974 100644 --- a/.azure-pipelines/official-build.yml +++ b/.azure-pipelines/official-build.yml @@ -17,6 +17,7 @@ pr: none stages: - stage: Build + pool: sonicbld variables: CACHE_MODE: wcache ${{ if eq(variables['Build.SourceBranchName'], '202012') }}: From 903d2595cc5af9248743b3961dae7492c5308b00 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Fri, 2 Apr 2021 16:57:25 +0800 Subject: [PATCH 12/14] fix --- .azure-pipelines/azure-pipelines-job-groups.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-job-groups.yml b/.azure-pipelines/azure-pipelines-job-groups.yml index 4c97f24f546..8318437ae9e 100644 --- a/.azure-pipelines/azure-pipelines-job-groups.yml +++ b/.azure-pipelines/azure-pipelines-job-groups.yml @@ -20,9 +20,6 @@ parameters: - name: 'timeoutInMinutes' type: 'number' default: 600 -- name: 'pool' - type: string - default: 'sonicbld' - name: 'jobFilters' type: object default: '' From 81f0e4c070810dba73dc49e28a8a1c01da83a86c Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Fri, 2 Apr 2021 16:59:01 +0800 Subject: [PATCH 13/14] fix --- .azure-pipelines/azure-pipelines-job-groups.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-job-groups.yml b/.azure-pipelines/azure-pipelines-job-groups.yml index 8318437ae9e..d5be80dcde3 100644 --- a/.azure-pipelines/azure-pipelines-job-groups.yml +++ b/.azure-pipelines/azure-pipelines-job-groups.yml @@ -33,8 +33,6 @@ jobs: ${{ pair.key }}: ${{ pair.value }} ${{ if eq(jobGroup.timeoutInMinutes, '') }}: timeoutInMinutes: ${{ parameters.timeoutInMinutes }} - ${{ if eq(jobGroup.pool, '') }}: - pool: ${{ parameters.pool }} variables: GROUP_NAME: ${{ jobGroup.name }} GROUP_EXTNAME: '${{ jobGroup.extName }}' From 5488ca85d3546dad7e08169bf9b1fcfde74dcf79 Mon Sep 17 00:00:00 2001 From: Shilong Liu Date: Wed, 7 Apr 2021 15:04:32 +0800 Subject: [PATCH 14/14] fix Signed-off-by: Shilong Liu --- .azure-pipelines/azure-pipelines-build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml index f44c3212fe6..55471d7cd49 100644 --- a/.azure-pipelines/azure-pipelines-build.yml +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -38,21 +38,20 @@ jobs: swi_image: true - name: broadcom variables: - platform_rpc: brcm dbg_image: true swi_image: true raw_image: true sync_rpc_image: true + platform_rpc: brcm - name: centec variables: - platform_rpc: centec dbg_image: true sync_rpc_image: true + platform_rpc: centec - name: centec-arm64 pool: sonicbld_8c variables: arch: arm64 - platform_rpc: centec-arm64 timeoutInMinutes: 1800 - name: generic variables: @@ -64,16 +63,17 @@ jobs: pool: sonicbld_8c variables: arch: armhf + timeoutInMinutes: 1800 - name: mellanox variables: - platform_rpc: mlnx dbg_image: true sync_rpc_image: true + platform_rpc: mlnx - name: nephos variables: - platform_rpc: nephos dbg_image: true sync_rpc_image: true + platform_rpc: nephos buildSteps: - bash: | if [ $(GROUP_NAME) == vs ]; then