-
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 'master' into include_docker_script_in_sonic
- Loading branch information
Showing
1,810 changed files
with
108,298 additions
and
15,234 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
**/* | ||
!target/*.bin | ||
!target/*.log | ||
!target/*.img.gz | ||
!target/docker-sonic-vs.gz | ||
!target/docker-ptf.gz | ||
!target/debs/**/*.deb | ||
!target/debs/**/*.deb.log | ||
!target/debs/**/*.deb-install.log | ||
!target/python-wheels/*.whl | ||
!target/python-wheels/*.whl.log | ||
!target/python-wheels/*.whl-install.log |
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 @@ | ||
parameters: | ||
- name: platform | ||
type: string | ||
values: | ||
- broadcom | ||
- mellanox | ||
- marvell-armhf | ||
|
||
- name: platform_arch | ||
type: string | ||
values: | ||
- amd64 | ||
- armhf | ||
- arm64 | ||
default: amd64 | ||
|
||
- name: platform_short | ||
type: string | ||
values: | ||
- brcm | ||
- mlnx | ||
- marvell-armhf | ||
|
||
- name: cache_mode | ||
type: string | ||
values: | ||
- wcache | ||
- rcache | ||
- cache | ||
|
||
- name: pool | ||
type: string | ||
values: | ||
- sonicbld | ||
- sonicbld_8c | ||
default: sonicbld | ||
|
||
- name: dbg_image | ||
type: boolean | ||
default: false | ||
|
||
- name: swi_image | ||
type: boolean | ||
default: false | ||
|
||
- name: raw_image | ||
type: boolean | ||
default: false | ||
|
||
- name: sync_rpc_image | ||
type: boolean | ||
default: false | ||
|
||
- name: timeout | ||
type: number | ||
default: 600 | ||
|
||
jobs: | ||
- job: | ||
pool: ${{ parameters.pool }} | ||
displayName: ${{ parameters.platform }} | ||
timeoutInMinutes: ${{ parameters.timeout }} | ||
steps: | ||
- checkout: self | ||
submodules: recursive | ||
displayName: 'Checkout code' | ||
- template: cleanup.yml | ||
- script: | | ||
set -e | ||
sudo modprobe overlay | ||
sudo apt-get install -y acl | ||
export DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker | ||
CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=${{ parameters.cache_mode }} SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/${{ parameters.platform }}" | ||
ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=${{ parameters.platform }} PLATFORM_ARCH=${{ parameters.platform_arch }} | ||
trap "sudo rm -rf fsroot" EXIT | ||
if [ ${{ parameters.dbg_image }} == true ];then | ||
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-${{ parameters.platform }}.bin && \ | ||
mv target/sonic-${{ parameters.platform }}.bin target/sonic-${{ parameters.platform }}-dbg.bin | ||
fi | ||
if [ ${{ parameters.swi_image }} == true ];then | ||
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-${{ parameters.platform }}.swi | ||
fi | ||
if [ ${{ parameters.raw_image }} == true ];then | ||
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.raw | ||
fi | ||
if [ ${{ parameters.sync_rpc_image }} == true ];then | ||
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y target/docker-syncd-${{ parameters.platform_short }}-rpc.gz | ||
fi | ||
make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.bin | ||
displayName: 'Build sonic image' | ||
- publish: $(System.DefaultWorkingDirectory)/ | ||
artifact: sonic-buildimage.${{ parameters.platform }} | ||
displayName: "Archive sonic image" | ||
- template: cleanup.yml |
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,18 @@ | ||
steps: | ||
- script: | | ||
sudo kill -9 `sudo cat /var/run/march/docker.pid` || true | ||
sudo rm -f /var/run/march/docker.pid || true | ||
sudo rm -rf fsroot || true | ||
git clean -xfdf || true | ||
git reset --hard || true | ||
git submodule foreach --recursive 'git clean -xfdf || true' || true | ||
git submodule foreach --recursive 'git reset --hard || true' || true | ||
git submodule foreach --recursive 'git remote update || true' || true | ||
git submodule update --init --recursive || true | ||
# clean native docker build | ||
if sudo [ -f dockerfs/var/run/docker.pid ] ; then | ||
pid=`sudo cat dockerfs/var/run/docker.pid` ; sudo kill $pid | ||
fi | ||
sudo rm -rf /data/march/docker | ||
displayName: "Clean Workspace" |
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,38 @@ | ||
# 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 | ||
always: true | ||
|
||
trigger: none | ||
pr: none | ||
|
||
stages: | ||
- stage: Build | ||
|
||
jobs: | ||
- template: build-template.yml | ||
parameters: | ||
platform: broadcom | ||
platform_short: brcm | ||
cache_mode: wcache | ||
dbg_image: true | ||
swi_image: true | ||
raw_image: true | ||
sync_rpc_image: true | ||
|
||
- template: build-template.yml | ||
parameters: | ||
timeout: 3600 | ||
platform: marvell-armhf | ||
platform_arch: armhf | ||
platform_short: marvell-armhf | ||
cache_mode: wcache | ||
pool: sonicbld_8c |
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,82 @@ | ||
parameters: | ||
- name: dut | ||
type: string | ||
- name: tbname | ||
type: string | ||
- name: tbtype | ||
type: string | ||
- name: ptf_name | ||
type: string | ||
|
||
steps: | ||
- checkout: self | ||
clean: true | ||
displayName: 'checkout sonic-mgmt repo' | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
artifact: sonic-buildimage.kvm | ||
displayName: "Download sonic-buildimage.kvm artifact" | ||
|
||
- script: | | ||
set -x | ||
sudo mkdir -p /data/sonic-vm/images | ||
sudo cp -v ../target/sonic-vs.img.gz /data/sonic-vm/images/sonic-vs.img.gz | ||
sudo gzip -fd /data/sonic-vm/images/sonic-vs.img.gz | ||
username=$(id -un) | ||
sudo chown -R $username.$username /data/sonic-vm | ||
pushd /data/sonic-mgmt | ||
git remote update | ||
git reset --hard origin/master | ||
sed -i s/use_own_value/${username}/ ansible/veos_vtb | ||
echo aaa > ansible/password.txt | ||
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 | ||
displayName: "Setup testbed" | ||
|
||
- script: | | ||
rm -rf $(Build.ArtifactStagingDirectory)/* | ||
docker exec sonic-mgmt bash -c "/data/sonic-mgmt/tests/kvmtest.sh -en -T ${{ parameters.tbtype }} ${{ parameters.tbname }} ${{ parameters.dut }}" | ||
displayName: "Run tests" | ||
|
||
- script: | | ||
# save dut state if test fails | ||
virsh_version=$(virsh --version) | ||
if [ $virsh_version == "6.0.0" ]; then | ||
mkdir -p $(Build.ArtifactStagingDirectory)/kvmdump | ||
virsh -c qemu:///system list | ||
virsh -c qemu:///system save ${{ parameters.dut }} $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.memdmp | ||
virsh -c qemu:///system dumpxml ${{ parameters.dut }} > $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.xml | ||
img=$(virsh -c qemu:///system domblklist ${{ parameters.dut }} | grep vda | awk '{print $2}') | ||
cp $img $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.img | ||
virsh -c qemu:///system undefine ${{ parameters.dut }} | ||
fi | ||
docker commit ${{ parameters.ptf_name }} docker-ptf:$(Build.BuildNumber) | ||
docker save docker-ptf:$(Build.BuildNumber) | gzip -c > $(Build.ArtifactStagingDirectory)/kvmdump/docker-ptf-dump.gz | ||
docker rmi docker-ptf:$(Build.BuildNumber) | ||
displayName: "Collect kvmdump" | ||
condition: failed() | ||
|
||
- script: | | ||
cp -r /data/sonic-mgmt/tests/logs $(Build.ArtifactStagingDirectory)/ | ||
username=$(id -un) | ||
sudo chown -R $username.$username $(Build.ArtifactStagingDirectory) | ||
displayName: "Collect test logs" | ||
condition: succeededOrFailed() | ||
|
||
- publish: $(Build.ArtifactStagingDirectory)/kvmdump | ||
artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype}}.memdump@$(System.JobAttempt) | ||
displayName: "Archive sonic kvm memdump" | ||
condition: failed() | ||
|
||
- publish: $(Build.ArtifactStagingDirectory)/logs | ||
artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype }}.log@$(System.JobAttempt) | ||
displayName: "Archive sonic kvm logs" | ||
condition: succeededOrFailed() | ||
|
||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFiles: '$(Build.ArtifactStagingDirectory)/logs/**/*.xml' | ||
testRunTitle: kvmtest.${{ parameters.tbtype }} | ||
condition: succeededOrFailed() |
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,35 @@ | ||
# This is a comment. | ||
# Each line is a file pattern followed by one or more owners. | ||
|
||
# rules are explained here | ||
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners | ||
|
||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence, | ||
# @lguohan will be requested for review when someone opens | ||
# a pull request. | ||
* @lguohan | ||
|
||
/device/ @jleveque | ||
|
||
# build | ||
/rules/ @qiluo-msft @xumia @lguohan | ||
/Makefile @qiluo-msft @xumia @lguohan | ||
/Makefile.cache @qiluo-msft @xumia @lguohan | ||
/Makefile.work @qiluo-msft @xumia @lguohan | ||
/slave.mk @qiluo-msft @xumia @lguohan | ||
/scripts @qiluo-msft @xumia @lguohan | ||
|
||
# installer | ||
/installer/ @qiluo-msft | ||
|
||
# permission | ||
/files/image_config/sudoers/ @qiluo-msft | ||
|
||
# dockers | ||
/dockers/docker-base*/ @qiluo-msft | ||
/dockers/docker-config-engine*/ @qiluo-msft | ||
/dockers/docker-snmp/ @qiluo-msft | ||
|
||
# src | ||
/src/initramfs-tools/ @qiluo-msft |
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
Oops, something went wrong.