Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
116 changes: 61 additions & 55 deletions .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ parameters:
- name: 'postSteps'
type: stepList
default: []
- name: 'jobGroups'
type: object
default: ''

jobs:
- template: azure-pipelines-image-template.yml
Expand All @@ -25,75 +28,78 @@ jobs:
PLATFORM_ARCH: amd64
BUILD_OPTIONS: ${{ parameters.buildOptions }}
DOCKER_DATA_ROOT_FOR_MULTIARCH: /data/march/docker
dbg_image: false
swi_image: false
raw_image: false
sync_rpc_image: false
platform_rpc: false
jobGroups:
- name: vs
variables:
dbg_image: true
- name: barefoot
variables:
swi_image: true
- name: broadcom
variables:
dbg_image: true
swi_image: true
raw_image: true
sync_rpc_image: true
platform_rpc: brcm
- name: centec
variables:
dbg_image: true
sync_rpc_image: true
platform_rpc: centec
- name: centec-arm64
pool: sonicbld_8c
timeoutInMinutes: 1800
variables:
PLATFORM_ARCH: arm64
- name: generic
variables:
dbg_image: true
- name: innovium
variables:
swi_image: true
- name: marvell-armhf
pool: sonicbld_8c
timeoutInMinutes: 1800
variables:
PLATFORM_ARCH: armhf
- name: mellanox
variables:
dbg_image: true
sync_rpc_image: true
platform_rpc: mlnx
- name: nephos
variables:
dbg_image: true
sync_rpc_image: true
platform_rpc: nephos
dbg_image: no
swi_image: no
raw_image: no
sync_rpc_image: no
platform_rpc: no
${{ if ne(parameters.jobGroups, '') }}:
jobGroups: ${{ parameters.jobGroups }}
${{ if eq(parameters.jobGroups, '') }}:
jobGroups:
- name: vs
variables:
dbg_image: yes
- name: barefoot
variables:
swi_image: yes
- name: broadcom
variables:
dbg_image: yes
swi_image: yes
raw_image: yes
sync_rpc_image: yes
platform_rpc: brcm
- name: centec
variables:
dbg_image: yes
sync_rpc_image: yes
platform_rpc: centec
- name: centec-arm64
pool: sonicbld_8c
timeoutInMinutes: 1800
variables:
PLATFORM_ARCH: arm64
- name: generic
variables:
dbg_image: yes
- name: innovium
variables:
swi_image: yes
- name: marvell-armhf
pool: sonicbld_8c
timeoutInMinutes: 1800
variables:
PLATFORM_ARCH: armhf
- name: mellanox
variables:
dbg_image: yes
sync_rpc_image: yes
platform_rpc: mlnx
- name: nephos
variables:
dbg_image: yes
sync_rpc_image: yes
platform_rpc: nephos
buildSteps:
- bash: |
if [ $(GROUP_NAME) == vs ]; then
if [ $(dbg_image) == true ]; then
if [ $(dbg_image) == yes ]; 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
if [ $(dbg_image) == yes ]; 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
if [ $(swi_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-$(GROUP_NAME).swi
fi
if [ $(raw_image) == true ]; then
if [ $(raw_image) == yes ]; then
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).raw
fi
if [ $(sync_rpc_image) == true ]; then
if [ $(sync_rpc_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-rpc.gz
fi
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin
Expand Down
4 changes: 3 additions & 1 deletion .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ jobs:
submodules: recursive
displayName: 'Checkout code'
- script: |
git checkout -b $(Build.SourceBranchName)
BRANCH_NAME=$(Build.SourceBranchName)
[ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ] && BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER"
git checkout -b $BRANCH_NAME
sudo modprobe overlay
sudo apt-get install -y acl
sudo bash -c "echo 1 > /proc/sys/vm/compact_memory"
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ stages:
- template: .azure-pipelines/azure-pipelines-build.yml
parameters:
buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}'
jobFilters:
- vs
- broadcom
- mellanox
jobGroups:
- name: vs
- name: broadcom
- name: mellanox

- stage: Test
variables:
Expand Down
2 changes: 2 additions & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform
$(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_pydebs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_DEBS)))\n" | awk '!a[$$0]++'))
$(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_whls=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_WHEELS)))\n" | awk '!a[$$0]++'))
$(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_PACKAGES)))\n" | awk '!a[$$0]++'))
$(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_pkgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_APT_PACKAGES)))\n" | awk '!a[$$0]++'))
j2 $($*.gz_PATH)/Dockerfile.j2 > $($*.gz_PATH)/Dockerfile
# Prepare docker build info
PACKAGE_URL_PREFIX=$(PACKAGE_URL_PREFIX) \
Expand Down Expand Up @@ -797,6 +798,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) : $(TARGET_PATH)/%-$(DBG_IMAG
# Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs
$(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++'))
$(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_image_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_IMAGE_PACKAGES)))\n" | awk '!a[$$0]++'))
$(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_pkgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_APT_PACKAGES),RDEPENDS))\n" | awk '!a[$$0]++'))
./build_debug_docker_j2.sh $* $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs $(subst -,_,$(notdir $($*.gz_PATH)))_image_dbgs > $($*.gz_PATH)/Dockerfile-dbg.j2
j2 $($*.gz_PATH)/Dockerfile-dbg.j2 > $($*.gz_PATH)/Dockerfile-dbg
# Prepare docker build info
Expand Down