Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 55 additions & 45 deletions .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,82 @@
# The azure pipeline template for Official build, and upgrade version build

parameters:
- name: 'jobFilters'
type: object
default: ''
- 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: []

jobs:
- template: azure-pipelines-job-groups.yml
- template: azure-pipelines-image-template.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
54 changes: 54 additions & 0 deletions .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-job-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')) }}:
Expand Down
51 changes: 9 additions & 42 deletions .azure-pipelines/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,54 +9,21 @@ schedules:
branches:
include:
- master
- 202012
always: true

trigger: none
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