-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'as7712_20210827_api2_202012br' of https://github.com/jo…
…star-yang/sonic-buildimage into as7712_20210827_api2_202012br
- Loading branch information
Showing
685 changed files
with
30,789 additions
and
13,254 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# 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 | ||
|
||
schedules: | ||
- cron: "0 8 * * *" | ||
displayName: Daily midnight build | ||
branches: | ||
include: | ||
- master | ||
- 202012 | ||
always: true | ||
|
||
trigger: none | ||
pr: none | ||
|
||
resources: | ||
repositories: | ||
- repository: cisco-8000 | ||
type: github | ||
name: Cisco-8000-sonic/platform-cisco-8000 | ||
endpoint: cisco-connection | ||
|
||
variables: | ||
- group: SONIC-AKV-STROAGE-1 | ||
- name: StorageSASKey | ||
value: $(sonicstorage-SasToken) | ||
|
||
stages: | ||
- stage: Build | ||
pool: sonic | ||
variables: | ||
CACHE_MODE: wcache | ||
SKIP_CHECKOUT: true | ||
TERM: '' | ||
PACKAGE_URL: "https://sonicstorage.blob.core.windows.net/packages" | ||
|
||
jobs: | ||
- template: azure-pipelines-build.yml | ||
parameters: | ||
buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}' | ||
preSteps: | ||
- checkout: self | ||
submodules: recursive | ||
path: s | ||
displayName: 'Checkout code' | ||
- checkout: cisco-8000 | ||
submodules: recursive | ||
path: s/platform/cisco-8000 | ||
displayName: 'Checkout cisco-8000' | ||
- script: | | ||
cisco_ref=$(cat platform/checkout/cisco-8000.ini | grep '^ref=' | cut -d= -f2) | ||
echo "The cisco 8000 release version is $cisco_ref" | ||
echo "##vso[task.setvariable variable=cisco.ref]$cisco_ref" | ||
displayName: 'Export cisco release version' | ||
- task: DownloadGitHubRelease@0 | ||
inputs: | ||
connection: cisco-connection | ||
userRepository: Cisco-8000-sonic/platform-cisco-8000 | ||
defaultVersionType: specificTag | ||
version: $(cisco.ref) | ||
itemPattern: 'artifactory-*.tar.gz' | ||
downloadPath: '$(System.ArtifactsDirectory)' | ||
- script: | | ||
make PLATFORM=cisco-8000 platform/cisco-8000 | ||
tar xfz $(System.ArtifactsDirectory)/artifactory-*.tar.gz -C platform/cisco-8000 | ||
displayName: 'Setup cisco artifacts' | ||
- script: | | ||
set -ex | ||
filename=$(find platform/cisco-8000/artifactory/sonic -name cisco-* -type f | head -n 1) | ||
if [ -z "$filename" ]; then | ||
echo "Cisco sai package not found" 1>&2 | ||
exit 1 | ||
fi | ||
cd $(dirname $filename) | ||
echo "PWD=$(pwd)" | ||
ls -l *.deb | ||
while read -r package; do | ||
# Cisco version format: <VERSION>-sai-<sai-ver>-<distribution>-<COMMIT HASH> | ||
# The <sai-ver> may contain several values in one build, the part is skipped when publishing to storage | ||
# See https://github.com/Cisco-8000-sonic/sdk/blob/master/azure-pipelines.yml | ||
# The $PACKAGE_URL is only accessible for AZP | ||
version=$(echo $package | awk -F_ '{print $(NF-1)}' | cut -d- -f1,2,4,5) | ||
package_url="$PACKAGE_URL/sai/ciscosai/master/$version/$package" | ||
echo "Override package $package from $package_url" | ||
wget "$package_url$StorageSASKey" -O "$package" | ||
done < <(ls *.deb) | ||
env: | ||
StorageSASKey: $(StorageSASKey) | ||
condition: ne(variables['Build.Reason'], 'PullRequest') | ||
displayName: "Override cisco sai packages" | ||
jobGroups: | ||
- name: cisco-8000 |
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' |
Oops, something went wrong.