Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…to nba610-initial-support
  • Loading branch information
andrewsapronov committed Jun 19, 2022
2 parents 730560f + ed99ce0 commit 0fbb1c2
Show file tree
Hide file tree
Showing 566 changed files with 48,510 additions and 2,328 deletions.
1 change: 1 addition & 0 deletions .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
platform_rpc: nephos

buildSteps:
- template: template-skipvstest.yml
- bash: |
set -ex
if [ $(GROUP_NAME) == vs ]; then
Expand Down
15 changes: 9 additions & 6 deletions .azure-pipelines/azure-pipelines-image-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,23 @@ jobs:
ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure
displayName: 'Make configure'
postSteps:
- script: mv target $(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"
- template: trigger-publish-artifacts-build.yml
parameters:
artifactName: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)'
publishPrefix: '$(Build.DefinitionName)/$(Build.SourceBranchName)/$(GROUP_NAME)'
- ${{ 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
2 changes: 2 additions & 0 deletions .azure-pipelines/run-test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ steps:
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 }}
12 changes: 12 additions & 0 deletions .azure-pipelines/template-skipvstest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
steps:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- script: |
set -ex
tar_branch=origin/$(System.PullRequest.TargetBranch)
git diff $tar_branch..HEAD --name-only | grep -v -f .azure-pipelines/vstest-exclude && exit 0
git diff $tar_branch..HEAD --name-only | grep -f .azure-pipelines/vstest-include && exit 0
set +x
echo "Skip vstest jobs"
echo "##vso[task.setvariable variable=SKIP_VSTEST;isOutput=true]YES"
name: SetVar
displayName: "Check if vstest is needed."
1 change: 1 addition & 0 deletions .azure-pipelines/template-variables.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
variables:
DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io'
COMMON_LIB_BUILD_ENVS: 'bullseye'
SONIC_SLAVE_DOCKER_DRIVER: 'overlay2'
2 changes: 0 additions & 2 deletions .azure-pipelines/trigger-publish-artifacts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ steps:
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"
condition: ne(variables['Build.Reason'], 'PullRequest')
displayName: 'Set trigger build variables'
- task: TriggerBuild@4
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
definitionIsInCurrentTeamProject: false
teamProject: internal
Expand Down
3 changes: 3 additions & 0 deletions .azure-pipelines/vstest-exclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
^platform
^.azure-pipelines
^files/build/versions
2 changes: 2 additions & 0 deletions .azure-pipelines/vstest-include
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
^platform/vs
^.azure-pipelines/run-test-template.yml
74 changes: 73 additions & 1 deletion .github/CODEOWNERS
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
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205

#### Description for the changelog
<!--
Expand Down
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
20 changes: 17 additions & 3 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ MULTIARCH_QEMU_ENVIRON = y
endif
endif
SLAVE_IMAGE = $(SLAVE_BASE_IMAGE)-$(USER_LC)
DOCKER_ROOT = $(PWD)/fsroot.docker.$(BLDENV)

# Support FIPS feature, armhf not supported yet
ifeq ($(PLATFORM_ARCH),armhf)
Expand Down Expand Up @@ -181,6 +182,7 @@ endif
DOCKER_LOCKFILE_SAVE := $(DOCKER_LOCKDIR)/docker_save.lock
$(shell mkdir -m 0777 -p $(DOCKER_LOCKDIR))
$(shell [ -f $(DOCKER_LOCKFILE_SAVE) ] || (touch $(DOCKER_LOCKFILE_SAVE) && chmod 0777 $(DOCKER_LOCKFILE_SAVE)))
$(shell sudo rm -rf $(DOCKER_ROOT) && mkdir -p $(DOCKER_ROOT))

ifeq ($(DOCKER_BUILDER_MOUNT),)
override DOCKER_BUILDER_MOUNT := "$(PWD):/sonic"
Expand All @@ -200,6 +202,11 @@ DOCKER_RUN := docker run --rm=true --privileged --init \
-i$(shell { if [ -t 0 ]; then echo t; fi }) \
$(SONIC_BUILDER_EXTRA_CMDLINE)

# Mount the $(DOCKER_ROOT) to /var/lib/docker in the slave container, the overlay fs is not supported as dockerd root folder.
ifneq ($(filter $(SONIC_SLAVE_DOCKER_DRIVER),overlay overlay2),)
DOCKER_RUN += -v $(DOCKER_ROOT):/var/lib/docker
endif

ifneq ($(DOCKER_BUILDER_USER_MOUNT),)
DOCKER_RUN += $(foreach mount,$(subst $(comma), ,$(DOCKER_BUILDER_USER_MOUNT)), $(addprefix -v , $(mount)))
endif
Expand Down Expand Up @@ -294,12 +301,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 +325,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 @@ -370,6 +383,7 @@ SONIC_BUILD_INSTRUCTION := make \
ENABLE_ASAN=$(ENABLE_ASAN) \
ENABLE_FIPS_FEATURE=$(ENABLE_FIPS_FEATURE) \
ENABLE_FIPS=$(ENABLE_FIPS) \
SONIC_SLAVE_DOCKER_DRIVER=$(SONIC_SLAVE_DOCKER_DRIVER) \
$(SONIC_OVERRIDE_BUILD_VARS)

.PHONY: sonic-slave-build sonic-slave-bash init reset
Expand Down Expand Up @@ -457,7 +471,7 @@ reset :
@read ans && (
if [ $$ans == y ]; then
echo "Resetting local repository. Please wait...";
$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) sudo rm -rf fsroot;
sudo rm -rf fsroot*;
if [ "$(MULTIARCH_QEMU_ENVIRON)" == y ] && [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then
echo "Stopping march $(CONFIGURED_ARCH) docker"
sudo kill -9 `sudo cat /var/run/march/docker.pid` || true
Expand Down
3 changes: 2 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ stages:

- stage: Test
dependsOn: BuildVS
condition: and(ne(stageDependencies.BuildVS.outputs['vs.SetVar.SKIP_VSTEST'], 'YES'), succeeded())
variables:
- name: inventory
value: veos_vtb
Expand Down Expand Up @@ -184,7 +185,7 @@ stages:
- job:
pool: sonictest-t1-lag
displayName: "kvmtest-t1-lag"
timeoutInMinutes: 240
timeoutInMinutes: 300

steps:
- template: .azure-pipelines/run-test-template.yml
Expand Down
4 changes: 2 additions & 2 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ rm /files/etc/ssh/sshd_config/ClientAliveCountMax
touch /files/etc/ssh/sshd_config/EmptyLineHack
rename /files/etc/ssh/sshd_config/EmptyLineHack ""
set /files/etc/ssh/sshd_config/ClientAliveInterval 900
set /files/etc/ssh/sshd_config/ClientAliveCountMax 0
set /files/etc/ssh/sshd_config/ClientAliveCountMax 1
ins #comment before /files/etc/ssh/sshd_config/ClientAliveInterval
set /files/etc/ssh/sshd_config/#comment[following-sibling::*[1][self::ClientAliveInterval]] "Close inactive client sessions after 15 minutes"
save
Expand Down Expand Up @@ -647,5 +647,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 0fbb1c2

Please sign in to comment.