Skip to content

Commit

Permalink
Merge branch 'master' into dev-reset-local-users-password
Browse files Browse the repository at this point in the history
  • Loading branch information
azmy98 authored and azmyali98 committed May 7, 2024
2 parents 6bb6a32 + 99ec0f3 commit a848ace
Show file tree
Hide file tree
Showing 2,588 changed files with 145,365 additions and 216,550 deletions.
7 changes: 4 additions & 3 deletions .azure-pipelines/azure-pipelines-UpgrateVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ parameters:
type: object
default:
- vs
- barefoot
- broadcom
- centec
- centec-arm64
- generic
- marvell-armhf
- marvell-arm64
- mellanox
- pensando

stages:
- stage: Prepare
Expand Down Expand Up @@ -161,8 +162,8 @@ stages:
git branch -u remote/$BRANCH_NAME
echo $GIT_PASSWORD | gh auth login --with-token
TITLE="Upgrade SONiC Versions"
BODY="Upgrade SONiC Versions"
TITLE="[${SOURCE_BRANCH#refs/heads/}] Upgrade SONiC package Versions"
BODY=$TITLE
RET=0
if ! gh pr create -t "$TITLE" -b "$BODY" -B $(Build.SourceBranch) -R $(Build.Repository.Name) > pr.log 2>&1; then
if ! grep -q "already exists" pr.log; then
Expand Down
16 changes: 14 additions & 2 deletions .azure-pipelines/azure-pipelines-build-ubuntu-2004.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ trigger:
branches:
include:
- master
- 202???

schedules:
- cron: "0 0 * * *"
displayName: Daily build
branches:
include:
- master
- 202???
always: true

stages:
- stage: Build
Expand All @@ -28,13 +38,15 @@ stages:
cmake pkg-config python3-pip python cmake libgtest-dev libgmock-dev libyang-dev \
debhelper-compat dh-elpa dh-sequence-python3 python3-all \
libpython3-all-dev python3-six xmlto unzip rake-compiler gem2deb pkg-php-tools \
ant default-jdk maven-repo-helper libguava-java
ant default-jdk maven-repo-helper libguava-java \
libboost-all-dev libgtest-dev build-essential swig4.0 swig
sudo pip3 install pytest click
wget http://ftp.us.debian.org/debian/pool/main/libg/libgoogle-gson-java/libgoogle-gson-java_2.8.6-1+deb11u1_all.deb
sudo dpkg -i libgoogle-gson-java_2.8.6-1+deb11u1_all.deb
mkdir -p /tmp/artifacts
displayName: "Install dependencies"
- script: |
SONIC_CONFIG_MAKE_JOBS=$(nproc) CONFIGURED_ARCH=amd64 DEST=/tmp/artifacts make -f ../rules/protobuf.mk -f protobuf/Makefile
BLDENV=bullseye SONIC_CONFIG_MAKE_JOBS=$(nproc) CONFIGURED_ARCH=amd64 DEST=/tmp/artifacts make -f ../rules/protobuf.mk -f protobuf/Makefile
workingDirectory: src
displayName: "Build protobuf"
- script: |
Expand Down
26 changes: 17 additions & 9 deletions .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
dbg_image: no
asan_image: no
swi_image: no
raw_image: no
docker_syncd_rpc_image: no
syncd_rpc_image: no
platform_rpc: no
Expand All @@ -62,7 +61,6 @@ jobs:
variables:
dbg_image: yes
swi_image: yes
raw_image: yes
docker_syncd_rpc_image: yes
platform_rpc: brcm

Expand Down Expand Up @@ -92,13 +90,15 @@ jobs:
pool: sonicbld-armhf
timeoutInMinutes: 2880
variables:
PLATFORM_NAME: marvell
PLATFORM_ARCH: armhf

- name: marvell-arm64
${{ if not(parameters.qemuOrCrossBuild) }}:
pool: sonicbld-arm64
timeoutInMinutes: 2880
variables:
PLATFORM_NAME: marvell
PLATFORM_ARCH: arm64

- name: marvell
Expand All @@ -116,12 +116,19 @@ jobs:
docker_syncd_rpc_image: yes
platform_rpc: nephos

- name: pensando
pool: sonicbld-arm64
variables:
PLATFORM_ARCH: arm64

buildSteps:
- template: .azure-pipelines/template-skipvstest.yml@buildimage
- template: .azure-pipelines/template-daemon.yml@buildimage
- bash: |
set -ex
if [ $(GROUP_NAME) == vs ]; then
if [ $(GROUP_NAME) == pensando ]; then
make $BUILD_OPTIONS target/sonic-pensando.tar
elif [ $(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
Expand All @@ -130,9 +137,13 @@ jobs:
make $BUILD_OPTIONS ENABLE_ASAN=y target/docker-sonic-vs.gz
mv target/docker-sonic-vs.gz target/docker-sonic-vs-asan.gz
fi
if [ $(K8S_OPTIONS) == 'INCLUDE_KUBERNETES_MASTER=y' ]; then
make $BUILD_OPTIONS $(K8S_OPTIONS) target/sonic-vs.img.gz
mv target/sonic-vs.img.gz target/sonic-vs-k8s.img.gz
if [ "$(K8S_MASTER_CHANGED)" == 'YES' ]; then
make $BUILD_OPTIONS INCLUDE_KUBERNETES_MASTER=y target/sonic-vs.img.gz
gzip -d 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 $BUILD_OPTIONS sonic-slave-run
gzip target/sonic-vs.vhdx
mv target/sonic-vs.vhdx.gz target/sonic-vs-k8s.vhdx.gz
rm target/sonic-vs.img
fi
make $BUILD_OPTIONS target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz
make $BUILD_OPTIONS target/docker-ptf-sai.gz
Expand All @@ -149,9 +160,6 @@ jobs:
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 [ $(docker_syncd_rpc_image) == yes ]; then
# workaround for issue in rules/sairedis.dep, git ls-files will list un-exist files for cache
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-rpc.gz
Expand Down
5 changes: 3 additions & 2 deletions .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- script: |
[ -n "$OVERRIDE_BUILD_OPTIONS" ] && OVERRIDE_BUILD_OPTIONS=$(OVERRIDE_BUILD_OPTIONS)
BUILD_OPTIONS="$(BUILD_OPTIONS) $OVERRIDE_BUILD_OPTIONS"
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf|marvell-arm64)$"; then
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)"
BUILD_OPTIONS="$BUILD_OPTIONS $CACHE_OPTIONS"
fi
Expand All @@ -49,7 +49,8 @@ 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) $(BUILD_OPTIONS) configure
[ -z "$PLATFORM_NAME" ] && PLATFORM_NAME=$(PLATFORM_AZP)
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$PLATFORM_NAME PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure
displayName: 'Make configure'
postSteps:
- script: |
Expand Down
3 changes: 0 additions & 3 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ jobs:
if [ ${{ parameters.swi_image }} == true ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-${{ parameters.platform }}.swi
fi
if [ ${{ parameters.raw_image }} == true ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.raw
fi
if [ ${{ parameters.sync_rpc_image }} == true ]; then
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y target/docker-syncd-${{ parameters.platform_short }}-rpc.gz
# workaround for issue in rules/sairedis.dep, git ls-files will list un-exist files for cache
Expand Down
63 changes: 63 additions & 0 deletions .azure-pipelines/docker-sonic-mgmt-py3-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 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-mgmt image

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

trigger: none
pr:
branches:
include:
- master
paths:
include:
- dockers/docker-sonic-mgmt

parameters:
- name: registry_url
type: string
default: sonicdev-microsoft.azurecr.io
- name: registry_conn
type: string
default: sonicdev

stages:
- stage: Build
jobs:
- job: Build
pool: sonicbld
timeoutInMinutes: 360
steps:
- template: cleanup.yml
- checkout: self
clean: true
- bash: |
set -xe
git submodule update --init --recursive -- src/sonic-platform-daemons src/sonic-genl-packet src/sonic-sairedis src/ptf src/sonic-device-data
make SONIC_BUILD_JOBS=$(nproc) DEFAULT_CONTAINER_REGISTRY=publicmirror.azurecr.io ENABLE_DOCKER_BASE_PULL=y configure PLATFORM=generic
make -f Makefile.work BLDENV=bullseye SONIC_BUILD_JOBS=$(nproc) DEFAULT_CONTAINER_REGISTRY=publicmirror.azurecr.io ENABLE_DOCKER_BASE_PULL=y LEGACY_SONIC_MGMT_DOCKER=n target/docker-sonic-mgmt.gz
cp target -r $(Build.ArtifactStagingDirectory)/target
docker load -i target/docker-sonic-mgmt.gz
docker tag docker-sonic-mgmt $REGISTRY_SERVER/docker-sonic-mgmt:py3only
env:
REGISTRY_SERVER: ${{ parameters.registry_url }}
displayName: Build docker-sonic-mgmt.gz
- task: Docker@2
displayName: Upload image
inputs:
containerRegistry: ${{ parameters.registry_conn }}
repository: docker-sonic-mgmt
command: push
tags: py3only
- publish: $(Build.ArtifactStagingDirectory)
artifact: 'docker-sonic-mgmt'
displayName: "Archive docker image sonic-mgmt"

2 changes: 1 addition & 1 deletion .azure-pipelines/docker-sonic-mgmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ stages:
git submodule update --init --recursive -- src/sonic-platform-daemons src/sonic-genl-packet src/sonic-sairedis src/ptf src/sonic-device-data
make SONIC_BUILD_JOBS=$(nproc) DEFAULT_CONTAINER_REGISTRY=publicmirror.azurecr.io ENABLE_DOCKER_BASE_PULL=y configure PLATFORM=generic
make SONIC_BUILD_JOBS=$(nproc) DEFAULT_CONTAINER_REGISTRY=publicmirror.azurecr.io ENABLE_DOCKER_BASE_PULL=y target/docker-sonic-mgmt.gz
make -f Makefile.work BLDENV=bullseye SONIC_BUILD_JOBS=$(nproc) DEFAULT_CONTAINER_REGISTRY=publicmirror.azurecr.io ENABLE_DOCKER_BASE_PULL=y LEGACY_SONIC_MGMT_DOCKER=y target/docker-sonic-mgmt.gz
cp target -r $(Build.ArtifactStagingDirectory)/target
docker load -i target/docker-sonic-mgmt.gz
docker tag docker-sonic-mgmt $REGISTRY_SERVER/docker-sonic-mgmt:latest
Expand Down
1 change: 1 addition & 0 deletions .azure-pipelines/docker-sonic-slave-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ parameters:
- name: dist
type: string
values:
- bookworm
- bullseye
- buster
- stretch
Expand Down
3 changes: 2 additions & 1 deletion .azure-pipelines/docker-sonic-slave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resources:
- repository: buildimage
type: github
name: sonic-net/sonic-buildimage
ref: master
ref: bookworm
endpoint: sonic-net

schedules:
Expand Down Expand Up @@ -44,6 +44,7 @@ parameters:
- name: 'dists'
type: object
default:
- bookworm
- bullseye
- buster
- stretch
Expand Down
27 changes: 24 additions & 3 deletions .azure-pipelines/dpkg-cache-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,34 @@ trigger: none
pr: none

jobs:
- job: Build
- job: Amd
pool: sonicbld
timeoutInMinutes: 5
steps:
- checkout: none
- script: |
set -xe
df -h
sudo find /nfs/dpkg_cache/ -name *.tgz -mtime +30 -type f -delete
df -h
displayName: clean dpkg cache
- job: Armhf
pool: sonicbld-armhf
timeoutInMinutes: 5
steps:
- checkout: none
- script: |
df -h
sudo find /nfs/dpkg_cache/ -name *.tgz -mtime +30 -type f -delete
df -h
displayName: clean dpkg cache
- job: Arm64
pool: sonicbld-arm64
timeoutInMinutes: 5
steps:
- checkout: none
- script: |
df -h
sudo find /nfs/dpkg_cache/ -name *.tgz -mtime +30 -type f -delete
df -h
displayName: clean dpkg cache
2 changes: 1 addition & 1 deletion .azure-pipelines/official-build-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ stages:
- name: broadcom
variables:
swi_image: yes
raw_image: yes
docker_syncd_rpc_image: yes
platform_rpc: brcm
- name: mellanox
Expand All @@ -50,4 +49,5 @@ stages:
pool: sonicbld-armhf
timeoutInMinutes: 1200
variables:
PLATFORM_NAME: marvell
PLATFORM_ARCH: armhf
13 changes: 9 additions & 4 deletions .azure-pipelines/template-skipvstest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ steps:
set -ex
tar_branch=origin/$(System.PullRequest.TargetBranchName)
# Check if k8s master entrance script is changed
if ! git diff $tar_branch..HEAD --name-only | grep -F files/image_config/kubernetes/kubernetes_master_entrance.sh; then
echo "##vso[task.setvariable variable=K8S_OPTIONS;]INCLUDE_KUBERNETES_MASTER=n"
else
echo "##vso[task.setvariable variable=K8S_OPTIONS;]INCLUDE_KUBERNETES_MASTER=y"
K8S_MASTER_CHANGED=NO
if git diff $tar_branch..HEAD --name-only | grep -F files/image_config/kubernetes/kubernetes_master_entrance.sh; then
K8S_MASTER_CHANGED=YES
fi
set +x
echo "##vso[task.setvariable variable=K8S_MASTER_CHANGED;]$K8S_MASTER_CHANGED"
displayName: "Check if k8s master image build is needed."
- script: |
set -ex
tar_branch=origin/$(System.PullRequest.TargetBranchName)
git diff $tar_branch..HEAD --name-only | grep -v -f .azure-pipelines/vstest-exclude && exit 0
git diff $tar_branch..HEAD --name-only | grep -f .azure-pipelines/vstest-include && exit 0
set +x
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:

jobs:
automerge:
if: github.event.check_suite.app.name == 'Azure Pipelines' && github.event.check_suite.conclusion == 'success'
# Disable workflow. Use automerge_scan instead to have the same behaviour.
if: github.event.check_suite.app.name == 'Azure Pipelines' && github.event.check_suite.conclusion == 'success' && false
runs-on: ubuntu-latest
steps:
- name: automerge
Expand Down
Loading

0 comments on commit a848ace

Please sign in to comment.