Skip to content

Commit

Permalink
Merge branch 'sonic-net:master' into add_as9817-64_platform
Browse files Browse the repository at this point in the history
  • Loading branch information
roger530-ho authored Feb 27, 2025
2 parents 413b1eb + 7f1f300 commit 7164392
Show file tree
Hide file tree
Showing 2,732 changed files with 527,886 additions and 179,985 deletions.
125 changes: 125 additions & 0 deletions .azure-pipelines/azure-pipelines-build-vs-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
pr: none
trigger: none


name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)

resources:
repositories:
- repository: sonic-mgmt
type: github
name: sonic-net/sonic-mgmt
ref: master
endpoint: sonic-net
- repository: buildimage
type: github
name: sonic-net/sonic-buildimage
endpoint: sonic-net
ref: master


variables:
- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage
- template: .azure-pipelines/template-variables.yml@buildimage
- name: CACHE_MODE
value: rcache
- name: ENABLE_FIPS
value: y
- name: BUILD_BRANCH
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
value: $(System.PullRequest.TargetBranch)
${{ else }}:
value: $(Build.SourceBranchName)


parameters:
- name: SUBMODULE
type: string
default: ' '

- name: COMMIT_ID
type: string
default: ' '

- name: MGMT_BRANCH
type: string
default: 'master'

- name: TOPOLOGY
type: string
default: ''
values:
- t0
- t0-64-32
- t1-lag
- multi-asic-t1-lag
- dualtor
- dpu

- name: DEPLOY_MG_EXTRA_PARAMS
type: string
default: ' '

- name: SCRIPTS
type: string
default: ' '

- name: FEATURES
type: string
default: ' '

- name: MIN_WORKER
type: string
default: '1'

- name: MAX_WORKER
type: string
default: '1'

- name: STOP_ON_FAILURE
type: string
default: 'False'
values:
- 'True'
- 'False'

stages:
- stage: BuildVS
pool: sonicbld-1es
jobs:
- template: azure-pipelines-build.yml
parameters:
buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) BUILD_MULTIASIC_KVM=y INCLUDE_DHCP_SERVER=y ${{ variables. VERSION_CONTROL_OPTIONS }}'
jobGroups:
- name: vs
SUBMODULE: ${{ parameters.SUBMODULE }}
COMMIT_ID: ${{ parameters.COMMIT_ID }}

- stage: Test
dependsOn: BuildVS
condition: and(succeeded(), and(ne(stageDependencies.BuildVS.outputs['vs.SetVar.SKIP_VSTEST'], 'YES'), in(dependencies.BuildVS.result, 'Succeeded', 'SucceededWithIssues')))
variables:
- group: SONiC-Elastictest
- name: inventory
value: veos_vtb
- name: testbed_file
value: vtestbed.yaml

jobs:
- job: KVMTEST
displayName: "kvmtest by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: sonic-ubuntu-1c
steps:
- template: .azure-pipelines/run-test-elastictest-template.yml@sonic-mgmt
parameters:
TOPOLOGY: ${{ parameters.TOPOLOGY }}
MIN_WORKER: ${{ parameters.MIN_WORKER }}
MAX_WORKER: ${{ parameters.MAX_WORKER }}
KVM_IMAGE_BRANCH: $(BUILD_BRANCH)
MGMT_BRANCH: ${{ parameters.MGMT_BRANCH }}
SCRIPTS: ${{ parameters.SCRIPTS }}
FEATURES: ${{ parameters.FEATURES }}
DEPLOY_MG_EXTRA_PARAMS: ${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}
STOP_ON_FAILURE: ${{ parameters.STOP_ON_FAILURE }}
29 changes: 28 additions & 1 deletion .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,21 @@ parameters:
- name: 'qemuOrCrossBuild'
type: boolean
default: false
- name: SUBMODULE
type: string
default: ''
- name: COMMIT_ID
type: string
default: ''

jobs:
- template: azure-pipelines-image-template.yml
parameters:
jobFilters: ${{ parameters.jobFilters }}
preSteps: ${{ parameters.preSteps }}
postSteps: ${{ parameters.postSteps }}
SUBMODULE: ${{ parameters.SUBMODULE }}
COMMIT_ID: ${{ parameters.COMMIT_ID }}
jobVariables:
PLATFORM_AZP: $(GROUP_NAME)
PLATFORM_ARCH: amd64
Expand All @@ -38,6 +46,7 @@ jobs:
docker_syncd_rpc_image: no
syncd_rpc_image: no
platform_rpc: no
ss_image: no
${{ if parameters.qemuOrCrossBuild }}:
SONIC_SLAVE_DOCKER_DRIVER: 'vfs'
CACHE_MODE: 'none'
Expand Down Expand Up @@ -81,7 +90,7 @@ jobs:
variables:
dbg_image: yes

- name: innovium
- name: marvell-teralynx
variables:
dbg_image: yes

Expand All @@ -106,6 +115,7 @@ jobs:
- name: mellanox
variables:
dbg_image: yes
ss_image: yes
docker_syncd_rpc_image: yes
syncd_rpc_image: yes
platform_rpc: mlnx
Expand All @@ -126,6 +136,10 @@ jobs:
variables:
PLATFORM_ARCH: arm64

- name: vpp
variables:
dbg_image: yes

buildSteps:
- template: .azure-pipelines/template-skipvstest.yml@buildimage
- template: .azure-pipelines/template-daemon.yml@buildimage
Expand Down Expand Up @@ -157,11 +171,21 @@ jobs:
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
rm target/sonic-vs.img
fi
elif [ $(GROUP_NAME) == vpp ]; then
if [ $(dbg_image) == yes ]; then
make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-vpp.img.gz
mv target/sonic-vpp.img.gz target/sonic-vpp-dbg.img.gz
fi
make $BUILD_OPTIONS target/sonic-vpp.img.gz
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
fi
if [ $(ss_image) == yes ]; then
make $BUILD_OPTIONS SMARTSWITCH=1 INCLUDE_DHCP_SERVER=y target/sonic-$(GROUP_NAME).bin
mv target/sonic-$(GROUP_NAME).bin target/sonic-$(GROUP_NAME)-smartswitch.bin
fi
if [ $(swi_image) == yes ]; then
make $BUILD_OPTIONS ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-$(GROUP_NAME).swi
fi
Expand All @@ -182,6 +206,9 @@ jobs:
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/sonic-$(GROUP_NAME).bin
mv target/sonic-mellanox.bin target/sonic-$(GROUP_NAME)-rpc.bin
fi
if [ $(GROUP_NAME) == nvidia-bluefield ]; then
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bfb
fi
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin
fi
displayName: "Build sonic image"
Expand Down
19 changes: 18 additions & 1 deletion .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ parameters:
- name: jobVariables
type: object
default: []
- name: SUBMODULE
type: string
default: ''
- name: COMMIT_ID
type: string
default: ''
jobs:
- template: azure-pipelines-job-groups.yml
parameters:
Expand All @@ -30,7 +36,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|marvell-arm64)$"; then
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf|marvell-arm64|vpp)$"; 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 @@ -42,6 +48,17 @@ jobs:
fetchDepth: 0
condition: and(succeeded(), eq(variables.SKIP_CHECKOUT, ''))
displayName: 'Checkout code'
- script: |
if [ -n "${{ parameters.COMMIT_ID }}" ]; then
if [ -n "${{ parameters.SUBMODULE }}" ]; then
git submodule update --init --recursive
cd src/${{ parameters.SUBMODULE }}
fi
git checkout ${{ parameters.COMMIT_ID }}
else
echo "No specific commit id provided, checkout to latest commit"
fi
displayName: 'Checkout commit'
- script: |
set -x
sudo setfacl -R -b $(Agent.BuildDirectory)
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-repd-build-variables.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
variables:
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=py2,py3,web,git,docker'
8 changes: 7 additions & 1 deletion .azure-pipelines/docker-sonic-mgmt-py3-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ stages:
- template: cleanup.yml
- checkout: self
clean: true

- script: |
set -x
sudo setfacl -R -b $(Agent.BuildDirectory)
displayName: 'setfacl'
- 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
git submodule update --init --recursive -- src/sonic-platform-daemons src/sonic-genl-packet src/sonic-sairedis src/ptf src/sonic-device-data src/sonic-dash-api
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
Expand Down
7 changes: 6 additions & 1 deletion .azure-pipelines/docker-sonic-mgmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ stages:
- template: cleanup.yml
- checkout: self
clean: true
- script: |
set -x
sudo setfacl -R -b $(Agent.BuildDirectory)
displayName: 'setfacl'
- 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
git submodule update --init --recursive -- src/sonic-platform-daemons src/sonic-genl-packet src/sonic-sairedis src/ptf src/sonic-device-data src/sonic-dash-api
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=y target/docker-sonic-mgmt.gz
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/template-variables.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variables:
DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io'
COMMON_LIB_BUILD_ENVS: 'bullseye'
COMMON_LIB_BUILD_ENVS: 'bookworm'
SONIC_SLAVE_DOCKER_DRIVER: 'overlay2'
SONIC_BUILD_RETRY_COUNT: 3
SONIC_BUILD_RETRY_INTERVAL: 600
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/protect-file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Protect certain files to avoid further changes

on:
push:
branches:
- 'master'
- '202[2-9][0-9][0-9]'
pull_request:
branches:
- 'master'
- '202[2-9][0-9][0-9]'

jobs:
check-file:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Fetch base branch
run: |
git fetch origin ${GITHUB_BASE_REF}
- name: Check protected files
run: |
echo "Starting file check step"
protected_files=('src/sonic-config-engine/minigraph.py' 'files/build_templates/init_cfg.json.j2')
base_branch=$(git rev-parse origin/${GITHUB_BASE_REF})
for protected_file in "${protected_files[@]}"; do
echo "Checking ${protected_file}"
if git diff --name-only $base_branch | grep -q "^${protected_file}\$"; then
echo "Error: You are trying to modify ${protected_file}, which is protected."
exit 1
fi
done
echo "No changes detected in protected files"
17 changes: 13 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
[submodule "src/sonic-frr/frr"]
path = src/sonic-frr/frr
url = https://github.com/sonic-net/sonic-frr.git
branch = frr/8.5
branch = frr-10.0.1
[submodule "platform/p4/p4-hlir/p4-hlir-v1.1"]
path = platform/p4/p4-hlir/p4-hlir-v1.1
url = https://github.com/p4lang/p4-hlir.git
Expand Down Expand Up @@ -106,6 +106,9 @@
[submodule "src/sonic-gnmi"]
path = src/sonic-gnmi
url = https://github.com/sonic-net/sonic-gnmi.git
[submodule "src/sonic-bmp"]
path = src/sonic-bmp
url = https://github.com/sonic-net/sonic-bmp.git
[submodule "src/sonic-genl-packet"]
path = src/sonic-genl-packet
url = https://github.com/sonic-net/sonic-genl-packet
Expand All @@ -121,6 +124,12 @@
[submodule "platform/marvell/sonic-platform-marvell"]
path = platform/marvell/sonic-platform-marvell
url = https://github.com/Marvell-switching/sonic-platform-arm64.git
[submodule "platform/innovium/sonic-platform-marvell"]
path = platform/innovium/sonic-platform-marvell
url = https://github.com/Marvell-switching/sonic-platform-marvell
[submodule "src/sonic-stp"]
path = src/sonic-stp
url = https://github.com/sonic-net/sonic-stp
[submodule "platform/marvell-teralynx/sonic-platform-marvell-teralynx"]
path = platform/marvell-teralynx/sonic-platform-marvell-teralynx
url = https://github.com/Marvell-switching/sonic-platform-marvell.git
[submodule "platform/vpp"]
path = platform/vpp
url = https://github.com/sonic-net/sonic-platform-vpp.git
Loading

0 comments on commit 7164392

Please sign in to comment.