Skip to content

Commit bda2a63

Browse files
Merge branch 'master' into extension-yang
2 parents 9f814e3 + 0ceaf84 commit bda2a63

File tree

713 files changed

+75225
-8483
lines changed

Some content is hidden

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

713 files changed

+75225
-8483
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Starter pipeline
2+
# Start with a minimal pipeline that you can customize to build and deploy your code.
3+
# Add steps that build, run tests, deploy, and more:
4+
# https://aka.ms/yaml
5+
6+
trigger: none
7+
pr: none
8+
9+
schedules:
10+
- cron: "0 0 * * *"
11+
displayName: Daily Build
12+
branches:
13+
include:
14+
- 202012
15+
always: true
16+
17+
pool: sonicbld
18+
19+
stages:
20+
- stage: Build
21+
jobs:
22+
- template: azure-pipelines-build.yml
23+
parameters:
24+
buildOptions: 'SONIC_CONFIG_BUILD_JOBS=1 SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web'
25+
postSteps:
26+
- script: |
27+
make freeze
28+
git status files/build/versions
29+
git add files/build/versions
30+
git diff HEAD files/build/versions
31+
displayName: "Show git diff"
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Starter pipeline
2+
# Start with a minimal pipeline that you can customize to build and deploy your code.
3+
# Add steps that build, run tests, deploy, and more:
4+
# https://aka.ms/yaml
5+
6+
trigger: none
7+
pr: none
8+
9+
schedules:
10+
- cron: "0 0 * * *"
11+
displayName: Daily Build
12+
branches:
13+
include:
14+
- 202012
15+
always: true
16+
17+
pool: sonicbld
18+
19+
stages:
20+
- stage: Build
21+
jobs:
22+
- template: azure-pipelines-build.yml
23+
parameters:
24+
buildSlave: y
25+
- stage: UpgradeVersions
26+
jobs:
27+
- job: UpgradeVersions
28+
pool:
29+
vmImage: 'ubuntu-20.04'
30+
steps:
31+
- script: |
32+
if [ -z "$(which gh)" ]; then
33+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
34+
sudo apt-add-repository https://cli.github.com/packages
35+
sudo apt update
36+
sudo apt install gh
37+
fi
38+
displayName: 'Install gh'
39+
- checkout: self
40+
displayName: 'Checkout code'
41+
- download: current
42+
patterns: '**/versions-*'
43+
- script: |
44+
mkdir -p target
45+
default_platform=broadcom
46+
artifacts=$(find $(Pipeline.Workspace) -maxdepth 1 -type d -name 'sonic-buildimage.*' | grep -v "sonic-buildimage.${default_platform}")
47+
echo "artifacts$artifacts"
48+
cp -r $(Pipeline.Workspace)/sonic-buildimage.${default_platform}/versions target/
49+
make freeze FREEZE_VERSION_OPTIONS=-r
50+
find files/build/versions
51+
for artifact in $artifacts
52+
do
53+
rm -rf target/versions
54+
cp -r $artifact/versions target/
55+
make freeze FREEZE_VERSION_OPTIONS="-a -d"
56+
done
57+
git diff files/build/versions
58+
displayName: 'Freeze Versions'
59+
- script: |
60+
if [ -z "$GIT_USER" ]; then
61+
echo "Skipped to send the pull request, GIT_USER not set."
62+
exit 0
63+
fi
64+
GIT_STATUS=$(git status --porcelain files/build/versions)
65+
if [ -z "$GIT_STATUS" ]; then
66+
echo "Skipped to send the pull request, no version change in files/build/versions"
67+
exit 0
68+
fi
69+
if [ ! -d "$HOME" ]; then
70+
sudo mkdir -p $HOME
71+
sudo chown -R $(id -un):$(id -gn) $HOME
72+
fi
73+
SOURCE_BRANCH=$(Build.SourceBranch)
74+
REPO_NAME=$(Build.Repository.Name)
75+
[ -z "$GIT_REPO" ] && GIT_REPO=${REPO_NAME#*/}
76+
BRANCH_NAME=repd/versions/${SOURCE_BRANCH#refs/heads/}
77+
echo '#!/bin/bash' > git_env_password.sh
78+
echo 'echo $GIT_PASSWORD' >> git_env_password.sh
79+
chmod a+x git_env_password.sh
80+
export GIT_ASKPASS=./git_env_password.sh
81+
82+
git config user.name $GIT_USER
83+
git config credential.https://g.yxqyang.asia.username $GIT_USER
84+
git add files/build/versions
85+
git commit -m "[ci/build]: Upgrade SONiC package versions"
86+
git checkout -b $BRANCH_NAME
87+
git remote add remote https://github.com/$GIT_USER/$GIT_REPO
88+
git push remote HEAD:refs/heads/$BRANCH_NAME -f
89+
git branch -u remote/$BRANCH_NAME
90+
91+
echo $GIT_PASSWORD | gh auth login --with-token
92+
TITLE="Upgrade SONiC Versions"
93+
BODY="Upgrade SONiC Versions"
94+
RET=0
95+
if ! gh pr create -t "$TITLE" -b "$BODY" -B $(Build.SourceBranch) -R $(Build.Repository.Name) > pr.log 2>&1; then
96+
if ! grep -q "already exists" pr.log; then
97+
RET=1
98+
fi
99+
fi
100+
cat pr.log
101+
exit $RET
102+
env:
103+
GIT_USER: $(GIT_USER)
104+
GIT_PASSWORD: $(GIT_PASSWORD)
105+
displayName: 'Send Pull Request'
106+
- publish: $(System.DefaultWorkingDirectory)/files/build/versions
107+
artifact: 'sonic-buildimage.versions'
108+
displayName: 'Archive SONiC versions'
109+
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
parameters:
2+
- name: 'jobFilters'
3+
type: object
4+
default: ''
5+
- name: 'buildOptions'
6+
type: string
7+
default: 'SONIC_CONFIG_BUILD_JOBS=1'
8+
- name: 'buildSlave'
9+
type: string
10+
default: 'n'
11+
- name: 'postSteps'
12+
type: stepList
13+
default: []
14+
15+
jobs:
16+
- template: azure-pipelines-job-groups.yml
17+
parameters:
18+
jobFilters: ${{ parameters.jobFilters }}
19+
preSteps:
20+
- script: |
21+
containers=$(docker container ls | grep "sonic-slave" | awk '{ print $1 }')
22+
if [ ! -z "$containers" ]; then
23+
docker container kill $containers || true
24+
sleep 5
25+
fi
26+
if [ "${{ parameters.buildSlave }}" == "y" ]; then
27+
images=$(docker images 'sonic-slave-*' -a -q)
28+
[ ! -z "$images" ] && docker rmi -f $images
29+
fi
30+
sudo rm -rf $(ls -A1)
31+
displayName: 'Init'
32+
- checkout: self
33+
submodules: recursive
34+
displayName: 'Checkout code'
35+
- script: |
36+
make ${{ parameters.buildOptions }} PLATFORM=$GROUP_NAME configure
37+
displayName: 'Make configure'
38+
postSteps:
39+
- ${{ parameters.postSteps }}
40+
- publish: $(System.DefaultWorkingDirectory)/target
41+
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
42+
displayName: "Archive sonic image"
43+
jobGroups:
44+
- name: vs
45+
script: |
46+
sudo bash -c "echo 1 > /proc/sys/vm/compact_memory"
47+
make ${{ parameters.buildOptions }} target/sonic-vs.img.gz
48+
- name: broadcom
49+
script: |
50+
make ${{ parameters.buildOptions }} target/sonic-broadcom.bin target/sonic-aboot-broadcom.swi
51+
- name: barefoot
52+
script: |
53+
make ${{ parameters.buildOptions }} target/sonic-barefoot.bin target/sonic-aboot-barefoot.swi
54+
- name: centec
55+
script: |
56+
make ${{ parameters.buildOptions }} INSTALL_DEBUG_TOOLS=y target/sonic-centec.bin
57+
mv target/sonic-centec.bin target/sonic-centec-dbg.bin
58+
make ${{ parameters.buildOptions }} target/sonic-centec.bin
59+
make ${{ parameters.buildOptions }} ENABLE_SYNCD_RPC=y target/docker-syncd-centec-rpc.gz
60+
- name: innovium
61+
script: |
62+
make ${{ parameters.buildOptions }} SONIC_CONFIG_BUILD_JOBS=1 target/sonic-innovium.bin
63+
- name: mellanox
64+
script: |
65+
make ${{ parameters.buildOptions }} target/sonic-mellanox.bin
66+
- name: mellanox
67+
extName: _rpc
68+
script: |
69+
make ${{ parameters.buildOptions }} ENABLE_SYNCD_RPC=y all
70+
- name: nephos
71+
script: |
72+
make ${{ parameters.buildOptions }} target/sonic-nephos.bin
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
parameters:
2+
- name: 'preSteps'
3+
type: stepList
4+
default: []
5+
- name: "postSteps"
6+
type: stepList
7+
default: []
8+
- name: 'jobGroups'
9+
type: object
10+
default: []
11+
- name: 'jobVariables'
12+
type: object
13+
default: {}
14+
- name: 'scriptEnv'
15+
type: object
16+
default: ''
17+
- name: 'timeoutInMinutes'
18+
type: 'number'
19+
default: 1440
20+
- name: 'jobFilters'
21+
type: object
22+
default: ''
23+
24+
jobs:
25+
- ${{ each jobGroup in parameters.jobGroups }}:
26+
- ${{ if or(eq(parameters.jobFilters, ''), containsValue(parameters.jobFilters, jobGroup.name)) }}:
27+
- job: ${{ replace(format('{0}{1}', jobGroup.name, jobGroup.extName), '-', '_') }}
28+
${{ each pair in jobGroup }}:
29+
${{ if not(in(pair.key, 'job', 'name', 'extName', 'variables', 'steps', 'script', 'scriptEnv')) }}:
30+
${{ pair.key }}: ${{ pair.value }}
31+
${{ if eq(jobGroup.timeoutInMinutes, '') }}:
32+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
33+
variables:
34+
GROUP_NAME: ${{ jobGroup.name }}
35+
GROUP_EXTNAME: '${{ jobGroup.extName }}'
36+
GROUP_NAMES: ${{ join(',', parameters.jobGroups.*.name ) }}
37+
${{ if ne(jobGroup.variables, '') }}:
38+
${{ jobGroup.variables }}
39+
${{ each para in parameters.jobvariables }}:
40+
${{ if eq(jobGroup.variables[para.key], '') }}:
41+
${{ para.key }}: ${{ para.value }}
42+
steps:
43+
- ${{ parameters.preSteps }}
44+
- ${{ if ne(jobGroup.script, '') }}:
45+
- script: |
46+
${{ jobGroup.script }}
47+
env:
48+
${{ if ne(parameters.scriptEnv, '') }}:
49+
${{ parameters.scriptEnv }}
50+
displayName: 'JobScript'
51+
- ${{ if ne(jobGroup.steps, '') }}:
52+
- ${{ jobGroup.steps }}
53+
- ${{ parameters.postSteps }}

.azure-pipelines/build-template.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,12 @@ jobs:
114114
- publish: $(System.DefaultWorkingDirectory)/
115115
artifact: sonic-buildimage.${{ parameters.platform }}
116116
displayName: "Archive sonic image"
117+
- script: |
118+
set -x
119+
find target -name "*.log" | xargs -I{} cp {} $(Build.ArtifactStagingDirectory)/
120+
condition: failed()
121+
displayName: "Copy build logs"
122+
- publish: $(Build.ArtifactStagingDirectory)/
123+
artifact: sonic-buildimage.${{ parameters.platform}}.logs@$(System.JobAttempt)
124+
displayName: "Archive build logs"
125+
condition: failed()

.azure-pipelines/official-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ stages:
2828
raw_image: true
2929
sync_rpc_image: true
3030

31+
- template: build-template.yml
32+
parameters:
33+
platform: mellanox
34+
platform_short: mlnx
35+
cache_mode: wcache
36+
dbg_image: true
37+
sync_rpc_image: true
38+
3139
- template: build-template.yml
3240
parameters:
3341
platform: vs

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ steps:
4949
virsh -c qemu:///system dumpxml ${{ parameters.dut }} > $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.xml
5050
img=$(virsh -c qemu:///system domblklist ${{ parameters.dut }} | grep vda | awk '{print $2}')
5151
cp $img $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.img
52+
gzip $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.img
53+
sudo gzip $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.memdmp
5254
virsh -c qemu:///system undefine ${{ parameters.dut }}
5355
fi
5456

.github/issue_template.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
```
5151
(paste your output here)
5252
```
53+
#### Output of `show techsupport`:
54+
55+
```
56+
(paste your output here or download and attach the file here )
57+
```
5358

5459
#### Additional information you deem important (e.g. issue happens only occasionally):
5560

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
url = https://github.com/aristanetworks/sonic
6060
[submodule "platform/mellanox/hw-management/hw-mgmt"]
6161
path = platform/mellanox/hw-management/hw-mgmt
62-
url = https://github.com/Mellanox/hw-mgmt/
62+
url = https://github.com/Mellanox/hw-mgmt
6363
[submodule "src/redis-dump-load"]
6464
path = src/redis-dump-load
6565
url = https://github.com/p/redis-dump-load.git

Makefile.work

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# * ENABLE_PFCWD_ON_START: Enable PFC Watchdog (PFCWD) on server-facing ports
1414
# * by default for TOR switch.
1515
# * ENABLE_SYNCD_RPC: Enables rpc-based syncd builds.
16-
# * INSTALL_DEBUG_TOOLS: Install debug tools and debug symbol packeages.
16+
# * INSTALL_DEBUG_TOOLS: Install debug tools and debug symbol packages.
1717
# * USERNAME: Desired username -- default at rules/config
1818
# * PASSWORD: Desired password -- default at rules/config
1919
# * KEEP_SLAVE_ON: Keeps slave container up and active after building process concludes.

0 commit comments

Comments
 (0)