Skip to content

Commit

Permalink
Merge branch 'master' into mellanox_security
Browse files Browse the repository at this point in the history
  • Loading branch information
maipbui committed Sep 16, 2022
2 parents 98ef8c2 + a1b50ca commit bd9cf87
Show file tree
Hide file tree
Showing 195 changed files with 8,616 additions and 320 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/official-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ stages:
variables:
- name: CACHE_MODE
value: wcache
- template: azure-pipelines-repd-build-variables.yml@buildimage
- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage
jobs:
- template: azure-pipelines-build.yml
parameters:
Expand Down
3 changes: 0 additions & 3 deletions .azure-pipelines/run-test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ 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, 'multi-asic-t1-lag-pr') }}:
continueOnError: true

- script: |
# save dut state if test fails
virsh_version=$(virsh --version)
Expand Down
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

#### Ensure to add label/tag for the feature raised. example - [PR#2174](https://github.com/sonic-net/sonic-utilities/pull/2174) where, Generic Config and Update feature has been labelled as GCU.

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ jobs:
label:
runs-on: ubuntu-latest
steps:
- name: approve
run: |
set -e
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
url=$(echo $GITHUB_CONTEXT | jq -r '.event.pull_request._links.html.href')
echo PR: $url
gh pr review $url --approve
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
31 changes: 10 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
[![Mellanox](https://dev.azure.com/mssonic/build/_apis/build/status/mellanox/Azure.sonic-buildimage.official.mellanox?branchName=master&label=Mellanox)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=139&branchName=master)
[![Marvell(armhf)](https://dev.azure.com/mssonic/build/_apis/build/status/marvell/Azure.sonic-buildimage.official.marvell-armhf?branchName=master&label=Marvell-armhf)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=141&branchName=master)
[![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=master&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=master)
[![P4](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/buildimage-p4-all/badge/icon?subject=P4)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/buildimage-p4-all)
[![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=master&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=master)

*202205 builds*:
Expand Down Expand Up @@ -70,25 +69,13 @@
[![Nephos](https://dev.azure.com/mssonic/build/_apis/build/status/nephos/Azure.sonic-buildimage.official.nephos?branchName=201811&label=Nephos)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=149&branchName=201811)
[![VS](https://dev.azure.com/mssonic/build/_apis/build/status/vs/Azure.sonic-buildimage.official.vs?branchName=201811&label=VS)](https://dev.azure.com/mssonic/build/_build/latest?definitionId=142&branchName=201811)

*201807 builds*:

[![Broadcom](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201807/badge/icon?subject=Broadcom)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201807/)
[![Barefoot](https://sonic-jenkins.westus2.cloudapp.azure.com/job/barefoot/job/buildimage-bf-201807/badge/icon?subject=Barefoot)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/barefoot/job/buildimage-bf-201807/)

*201803 builds*:

[![Broadcom](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201803/badge/icon?subject=Broadcom)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201803/)
[![Nephos](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/job/buildimage-nephos-201803/badge/icon?subject=Nephos)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/job/buildimage-nephos-201803/)
[![Marvell](https://sonic-jenkins.westus2.cloudapp.azure.com/job/marvell/job/buildimage-mrvl-201803/badge/icon?subject=Marvell)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/marvell/job/buildimage-mrvl-201803/)
[![Mellanox](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-201803/badge/icon?subject=Mellanox)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-201803/)

# sonic-buildimage

## Build SONiC Switch Images

# Description

Following is the instruction on how to build an [(ONIE)](https://github.com/opencomputeproject/onie) compatible network operating system (NOS) installer image for network switches, and also how to build docker images running inside the NOS. Note that SONiC image are build per ASIC platform. Switches using the same ASIC platform share a common image. For a list of supported switches and ASIC, please refer to this [list](https://github.com/sonic-net/SONiC/wiki/Supported-Devices-and-Platforms)
Following are the instructions on how to build an [(ONIE)](https://github.com/opencomputeproject/onie) compatible network operating system (NOS) installer image for network switches, and also how to build docker images running inside the NOS. Note that SONiC images are build per ASIC platform. Switches using the same ASIC platform share a common image. For a list of supported switches and ASIC, please refer to this [list](https://github.com/sonic-net/SONiC/wiki/Supported-Devices-and-Platforms)

# Hardware

Expand Down Expand Up @@ -156,12 +143,14 @@ To build SONiC installer image and docker images, run the following commands:
- PLATFORM=vs

## Usage for ARM Architecture
To build Arm32 bit for (ARMHF) platform
ARM build has dependency in docker version 18,
if docker version is 19, downgrade to 18 as below
sudo apt-get install --allow-downgrades -y docker-ce=5:18.09.0~3-0~ubuntu-xenial
sudo apt-get install --allow-downgrades -y docker-ce-cli=5:18.09.0~3-0~ubuntu-xenial

ARM build has dependency in docker version 18. If docker version is 19, downgrade to 18 with:
```
sudo apt-get install --allow-downgrades -y docker-ce=5:18.09.0~3-0~ubuntu-xenial
sudo apt-get install --allow-downgrades -y docker-ce-cli=5:18.09.0~3-0~ubuntu-xenial
```
To build Arm32 bit for (ARMHF) platform

# Execute make configure once to configure ASIC and ARCH

make configure PLATFORM=[ASIC_VENDOR] PLATFORM_ARCH=armhf
Expand All @@ -174,7 +163,7 @@ To build Arm32 bit for (ARMHF) platform

make target/sonic-marvell-armhf.bin

To build Arm32 bit for (ARMHF) Marvell platform on amd64 host for debian buster using cross-compilation run the following commands:
To build Arm32 bit for (ARMHF) Marvell platform on amd64 host for debian buster using cross-compilation, run the following commands:

# Execute make configure once to configure ASIC and ARCH for cross-compilation build

Expand Down Expand Up @@ -239,7 +228,7 @@ Every target has a clean target, so in order to clean swss, execute:
It is recommended to use clean targets to clean all packages that are built together, like dev packages for instance. In order to be more familiar with build process and make some changes to it, it is recommended to read this short [Documentation](README.buildsystem.md).

## Build debug dockers and debug SONiC installer image:
SONiC build system supports building dockers and ONIE-image with debug tools and debug symbols, to help with live & core debugging. For details refer to [(SONiC Buildimage Guide)](https://github.com/sonic-net/sonic-buildimage/blob/master/README.buildsystem.md).
SONiC build system supports building dockers and ONIE-image with debug tools and debug symbols, to help with live & core debugging. For details refer to [SONiC Buildimage Guide](https://github.com/sonic-net/sonic-buildimage/blob/master/README.buildsystem.md).

## SAI Version
Please refer to [SONiC roadmap](https://github.com/sonic-net/SONiC/wiki/Sonic-Roadmap-Planning) on the SAI version for each SONiC release.
Expand Down
15 changes: 10 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ stages:
- name: testbed_file
value: vtestbed.csv

# For every test job:
# continueOnError: false means it's a required test job and will block merge if it fails
# continueOnError: true means it's an optional test job and will not block merge even though it fails(unless a required test job depends on its result)

jobs:
- job:
pool: sonictest
Expand Down Expand Up @@ -133,7 +137,7 @@ stages:
pool: sonictest
displayName: "kvmtest-t0-part1"
timeoutInMinutes: 360

continueOnError: true
steps:
- template: .azure-pipelines/run-test-template.yml
parameters:
Expand All @@ -147,7 +151,7 @@ stages:
pool: sonictest
displayName: "kvmtest-t0-part2"
timeoutInMinutes: 360

continueOnError: true
steps:
- template: .azure-pipelines/run-test-template.yml
parameters:
Expand All @@ -165,6 +169,7 @@ stages:
- t0_part1
- t0_part2
condition: always()
continueOnError: false
variables:
resultOfPart1: $[ dependencies.t0_part1.result ]
resultOfPart2: $[ dependencies.t0_part2.result ]
Expand All @@ -183,7 +188,7 @@ stages:
pool: sonictest-t1-lag
displayName: "kvmtest-t1-lag"
timeoutInMinutes: 360

continueOnError: false
steps:
- template: .azure-pipelines/run-test-template.yml
parameters:
Expand All @@ -196,7 +201,7 @@ stages:
pool: sonictest-sonic-t0
displayName: "kvmtest-t0-sonic"
timeoutInMinutes: 360

continueOnError: true
steps:
- template: .azure-pipelines/run-test-template.yml
parameters:
Expand All @@ -210,7 +215,7 @@ stages:
pool: sonictest-ma
displayName: "kvmtest-multi-asic-t1-lag"
timeoutInMinutes: 240

continueOnError: true
steps:
- template: .azure-pipelines/run-test-template.yml
parameters:
Expand Down
3 changes: 2 additions & 1 deletion build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
fdisk \
gpg \
jq \
auditd
auditd \
linux-perf

# default rsyslog version is 8.2110.0 which has a bug on log rate limit,
# use backport version
Expand Down
7 changes: 6 additions & 1 deletion check_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def main():
passwd_prompt = 'Password:'
cmd_prompt = "{}@sonic:~\$ $".format(args.u)
grub_selection = "The highlighted entry will be executed"
firsttime_prompt = 'firsttime_exit'

i = 0
while True:
Expand All @@ -38,13 +39,17 @@ def main():

# bootup sonic image
while True:
i = p.expect([login_prompt, passwd_prompt, cmd_prompt])
i = p.expect([login_prompt, passwd_prompt, firsttime_prompt, cmd_prompt])
if i == 0:
# send user name
p.sendline(args.u)
elif i == 1:
# send password
p.sendline(args.P)
elif i == 2:
# fix a login timeout issue, caused by the login_prompt message mixed with the output message of the rc.local
time.sleep(1)
p.sendline()
else:
break

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
#port_init_autoneg=0
bcm_num_cos=8
stable_size=0x5500000
ifp_inports_support_enable=1
ipv6_lpm_128b_enable=0x1
l2xmsg_mode=1
l2_mem_entries=32768
l3_mem_entries=16384
lpm_scaling_enable=0
l3_alpm_enable=0
riot_enable=0
port_flex_enable=1
#


# XE/CE port mapping
pbmp_xport_xe=0x1e00000000000000

# MCQ0, MCQ1: QSGMII mode
port_gmii_mode_25=1
port_gmii_mode_41=1

# MQ16-0 (logical ports: P25 to P40)
# MQ16-0_0
portmap_25=25:1
portmap_26=26:1
portmap_27=27:1
portmap_28=28:1
# MQ16-0_1
portmap_29=29:1
portmap_30=30:1
portmap_31=31:1
portmap_32=32:1
# MQ16-0_2
portmap_33=33:1
portmap_34=34:1
portmap_35=35:1
portmap_36=36:1
# MQ16-0_3
portmap_37=37:1
portmap_38=38:1
portmap_39=39:1
portmap_40=40:1
# MQ16-1 (logical ports: P41 to P56)
# MQ16-1_0
portmap_41=41:1
portmap_42=42:1
portmap_43=43:1
portmap_44=44:1
# MQ16-1_2
portmap_45=49:1
portmap_46=50:1
portmap_47=51:1
portmap_48=52:1
# GPHY[5:0] (logical ports: P1 to P24)
portmap_1=1:1
portmap_2=2:1
portmap_3=3:1
portmap_4=4:1
portmap_5=5:1
portmap_6=6:1
portmap_7=7:1
portmap_8=8:1
portmap_9=9:1
portmap_10=10:1
portmap_11=11:1
portmap_12=12:1
portmap_13=13:1
portmap_14=14:1
portmap_15=15:1
portmap_16=16:1
portmap_17=17:1
portmap_18=18:1
portmap_19=19:1
portmap_20=20:1
portmap_21=21:1
portmap_22=22:1
portmap_23=23:1
portmap_24=24:1

# F16-0 (logical ports: P57 to P60)
portmap_57=57:25
portmap_58=58:25
portmap_59=59:25
portmap_60=60:25

# Specifies the base port and phy index of a multi slice phy chip
phy_port_primary_and_offset_1=0x0100
phy_port_primary_and_offset_2=0x0101
phy_port_primary_and_offset_3=0x0102
phy_port_primary_and_offset_4=0x0103
phy_port_primary_and_offset_5=0x0104
phy_port_primary_and_offset_6=0x0105
phy_port_primary_and_offset_7=0x0106
phy_port_primary_and_offset_8=0x0107

phy_port_primary_and_offset_9=0x0900
phy_port_primary_and_offset_10=0x0901
phy_port_primary_and_offset_11=0x0902
phy_port_primary_and_offset_12=0x0903
phy_port_primary_and_offset_13=0x0904
phy_port_primary_and_offset_14=0x0905
phy_port_primary_and_offset_15=0x0906
phy_port_primary_and_offset_16=0x0907

phy_port_primary_and_offset_17=0x1100
phy_port_primary_and_offset_18=0x1101
phy_port_primary_and_offset_19=0x1102
phy_port_primary_and_offset_20=0x1103
phy_port_primary_and_offset_21=0x1104
phy_port_primary_and_offset_22=0x1105
phy_port_primary_and_offset_23=0x1106
phy_port_primary_and_offset_24=0x1107

# Enable DPORT Mapping, to sync the mapping in ds ps with front panel port
dport_map_enable=1
dport_map_port_1=26
dport_map_port_2=25
dport_map_port_3=28
dport_map_port_4=27
dport_map_port_5=30
dport_map_port_6=29
dport_map_port_7=32
dport_map_port_8=31
dport_map_port_9=34
dport_map_port_10=33

dport_map_port_11=36
dport_map_port_12=35
dport_map_port_13=38
dport_map_port_14=37
dport_map_port_15=40
dport_map_port_16=39
dport_map_port_17=42
dport_map_port_18=41
dport_map_port_19=44
dport_map_port_20=43

dport_map_port_21=46
dport_map_port_22=45
dport_map_port_23=48
dport_map_port_24=47
dport_map_port_25=2
dport_map_port_26=1
dport_map_port_27=4
dport_map_port_28=3
dport_map_port_29=6
dport_map_port_30=5

dport_map_port_31=8
dport_map_port_32=7
dport_map_port_33=10
dport_map_port_34=9
dport_map_port_35=12
dport_map_port_36=11
dport_map_port_37=14
dport_map_port_38=13
dport_map_port_39=16
dport_map_port_40=15

dport_map_port_41=18
dport_map_port_42=17
dport_map_port_43=20
dport_map_port_44=19
dport_map_port_45=22
dport_map_port_46=21
dport_map_port_47=24
dport_map_port_48=23

dport_map_port_49=57
dport_map_port_50=58
dport_map_port_51=59
dport_map_port_52=60
Loading

0 comments on commit bd9cf87

Please sign in to comment.