Skip to content

Commit

Permalink
Merge branch 'sonic-net:master' into featured
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekrnv authored Jul 14, 2023
2 parents 338a78a + 30959ec commit 136bfb9
Show file tree
Hide file tree
Showing 233 changed files with 18,609 additions and 424 deletions.
55 changes: 55 additions & 0 deletions .azure-pipelines/azure-pipelines-build-ubuntu-2004.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# C/C++ with GCC
# Build your C/C++ project with GCC using make.
# Add steps that publish test results, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc
pr: none

trigger:
batch: true
branches:
include:
- master

stages:
- stage: Build

jobs:
- job:
displayName: "amd64/ubuntu-20.04"
pool:
vmImage: 'ubuntu-20.04'

steps:
- checkout: self
submodules: true
- script: |
sudo apt-get update
sudo apt-get install -y make wget libtool m4 autoconf dh-exec libdebhelper-perl=13.6ubuntu1~bpo20.04.1 debhelper=13.6ubuntu1~bpo20.04.1 \
cmake pkg-config python3-pip python cmake libgtest-dev libgmock-dev libyang-dev \
debhelper-compat dh-elpa dh-sequence-python3 python3-all \
libpython3-all-dev python3-six xmlto unzip rake-compiler gem2deb pkg-php-tools \
ant default-jdk maven-repo-helper libguava-java
wget http://ftp.us.debian.org/debian/pool/main/libg/libgoogle-gson-java/libgoogle-gson-java_2.8.6-1+deb11u1_all.deb
sudo dpkg -i libgoogle-gson-java_2.8.6-1+deb11u1_all.deb
mkdir -p /tmp/artifacts
displayName: "Install dependencies"
- script: |
SONIC_CONFIG_MAKE_JOBS=$(nproc) CONFIGURED_ARCH=amd64 DEST=/tmp/artifacts make -f ../rules/protobuf.mk -f protobuf/Makefile
workingDirectory: src
displayName: "Build protobuf"
- script: |
sudo dpkg -i protobuf-compiler_3.21.12-3_amd64.deb libprotoc32_3.21.12-3_amd64.deb \
libprotobuf32_3.21.12-3_amd64.deb libprotobuf-dev_3.21.12-3_amd64.deb \
libprotobuf-lite32_3.21.12-3_amd64.deb
workingDirectory: /tmp/artifacts
displayName: "Install protobuf"
- script: |
dpkg-buildpackage -rfakeroot -b -us -uc
workingDirectory: src/sonic-dash-api
displayName: "Build sonic-dash-api"
- script: |
cp *.deb /tmp/artifacts
workingDirectory: src
- publish: /tmp/artifacts
artifact: sonic-buildimage.amd64.ubuntu20_04
displayName: "Archive sonic-buildimage debian packages for ubuntu20.04"
114 changes: 94 additions & 20 deletions .azure-pipelines/run-test-scheduler-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ parameters:
type: string
default: 1

- name: NUM_ASIC
type: number
default: 1

- name: TEST_SET
type: string
default: ""
Expand All @@ -34,13 +38,73 @@ parameters:
type: string
default: "ceos"

- name: TESTBED_NAME
type: string
default: ""

- name: IMAGE_URL
type: string
default: ""

- name: HWSKU
type: string
default: ""

- name: TEST_PLAN_TYPE
type: string
default: ""

- name: PLATFORM
type: string
default: ""

- name: SCRIPTS
type: string
default: ""

- name: FEATURES
type: string
default: ""

- name: SCRIPTS_EXCLUDE
type: string
default: ""

- name: FEATURES_EXCLUDE
type: string
default: ""

- name: REPO_NAME
type: string
default: ""

- name: MGMT_BRANCH
type: string
default: master
default: ""

- name: STOP_ON_FAILURE
type: string
default: ""

- name: NUM_ASIC
- name: RETRY_TIMES
type: string
default: ""

- name: DUMP_KVM_IF_FAIL
type: string
default: "True"
values:
- "True"
- "False"

- name: REQUESTER
type: string
default: ""

- name: MAX_RUN_TEST_MINUTES
type: number
default: 1
default: 480


steps:
- script: |
Expand All @@ -53,12 +117,20 @@ steps:
set -e
pip install PyYAML
rm -f new_test_plan_id.txt
python ./.azure-pipelines/test_plan.py create -t ${{ parameters.TOPOLOGY }} -o new_test_plan_id.txt \
--min-worker ${{ parameters.MIN_WORKER }} --max-worker ${{ parameters.MAX_WORKER }} \
--test-set ${{ parameters.TEST_SET }} --kvm-build-id $(KVM_BUILD_ID) \
--deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" --common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" \
--mgmt-branch ${{ parameters.MGMT_BRANCH }} --vm-type ${{ parameters.VM_TYPE }} \
python ./.azure-pipelines/test_plan.py create \
-t ${{ parameters.TOPOLOGY }} \
-o new_test_plan_id.txt \
--min-worker ${{ parameters.MIN_WORKER }} \
--max-worker ${{ parameters.MAX_WORKER }} \
--test-set ${{ parameters.TEST_SET }} \
--kvm-build-id $(KVM_BUILD_ID) \
--deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" \
--common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" \
--mgmt-branch ${{ parameters.MGMT_BRANCH }} \
--vm-type ${{ parameters.VM_TYPE }} \
--num-asic ${{ parameters.NUM_ASIC }}
TEST_PLAN_ID=`cat new_test_plan_id.txt`
echo "Created test plan $TEST_PLAN_ID"
Expand Down Expand Up @@ -104,18 +176,20 @@ steps:
env:
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
displayName: Run test
- script: |
set -e
echo "KVM dump"
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com"
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
# When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED"
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP
condition: succeededOrFailed()
env:
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
displayName: KVM dump
timeoutInMinutes: ${{ parameters.MAX_RUN_TEST_MINUTES }}
- ${{ if eq(parameters.DUMP_KVM_IF_FAIL, 'True') }}:
- script: |
set -e
echo "KVM dump"
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com"
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
# When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED"
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP
condition: succeededOrFailed()
env:
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
displayName: KVM dump
- script: |
set -e
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,6 @@
[submodule "src/dhcpmon"]
path = src/dhcpmon
url = https://github.com/sonic-net/sonic-dhcpmon.git
[submodule "src/sonic-dash-api/sonic-dash-api"]
path = src/sonic-dash-api/sonic-dash-api
url = https://github.com/sonic-net/sonic-dash-api.git
10 changes: 5 additions & 5 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ DOCKER_ROOT = $(PWD)/fsroot.docker.$(BLDENV)

# Support FIPS feature, armhf not supported yet
ifeq ($(PLATFORM_ARCH),armhf)
ENABLE_FIPS_FEATURE := n
INCLUDE_FIPS := n
ENABLE_FIPS := n
endif

ifeq ($(ENABLE_FIPS_FEATURE), n)
ifeq ($(INCLUDE_FIPS), n)
ifeq ($(ENABLE_FIPS), y)
$(error Cannot set fips config ENABLE_FIPS=y when ENABLE_FIPS_FEATURE=n)
$(error Cannot set fips config ENABLE_FIPS=y when INCLUDE_FIPS=n)
endif
endif

Expand All @@ -209,7 +209,7 @@ $(shell \
$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) \
MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) \
CROSS_BUILD_ENVIRON=$(CROSS_BUILD_ENVIRON) \
ENABLE_FIPS_FEATURE=$(ENABLE_FIPS_FEATURE) \
INCLUDE_FIPS=$(INCLUDE_FIPS) \
DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) \
DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \
GZ_COMPRESS_PROGRAM=$(GZ_COMPRESS_PROGRAM) \
Expand Down Expand Up @@ -559,7 +559,7 @@ SONIC_BUILD_INSTRUCTION := $(MAKE) \
ENABLE_ASAN=$(ENABLE_ASAN) \
SONIC_INCLUDE_BOOTCHART=$(INCLUDE_BOOTCHART) \
SONIC_ENABLE_BOOTCHART=$(ENABLE_BOOTCHART) \
ENABLE_FIPS_FEATURE=$(ENABLE_FIPS_FEATURE) \
INCLUDE_FIPS=$(INCLUDE_FIPS) \
ENABLE_FIPS=$(ENABLE_FIPS) \
SONIC_SLAVE_DOCKER_DRIVER=$(SONIC_SLAVE_DOCKER_DRIVER) \
MIRROR_URLS=$(MIRROR_URLS) \
Expand Down
30 changes: 18 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ stages:
TOPOLOGY: t0
MIN_WORKER: $(T0_INSTANCE_NUM)
MAX_WORKER: $(T0_INSTANCE_NUM)
MGMT_BRANCH: master

- job: t0_2vlans_elastictest
pool: ubuntu-20.04
Expand All @@ -170,6 +171,7 @@ stages:
TEST_SET: t0-2vlans
MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM)
MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM)
MGMT_BRANCH: master
DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a"

- job: t1_lag_elastictest
Expand All @@ -183,6 +185,7 @@ stages:
TOPOLOGY: t1-lag
MIN_WORKER: $(T1_LAG_INSTANCE_NUM)
MAX_WORKER: $(T1_LAG_INSTANCE_NUM)
MGMT_BRANCH: master

- job: multi_asic_elastictest
displayName: "kvmtest-multi-asic-t1-lag by Elastictest"
Expand All @@ -197,6 +200,7 @@ stages:
MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
NUM_ASIC: 4
MGMT_BRANCH: master

- job: dualtor_elastictest
pool: ubuntu-20.04
Expand All @@ -209,6 +213,7 @@ stages:
TOPOLOGY: dualtor
MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
MGMT_BRANCH: master
COMMON_EXTRA_PARAMS: "--disable_loganalyzer "

- job: sonic_t0_elastictest
Expand All @@ -223,18 +228,19 @@ stages:
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM)
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM)
TEST_SET: t0-sonic
MGMT_BRANCH: master
COMMON_EXTRA_PARAMS: "--neighbor_type=sonic "
VM_TYPE: vsonic

- job: wan_elastictest
displayName: "kvmtest-wan by Elastictest"
pool: ubuntu-20.04
timeoutInMinutes: 240
continueOnError: false
steps:
- template: .azure-pipelines/run-test-scheduler-template.yml
parameters:
TOPOLOGY: wan-pub
MIN_WORKER: $(WAN_INSTANCE_NUM)
MAX_WORKER: $(WAN_INSTANCE_NUM)
COMMON_EXTRA_PARAMS: "--skip_sanity "
# - job: wan_elastictest
# displayName: "kvmtest-wan by Elastictest"
# pool: ubuntu-20.04
# timeoutInMinutes: 240
# continueOnError: false
# steps:
# - template: .azure-pipelines/run-test-scheduler-template.yml
# parameters:
# TOPOLOGY: wan-pub
# MIN_WORKER: $(WAN_INSTANCE_NUM)
# MAX_WORKER: $(WAN_INSTANCE_NUM)
# COMMON_EXTRA_PARAMS: "--skip_sanity "
12 changes: 10 additions & 2 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ set -x -e
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
DOCKER_VERSION=5:24.0.2-1~debian.11~$IMAGE_DISTRO
CONTAINERD_IO_VERSION=1.6.21-1
LINUX_KERNEL_VERSION=5.10.0-18-2

## Working directory to prepare the file system
Expand Down Expand Up @@ -596,6 +596,14 @@ export built_by="$USER@$BUILD_HOSTNAME"
export sonic_os_version="${SONIC_OS_VERSION}"
j2 files/build_templates/sonic_version.yml.j2 | sudo tee $FILESYSTEM_ROOT/etc/sonic/sonic_version.yml

# Default users info
export password_expire="$( [[ "$CHANGE_DEFAULT_PASSWORD" == "y" ]] && echo true || echo false )"
export username="${USERNAME}"
export password="$(sudo grep ^${USERNAME} $FILESYSTEM_ROOT/etc/shadow | cut -d: -f2)"
j2 files/build_templates/default_users.json.j2 | sudo tee $FILESYSTEM_ROOT/etc/sonic/default_users.json
sudo LANG=c chroot $FILESYSTEM_ROOT chmod 600 /etc/sonic/default_users.json
sudo LANG=c chroot $FILESYSTEM_ROOT chown root:shadow /etc/sonic/default_users.json

## Copy over clean-up script
sudo cp ./files/scripts/core_cleanup.py $FILESYSTEM_ROOT/usr/bin/core_cleanup.py

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{%- set default_topo = 't0' %}
{%- include 'buffers_config.j2' %}
Loading

0 comments on commit 136bfb9

Please sign in to comment.