Skip to content

Commit ab41afc

Browse files
Merge pull request sonic-net#207 from Yakiv-Huryk/sonic-net-merge
Merge remote-tracking branch 'sonic-net/master' into bluefield
2 parents c8e0696 + 5737a91 commit ab41afc

File tree

1,311 files changed

+133123
-22732
lines changed

Some content is hidden

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

1,311 files changed

+133123
-22732
lines changed

.azure-pipelines/azure-pipelines-UpgrateVersion.yml

+35
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,32 @@ parameters:
4242
- mellanox
4343

4444
stages:
45+
- stage: Prepare
46+
jobs:
47+
- job: Prepare
48+
steps:
49+
- script: |
50+
DEFAULT_MIRROR_URL_PREFIX=http://packages.trafficmanager.net
51+
DEBIAN_TIMESTAMP=$(curl $DEFAULT_MIRROR_URL_PREFIX/snapshot/debian/latest/timestamp)
52+
DEBIAN_SECURITY_TIMESTAMP=$(curl $DEFAULT_MIRROR_URL_PREFIX/snapshot/debian-security/latest/timestamp)
53+
echo "DEBIAN_TIMESTAMP=$DEBIAN_TIMESTAMP, DEBIAN_SECURITY_TIMESTAMP=$DEBIAN_SECURITY_TIMESTAMP"
54+
echo "##vso[task.setvariable variable=DEBIAN_TIMESTAMP;isOutput=true]$DEBIAN_TIMESTAMP"
55+
echo "##vso[task.setvariable variable=DEBIAN_SECURITY_TIMESTAMP;isOutput=true]$DEBIAN_SECURITY_TIMESTAMP"
56+
name: SetVersions
57+
displayName: 'Set snapshot versions'
4558
- stage: Build
59+
dependsOn: Prepare
4660
variables:
4761
- name: CACHE_MODE
4862
value: none
4963
- name: VERSION_CONTROL_OPTIONS
5064
value: 'SONIC_VERSION_CONTROL_COMPONENTS='
65+
- name: SKIP_CHECKOUT
66+
value: true
67+
- name: DEBIAN_TIMESTAMP
68+
value: $[ stageDependencies.Prepare.Prepare.outputs['SetVersions.DEBIAN_TIMESTAMP'] ]
69+
- name: DEBIAN_SECURITY_TIMESTAMP
70+
value: $[ stageDependencies.Prepare.Prepare.outputs['SetVersions.DEBIAN_SECURITY_TIMESTAMP'] ]
5171
- template: .azure-pipelines/template-variables.yml@buildimage
5272
jobs:
5373
- template: azure-pipelines-build.yml
@@ -56,6 +76,21 @@ stages:
5676
buildOptions: '${{ variables.VERSION_CONTROL_OPTIONS }} ENABLE_DOCKER_BASE_PULL=n SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y'
5777
preSteps:
5878
- template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage
79+
- checkout: self
80+
submodules: recursive
81+
fetchDepth: 0
82+
path: s
83+
displayName: 'Checkout code'
84+
- script: |
85+
echo "DEBIAN_TIMESTAMP=$DEBIAN_TIMESTAMP, DEBIAN_SECURITY_TIMESTAMP=$DEBIAN_SECURITY_TIMESTAMP"
86+
if [ "$MIRROR_SNAPSHOT" == y ]; then
87+
mkdir -p target/versions/default/
88+
echo "debian==$DEBIAN_TIMESTAMP" > target/versions/default/versions-mirror
89+
echo "debian-security==$DEBIAN_SECURITY_TIMESTAMP" >> target/versions/default/versions-mirror
90+
cat target/versions/default/versions-mirror
91+
fi
92+
displayName: 'Set snapshot versions'
93+
5994
- stage: UpgradeVersions
6095
jobs:
6196
- job: UpgradeVersions

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

+13-13
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ jobs:
104104
variables:
105105
PLATFORM_ARCH: armhf
106106

107+
- name: marvell-arm64
108+
${{ if not(parameters.qemuOrCrossBuild) }}:
109+
pool: sonicbld-arm64
110+
timeoutInMinutes: 2880
111+
variables:
112+
PLATFORM_ARCH: arm64
113+
114+
- name: marvell
115+
107116
- name: mellanox
108117
variables:
109118
dbg_image: yes
@@ -118,7 +127,8 @@ jobs:
118127
platform_rpc: nephos
119128

120129
buildSteps:
121-
- template: template-skipvstest.yml
130+
- template: .azure-pipelines/template-skipvstest.yml@buildimage
131+
- template: .azure-pipelines/template-daemon.yml@buildimage
122132
- bash: |
123133
set -ex
124134
if [ $(GROUP_NAME) == vs ]; then
@@ -137,7 +147,7 @@ jobs:
137147
fi
138148
if [ $(Build.Reason) != 'PullRequest' ];then
139149
gzip -kd target/sonic-vs.img.gz
140-
SONIC_RUN_CMDS="qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx" make sonic-slave-run
150+
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
141151
rm target/sonic-vs.img
142152
fi
143153
else
@@ -162,16 +172,6 @@ jobs:
162172
pushd ./src/sonic-sairedis/SAI
163173
git stash
164174
popd
165-
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-saiserverv2-brcm.gz
166-
pushd ./src/sonic-sairedis/SAI
167-
git stash
168-
popd
169-
fi
170-
if [ $(GROUP_NAME) == barefoot ]; then
171-
make $BUILD_OPTIONS SAITHRIFT_V2=y ENABLE_SYNCD_RPC=y target/docker-saiserverv2-bfn.gz
172-
pushd ./src/sonic-sairedis/SAI
173-
git stash
174-
popd
175175
fi
176176
fi
177177
if [ $(syncd_rpc_image) == yes ]; then
@@ -187,4 +187,4 @@ jobs:
187187
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin
188188
fi
189189
displayName: "Build sonic image"
190-
- template: check-dirty-version.yml
190+
- template: .azure-pipelines/check-dirty-version.yml@buildimage

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ jobs:
2525
jobFilters: ${{ parameters.jobFilters }}
2626
jobVariables: ${{ parameters.jobVariables }}
2727
preSteps:
28-
- template: cleanup.yml
28+
- template: .azure-pipelines/cleanup.yml@buildimage
2929
- ${{ parameters.preSteps }}
3030
- script: |
31+
[ -n "$OVERRIDE_BUILD_OPTIONS" ] && OVERRIDE_BUILD_OPTIONS=$(OVERRIDE_BUILD_OPTIONS)
32+
BUILD_OPTIONS="$(BUILD_OPTIONS) $OVERRIDE_BUILD_OPTIONS"
3133
if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then
3234
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)"
33-
BUILD_OPTIONS="$(BUILD_OPTIONS) $CACHE_OPTIONS"
34-
echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS"
35+
BUILD_OPTIONS="$BUILD_OPTIONS $CACHE_OPTIONS"
3536
fi
37+
echo $BUILD_OPTIONS
38+
echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS"
3639
displayName: "Set cache options"
3740
- checkout: self
3841
submodules: recursive
@@ -67,6 +70,6 @@ jobs:
6770
artifactName: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
6871
publishPrefix: '$(Build.DefinitionName)/$(Build.SourceBranchName)/$(GROUP_NAME)'
6972
- ${{ parameters.postSteps }}
70-
- template: cleanup.yml
73+
- template: .azure-pipelines/cleanup.yml@buildimage
7174
jobGroups: ${{ parameters.jobGroups }}
7275
buildSteps: ${{ parameters.buildSteps }}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
variables:
2-
VERSION_CONTROL_OPTIONS: ''
2+
VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker'

.azure-pipelines/cleanup.yml

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
steps:
22
- script: |
3+
set -x
4+
# kill daemon process
5+
ps $(cat /tmp/azp_daemon_kill_docker_pid)
6+
sudo kill $(cat /tmp/azp_daemon_kill_docker_pid)
7+
rm /tmp/azp_daemon_kill_docker_pid
8+
39
if sudo [ -f /var/run/march/docker.pid ] ; then
410
pid=`sudo cat /var/run/march/docker.pid` ; sudo kill $pid
511
fi
@@ -11,4 +17,5 @@ steps:
1117
pid=`sudo cat dockerfs/var/run/docker.pid` ; sudo kill $pid
1218
fi
1319
sudo rm -rf $(ls -A1)
20+
condition: always()
1421
displayName: "Clean Workspace"

.azure-pipelines/official-build-cache.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ schedules:
1111
- master
1212
- 202012
1313

14+
resources:
15+
repositories:
16+
- repository: buildimage
17+
type: github
18+
name: sonic-net/sonic-buildimage
19+
ref: master
20+
endpoint: sonic-net
21+
1422
trigger: none
1523
pr: none
1624

@@ -20,7 +28,8 @@ stages:
2028
variables:
2129
- name: CACHE_MODE
2230
value: cache
23-
- template: azure-pipelines-repd-build-variables.yml
31+
- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage
32+
- template: .azure-pipelines/template-variables.yml@buildimage
2433
jobs:
2534
- template: azure-pipelines-build.yml
2635
parameters:

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

+18-19
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
54-
displayName: Download TestbedV2 scripts
54+
displayName: Download test plan 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 \
@@ -66,7 +66,7 @@ steps:
6666
TEST_PLAN_ID=`cat new_test_plan_id.txt`
6767
6868
echo "Created test plan $TEST_PLAN_ID"
69-
echo "Check https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID for test plan status"
69+
echo "Check $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID for test plan status"
7070
echo "##vso[task.setvariable variable=TEST_PLAN_ID]$TEST_PLAN_ID"
7171
env:
7272
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
@@ -76,45 +76,44 @@ steps:
7676
displayName: Trigger test
7777
7878
- script: |
79-
set -ex
79+
set -e
8080
echo "Lock testbed"
81-
echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to sonictestbedtools@microsoft.com"
82-
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID"
81+
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com"
82+
echo "Runtime detailed progress at $(FRONTEND_URL)/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"
92-
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)"
93-
echo "If the progress keeps as 0 for more than 1 hour, please cancel and retry this pipeline"
94-
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"
92+
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"
93+
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to [email protected]"
94+
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
9695
# When "PREPARE_TESTBED" finish, it changes into "EXECUTING"
9796
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state PREPARE_TESTBED
9897
env:
9998
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
10099
displayName: Prepare testbed
101100
102101
- script: |
103-
set -ex
102+
set -e
104103
echo "Run test"
105-
echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to sonictestbedtools@microsoft.com"
106-
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID"
104+
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com"
105+
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
107106
# When "EXECUTING" finish, it changes into "KVMDUMP", "FAILED", "CANCELLED" or "FINISHED"
108107
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state EXECUTING
109108
env:
110109
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
111110
displayName: Run test
112111
113112
- script: |
114-
set -ex
113+
set -e
115114
echo "KVM dump"
116-
echo "TestbedV2 is just online and might not be stable enough, for any issue, please send email to sonictestbedtools@microsoft.com"
117-
echo "Runtime detailed progress at https://www.testbed-tools.org/scheduler/testplan/$TEST_PLAN_ID"
115+
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com"
116+
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
118117
# When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED"
119118
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP
120119
condition: succeededOrFailed()
@@ -123,7 +122,7 @@ steps:
123122
displayName: KVM dump
124123
125124
- script: |
126-
set -ex
125+
set -e
127126
echo "Try to cancel test plan $TEST_PLAN_ID, cancelling finished test plan has no effect."
128127
python ./.azure-pipelines/test_plan.py cancel -i "$(TEST_PLAN_ID)"
129128
condition: always()

.azure-pipelines/template-daemon.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
steps:
2+
- bash: |
3+
(
4+
while true
5+
do
6+
sleep 120
7+
now=$(date +%s)
8+
pids=$(ps -C docker -o pid,etime,args | grep "docker build" | cut -d" " -f2)
9+
for pid in $pids
10+
do
11+
start=$(date --date="$(ls -dl /proc/$pid --time-style full-iso | awk '{print$6,$7}')" +%s)
12+
time_s=$(($now-$start))
13+
if [[ $time_s -gt $(DOCKER_BUILD_TIMEOUT) ]]; then
14+
echo =========== $(date +%F%T) $time_s &>> target/daemon.log
15+
ps $pid &>> target/daemon.log
16+
sudo kill $pid
17+
fi
18+
done
19+
done
20+
) &
21+
daemon_pid=$!
22+
ps $daemon_pid
23+
echo $daemon_pid >> /tmp/azp_daemon_kill_docker_pid
24+
displayName: start daemon to kill hang docker

.azure-pipelines/template-variables.yml

+2
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ variables:
55
SONIC_BUILD_RETRY_COUNT: 3
66
SONIC_BUILD_RETRY_INTERVAL: 600
77
DOCKER_BUILDKIT: 0
8+
DOCKER_BUILD_TIMEOUT: 3600
9+
MIRROR_SNAPSHOT: y

.azure-pipelines/vstest-exclude

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
^platform
22
^.azure-pipelines
3-
^files/build/versions
43
^sonic-slave-

.github/pull_request_template.md

+22-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
<!--
@@ -33,14 +40,28 @@
3340
- [ ] 202111
3441
- [ ] 202205
3542
- [ ] 202211
43+
- [ ] 202305
44+
45+
#### Tested branch (Please provide the tested image version)
46+
47+
<!--
48+
- Please provide tested image version
49+
- e.g.
50+
- [x] 20201231.100
51+
-->
52+
53+
- [ ] <!-- image version 1 -->
54+
- [ ] <!-- image version 2 -->
3655

3756
#### Description for the changelog
3857
<!--
3958
Write a short (one line) summary that describes the changes in this
4059
pull request for inclusion in the changelog:
4160
-->
4261

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.
62+
<!--
63+
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.
64+
-->
4465

4566
#### Link to config_db schema for YANG module changes
4667
<!--

0 commit comments

Comments
 (0)