Skip to content

Commit 275c013

Browse files
authored
Merge branch 'sonic-net:master' into reset_factory
2 parents 71d5ae4 + 93adb9c commit 275c013

File tree

596 files changed

+71367
-8091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

596 files changed

+71367
-8091
lines changed

.azure-pipelines/azure-pipelines-build.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ jobs:
9494
variables:
9595
PLATFORM_ARCH: armhf
9696

97+
- name: marvell-arm64
98+
${{ if not(parameters.qemuOrCrossBuild) }}:
99+
pool: sonicbld-arm64
100+
timeoutInMinutes: 2880
101+
variables:
102+
PLATFORM_ARCH: arm64
103+
104+
- name: marvell
105+
97106
- name: mellanox
98107
variables:
99108
dbg_image: yes
@@ -125,7 +134,7 @@ jobs:
125134
make $BUILD_OPTIONS target/docker-ptf-sai.gz
126135
if [ $(Build.Reason) != 'PullRequest' ];then
127136
gzip -kd target/sonic-vs.img.gz
128-
SONIC_RUN_CMDS="qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx" make sonic-slave-run
137+
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
129138
rm target/sonic-vs.img
130139
fi
131140
else

.azure-pipelines/azure-pipelines-image-template.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ jobs:
2828
- template: .azure-pipelines/cleanup.yml@buildimage
2929
- ${{ parameters.preSteps }}
3030
- script: |
31+
BUILD_OPTIONS="$(BUILD_OPTIONS)"
3132
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then
3233
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)"
3334
BUILD_OPTIONS="$(BUILD_OPTIONS) $CACHE_OPTIONS"
34-
echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS"
3535
fi
36+
echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS"
3637
displayName: "Set cache options"
3738
- checkout: self
3839
submodules: recursive
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
variables:
2-
${{ if eq(variables['Build.Reason'],'PullRequest') }}:
3-
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=$([[ "$(System.PullRequest.TargetBranch)" =~ ^20[2-9][0-9]{3}$ ]] && echo deb,py2,py3,web,git,docker)'
4-
${{ else }}:
5-
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'
2+
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'

.azure-pipelines/run-test-scheduler-template.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ parameters:
4848

4949
steps:
5050
- script: |
51-
set -ex
51+
set -e
5252
wget -O ./.azure-pipelines/test_plan.py https://raw.githubusercontent.com/sonic-net/sonic-mgmt/master/.azure-pipelines/test_plan.py
5353
wget -O ./.azure-pipelines/pr_test_scripts.yaml https://raw.githubusercontent.com/sonic-net/sonic-mgmt/master/.azure-pipelines/pr_test_scripts.yaml
5454
displayName: Download TestbedV2 scripts
5555
5656
- script: |
57-
set -ex
57+
set -e
5858
pip install PyYAML
5959
rm -f new_test_plan_id.txt
6060
python ./.azure-pipelines/test_plan.py create -t ${{ parameters.TOPOLOGY }} -o new_test_plan_id.txt \
@@ -76,45 +76,45 @@ steps:
7676
displayName: Trigger test
7777
7878
- script: |
79-
set -ex
79+
set -e
8080
echo "Lock testbed"
8181
echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to [email protected]"
82-
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID"
82+
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID "
8383
# When "LOCK_TESTBED" finish, it changes into "PREPARE_TESTBED"
8484
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state LOCK_TESTBED
8585
env:
8686
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
8787
displayName: Lock testbed
8888
8989
- script: |
90-
set -ex
90+
set -e
9191
echo "Prepare testbed"
9292
echo "Preparing the testbed(add-topo, deploy-mg) may take 15-30 minutes. Before the testbed is ready, the progress of the test plan keeps displayed as 0, please be patient(We will improve the indication in a short time)"
9393
echo "If the progress keeps as 0 for more than 1 hour, please cancel and retry this pipeline"
9494
echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to [email protected]"
95-
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID"
95+
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID "
9696
# When "PREPARE_TESTBED" finish, it changes into "EXECUTING"
9797
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state PREPARE_TESTBED
9898
env:
9999
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
100100
displayName: Prepare testbed
101101
102102
- script: |
103-
set -ex
103+
set -e
104104
echo "Run test"
105105
echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to [email protected]"
106-
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID"
106+
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID "
107107
# When "EXECUTING" finish, it changes into "KVMDUMP", "FAILED", "CANCELLED" or "FINISHED"
108108
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state EXECUTING
109109
env:
110110
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
111111
displayName: Run test
112112
113113
- script: |
114-
set -ex
114+
set -e
115115
echo "KVM dump"
116116
echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to [email protected]"
117-
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID"
117+
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID "
118118
# When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED"
119119
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP
120120
condition: succeededOrFailed()
@@ -123,7 +123,7 @@ steps:
123123
displayName: KVM dump
124124
125125
- script: |
126-
set -ex
126+
set -e
127127
echo "Try to cancel test plan $TEST_PLAN_ID, cancelling finished test plan has no effect."
128128
python ./.azure-pipelines/test_plan.py cancel -i "$(TEST_PLAN_ID)"
129129
condition: always()

.github/pull_request_template.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@
1212

1313
#### Why I did it
1414

15+
##### Work item tracking
16+
- Microsoft ADO **(number only)**:
17+
1518
#### How I did it
1619

1720
#### How to verify it
1821

22+
<!--
23+
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
24+
-->
25+
1926
#### Which release branch to backport (provide reason below if selected)
2027

2128
<!--
@@ -34,13 +41,26 @@
3441
- [ ] 202205
3542
- [ ] 202211
3643

44+
#### Tested branch (Please provide the tested image version)
45+
46+
<!--
47+
- Please provide tested image version
48+
- e.g.
49+
- [x] 20201231.100
50+
-->
51+
52+
- [ ] <!-- image version 1 -->
53+
- [ ] <!-- image version 2 -->
54+
3755
#### Description for the changelog
3856
<!--
3957
Write a short (one line) summary that describes the changes in this
4058
pull request for inclusion in the changelog:
4159
-->
4260

43-
#### Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
61+
<!--
62+
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
63+
-->
4464

4565
#### Link to config_db schema for YANG module changes
4666
<!--

.github/workflows/automerge_scan.yml

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
echo PR: $(($i+1))/$count, URL: $url, createdAt: $created_at, now: $(date -u +"%FT%TZ")
3131
[[ "$url" == "" ]] && continue
3232
[[ $created_at > $(date --date "1 hour ago" -u +"%FT%TZ") ]] && continue
33+
# only check automerge PR.
34+
cat prs.log | jq -r ".[$i].labels[].name" | grep automerge || continue
35+
3336
checks=$(cat prs.log | jq ".[$i].statusCheckRollup")
3437
checks_count=$(echo $checks | jq 'length')
3538
echo Checks count: $checks_count
@@ -38,9 +41,14 @@ jobs:
3841
check=$(echo $checks | jq ".[$j]")
3942
state=$(echo $check | jq -r '.state')
4043
conclusion=$(echo $check | jq -r '.conclusion')
44+
name=$(echo $check | jq -r '.name')
4145
4246
# EasyCLA success flag: state=SUCCESS
4347
# Others success flag: conclusion in SUCCESS,NEUTRAL
48+
# Ignore Azure.sonic-buildimage stage check result. It may be set continueOnError
49+
echo "$name" | grep "Azure.sonic-buildimage (" && continue
50+
# Ignore Semgrep, it has issues.
51+
[[ "$name" == "Semgrep" ]] && continue
4452
if [[ "$state" == "SUCCESS" ]];then
4553
# check pass
4654
continue

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ platform/**/*.egg-info
6363
platform/**/*-none-any.whl
6464
platform/**/.pybuild
6565
platform/**/debian/*
66+
!platform/**/debian/control
67+
!platform/**/debian/rules
68+
!platform/**/debian/changelog
69+
!platform/**/debian/compat
70+
!platform/**/debian/*.postinst
71+
!platform/**/debian/*.install
6672
platform/**/build
6773
platform/**/*.ko
6874
platform/**/*.mod.c

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,6 @@
112112
[submodule "src/sonic-genl-packet"]
113113
path = src/sonic-genl-packet
114114
url = https://github.com/sonic-net/sonic-genl-packet
115+
[submodule "src/dhcpmon"]
116+
path = src/dhcpmon
117+
url = https://github.com/sonic-net/sonic-dhcpmon.git

Makefile.work

+27-3
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ PREPARE_DOCKER=BUILD_SLAVE=y \
224224
DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \
225225
SONIC_VERSION_CACHE=$(SONIC_VERSION_CACHE) \
226226
DBGOPT='$(DBGOPT)' \
227+
MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \
227228
scripts/prepare_docker_buildinfo.sh \
228229
$(SLAVE_BASE_IMAGE) \
229230
$(SLAVE_DIR)/Dockerfile \
@@ -245,6 +246,7 @@ SLAVE_BASE_TAG = $(shell \
245246
SLAVE_TAG = $(shell \
246247
(cat $(SLAVE_DIR)/Dockerfile.user \
247248
$(SLAVE_DIR)/Dockerfile \
249+
$(SLAVE_DIR)/sources.list.* \
248250
$(SLAVE_DIR)/buildinfo/versions/versions-* \
249251
&& echo $(USER)/$(PWD)/$(CONFIGURED_PLATFORM)) \
250252
| sha1sum \
@@ -309,6 +311,19 @@ ifdef SONIC_BUILD_QUIETER
309311
DOCKER_RUN += -e "SONIC_BUILD_QUIETER=$(SONIC_BUILD_QUIETER)"
310312
endif
311313

314+
# Mount the Signing key and Certificate in the slave container
315+
ifneq ($(SECURE_UPGRADE_DEV_SIGNING_KEY),)
316+
DOCKER_RUN += -v $(SECURE_UPGRADE_DEV_SIGNING_KEY):$(SECURE_UPGRADE_DEV_SIGNING_KEY):ro
317+
endif
318+
ifneq ($(SECURE_UPGRADE_SIGNING_CERT),)
319+
DOCKER_RUN += -v $(SECURE_UPGRADE_SIGNING_CERT):$(SECURE_UPGRADE_SIGNING_CERT):ro
320+
endif
321+
# Mount the Signing prod tool in the slave container
322+
$(info "SECURE_UPGRADE_PROD_SIGNING_TOOL": "$(SECURE_UPGRADE_PROD_SIGNING_TOOL)")
323+
ifneq ($(SECURE_UPGRADE_PROD_SIGNING_TOOL),)
324+
DOCKER_RUN += -v $(SECURE_UPGRADE_PROD_SIGNING_TOOL):/sonic/scripts/$(shell basename -- $(SECURE_UPGRADE_PROD_SIGNING_TOOL)):ro
325+
endif
326+
312327
ifneq ($(SONIC_DPKG_CACHE_SOURCE),)
313328
DOCKER_RUN += -v "$(SONIC_DPKG_CACHE_SOURCE):/dpkg_cache:rw"
314329
endif
@@ -399,7 +414,7 @@ endif
399414

400415
endif
401416

402-
SPLIT_LOG = | tee
417+
SPLIT_LOG = 2>&1 | tee
403418

404419
DOCKER_BASE_LOG = $(SLAVE_DIR)/$(SLAVE_BASE_IMAGE)_$(SLAVE_BASE_TAG).log
405420
DOCKER_LOG = $(SLAVE_DIR)/$(SLAVE_IMAGE)_$(SLAVE_TAG).log
@@ -416,7 +431,7 @@ DOCKER_SLAVE_BASE_BUILD = docker build --no-cache \
416431
$(SPLIT_LOG) $(DOCKER_BASE_LOG)
417432

418433
DOCKER_BASE_PULL = docker pull \
419-
$(REGISTRY_SERVER):$(REGISTRY_PORT)/$(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG)
434+
$(REGISTRY_SERVER):$(REGISTRY_PORT)$(REGISTRY_SERVER_PATH)/$(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG)
420435

421436
DOCKER_USER_BUILD = docker build --no-cache \
422437
--build-arg user=$(USER) \
@@ -442,7 +457,7 @@ DOCKER_SLAVE_BASE_PULL_REGISTRY = \
442457
$(DOCKER_BASE_PULL); \
443458
} && \
444459
{ \
445-
docker tag $(REGISTRY_SERVER):$(REGISTRY_PORT)/$(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) && \
460+
docker tag $(REGISTRY_SERVER):$(REGISTRY_PORT)$(REGISTRY_SERVER_PATH)/$(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) && \
446461
$(COLLECT_DOCKER); \
447462
}\
448463

@@ -490,6 +505,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \
490505
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
491506
INCLUDE_KUBERNETES=$(INCLUDE_KUBERNETES) \
492507
KUBERNETES_VERSION=$(KUBERNETES_VERSION) \
508+
KUBERNETES_CNI_VERSION=$(KUBERNETES_CNI_VERSION) \
493509
K8s_GCR_IO_PAUSE_VERSION=$(K8s_GCR_IO_PAUSE_VERSION) \
494510
INCLUDE_KUBERNETES_MASTER=$(INCLUDE_KUBERNETES_MASTER) \
495511
SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \
@@ -525,6 +541,11 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \
525541
BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \
526542
SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \
527543
SONIC_ENABLE_SECUREBOOT_SIGNATURE=$(SONIC_ENABLE_SECUREBOOT_SIGNATURE) \
544+
SECURE_UPGRADE_MODE=$(SECURE_UPGRADE_MODE) \
545+
SECURE_UPGRADE_DEV_SIGNING_KEY=$(SECURE_UPGRADE_DEV_SIGNING_KEY) \
546+
SECURE_UPGRADE_SIGNING_CERT=$(SECURE_UPGRADE_SIGNING_CERT) \
547+
SECURE_UPGRADE_PROD_SIGNING_TOOL=$(SECURE_UPGRADE_PROD_SIGNING_TOOL) \
548+
SECURE_UPGRADE_PROD_TOOL_ARGS=$(SECURE_UPGRADE_PROD_TOOL_ARGS) \
528549
SONIC_DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \
529550
ENABLE_HOST_SERVICE_ON_START=$(ENABLE_HOST_SERVICE_ON_START) \
530551
SLAVE_DIR=$(SLAVE_DIR) \
@@ -540,6 +561,8 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \
540561
MIRROR_SECURITY_URLS=$(MIRROR_SECURITY_URLS) \
541562
GZ_COMPRESS_PROGRAM=$(GZ_COMPRESS_PROGRAM) \
542563
MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \
564+
SONIC_VERSION_CONTROL_COMPONENTS=$(SONIC_VERSION_CONTROL_COMPONENTS) \
565+
SONIC_OS_VERSION=$(SONIC_OS_VERSION) \
543566
$(SONIC_OVERRIDE_BUILD_VARS)
544567

545568
.PHONY: sonic-slave-build sonic-slave-bash init reset
@@ -560,6 +583,7 @@ endif
560583

561584
export MIRROR_URLS
562585
export MIRROR_SECURITY_URLS
586+
export MIRROR_SNAPSHOT
563587
export SONIC_VERSION_CONTROL_COMPONENTS
564588

565589
%:: | sonic-build-hooks

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ make configure PLATFORM=marvell-arm64 PLATFORM_ARCH=arm64
227227
`/usr/bin/tar: /path/to/sonic-buildimage/<some_file>:
228228
Cannot write: No space left on device`
229229

230-
The solution is to [move the directory](https://linuxconfig.org/how-to-move-docker-s-default-var-lib-docker-to-another-directory-on-ubuntu-debian-linux)
230+
The solution is to [move the directory](https://www.ibm.com/docs/en/z-logdata-analytics/5.1.0?topic=compose-relocating-docker-root-directory)
231231
to a partition with more free space.
232232
* Use
233233
`http_proxy=[your_proxy] https_proxy=[your_proxy] no_proxy=[your_no_proxy] make`

0 commit comments

Comments
 (0)