Skip to content

Commit 62191d7

Browse files
Merge pull request sonic-net#260 from Yakiv-Huryk/merge-sonic-net
Merge sonic-net/master into bluefield
2 parents ce4a548 + c631606 commit 62191d7

File tree

1,724 files changed

+328581
-35992
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,724 files changed

+328581
-35992
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# C/C++ with GCC
2+
# Build your C/C++ project with GCC using make.
3+
# Add steps that publish test results, save build artifacts, deploy, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc
5+
pr: none
6+
7+
trigger:
8+
batch: true
9+
branches:
10+
include:
11+
- master
12+
13+
stages:
14+
- stage: Build
15+
16+
jobs:
17+
- job:
18+
displayName: "amd64/ubuntu-20.04"
19+
pool:
20+
vmImage: 'ubuntu-20.04'
21+
22+
steps:
23+
- checkout: self
24+
submodules: true
25+
- script: |
26+
sudo apt-get update
27+
sudo apt-get install -y make wget libtool m4 autoconf dh-exec libdebhelper-perl=13.6ubuntu1~bpo20.04.1 debhelper=13.6ubuntu1~bpo20.04.1 \
28+
cmake pkg-config python3-pip python cmake libgtest-dev libgmock-dev libyang-dev \
29+
debhelper-compat dh-elpa dh-sequence-python3 python3-all \
30+
libpython3-all-dev python3-six xmlto unzip rake-compiler gem2deb pkg-php-tools \
31+
ant default-jdk maven-repo-helper libguava-java
32+
wget http://ftp.us.debian.org/debian/pool/main/libg/libgoogle-gson-java/libgoogle-gson-java_2.8.6-1+deb11u1_all.deb
33+
sudo dpkg -i libgoogle-gson-java_2.8.6-1+deb11u1_all.deb
34+
mkdir -p /tmp/artifacts
35+
displayName: "Install dependencies"
36+
- script: |
37+
SONIC_CONFIG_MAKE_JOBS=$(nproc) CONFIGURED_ARCH=amd64 DEST=/tmp/artifacts make -f ../rules/protobuf.mk -f protobuf/Makefile
38+
workingDirectory: src
39+
displayName: "Build protobuf"
40+
- script: |
41+
sudo dpkg -i protobuf-compiler_3.21.12-3_amd64.deb libprotoc32_3.21.12-3_amd64.deb \
42+
libprotobuf32_3.21.12-3_amd64.deb libprotobuf-dev_3.21.12-3_amd64.deb \
43+
libprotobuf-lite32_3.21.12-3_amd64.deb
44+
workingDirectory: /tmp/artifacts
45+
displayName: "Install protobuf"
46+
- script: |
47+
dpkg-buildpackage -rfakeroot -b -us -uc
48+
workingDirectory: src/sonic-dash-api
49+
displayName: "Build sonic-dash-api"
50+
- script: |
51+
cp *.deb /tmp/artifacts
52+
workingDirectory: src
53+
- publish: /tmp/artifacts
54+
artifact: sonic-buildimage.amd64.ubuntu20_04
55+
displayName: "Archive sonic-buildimage debian packages for ubuntu20.04"

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
dbg_image: no
3636
asan_image: no
3737
swi_image: no
38-
raw_image: no
3938
docker_syncd_rpc_image: no
4039
syncd_rpc_image: no
4140
platform_rpc: no
@@ -62,7 +61,6 @@ jobs:
6261
variables:
6362
dbg_image: yes
6463
swi_image: yes
65-
raw_image: yes
6664
docker_syncd_rpc_image: yes
6765
platform_rpc: brcm
6866

@@ -140,6 +138,10 @@ jobs:
140138
make $BUILD_OPTIONS ENABLE_ASAN=y target/docker-sonic-vs.gz
141139
mv target/docker-sonic-vs.gz target/docker-sonic-vs-asan.gz
142140
fi
141+
if [ $(K8S_OPTIONS) == 'INCLUDE_KUBERNETES_MASTER=y' ]; then
142+
make $BUILD_OPTIONS $(K8S_OPTIONS) target/sonic-vs.img.gz
143+
mv target/sonic-vs.img.gz target/sonic-vs-k8s.img.gz
144+
fi
143145
make $BUILD_OPTIONS target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz
144146
make $BUILD_OPTIONS target/docker-ptf-sai.gz
145147
if [ $(gnmi_test_container) == yes ]; then
@@ -158,9 +160,6 @@ jobs:
158160
if [ $(swi_image) == yes ]; then
159161
make $BUILD_OPTIONS ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-$(GROUP_NAME).swi
160162
fi
161-
if [ $(raw_image) == yes ]; then
162-
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).raw
163-
fi
164163
if [ $(docker_syncd_rpc_image) == yes ]; then
165164
# workaround for issue in rules/sairedis.dep, git ls-files will list un-exist files for cache
166165
make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-rpc.gz

.azure-pipelines/build-template.yml

-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ jobs:
103103
if [ ${{ parameters.swi_image }} == true ]; then
104104
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-${{ parameters.platform }}.swi
105105
fi
106-
if [ ${{ parameters.raw_image }} == true ]; then
107-
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.raw
108-
fi
109106
if [ ${{ parameters.sync_rpc_image }} == true ]; then
110107
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y target/docker-syncd-${{ parameters.platform_short }}-rpc.gz
111108
# workaround for issue in rules/sairedis.dep, git ls-files will list un-exist files for cache

.azure-pipelines/dpkg-cache-cleanup.yml

+24-3
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,34 @@ trigger: none
1515
pr: none
1616

1717
jobs:
18-
- job: Build
18+
- job: Amd
1919
pool: sonicbld
2020
timeoutInMinutes: 5
2121
steps:
2222
- checkout: none
2323
- script: |
24-
set -xe
24+
df -h
2525
sudo find /nfs/dpkg_cache/ -name *.tgz -mtime +30 -type f -delete
26+
df -h
2627
displayName: clean dpkg cache
27-
28+
- job: Armhf
29+
pool: sonicbld-armhf
30+
timeoutInMinutes: 5
31+
steps:
32+
- checkout: none
33+
- script: |
34+
df -h
35+
sudo find /nfs/dpkg_cache/ -name *.tgz -mtime +30 -type f -delete
36+
df -h
37+
displayName: clean dpkg cache
38+
- job: Arm64
39+
pool: sonicbld-arm64
40+
timeoutInMinutes: 5
41+
steps:
42+
- checkout: none
43+
- script: |
44+
df -h
45+
sudo find /nfs/dpkg_cache/ -name *.tgz -mtime +30 -type f -delete
46+
df -h
47+
displayName: clean dpkg cache
48+

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

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ stages:
3939
- name: broadcom
4040
variables:
4141
swi_image: yes
42-
raw_image: yes
4342
docker_syncd_rpc_image: yes
4443
platform_rpc: brcm
4544
- name: mellanox

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

+92-22
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ parameters:
1818
type: string
1919
default: 1
2020

21+
- name: NUM_ASIC
22+
type: number
23+
default: 1
24+
2125
- name: TEST_SET
2226
type: string
2327
default: ""
@@ -34,17 +38,73 @@ parameters:
3438
type: string
3539
default: "ceos"
3640

37-
- name: SPECIFIED_PARAMS
41+
- name: TESTBED_NAME
42+
type: string
43+
default: ""
44+
45+
- name: IMAGE_URL
46+
type: string
47+
default: ""
48+
49+
- name: HWSKU
50+
type: string
51+
default: ""
52+
53+
- name: TEST_PLAN_TYPE
54+
type: string
55+
default: ""
56+
57+
- name: PLATFORM
58+
type: string
59+
default: ""
60+
61+
- name: SCRIPTS
62+
type: string
63+
default: ""
64+
65+
- name: FEATURES
66+
type: string
67+
default: ""
68+
69+
- name: SCRIPTS_EXCLUDE
70+
type: string
71+
default: ""
72+
73+
- name: FEATURES_EXCLUDE
3874
type: string
39-
default: "{}"
75+
default: ""
76+
77+
- name: REPO_NAME
78+
type: string
79+
default: ""
4080

4181
- name: MGMT_BRANCH
4282
type: string
43-
default: master
83+
default: ""
4484

45-
- name: NUM_ASIC
85+
- name: STOP_ON_FAILURE
86+
type: string
87+
default: ""
88+
89+
- name: RETRY_TIMES
90+
type: string
91+
default: ""
92+
93+
- name: DUMP_KVM_IF_FAIL
94+
type: string
95+
default: "True"
96+
values:
97+
- "True"
98+
- "False"
99+
100+
- name: REQUESTER
101+
type: string
102+
default: ""
103+
104+
- name: MAX_RUN_TEST_MINUTES
46105
type: number
47-
default: 1
106+
default: 480
107+
48108

49109
steps:
50110
- script: |
@@ -57,12 +117,20 @@ steps:
57117
set -e
58118
pip install PyYAML
59119
rm -f new_test_plan_id.txt
60-
python ./.azure-pipelines/test_plan.py create -t ${{ parameters.TOPOLOGY }} -o new_test_plan_id.txt \
61-
--min-worker ${{ parameters.MIN_WORKER }} --max-worker ${{ parameters.MAX_WORKER }} \
62-
--test-set ${{ parameters.TEST_SET }} --kvm-build-id $(KVM_BUILD_ID) \
63-
--deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" --common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" \
64-
--mgmt-branch ${{ parameters.MGMT_BRANCH }} --vm-type ${{ parameters.VM_TYPE }} --specified-params "${{ parameters.SPECIFIED_PARAMS }}" \
120+
121+
python ./.azure-pipelines/test_plan.py create \
122+
-t ${{ parameters.TOPOLOGY }} \
123+
-o new_test_plan_id.txt \
124+
--min-worker ${{ parameters.MIN_WORKER }} \
125+
--max-worker ${{ parameters.MAX_WORKER }} \
126+
--test-set ${{ parameters.TEST_SET }} \
127+
--kvm-build-id $(KVM_BUILD_ID) \
128+
--deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" \
129+
--common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" \
130+
--mgmt-branch ${{ parameters.MGMT_BRANCH }} \
131+
--vm-type ${{ parameters.VM_TYPE }} \
65132
--num-asic ${{ parameters.NUM_ASIC }}
133+
66134
TEST_PLAN_ID=`cat new_test_plan_id.txt`
67135
68136
echo "Created test plan $TEST_PLAN_ID"
@@ -108,18 +176,20 @@ steps:
108176
env:
109177
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
110178
displayName: Run test
111-
112-
- script: |
113-
set -e
114-
echo "KVM dump"
115-
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to [email protected]"
116-
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
117-
# When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED"
118-
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP
119-
condition: succeededOrFailed()
120-
env:
121-
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
122-
displayName: KVM dump
179+
timeoutInMinutes: ${{ parameters.MAX_RUN_TEST_MINUTES }}
180+
181+
- ${{ if eq(parameters.DUMP_KVM_IF_FAIL, 'True') }}:
182+
- script: |
183+
set -e
184+
echo "KVM dump"
185+
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to [email protected]"
186+
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
187+
# When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED"
188+
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP
189+
condition: succeededOrFailed()
190+
env:
191+
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
192+
displayName: KVM dump
123193
124194
- script: |
125195
set -e

.azure-pipelines/template-skipvstest.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ steps:
22
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
33
- script: |
44
set -ex
5-
tar_branch=origin/$(System.PullRequest.TargetBranch)
5+
tar_branch=origin/$(System.PullRequest.TargetBranchName)
6+
# Check if k8s master entrance script is changed
7+
if ! git diff $tar_branch..HEAD --name-only | grep -F files/image_config/kubernetes/kubernetes_master_entrance.sh; then
8+
echo "##vso[task.setvariable variable=K8S_OPTIONS;]INCLUDE_KUBERNETES_MASTER=n"
9+
else
10+
echo "##vso[task.setvariable variable=K8S_OPTIONS;]INCLUDE_KUBERNETES_MASTER=y"
11+
fi
612
git diff $tar_branch..HEAD --name-only | grep -v -f .azure-pipelines/vstest-exclude && exit 0
713
git diff $tar_branch..HEAD --name-only | grep -f .azure-pipelines/vstest-include && exit 0
814
set +x

0 commit comments

Comments
 (0)