Skip to content

Commit

Permalink
Merge branch 'master' into voq-recirc-port
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmanman authored Feb 28, 2022
2 parents 0d23994 + 6c31fc6 commit 7c9981d
Show file tree
Hide file tree
Showing 4,102 changed files with 350,952 additions and 56,118 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 5 additions & 1 deletion .azure-pipelines/azure-pipelines-UpgrateVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ schedules:
displayName: Daily Build
branches:
include:
- 202012
- 20*
exclude:
- 200*
- 201*
- 202006
always: true

pool: sonicbld
Expand Down
40 changes: 26 additions & 14 deletions .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ jobs:
dbg_image: no
swi_image: no
raw_image: no
sync_rpc_image: no
docker_syncd_rpc_image: no
syncd_rpc_image: no
platform_rpc: no
${{ if ne(parameters.jobGroups, '') }}:
jobGroups: ${{ parameters.jobGroups }}
Expand All @@ -44,7 +45,7 @@ jobs:

- name: barefoot
variables:
sync_rpc_image: yes
docker_syncd_rpc_image: yes
platform_rpc: bfn
swi_image: yes

Expand All @@ -53,18 +54,18 @@ jobs:
dbg_image: yes
swi_image: yes
raw_image: yes
sync_rpc_image: yes
docker_syncd_rpc_image: yes
platform_rpc: brcm

- name: centec
variables:
dbg_image: yes
sync_rpc_image: yes
docker_syncd_rpc_image: yes
platform_rpc: centec

- name: centec-arm64
pool: sonicbld_8c
timeoutInMinutes: 2160
pool: sonicbld-arm64
timeoutInMinutes: 2880
variables:
PLATFORM_ARCH: arm64

Expand All @@ -77,45 +78,56 @@ jobs:
dbg_image: yes

- name: marvell-armhf
pool: sonicbld_8c
timeoutInMinutes: 2160
pool: sonicbld-armhf
timeoutInMinutes: 2880
variables:
PLATFORM_ARCH: armhf

- name: mellanox
variables:
dbg_image: yes
sync_rpc_image: yes
docker_syncd_rpc_image: yes
syncd_rpc_image: yes
platform_rpc: mlnx

- name: nephos
variables:
dbg_image: yes
sync_rpc_image: yes
docker_syncd_rpc_image: yes
platform_rpc: nephos

buildSteps:
- bash: |
set -ex
if [ $(GROUP_NAME) == vs ]; 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
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
if [ $(Build.Reason) != 'PullRequest' ];then
gzip -kd target/sonic-vs.img.gz
SONIC_RUN_CMDS="qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx" make sonic-slave-run
rm target/sonic-vs.img
fi
else
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
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) == yes ]; then
make $BUILD_OPTIONS ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-$(GROUP_NAME).swi
fi
if [ $(raw_image) == yes ]; then
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).raw
fi
if [ $(sync_rpc_image) == yes ]; then
if [ $(docker_syncd_rpc_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-rpc.gz
fi
if [ $(syncd_rpc_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/sonic-$(GROUP_NAME).bin
mv target/sonic-mellanox.bin target/sonic-$(GROUP_NAME)-rpc.bin
fi
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin
fi
displayName: "Build sonic image"
10 changes: 8 additions & 2 deletions .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
jobVariables: ${{ parameters.jobVariables }}
preSteps:
- template: cleanup.yml
- ${{ parameters. preSteps }}
- ${{ parameters.preSteps }}
- script: |
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox)$"; then
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)"
Expand All @@ -36,6 +36,7 @@ jobs:
displayName: "Set cache options"
- checkout: self
submodules: recursive
condition: eq(variables.SKIP_CHECKOUT, '')
displayName: 'Checkout code'
- script: |
BRANCH_NAME=$(Build.SourceBranchName)
Expand All @@ -44,14 +45,19 @@ jobs:
sudo modprobe overlay
sudo apt-get install -y acl
sudo bash -c "echo 1 > /proc/sys/vm/compact_memory"
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) configure
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure
displayName: 'Make configure'
postSteps:
- script: cp target -r $(Build.ArtifactStagingDirectory)/
displayName: Copy Artifacts
condition: always()
- publish: $(Build.ArtifactStagingDirectory)
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
displayName: "Archive sonic image"
- publish: $(Build.ArtifactStagingDirectory)
condition: failed()
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)$(System.JobAttempt)'
displayName: "Archive failed sonic image"
- ${{ parameters.postSteps }}
- template: cleanup.yml
jobGroups: ${{ parameters.jobGroups }}
Expand Down
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 @@ -19,7 +19,7 @@ parameters:
default: ''
- name: 'timeoutInMinutes'
type: 'number'
default: 720
default: 900
- name: 'jobFilters'
type: object
default: ''
Expand Down
5 changes: 5 additions & 0 deletions .azure-pipelines/azure-pipelines-repd-build-variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
variables:
${{ if and(ge(variables['Build.SourceBranchName'], '202012'), le(variables['Build.SourceBranchName'], '299999')) }}:
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
${{ if or(lt(variables['Build.SourceBranchName'], '202012'), gt(variables['Build.SourceBranchName'], '299999')) }}:
VERSION_CONTROL_OPTIONS: ''
44 changes: 44 additions & 0 deletions .azure-pipelines/docker-sonic-slave-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
# Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64

schedules:
- cron: "0 8 * * *"
branches:
include:
- master
- 202012
always: true

trigger: none
pr:
branches:
include:
- master
paths:
include:
- sonic-slave-jessie
- sonic-slave-stretch
- sonic-slave-buster
- sonic-slave-bullseye

parameters:
- name: 'dists'
type: object
default:
- bullseye
- buster
- stretch

stages:
- stage: Build
jobs:
- ${{ each dist in parameters.dists }}:
- ${{ if contains(variables['Build.DefinitionName'], dist) }}:
- template: docker-sonic-slave-template.yml
parameters:
pool: sonicbld-arm64
arch: arm64
dist: ${{ dist }}
44 changes: 44 additions & 0 deletions .azure-pipelines/docker-sonic-slave-armhf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
# Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64

schedules:
- cron: "0 8 * * *"
branches:
include:
- master
- 202012
always: true

trigger: none
pr:
branches:
include:
- master
paths:
include:
- sonic-slave-jessie
- sonic-slave-stretch
- sonic-slave-buster
- sonic-slave-bullseye

parameters:
- name: 'dists'
type: object
default:
- bullseye
- buster
- stretch

stages:
- stage: Build
jobs:
- ${{ each dist in parameters.dists }}:
- ${{ if contains(variables['Build.DefinitionName'], dist) }}:
- template: docker-sonic-slave-template.yml
parameters:
pool: sonicbld-armhf
arch: armhf
dist: ${{ dist }}
108 changes: 108 additions & 0 deletions .azure-pipelines/docker-sonic-slave-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
# Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64

parameters:
- name: arch
type: string
values:
- amd64
- armhf
- arm64
- name: dist
type: string
values:
- bullseye
- buster
- stretch
- jessie
- name: registry_url
type: string
default: sonicdev-microsoft.azurecr.io
- name: registry_conn
type: string
default: sonicdev
- name: pool
type: string
default: sonicbld
values:
- sonicbld
- sonicbld-arm64
- sonicbld-armhf

jobs:
- job: Build_${{ parameters.dist }}_${{ parameters.arch }}
timeoutInMinutes: 360
pool: ${{ parameters.pool }}
steps:
- template: cleanup.yml
- checkout: self
clean: true
submodules: recursive
- bash: |
set -ex
SLAVE_DIR=sonic-slave-${{ parameters.dist }}
if [ x${{ parameters.pool }} == x"sonicbld" ]; then
if [ x${{ parameters.arch }} == x"amd64" ]; then
SLAVE_BASE_IMAGE=${SLAVE_DIR}
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}
elif [ x${{ parameters.pool }} == x"sonicbld" ]; then
SLAVE_BASE_IMAGE=${SLAVE_DIR}-march-${{ parameters.arch }}
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}-march-${{ parameters.arch }}
fi
elif [[ x${{ parameters.pool }} == x"sonicbld-armhf" && x${{ parameters.arch }} == x"armhf" ]]; then
SLAVE_BASE_IMAGE=${SLAVE_DIR}
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}-armhf
elif [[ x${{ parameters.pool }} == x"sonicbld-arm64" && x${{ parameters.arch }} == x"arm64" ]]; then
SLAVE_BASE_IMAGE=${SLAVE_DIR}
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}-arm64
else
echo "do not support build ${{ parameters.arch }} on ${{ parameters.pool }}"
exit 1
fi
if [ x"$(Build.SourceBranchName)" == x"202012" ]; then
BUILD_OPTIONS = 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
fi
containers=$(docker container ls | grep "sonic-slave" | awk '{ print $1 }')
if [ ! -z "$containers" ]; then
docker container kill $containers || true
sleep 5
fi
images=$(docker images 'sonic-slave-*' -a -q)
if [ ! -z "$images" ]; then
docker rmi -f $images
fi
tmpfile=$(mktemp)
echo ${{ parameters.arch }} > .arch
DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker BLDENV=${{ parameters.dist }} $(BUILD_OPTIONS) make -f Makefile.work sonic-slave-build | tee $tmpfile
SLAVE_BASE_TAG=$(grep "^Checking sonic-slave-base image:" $tmpfile | awk -F ':' '{print $3}')
SLAVE_TAG=$(grep "^Checking sonic-slave image:" $tmpfile | awk -F ':' '{print $3}')
mkdir -p target
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE_UPLOAD:latest
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE_UPLOAD:$SLAVE_BASE_TAG
set +x
echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_IMAGE]$SLAVE_BASE_IMAGE_UPLOAD"
echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_TAG]$SLAVE_BASE_TAG"
env:
REGISTRY_SERVER: ${{ parameters.registry_url }}
displayName: Build sonic-slave-${{ parameters.dist }}-${{ parameters.arch }}
- task: Docker@2
displayName: Upload image
inputs:
containerRegistry: ${{ parameters.registry_conn }}
repository: $(VARIABLE_SLAVE_BASE_IMAGE)
command: push
tags: |
$(VARIABLE_SLAVE_BASE_TAG)
latest
Loading

0 comments on commit 7c9981d

Please sign in to comment.