Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mellanox] Redirect ethtool stderr to subprocess for better error log #150

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4027147
Align API get_device_runtime_metadata() for python version < 3.9 (#11…
abdosi Aug 31, 2022
c601f24
[Arista7050cx3] TD3 SKU changes for pg headroom value after interop t…
developfast Aug 31, 2022
46292d7
Add linux perf tool to sonic image (#11906)
Junchao-Mellanox Aug 31, 2022
6e878a3
[mux] Exit to write `standby` state to `active-active` ports (#11821)
lolyu Aug 31, 2022
353b274
[YANG] Create YANG Model for Console (#11806)
Blueve Aug 31, 2022
88191b0
Add python-is-python3 package for bullseye base docker (#11895)
ZhaohuiS Sep 1, 2022
fdd9130
[YANG] Add MUX_CABLE yang model (#11797)
zjswhhh Sep 1, 2022
f82c1fd
Z9432F kernel dependency of platform module (#11941)
arunlk-dell Sep 1, 2022
030de9f
[actions] Add github context env in label action. (#11926)
liushilongbuaa Sep 2, 2022
a762b35
[arp_update]: Set failed IPv6 neighbors to incomplete (#11919)
theasianpianist Sep 2, 2022
a684392
[mux] skip mux operations during warm shutdown (#11937)
yxieca Sep 2, 2022
750e1b3
Define whether a test is required by code (#11921)
yejianquan Sep 2, 2022
e96ec5a
[kernel]: Submodule update (#11947)
theasianpianist Sep 2, 2022
71d63a7
New commits in swss-common: (#11954)
renukamanavalan Sep 3, 2022
6a54bc4
Streaming structured events implementation (#11848)
zbud-msft Sep 3, 2022
78eeeb7
[SN2201] remove extra empty lines in the pg_profile_lookup.ini (#11923)
keboliu Sep 4, 2022
4e18510
[submodule]] Advance sonic-utilities pointer (#11897)
dprital Sep 4, 2022
1b5d07f
[submodule] Advance sonic-platform-daemons pointer (#11882)
dprital Sep 4, 2022
a8b2a53
[docker-wait-any] immediately start to wait (#11595)
stepanblyschak Sep 6, 2022
31e750e
Fix PR build failure (#11973)
renukamanavalan Sep 6, 2022
5efd6f9
[macsec]: Add MACsec clear CLI support (#11731)
Pterosaur Sep 7, 2022
3b9bbf7
[doc]: Update README.md (#11960)
mdanish-kh Sep 7, 2022
38cc35f
support for static-route yang model (#11932)
UmaMaven Sep 7, 2022
280160d
Redirect ethtool stderr to subprocess for better error log
Junchao-Mellanox Sep 8, 2022
0a516eb
Change log level
Junchao-Mellanox Sep 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: approve
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
set -e
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
Expand Down
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PG lossless profiles.
# speed cable size xon xoff threshold xon_offset
50000 5m 4608 4608 33792 0 4608
100000 5m 4608 4608 49408 0 4608
50000 40m 4608 4608 36352 0 4608
100000 40m 4608 4608 54528 0 4608
50000 300m 4608 4608 55296 0 4608
100000 300m 4608 4608 92672 0 4608
50000 5m 4608 4608 160000 0 4608
100000 5m 4608 4608 160000 0 4608
50000 40m 4608 4608 160000 0 4608
100000 40m 4608 4608 160000 0 4608
50000 300m 4608 4608 160000 0 4608
100000 300m 4608 4608 160000 0 4608
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PG lossless profiles.
# speed cable size xon xoff threshold xon_offset
50000 5m 4608 4608 79872 0 4608
100000 5m 4608 4608 54528 0 4608
50000 40m 4608 4608 39936 0 4608
100000 40m 4608 4608 60416 0 4608
50000 300m 4608 4608 61440 0 4608
100000 300m 4608 4608 103680 0 4608
50000 5m 4608 4608 160000 0 4608
100000 5m 4608 4608 160000 0 4608
50000 40m 4608 4608 160000 0 4608
100000 40m 4608 4608 160000 0 4608
50000 300m 4608 4608 160000 0 4608
100000 300m 4608 4608 160000 0 4608
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
## See the License for the specific language governing permissions and
## limitations under the License.
##

# PG lossless profiles.
# speed cable size xon xoff threshold
100 5m 49152 19456 29696 0
Expand Down
1 change: 1 addition & 0 deletions dockers/docker-base-bullseye/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ RUN apt-get update && \
python3 \
python3-distutils \
python3-pip \
python-is-python3 \
vim-tiny \
# Install redis-tools
redis-tools \
Expand Down
36 changes: 36 additions & 0 deletions dockers/docker-eventd/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name
ARG image_version
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf

# Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

# Update apt's cache of available packages
RUN apt-get update

{% if docker_eventd_debs.strip() -%}
# Copy built Debian packages
{{ copy_files("debs/", docker_eventd_debs.split(' '), "/debs/") }}

# Install built Debian packages and implicitly install their dependencies
{{ install_debian_packages(docker_eventd_debs.split(' ')) }}
{%- endif %}

# Clean up
RUN apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /debs

COPY ["start.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["critical_processes", "/etc/supervisor"]

ENTRYPOINT ["/usr/local/bin/supervisord"]
1 change: 1 addition & 0 deletions dockers/docker-eventd/critical_processes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
program:eventd
6 changes: 6 additions & 0 deletions dockers/docker-eventd/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

if [ "${RUNTIME_OWNER}" == "" ]; then
RUNTIME_OWNER="kube"
fi

52 changes: 52 additions & 0 deletions dockers/docker-eventd/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[supervisord]
logfile_maxbytes=1MB
logfile_backups=2
nodaemon=true

[eventlistener:dependent-startup]
command=python3 -m supervisord_dependent_startup
autostart=true
autorestart=unexpected
startretries=0
exitcodes=0,3
events=PROCESS_STATE
buffer_size=1024

[eventlistener:supervisor-proc-exit-listener]
command=/usr/bin/supervisor-proc-exit-listener --container-name eventd
events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING
autostart=true
autorestart=unexpected
buffer_size=1024

[program:rsyslogd]
command=/usr/sbin/rsyslogd -n -iNONE
priority=1
autostart=false
autorestart=unexpected
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true

[program:start]
command=/usr/bin/start.sh
priority=2
autostart=false
autorestart=false
startsecs=0
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=rsyslogd:running


[program:eventd]
command=/usr/sbin/eventd
priority=3
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=start:exited

6 changes: 6 additions & 0 deletions dockers/docker-fpm-frr/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,15 @@ COPY ["TSC", "/usr/bin/TSC"]
COPY ["TS", "/usr/bin/TS"]
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
COPY ["zsocket.sh", "/usr/bin/"]
COPY ["*.json", "/etc/rsyslog.d/"]
# COPY ["files/rsyslog_plugin.conf.j2", "/etc/rsyslog.d/"]
RUN chmod a+x /usr/bin/TSA && \
chmod a+x /usr/bin/TSB && \
chmod a+x /usr/bin/TSC && \
chmod a+x /usr/bin/zsocket.sh

# RUN j2 -f json /etc/rsyslog.d/rsyslog_plugin.conf.j2 /etc/rsyslog.d/events_info.json > /etc/rsyslog.d/bgp_events.conf
# RUN rm -f /etc/rsyslog.d/rsyslog_plugin.conf.j2*
RUN rm -f /etc/rsyslog.d/events_info.json*

ENTRYPOINT ["/usr/bin/docker_init.sh"]
8 changes: 8 additions & 0 deletions dockers/docker-fpm-frr/bgp_regex.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"tag": "bgp-state",
"regex": "Peer .default\\|([0-9a-f:.]*[0-9a-f]*). admin state is set to .(up|down).",
"params": [ "ip", "status" ]
}
]

10 changes: 10 additions & 0 deletions dockers/docker-fpm-frr/events_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"yang_module": "sonic-events-bgp",
"proclist": [
{
"name": "bgp",
"parse_json": "bgp_regex.json"
}
]
}

36 changes: 36 additions & 0 deletions dockers/docker-macsec/cli/clear/plugins/clear_macsec_counter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import os
import click

import show.plugins.macsec as show_macsec
import utilities_common.cli as clicommon
from sonic_py_common import multi_asic

@click.group(cls=clicommon.AliasedGroup)
def macsec():
pass


@macsec.command('macsec')
@click.option('--clean-cache', type=bool, required=False, default=False, help="If the option of clean cache is true, next show commands will show the raw counters which based on the service booted instead of the last clear command.")
def macsec_clear_counters(clean_cache):
"""
Clear MACsec counts.
This clear command will generated a cache for next show commands which will base on this cache as the zero baseline to show the increment of counters.
"""

if clean_cache:
for namespace in multi_asic.get_namespace_list():
if os.path.isfile(show_macsec.CACHE_FILE.format(namespace)):
os.remove(show_macsec.CACHE_FILE.format(namespace))
print("Cleaned cache")
return

clicommon.run_command("show macsec --dump-file")
print("Clear MACsec counters")

def register(cli):
cli.add_command(macsec_clear_counters)


if __name__ == '__main__':
macsec_clear_counters(None)
Loading