Skip to content

Commit cf6bf3e

Browse files
Merge branch 'master' of https://github.com/Azure/sonic-buildimage into nba610-initial-support
2 parents 892e9b5 + 937bf09 commit cf6bf3e

File tree

362 files changed

+63766
-5154
lines changed

Some content is hidden

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

362 files changed

+63766
-5154
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
parameters:
2+
- name: connectionName
3+
type: string
4+
default: sonic-dev-connection
5+
- name: kevaultName
6+
type: string
7+
default: sonic-kv
8+
- name: certificateName
9+
type: string
10+
default: sonic-secure-boot
11+
12+
steps:
13+
- task: AzureKeyVault@2
14+
inputs:
15+
connectedServiceName: ${{ parameters.connectionName }}
16+
keyVaultName: ${{ parameters.kevaultName }}
17+
secretsFilter: ${{ parameters.certificateName }}
18+
19+
- script: |
20+
set -e
21+
TMP_FILE=$(mktemp)
22+
echo "$CERTIFICATE" | base64 -d > $TMP_FILE
23+
sudo mkdir -p /etc/certificates
24+
mkdir -p $(Build.StagingDirectory)/target
25+
# Save the public key
26+
openssl pkcs12 -in $TMP_FILE -clcerts --nokeys -nodes -passin pass: | sed -z -e "s/.*\(-----BEGIN CERTIFICATE\)/\1/" > $(SIGNING_CERT)
27+
# Save the private key
28+
openssl pkcs12 -in $TMP_FILE -nocerts -nodes -passin pass: | sed -z -e "s/.*\(-----BEGIN PRIVATE KEY\)/\1/" | sudo tee $(SIGNING_KEY) 1>/dev/null
29+
ls -lt $(SIGNING_CERT) $(SIGNING_KEY)
30+
rm $TMP_FILE
31+
env:
32+
CERTIFICATE: $(${{ parameters.certificateName }})
33+
displayName: "Save certificate"

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure
4949
displayName: 'Make configure'
5050
postSteps:
51-
- script: cp target -r $(Build.ArtifactStagingDirectory)/
51+
- script: mv target $(Build.ArtifactStagingDirectory)/
5252
displayName: Copy Artifacts
5353
condition: always()
5454
- publish: $(Build.ArtifactStagingDirectory)
@@ -58,6 +58,10 @@ jobs:
5858
condition: failed()
5959
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)$(System.JobAttempt)'
6060
displayName: "Archive failed sonic image"
61+
- template: trigger-publish-artifacts-build.yml
62+
parameters:
63+
artifactName: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
64+
publishPrefix: '$(Build.DefinitionName)/$(Build.SourceBranchName)/$(GROUP_NAME)'
6165
- ${{ parameters.postSteps }}
6266
- template: cleanup.yml
6367
jobGroups: ${{ parameters.jobGroups }}

.azure-pipelines/official-build-cisco-8000.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,17 @@ resources:
2222
name: Cisco-8000-sonic/platform-cisco-8000
2323
endpoint: cisco-connection
2424

25+
2526
variables:
2627
- group: SONIC-AKV-STROAGE-1
2728
- name: StorageSASKey
2829
value: $(sonicstorage-SasToken)
30+
- name: SONIC_ENABLE_SECUREBOOT_SIGNATURE
31+
value: y
32+
- name: SIGNING_KEY
33+
value: /etc/certificates/sonic-secure-boot-private.pem
34+
- name: SIGNING_CERT
35+
value: $(Build.StagingDirectory)/target/sonic-secure-boot-public.pem
2936

3037
stages:
3138
- stage: Build
@@ -41,6 +48,7 @@ stages:
4148
parameters:
4249
buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}'
4350
preSteps:
51+
- template: azure-pipelines-download-certificate.yml
4452
- checkout: self
4553
submodules: recursive
4654
path: s
@@ -90,5 +98,10 @@ stages:
9098
StorageSASKey: $(StorageSASKey)
9199
condition: ne(variables['Build.Reason'], 'PullRequest')
92100
displayName: "Override cisco sai packages"
101+
- script: |
102+
echo "SONIC_ENABLE_SECUREBOOT_SIGNATURE := y" >> rules/config.user
103+
echo "SIGNING_KEY := $(SIGNING_KEY)" >> rules/config.user
104+
echo "SIGNING_CERT := $(SIGNING_CERT)" >> rules/config.user
105+
displayName: "Enable secure boot signature"
93106
jobGroups:
94107
- name: cisco-8000

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ parameters:
77
type: string
88
- name: ptf_name
99
type: string
10+
- name: vmtype
11+
type: string
12+
default: 'ceos'
1013
- name: section
1114
type: string
1215
default: ''
@@ -41,7 +44,7 @@ steps:
4144
git reset --hard origin/master
4245
sed -i s/use_own_value/${username}/ ansible/veos_vtb
4346
echo aaa > ansible/password.txt
44-
docker exec sonic-mgmt bash -c "pushd /data/sonic-mgmt/ansible;./testbed-cli.sh -d /data/sonic-vm -m $(inventory) -t $(testbed_file) -k ceos refresh-dut ${{ parameters.tbname }} password.txt" && sleep 180
47+
docker exec sonic-mgmt bash -c "pushd /data/sonic-mgmt/ansible;./testbed-cli.sh -d /data/sonic-vm -m $(inventory) -t $(testbed_file) -k ${{ parameters.vmtype }} refresh-dut ${{ parameters.tbname }} password.txt" && sleep 180
4548
displayName: "Setup testbed"
4649

4750
- script: |

.azure-pipelines/template-commonlib.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,39 @@ jobs:
22
- job: Build
33
timeoutInMinutes: 120
44
pool: sonicbld
5+
variables:
6+
- template: template-variables.yml
57
steps:
68
- checkout: self
79
clean: true
810
submodules: recursive
911
- script: |
1012
set -ex
11-
case $(Build.SourceBranchName) in
12-
202012 | 202106)
13-
bldenv=buster
14-
;;
15-
*)
16-
bldenv=bullseye
17-
;;
18-
esac
19-
BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y
20-
echo "##vso[task.setvariable variable=bldenv;]$bldenv"
13+
branch=$(Build.SourceBranchName)
14+
# DIST_MASTER is set in variable.
15+
BRANCH=DIST_${branch^^}
16+
bldenvs=${!BRANCH}
17+
[ "$bldenvs" == "" ] && bldenvs="$(COMMON_LIB_BUILD_ENVS)"
18+
for bldenv in $bldenvs
19+
do
20+
BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y
21+
done
22+
set +x
23+
echo "##vso[task.setvariable variable=bldenvs;]$bldenvs"
2124
displayName: Make configure
2225
- script: |
2326
set -ex
24-
LIBNL3_VERSION_BASE=$(grep "LIBNL3_VERSION_BASE =" rules/libnl3.mk | awk '{print$3}')
25-
LIBNL3_VERSION=$(grep "LIBNL3_VERSION =" rules/libnl3.mk | awk '{print$3}' | sed -e "s/(//" -e "s/)//" -e "s/\\$//" -e "s/LIBNL3_VERSION_BASE/$LIBNL3_VERSION_BASE/")
26-
BLDENV=$(bldenv) make -f Makefile.work target/debs/$(bldenv)/libnl-3-200_${LIBNL3_VERSION}_amd64.deb ENABLE_DOCKER_BASE_PULL=y
27+
for bldenv in $(bldenvs)
28+
do
29+
LIBNL3_VERSION_BASE=$(grep "LIBNL3_VERSION_BASE =" rules/libnl3.mk | awk '{print$3}')
30+
LIBNL3_VERSION=$(grep "LIBNL3_VERSION =" rules/libnl3.mk | awk '{print$3}' | sed -e "s/(//" -e "s/)//" -e "s/\\$//" -e "s/LIBNL3_VERSION_BASE/$LIBNL3_VERSION_BASE/")
31+
SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work target/debs/$bldenv/libnl-3-200_${LIBNL3_VERSION}_amd64.deb ENABLE_DOCKER_BASE_PULL=y
2732
28-
LIBYANG_VERSION_BASE=$(grep "LIBYANG_VERSION_BASE =" rules/libyang.mk | awk '{print$3}')
29-
LIBYANG_VERSION=$(grep "LIBYANG_VERSION =" rules/libyang.mk | awk '{print$3}' | sed -e "s/\\$//" -e "s/(//" -e "s/)//" -e "s/LIBYANG_VERSION_BASE/$LIBYANG_VERSION_BASE/")
30-
BLDENV=$(bldenv) make -f Makefile.work target/debs/$(bldenv)/libyang_${LIBYANG_VERSION}_amd64.deb
31-
find target -name *.deb | xargs -i cp {} $(Build.ArtifactStagingDirectory)
33+
LIBYANG_VERSION_BASE=$(grep "LIBYANG_VERSION_BASE =" rules/libyang.mk | awk '{print$3}')
34+
LIBYANG_VERSION=$(grep "LIBYANG_VERSION =" rules/libyang.mk | awk '{print$3}' | sed -e "s/\\$//" -e "s/(//" -e "s/)//" -e "s/LIBYANG_VERSION_BASE/$LIBYANG_VERSION_BASE/")
35+
SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work target/debs/$bldenv/libyang_${LIBYANG_VERSION}_amd64.deb
36+
done
37+
mv target $(Build.ArtifactStagingDirectory)
3238
displayName: Make common lib packages
3339
- publish: $(Build.ArtifactStagingDirectory)
3440
artifact: common-lib
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
variables:
22
DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io'
3+
COMMON_LIB_BUILD_ENVS: 'bullseye'
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# The steps to trigger the pipeline to publish the artifacts
2+
3+
parameters:
4+
- name: artifactName
5+
type: string
6+
default: ""
7+
- name: publishPrefix
8+
type: string
9+
default: "$(Build.DefinitionName)/$(Build.SourceBranchName)"
10+
11+
steps:
12+
- script: |
13+
. functions.sh
14+
sonic_version=$(sonic_get_version)
15+
latest_tag=$(git describe --tags --abbrev=0)
16+
docker_tags="$sonic_version $(Build.SourceBranchName)"
17+
if [ "$(Build.SourceBranchName)" == "master" ]; then
18+
docker_tags="$docker_tags latest"
19+
fi
20+
echo "##vso[task.setvariable variable=sonic_version]$sonic_version"
21+
echo "##vso[task.setvariable variable=latest_tag]$latest_tag"
22+
echo "##vso[task.setvariable variable=docker_tags]$docker_tags"
23+
condition: ne(variables['Build.Reason'], 'PullRequest')
24+
displayName: 'Set trigger build variables'
25+
- task: TriggerBuild@4
26+
condition: ne(variables['Build.Reason'], 'PullRequest')
27+
inputs:
28+
definitionIsInCurrentTeamProject: false
29+
teamProject: internal
30+
tfsServer: $(System.CollectionUri)
31+
buildDefinition: 'publish-artifacts'
32+
queueBuildForUserThatTriggeredBuild: true
33+
ignoreSslCertificateErrors: false
34+
useSameSourceVersion: false
35+
useCustomSourceVersion: false
36+
useSameBranch: false
37+
waitForQueuedBuildsToFinish: false
38+
storeInEnvironmentVariable: true
39+
authenticationMethod: 'Personal Access Token'
40+
password: '$(system.accesstoken)'
41+
enableBuildInQueueCondition: false
42+
dependentOnSuccessfulBuildCondition: false
43+
dependentOnFailedBuildCondition: false
44+
checkbuildsoncurrentbranch: false
45+
failTaskIfConditionsAreNotFulfilled: false
46+
buildParameters: ''
47+
templateParameters: |
48+
pipelineContext: {"buildId":"$(Build.BuildId)",
49+
"pipelineId":"$(System.DefinitionId)",
50+
"project": "$(System.TeamProject)",
51+
"branchName":"$(Build.SourceBranchName)"},
52+
artifactContext: {"artifactName":"${{ parameters.artifactName }}",
53+
"artifactPatterns":"**/*.bin\n
54+
**/*.swi\n
55+
**/*.raw\n
56+
**/*.img.gz\n
57+
**/*-rpc.gz\n
58+
**/python-saithrift*.deb"},
59+
publishContext: {"publishPrefix":"${{ parameters.publishPrefix }}",
60+
"keepArtifactName":false,
61+
"dockerImagePatterns":"target/*-rpc.gz",
62+
"dockerTags":"$(docker_tags)",
63+
"version":"$(sonic_version)",
64+
"latestTag":"$(latest_tag)"}

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pull request for inclusion in the changelog:
4242
<!--
4343
Provide a link to config_db schema for the table for which YANG model
4444
is defined
45-
Link should point to correct section on https://github.com/Azure/SONiC/wiki/Configuration.
45+
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
4646
-->
4747

4848
#### A picture of a cute animal (not mandatory but encouraged)

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@
103103
[submodule "src/sonic-p4rt/sonic-pins"]
104104
path = src/sonic-p4rt/sonic-pins
105105
url = https://github.com/Azure/sonic-pins.git
106-
[submodule "src/thrift_0_14_1/thrift"]
107-
path = src/thrift_0_14_1/thrift
108-
url = https://github.com/apache/thrift.git
106+
[submodule "src/ptf-py3"]
107+
path = src/ptf-py3
108+
url = https://github.com/p4lang/ptf.git

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ endif
4040
ifeq ($(NOBULLSEYE), 0)
4141
BLDENV=bullseye make -f Makefile.work $@
4242
endif
43+
BLDENV=bullseye make -f Makefile.work docker-cleanup
4344

4445
jessie:
4546
@echo "+++ Making $@ +++"
@@ -83,7 +84,7 @@ $(PLATFORM_PATH):
8384
configure : $(PLATFORM_PATH)
8485
$(call make_work, $@)
8586

86-
clean reset showtag sonic-slave-build sonic-slave-bash :
87+
clean reset showtag docker-cleanup sonic-slave-build sonic-slave-bash :
8788
$(call make_work, $@)
8889

8990
# Freeze the versions, see more detail options: scripts/versions_manager.py freeze -h

0 commit comments

Comments
 (0)