Skip to content

Commit

Permalink
Merged PR 6148955: Manual merge internal branch with github master br…
Browse files Browse the repository at this point in the history
…anch

Related work items: #52, #71, #73, #75, #77, sonic-net#1306, sonic-net#1588, sonic-net#1991, sonic-net#2031, sonic-net#2040, sonic-net#2053, sonic-net#2066, sonic-net#2069, sonic-net#2087, sonic-net#2107, sonic-net#2110, sonic-net#2112, sonic-net#2113, sonic-net#2117, sonic-net#2124, sonic-net#2125, sonic-net#2126, sonic-net#2128, sonic-net#2130, sonic-net#2131, sonic-net#2132, sonic-net#2133, sonic-net#2134, sonic-net#2135, sonic-net#2136, sonic-net#2137, sonic-net#2138, sonic-net#2139, sonic-net#2140, sonic-net#2143, sonic-net#2158, sonic-net#2161, sonic-net#2233, sonic-net#2243, sonic-net#2250, sonic-net#2254, sonic-net#2260, sonic-net#2261, sonic-net#2267, sonic-net#2278, sonic-net#2282, sonic-net#2285, sonic-net#2288, sonic-net#2289, sonic-net#2292, sonic-net#2294, sonic-net#8887, sonic-net#9279, sonic-net#9390, sonic-net#9511, sonic-net#9700, sonic-net#10025, sonic-net#10322, sonic-net#10479, sonic-net#10484, sonic-net#10493, sonic-net#10500, sonic-net#10580, sonic-net#10595, sonic-net#10628, sonic-net#10634, sonic-net#10635, sonic-net#10644, sonic-net#10670, sonic-net#10691, sonic-net#10716, sonic-net#10731, sonic-net#10750, sonic-net#10751, sonic-net#10752, sonic-net#10761, sonic-net#10769, sonic-net#10775, sonic-net#10776, sonic-net#10779, sonic-net#10786, sonic-net#10792, sonic-net#10793, sonic-net#10800, sonic-net#10806, sonic-net#10826, sonic-net#10839, sonic-net#10840, sonic-net#10842, sonic-net#10844, sonic-net#10847, sonic-net#10849, sonic-net#10852, sonic-net#10865, sonic-net#10872, sonic-net#10877, sonic-net#10886, sonic-net#10889, sonic-net#10903, sonic-net#10904, sonic-net#10905, sonic-net#10913, sonic-net#10914, sonic-net#10916, sonic-net#10919, sonic-net#10925, sonic-net#10926, sonic-net#10929, sonic-net#10933, sonic-net#10934, sonic-net#10937, sonic-net#10941, sonic-net#10947, sonic-net#10952, sonic-net#10953, sonic-net#10957, sonic-net#10959, sonic-net#10971, sonic-net#10972, sonic-net#10980
  • Loading branch information
yxieca committed Jun 1, 2022
2 parents de2887b + 8b69540 commit a1e7352
Show file tree
Hide file tree
Showing 327 changed files with 70,533 additions and 1,743 deletions.
11 changes: 9 additions & 2 deletions .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,23 @@ jobs:
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure
displayName: 'Make configure'
postSteps:
- script: cp target -r $(Build.ArtifactStagingDirectory)/
- script: |
mkdir -p $(Build.ArtifactStagingDirectory)/target
mv target/* $(Build.ArtifactStagingDirectory)/target/
displayName: Copy Artifacts
condition: always()
- publish: $(Build.ArtifactStagingDirectory)
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
displayName: "Archive sonic image"
- publish: $(Build.ArtifactStagingDirectory)
condition: failed()
condition: or(failed(), canceled())
artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)$(System.JobAttempt)'
displayName: "Archive failed sonic image"
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- template: trigger-publish-artifacts-build.yml
parameters:
artifactName: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
publishPrefix: '$(Build.DefinitionName)/$(Build.SourceBranchName)/$(GROUP_NAME)'
- ${{ parameters.postSteps }}
- template: cleanup.yml
jobGroups: ${{ parameters.jobGroups }}
Expand Down
7 changes: 6 additions & 1 deletion .azure-pipelines/run-test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ parameters:
type: string
- name: ptf_name
type: string
- name: vmtype
type: string
default: 'ceos'
- name: section
type: string
default: ''
Expand Down Expand Up @@ -41,13 +44,15 @@ steps:
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
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
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 }} ${{ parameters.section }}"
displayName: "Run tests"
${{ if eq(parameters.tbtype, 't0-sonic') }}:
continueOnError: true

- script: |
# save dut state if test fails
Expand Down
91 changes: 52 additions & 39 deletions .azure-pipelines/template-commonlib.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
jobs:
- job: Build
timeoutInMinutes: 120
pool: sonicbld
variables:
- template: template-variables.yml
steps:
- checkout: self
clean: true
submodules: recursive
- script: |
set -ex
branch=$(Build.SourceBranchName)
# DIST_MASTER is set in variable.
BRANCH=DIST_${branch^^}
bldenvs=${!BRANCH}
[ "$bldenvs" == "" ] && bldenvs="$(COMMON_LIB_BUILD_ENVS)"
for bldenv in $bldenvs
do
BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y
done
set +x
echo "##vso[task.setvariable variable=bldenvs;]$bldenvs"
displayName: Make configure
- script: |
set -ex
for bldenv in $(bldenvs)
do
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/")
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
parameters:
- name: archs
type: object
default:
- amd64
- armhf
- arm64

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/")
SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work target/debs/$bldenv/libyang_${LIBYANG_VERSION}_amd64.deb
done
mv target $(Build.ArtifactStagingDirectory)
displayName: Make common lib packages
- publish: $(Build.ArtifactStagingDirectory)
artifact: common-lib
jobs:
- ${{ each arch in parameters.archs }}:
- job: Build_${{ arch }}
timeoutInMinutes: 120
${{ if eq(arch,'amd64') }}:
pool: sonicbld
${{ else }}:
pool: sonicbld-${{ arch }}
variables:
- template: template-variables.yml
steps:
- checkout: self
clean: true
submodules: recursive
- script: |
set -ex
branch=$(Build.SourceBranchName)
# replace all: '-' -> '_'
branch=${branch//-/_}
# replace all: 'a' -> 'A', DIST_MASTER is set in variable.
BRANCH=DIST_${branch^^}
# variable name is dynamic
bldenvs=${!BRANCH}
[ "$bldenvs" == "" ] && bldenvs="$(COMMON_LIB_BUILD_ENVS)"
for bldenv in $bldenvs
do
BLDENV=$bldenv make -f Makefile.work configure PLATFORM_ARCH=${{ arch }} PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y
done
set +x
echo "##vso[task.setvariable variable=bldenvs;]$bldenvs"
displayName: Make configure
- script: |
set -ex
for bldenv in $(bldenvs)
do
SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work lib-packages ENABLE_DOCKER_BASE_PULL=y
done
mv target $(Build.ArtifactStagingDirectory)
displayName: Make common lib packages
- ${{ if eq(arch,'amd64') }}:
- publish: $(Build.ArtifactStagingDirectory)
artifact: common-lib
- ${{ else }}:
- publish: $(Build.ArtifactStagingDirectory)
artifact: common-lib.${{ arch }}
62 changes: 62 additions & 0 deletions .azure-pipelines/trigger-publish-artifacts-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# The steps to trigger the pipeline to publish the artifacts

parameters:
- name: artifactName
type: string
default: ""
- name: publishPrefix
type: string
default: "$(Build.DefinitionName)/$(Build.SourceBranchName)"

steps:
- script: |
. functions.sh
sonic_version=$(sonic_get_version)
latest_tag=$(git describe --tags --abbrev=0)
docker_tags="$sonic_version $(Build.SourceBranchName)"
if [ "$(Build.SourceBranchName)" == "master" ]; then
docker_tags="$docker_tags latest"
fi
echo "##vso[task.setvariable variable=sonic_version]$sonic_version"
echo "##vso[task.setvariable variable=latest_tag]$latest_tag"
echo "##vso[task.setvariable variable=docker_tags]$docker_tags"
displayName: 'Set trigger build variables'
- task: TriggerBuild@4
inputs:
definitionIsInCurrentTeamProject: false
teamProject: internal
tfsServer: $(System.CollectionUri)
buildDefinition: 'publish-artifacts'
queueBuildForUserThatTriggeredBuild: true
ignoreSslCertificateErrors: false
useSameSourceVersion: false
useCustomSourceVersion: false
useSameBranch: false
waitForQueuedBuildsToFinish: false
storeInEnvironmentVariable: true
authenticationMethod: 'Personal Access Token'
password: '$(system.accesstoken)'
enableBuildInQueueCondition: false
dependentOnSuccessfulBuildCondition: false
dependentOnFailedBuildCondition: false
checkbuildsoncurrentbranch: false
failTaskIfConditionsAreNotFulfilled: false
buildParameters: ''
templateParameters: |
pipelineContext: {"buildId":"$(Build.BuildId)",
"pipelineId":"$(System.DefinitionId)",
"project": "$(System.TeamProject)",
"branchName":"$(Build.SourceBranchName)"},
artifactContext: {"artifactName":"${{ parameters.artifactName }}",
"artifactPatterns":"**/*.bin\n
**/*.swi\n
**/*.raw\n
**/*.img.gz\n
**/*-rpc.gz\n
**/python-saithrift*.deb"},
publishContext: {"publishPrefix":"${{ parameters.publishPrefix }}",
"keepArtifactName":false,
"dockerImagePatterns":"target/*-rpc.gz",
"dockerTags":"$(docker_tags)",
"version":"$(sonic_version)",
"latestTag":"$(latest_tag)"}
74 changes: 73 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
/Makefile.work @qiluo-msft @xumia @lguohan
/slave.mk @qiluo-msft @xumia @lguohan
/scripts @qiluo-msft @xumia @lguohan
/src/sonic-build-hooks/ @Azure/sonic-build
/src/debootstrap/ @Azure/sonic-build
/src/sonic-fips/ @Azure/sonic-build

# installer
/installer/ @qiluo-msft
Expand All @@ -31,8 +34,77 @@
/dockers/docker-config-engine*/ @qiluo-msft
/dockers/docker-snmp/ @qiluo-msft

# src
# kernel
/src/sonic-linux-kernel/ @Azure/sonic-kernel

# devices
/device/ @Azure/sonic-platform
/src/sonic-platform-common/ @Azure/sonic-platform
/src/sonic-platform-daemons/ @Azure/sonic-platform
/src/sonic-platform-pde/ @Azure/sonic-platform
/src/lm-sensors/ @Azure/sonic-platform
/src/flashrom/ @Azure/sonic-platform

# common library
/src/initramfs-tools/ @qiluo-msft
/src/redis-dump-load/ @Azure/sonic-management
/src/sonic-py-common/ @Azure/sonic-management
/src/sonic-py-swsssdk/ @Azure/sonic-management
/src/sonic-swss-common/ @Azure/sonic-management
/src/bash/ @Azure/sonic-management
/src/tacacs/ @Azure/sonic-management
/src/radius/ @Azure/sonic-management
/src/swig/ @Azure/sonic-management
/src/socat/ @Azure/sonic-management

# redis
/src/redis/ @Azure/sonic-management
/src/hiredis/ @Azure/sonic-management

# yang
/src/sonic-yang-models/ @praveen-li @dgsudharsan @rathnasabapathyv @venkatmahalingam @qiluo-msft
/src/sonic-yang-mgmt/ @Azure/sonic-management
/src/libyang/ @Azure/sonic-management
/src/libyang1/ @Azure/sonic-management
/src/libyang2/ @Azure/sonic-management

# bgpcfgd
/src/sonic-bgpcfgd/ @StormLiangMS

# sonic-config-engine
/src/sonic-config-engine/ @Azure/sonic-management

# sonic-utilities
/src/sonic-utilities/ @Azure/sonic-management

# sonic-telemetry
/src/sonic-telemetry/ @Azure/sonic-management

# snmp
/src/sonic-snmpagent/ @Azure/sonic-management
/src/snmpd/ @Azure/sonic-management

# dhcp relay
/src/dhcp6relay/ @Azure/sonic-fundamentals
/src/dhcpmon/ @Azure/sonic-fundamentals
/src/isc-dhcp/ @Azure/sonic-fundamentals

# sflow
/src/sflow/ @Azure/sonic-dataplane

# sonic restapi
/src/sonic-restapi/ @Azure/sonic-dataplane

# sonic swss
/src/sonic-swss/ @Azure/sonic-dataplane

# linux networking, e.g., libnl3, iproute2, ifupdown2, ethtool
/src/libnl3/ @Azure/sonic-dataplane
/src/iproute2/ @Azure/sonic-dataplane
/src/ifupdown2/ @Azure/sonic-dataplane
/src/ethtool/ @Azure/sonic-dataplane

# ptf
/src/ptf/ @Azure/sonic-fundamentals
/src/ptf-py3/ @Azure/sonic-fundamentals
/src/scapy/ @Azure/sonic-fundamentals
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ target/
*.img
*.pyc

# Slave docker log files
sonic-slave*/*.log

# Autogenerated Dockerfiles
sonic-slave*/Dockerfile
sonic-slave*/Dockerfile.user
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
[submodule "src/sonic-frr/frr"]
path = src/sonic-frr/frr
url = https://github.com/Azure/sonic-frr.git
branch = frr/7.5
branch = frr/8.2
[submodule "platform/p4/p4-hlir/p4-hlir-v1.1"]
path = platform/p4/p4-hlir/p4-hlir-v1.1
url = https://github.com/p4lang/p4-hlir.git
Expand Down
11 changes: 9 additions & 2 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,18 @@ endif

endif

SPLIT_LOG = | tee

DOCKER_BASE_LOG = $(SLAVE_DIR)/$(SLAVE_BASE_IMAGE)_$(SLAVE_BASE_TAG).log
DOCKER_LOG = $(SLAVE_DIR)/$(SLAVE_IMAGE)_$(SLAVE_TAG).log


DOCKER_BASE_BUILD = docker build --no-cache \
-t $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) \
--build-arg http_proxy=$(http_proxy) \
--build-arg https_proxy=$(https_proxy) \
--build-arg no_proxy=$(no_proxy) \
$(SLAVE_DIR)
$(SLAVE_DIR) $(SPLIT_LOG) $(DOCKER_BASE_LOG)

DOCKER_BASE_PULL = docker pull \
$(REGISTRY_SERVER):$(REGISTRY_PORT)/$(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG)
Expand All @@ -312,7 +318,7 @@ DOCKER_BUILD = docker build --no-cache \
--build-arg slave_base_tag_ref=$(SLAVE_BASE_TAG) \
-t $(SLAVE_IMAGE):$(SLAVE_TAG) \
-f $(SLAVE_DIR)/Dockerfile.user \
$(SLAVE_DIR)
$(SLAVE_DIR) $(SPLIT_LOG) $(DOCKER_LOG)

SONIC_BUILD_INSTRUCTION := make \
-f slave.mk \
Expand Down Expand Up @@ -354,6 +360,7 @@ SONIC_BUILD_INSTRUCTION := make \
SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD=$(SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD) \
SONIC_INCLUDE_SYSTEM_TELEMETRY=$(INCLUDE_SYSTEM_TELEMETRY) \
INCLUDE_DHCP_RELAY=$(INCLUDE_DHCP_RELAY) \
INCLUDE_MACSEC=$(INCLUDE_MACSEC) \
SONIC_INCLUDE_RESTAPI=$(INCLUDE_RESTAPI) \
SONIC_INCLUDE_ACMS=$(INCLUDE_ACMS) \
SONIC_INCLUDE_VNET_MONITOR=$(INCLUDE_VNET_MONITOR) \
Expand Down
14 changes: 14 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,17 @@ stages:
tbname: vms-kvm-t1-lag
ptf_name: ptf_vms6-2
tbtype: t1-lag

- job:
pool: sonictest-sonic-t0
displayName: "kvmtest-t0-sonic"
timeoutInMinutes: 360

steps:
- template: .azure-pipelines/run-test-template.yml
parameters:
dut: vlab-02
tbname: vms-kvm-t0-64-32
ptf_name: ptf_vms6-1
tbtype: t0-sonic
vmtype: vsonic
8 changes: 6 additions & 2 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CONFIGURED_ARCH=$([ -f .arch ] && cat .arch || echo amd64)
## docker engine version (with platform)
DOCKER_VERSION=5:20.10.14~3-0~debian-$IMAGE_DISTRO
CONTAINERD_IO_VERSION=1.5.11-1
LINUX_KERNEL_VERSION=5.10.0-8-2
LINUX_KERNEL_VERSION=5.10.0-12-2

## Working directory to prepare the file system
FILESYSTEM_ROOT=./fsroot
Expand Down Expand Up @@ -189,6 +189,10 @@ sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/arista-
sudo cp files/initramfs-tools/resize-rootfs $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/resize-rootfs
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/resize-rootfs

# Hook into initramfs: upgrade SSD from initramfs
sudo cp files/initramfs-tools/ssd-upgrade $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/ssd-upgrade
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/ssd-upgrade

# Hook into initramfs: run fsck to repair a non-clean filesystem prior to be mounted
sudo cp files/initramfs-tools/fsck-rootfs $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/fsck-rootfs
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/fsck-rootfs
Expand Down Expand Up @@ -663,5 +667,5 @@ fi
pushd $FILESYSTEM_ROOT && sudo tar czf $OLDPWD/$FILESYSTEM_DOCKERFS -C ${DOCKERFS_PATH}var/lib/docker .; popd

## Compress together with /boot, /var/lib/docker and $PLATFORM_DIR as an installer payload zip file
pushd $FILESYSTEM_ROOT && sudo zip --symlinks $OLDPWD/$ONIE_INSTALLER_PAYLOAD -r boot/ $PLATFORM_DIR/; popd
pushd $FILESYSTEM_ROOT && sudo zip $OLDPWD/$ONIE_INSTALLER_PAYLOAD -r boot/ $PLATFORM_DIR/; popd
sudo zip -g -n .squashfs:.gz $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS $FILESYSTEM_DOCKERFS
Loading

0 comments on commit a1e7352

Please sign in to comment.