-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '202012' of https://github.com/Azure/sonic-buildimage in…
…to 202012-nb-inno3
- Loading branch information
Showing
532 changed files
with
22,028 additions
and
6,606 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
parameters: | ||
- name: connectionName | ||
type: string | ||
default: sonic-dev-connection | ||
- name: kevaultName | ||
type: string | ||
default: sonic-kv | ||
- name: certificateName | ||
type: string | ||
default: sonic-secure-boot | ||
|
||
steps: | ||
- task: AzureKeyVault@2 | ||
inputs: | ||
connectedServiceName: ${{ parameters.connectionName }} | ||
keyVaultName: ${{ parameters.kevaultName }} | ||
secretsFilter: ${{ parameters.certificateName }} | ||
|
||
- script: | | ||
set -e | ||
TMP_FILE=$(mktemp) | ||
echo "$CERTIFICATE" | base64 -d > $TMP_FILE | ||
sudo mkdir -p /etc/certificates | ||
mkdir -p $(Build.StagingDirectory)/target | ||
# Save the public key | ||
openssl pkcs12 -in $TMP_FILE -clcerts --nokeys -nodes -passin pass: | sed -z -e "s/.*\(-----BEGIN CERTIFICATE\)/\1/" > $(SIGNING_CERT) | ||
# Save the private key | ||
openssl pkcs12 -in $TMP_FILE -nocerts -nodes -passin pass: | sed -z -e "s/.*\(-----BEGIN PRIVATE KEY\)/\1/" | sudo tee $(SIGNING_KEY) 1>/dev/null | ||
ls -lt $(SIGNING_CERT) $(SIGNING_KEY) | ||
rm $TMP_FILE | ||
env: | ||
CERTIFICATE: $(${{ parameters.certificateName }}) | ||
displayName: "Save certificate" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
pr: none | ||
trigger: none | ||
schedules: | ||
- cron: "0 0 * * *" | ||
displayName: Daily build | ||
branches: | ||
include: | ||
- master | ||
- 202??? | ||
resources: | ||
repositories: | ||
- repository: buildimage | ||
type: github | ||
name: Azure/sonic-buildimage | ||
ref: master | ||
endpoint: build | ||
|
||
jobs: | ||
- template: .azure-pipelines/template-commonlib.yml@buildimage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
steps: | ||
- script: | | ||
. functions.sh | ||
SONIC_VERSION=$(sonic_get_version) | ||
echo "SONIC_VERSION=$SONIC_VERSION" | ||
if [[ "$SONIC_VERSION" == *dirty* ]]; then | ||
# Print the detail dirty info | ||
git status --untracked-files=no -s --ignore-submodules | ||
# Exit with error, if it is a PR build | ||
if [ "$(Build.Reason)" == "PullRequest" ]; then | ||
echo "Build failed for the dirty version: $SONIC_VERSION" 1>&2 | ||
exit 1 | ||
fi | ||
fi | ||
displayName: "Check the dirty version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# Starter pipeline | ||
# Start with a minimal pipeline that you can customize to build and deploy your code. | ||
# Add steps that build, run tests, deploy, and more: | ||
# https://aka.ms/yaml | ||
# Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64 | ||
resources: | ||
repositories: | ||
- repository: buildimage | ||
type: github | ||
name: Azure/sonic-buildimage | ||
ref: master | ||
endpoint: build | ||
|
||
parameters: | ||
- name: arch | ||
type: string | ||
values: | ||
- amd64 | ||
- armhf | ||
- arm64 | ||
- name: dist | ||
type: string | ||
values: | ||
- bullseye | ||
- buster | ||
- stretch | ||
- jessie | ||
- name: registry_url | ||
type: string | ||
default: sonicdev-microsoft.azurecr.io | ||
- name: registry_conn | ||
type: string | ||
default: sonicdev | ||
- name: pool | ||
type: string | ||
default: sonicbld | ||
values: | ||
- sonicbld | ||
- sonicbld-arm64 | ||
- sonicbld-armhf | ||
|
||
jobs: | ||
- job: Build_${{ parameters.dist }}_${{ parameters.arch }} | ||
timeoutInMinutes: 360 | ||
pool: ${{ parameters.pool }} | ||
steps: | ||
- template: cleanup.yml | ||
- template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage | ||
- checkout: self | ||
clean: true | ||
submodules: recursive | ||
- bash: | | ||
set -ex | ||
SLAVE_DIR=sonic-slave-${{ parameters.dist }} | ||
if [ x${{ parameters.pool }} == x"sonicbld" ]; then | ||
if [ x${{ parameters.arch }} == x"amd64" ]; then | ||
SLAVE_BASE_IMAGE=${SLAVE_DIR} | ||
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR} | ||
elif [ x${{ parameters.pool }} == x"sonicbld" ]; then | ||
SLAVE_BASE_IMAGE=${SLAVE_DIR}-march-${{ parameters.arch }} | ||
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}-march-${{ parameters.arch }} | ||
fi | ||
elif [[ x${{ parameters.pool }} == x"sonicbld-armhf" && x${{ parameters.arch }} == x"armhf" ]]; then | ||
SLAVE_BASE_IMAGE=${SLAVE_DIR} | ||
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}-armhf | ||
elif [[ x${{ parameters.pool }} == x"sonicbld-arm64" && x${{ parameters.arch }} == x"arm64" ]]; then | ||
SLAVE_BASE_IMAGE=${SLAVE_DIR} | ||
SLAVE_BASE_IMAGE_UPLOAD=${SLAVE_DIR}-arm64 | ||
else | ||
echo "do not support build ${{ parameters.arch }} on ${{ parameters.pool }}" | ||
exit 1 | ||
fi | ||
if [ x"$(Build.SourceBranchName)" == x"202012" ]; then | ||
BUILD_OPTIONS = 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' | ||
fi | ||
tmpfile=$(mktemp) | ||
echo ${{ parameters.arch }} > .arch | ||
DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker BLDENV=${{ parameters.dist }} $(BUILD_OPTIONS) make -f Makefile.work sonic-slave-build | tee $tmpfile | ||
SLAVE_BASE_TAG=$(grep "^Checking sonic-slave-base image:" $tmpfile | awk -F ':' '{print $3}') | ||
SLAVE_TAG=$(grep "^Checking sonic-slave image:" $tmpfile | awk -F ':' '{print $3}') | ||
mkdir -p target | ||
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE_UPLOAD:latest | ||
docker tag $SLAVE_BASE_IMAGE:$SLAVE_BASE_TAG $REGISTRY_SERVER/$SLAVE_BASE_IMAGE_UPLOAD:$SLAVE_BASE_TAG | ||
set +x | ||
echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_IMAGE]$SLAVE_BASE_IMAGE_UPLOAD" | ||
echo "##vso[task.setvariable variable=VARIABLE_SLAVE_BASE_TAG]$SLAVE_BASE_TAG" | ||
env: | ||
REGISTRY_SERVER: ${{ parameters.registry_url }} | ||
displayName: Build sonic-slave-${{ parameters.dist }}-${{ parameters.arch }} | ||
- task: Docker@2 | ||
displayName: Upload image | ||
inputs: | ||
containerRegistry: ${{ parameters.registry_conn }} | ||
repository: $(VARIABLE_SLAVE_BASE_IMAGE) | ||
command: push | ||
tags: | | ||
$(VARIABLE_SLAVE_BASE_TAG) | ||
latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
steps: | ||
- script: | | ||
containers=$(docker container ls -a | grep "sonic-slave" | awk '{ print $1 }') | ||
[ -n "$containers" ] && docker container rm -f $containers | ||
docker images | grep "^<none>" | awk '{print$3}' | xargs -i docker rmi {} | ||
images=$(docker images 'sonic-slave-*' -a -q) | ||
[ -n "$images" ] && docker rmi -f $images | ||
displayName: 'Cleanup sonic slave' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
jobs: | ||
- job: Build | ||
timeoutInMinutes: 120 | ||
pool: sonicbld | ||
steps: | ||
- checkout: self | ||
clean: true | ||
submodules: recursive | ||
- script: | | ||
set -ex | ||
case $(Build.SourceBranchName) in | ||
202012 | 202106) | ||
bldenv=buster | ||
;; | ||
*) | ||
bldenv=bullseye | ||
;; | ||
esac | ||
BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y | ||
echo "##vso[task.setvariable variable=bldenv;]$bldenv" | ||
displayName: Make configure | ||
- script: | | ||
set -ex | ||
LIBNL3_VERSION_BASE=$(grep "LIBNL3_VERSION_BASE =" rules/libnl3.mk | awk '{print$3}') | ||
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/") | ||
BLDENV=$(bldenv) make -f Makefile.work target/debs/$(bldenv)/libnl-3-200_${LIBNL3_VERSION}_amd64.deb ENABLE_DOCKER_BASE_PULL=y | ||
LIBYANG_VERSION_BASE=$(grep "LIBYANG_VERSION_BASE =" rules/libyang.mk | awk '{print$3}') | ||
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/") | ||
BLDENV=$(bldenv) make -f Makefile.work target/debs/$(bldenv)/libyang_${LIBYANG_VERSION}_amd64.deb | ||
find target -name *.deb | xargs -i cp {} $(Build.ArtifactStagingDirectory) | ||
displayName: Make common lib packages | ||
- publish: $(Build.ArtifactStagingDirectory) | ||
artifact: common-lib |
Oops, something went wrong.