-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[CI] Update sonic image official build template. #7198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
xumia
merged 14 commits into
sonic-net:master
from
liushilongbuaa:refine-pipeline-template
Apr 7, 2021
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f44771a
draft
sonic-build 99c6bc2
fix
sonic-build 42943ed
Update new-build-template.yml
liushilongbuaa 44c95a2
Update azure-pipelines-build.yml
liushilongbuaa 08a6729
Update azure-pipelines-job-groups.yml
liushilongbuaa 12c13ee
fix
liushilongbuaa 25cf1ad
fix
liushilongbuaa 2f53bcb
draft
liushilongbuaa 7cabf2d
fix
liushilongbuaa b9f015b
fix
liushilongbuaa 52eaa98
fix
liushilongbuaa 903d259
fix
liushilongbuaa 81f0e4c
fix
liushilongbuaa 5488ca8
fix
liushilongbuaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,72 +1,99 @@ | ||
| # The azure pipeline template for Official build, and upgrade version build | ||
|
|
||
| parameters: | ||
| - name: 'jobFilters' | ||
| type: object | ||
| default: '' | ||
| - name: 'buildOptions' | ||
| type: string | ||
| default: 'SONIC_CONFIG_BUILD_JOBS=1' | ||
| - name: 'buildSlave' | ||
| type: string | ||
| default: 'n' | ||
| - name: 'preSteps' | ||
| type: stepList | ||
| default: [] | ||
| - name: 'postSteps' | ||
| type: stepList | ||
| default: [] | ||
|
|
||
| jobs: | ||
| - template: azure-pipelines-job-groups.yml | ||
| - template: azure-pipelines-image-template.yml | ||
| parameters: | ||
| jobFilters: ${{ parameters.jobFilters }} | ||
| preSteps: | ||
| - script: | | ||
| containers=$(docker container ls | grep "sonic-slave" | awk '{ print $1 }') | ||
| if [ ! -z "$containers" ]; then | ||
| docker container kill $containers || true | ||
| sleep 5 | ||
| fi | ||
| if [ "${{ parameters.buildSlave }}" == "y" ]; then | ||
| images=$(docker images 'sonic-slave-*' -a -q) | ||
| [ ! -z "$images" ] && docker rmi -f $images | ||
| fi | ||
| sudo rm -rf $(ls -A1) | ||
| displayName: 'Init' | ||
| - checkout: self | ||
| submodules: recursive | ||
| displayName: 'Checkout code' | ||
| - script: | | ||
| make ${{ parameters.buildOptions }} PLATFORM=$GROUP_NAME configure | ||
| displayName: 'Make configure' | ||
| postSteps: | ||
| - ${{ parameters.postSteps }} | ||
| - publish: $(System.DefaultWorkingDirectory)/target | ||
| artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)' | ||
| displayName: "Archive sonic image" | ||
| preSteps: ${{ parameters.preSteps }} | ||
| postSteps: ${{ parameters.postSteps }} | ||
| jobVariables: | ||
| PLATFORM: $(GROUP_NAME) | ||
| PLATFORM_ARCH: amd64 | ||
| BUILD_OPTIONS: ${{ parameters.buildOptions }} | ||
| dbg_image: false | ||
| swi_image: false | ||
| raw_image: false | ||
| sync_rpc_image: false | ||
| platform_rpc: false | ||
| jobGroups: | ||
| - name: vs | ||
| script: | | ||
| sudo bash -c "echo 1 > /proc/sys/vm/compact_memory" | ||
| make ${{ parameters.buildOptions }} target/sonic-vs.img.gz | ||
| - name: broadcom | ||
| script: | | ||
| make ${{ parameters.buildOptions }} target/sonic-broadcom.bin target/sonic-aboot-broadcom.swi | ||
| variables: | ||
| dbg_image: true | ||
| - name: barefoot | ||
| script: | | ||
| make ${{ parameters.buildOptions }} target/sonic-barefoot.bin target/sonic-aboot-barefoot.swi | ||
| variables: | ||
| swi_image: true | ||
| - name: broadcom | ||
| variables: | ||
| dbg_image: true | ||
| swi_image: true | ||
| raw_image: true | ||
| sync_rpc_image: true | ||
| platform_rpc: brcm | ||
| - name: centec | ||
| script: | | ||
| make ${{ parameters.buildOptions }} INSTALL_DEBUG_TOOLS=y target/sonic-centec.bin | ||
| mv target/sonic-centec.bin target/sonic-centec-dbg.bin | ||
| make ${{ parameters.buildOptions }} target/sonic-centec.bin | ||
| make ${{ parameters.buildOptions }} ENABLE_SYNCD_RPC=y target/docker-syncd-centec-rpc.gz | ||
| variables: | ||
| dbg_image: true | ||
| sync_rpc_image: true | ||
| platform_rpc: centec | ||
| - name: centec-arm64 | ||
| pool: sonicbld_8c | ||
| variables: | ||
| arch: arm64 | ||
| timeoutInMinutes: 1800 | ||
| - name: generic | ||
| variables: | ||
| dbg_image: true | ||
| - name: innovium | ||
| script: | | ||
| make ${{ parameters.buildOptions }} SONIC_CONFIG_BUILD_JOBS=1 target/sonic-innovium.bin | ||
| variables: | ||
| swi_image: true | ||
| - name: marvell-armhf | ||
| pool: sonicbld_8c | ||
| variables: | ||
| arch: armhf | ||
liushilongbuaa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| timeoutInMinutes: 1800 | ||
| - name: mellanox | ||
| script: | | ||
| make ${{ parameters.buildOptions }} target/sonic-mellanox.bin | ||
| - name: mellanox | ||
| extName: _rpc | ||
| script: | | ||
| make ${{ parameters.buildOptions }} ENABLE_SYNCD_RPC=y all | ||
| variables: | ||
| dbg_image: true | ||
| sync_rpc_image: true | ||
| platform_rpc: mlnx | ||
| - name: nephos | ||
| script: | | ||
| make ${{ parameters.buildOptions }} target/sonic-nephos.bin | ||
| variables: | ||
| dbg_image: true | ||
| sync_rpc_image: true | ||
| platform_rpc: nephos | ||
| buildSteps: | ||
| - bash: | | ||
| if [ $(GROUP_NAME) == vs ]; then | ||
| if [ $(dbg_image) == true ]; then | ||
| make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-vs.img.gz && mv target/sonic-vs.img.gz target/sonic-vs-dbg.img.gz | ||
| fi | ||
| make $BUILD_OPTIONS target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz | ||
| else | ||
| if [ $(dbg_image) == true ]; then | ||
| make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-$(GROUP_NAME).bin && \ | ||
| mv target/sonic-$(GROUP_NAME).bin target/sonic-$(GROUP_NAME)-dbg.bin | ||
| fi | ||
| if [ $(swi_image) == true ]; then | ||
| make $BUILD_OPTIONS ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-$(GROUP_NAME).swi | ||
| fi | ||
| if [ $(raw_image) == true ]; then | ||
| make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).raw | ||
| fi | ||
| if [ $(sync_rpc_image) == true ]; then | ||
| make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-rpc.gz | ||
| fi | ||
| make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin | ||
| fi | ||
This file contains hidden or 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,54 @@ | ||
| # The azure pipeline template for PR build, Official build, and upgrade version build | ||
|
|
||
| parameters: | ||
| - name: 'jobFilters' | ||
| type: object | ||
| default: '' | ||
| - name: 'preSteps' | ||
| type: stepList | ||
| default: [] | ||
| - name: 'buildSteps' | ||
| type: stepList | ||
| default: [] | ||
| - name: 'postSteps' | ||
| type: stepList | ||
| default: [] | ||
| - name: jobGroups | ||
| type: object | ||
| default: [] | ||
| - name: jobVariables | ||
| type: object | ||
| default: [] | ||
| jobs: | ||
| - template: azure-pipelines-job-groups.yml | ||
| parameters: | ||
| jobFilters: ${{ parameters.jobFilters }} | ||
| jobVariables: ${{ parameters.jobVariables }} | ||
| preSteps: | ||
| - template: cleanup.yml | ||
| - ${{ parameters. preSteps }} | ||
| - script: | | ||
| if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM) | grep -E -q "^(vs|broadcom|mellanox)$"; then | ||
| CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM)" | ||
| BUILD_OPTIONS="$(BUILD_OPTIONS) $CACHE_OPTIONS" | ||
| echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS" | ||
| fi | ||
| displayName: "Make build options" | ||
| - checkout: self | ||
| submodules: recursive | ||
| displayName: 'Checkout code' | ||
| - script: | | ||
| sudo modprobe overlay | ||
| sudo apt-get install -y acl | ||
| export DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker | ||
| sudo bash -c "echo 1 > /proc/sys/vm/compact_memory" | ||
| ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM) PLATFORM_ARCH=$(PLATFORM_ARCH) configure | ||
| displayName: 'Make configure' | ||
| postSteps: | ||
| - publish: $(System.DefaultWorkingDirectory)/target | ||
| artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)' | ||
| displayName: "Archive sonic image" | ||
| - ${{ parameters.postSteps }} | ||
| - template: cleanup.yml | ||
| jobGroups: ${{ parameters.jobGroups }} | ||
| buildSteps: ${{ parameters.buildSteps }} |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.