• Stars
    star
    157
  • Rank 238,399 (Top 5 %)
  • Language
    Python
  • License
    Other
  • Created over 8 years ago
  • Updated 24 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Command line utilities for the SONiC project

static analysis:

Total alerts Language grade: Python

sonic-utilities builds:

master build

202205 build

202012 build

SONiC: Software for Open Networking in the Cloud

sonic-utilities

Command-line utilities for SONiC

This repository produces two packages, as follows:

sonic-utilities

A Python wheel package, containing all the Python source code for the command-line utilities

Setting up a build/test environment

The sonic-utilities package depends on a number of other packages, many of which are available via PyPI, but some are part of the SONiC codebase. When building/testing the package, setuptools/pip will attempt to install the packages available from PyPI. However, you will need to manually build and install the SONiC dependencies before attempting to build or test the package.

Currently, this list of dependencies is as follows:

  • libyang_1.0.73_amd64.deb
  • libyang-cpp_1.0.73_amd64.deb
  • python3-yang_1.0.73_amd64.deb
  • redis_dump_load-1.1-py3-none-any.whl
  • sonic_py_common-1.0-py3-none-any.whl
  • sonic_config_engine-1.0-py3-none-any.whl
  • sonic_yang_mgmt-1.0-py3-none-any.whl
  • sonic_yang_models-1.0-py3-none-any.whl
  • python-swsscommon_1.0.0_amd64.deb

A convenient alternative is to let the SONiC build system configure a build enviroment for you. This can be done by cloning the sonic-buildimage repo, building the sonic-utilities package inside the Debian Buster slave container, and staying inside the container once the build finishes. During the build process, the SONiC build system will build and install all the necessary dependencies inside the container. After following the instructions to clone and initialize the sonic-buildimage repo, this can be done as follows:

  1. Configure the build environment for an ASIC type (any type will do, here we use generic)

    make configure PLATFORM=generic
    
  2. Build the sonic-utilities Python wheel package inside the Bullseye slave container, and tell the build system to keep the container alive when finished

    make NOSTRETCH=1 NOBUSTER=1 KEEP_SLAVE_ON=yes target/python-wheels/bullseye/sonic_utilities-1.2-py3-none-any.whl
    
  3. When the build finishes, your prompt will change to indicate you are inside the slave container. Change into the src/sonic-utilities/ directory

    user@911799f161a0:/sonic$ cd src/sonic-utilities/
    
  4. You can now make changes to the sonic-utilities source and build the package or run unit tests with the commands below. When finished, you can exit the container by calling exit.

To build

python3 setup.py bdist_wheel

To run unit tests

python3 setup.py test

sonic-utilities-data

A Debian package, containing data files needed by the utilities (bash_completion files, Jinja2 templates, etc.)

To build

Instructions for building the sonic-utilities-data package can be found in sonic-utilities-data/README.md


Contribution guide

Please read the contributor guide for more details on how to contribute.

All contributors must sign an Individual Contributor License Agreement (ICLA) before contributions can be accepted. This process is now automated via a GitHub bot when submitting new pull request. If the contributor has not yet signed a CLA, the bot will create a comment on the pull request containing a link to electronically sign the CLA.

GitHub Workflow

We're following basic GitHub Flow. If you have no idea what we're talking about, check out GitHub's official guide. Note that merge is only performed by the repository maintainer.

Guide for performing commits:

  • Isolate each commit to one component/bugfix/issue/feature
  • Use a standard commit message format:
[component/folder touched]: Description intent of your changes

[List of changes]

Signed-off-by: Your Name [email protected]

For example:

swss-common: Stabilize the ConsumerTable

* Fixing autoreconf
* Fixing unit-tests by adding checkers and initialize the DB before start
* Adding the ability to select from multiple channels
* Health-Monitor - The idea of the patch is that if something went wrong with the notification channel,
  we will have the option to know about it (Query the LLEN table length).

  Signed-off-by: John Doe [email protected]
  • Each developer should fork this repository and add the team as a Contributor
  • Push your changes to your private fork and do "pull-request" to this repository
  • Use a pull request to do code review
  • Use issues to keep track of what is going on

More Repositories

1

SONiC

Landing page for Software for Open Networking in the Cloud (SONiC) - https://sonic-net.github.io/SONiC/
HTML
2,232
star
2

sonic-buildimage

Scripts which perform an installable binary image build for SONiC
C
735
star
3

sonic-swss

SONiC Switch State Service (SwSS)
C++
174
star
4

sonic-mgmt

Configuration management examples for SONiC
Python
173
star
5

DASH

Disaggregated APIs for SONiC Hosts
Python
83
star
6

sonic-sairedis

SAI object interface to Redis database, as used in the SONiC project
C++
56
star
7

sonic-linux-kernel

Linux kernel drivers for SONiC project
Shell
48
star
8

sonic-platform-common

Python packages which provide a common interface to platform-specific hardware peripherals in SONiC
Python
46
star
9

sonic-swss-common

Common components for SONiC switch state service
C++
45
star
10

sonic-telemetry

SONiC telemetry, moved to https://github.com/sonic-net/sonic-gnmi
Go
38
star
11

sonic-frr

sonic frr
C
32
star
12

sonic-mgmt-framework

Python
30
star
13

sonic-pins

P4 Integrated Network Stack (PINS)
C++
30
star
14

sonic-restapi

restful api server
Python
23
star
15

sonic-platform-daemons

Platform module daemons for SONiC
Python
23
star
16

sonic-gnmi

SONiC gNMI server and gNOI repo
Go
17
star
17

sonic-snmpagent

A net-snmpd agentx subagent for SONiC
Python
14
star
18

sonic-quagga

Sonic quagga is a fork of savannah project quagga
C
13
star
19

sonic-py-swsssdk

Python SONiC switch state service sdk
Python
13
star
20

sonic-mgmt-common

Go
9
star
21

sonic-platform-modules-s6000

linux kernel drivers for dell S6000
C
7
star
22

sonic-dbsyncd

Python library for sonic/redis database syncing
Python
6
star
23

sonic-stp

C
6
star
24

sonic-wpa-supplicant

control plane MacSec
C
6
star
25

sonic-platform-vpp

C++
5
star
26

sonic-linkmgrd

Repo For SONiC Supporting Dual-ToRs
C++
4
star
27

sonic-platform-modules-dell

platform drivers for dell switches
C
4
star
28

sonic-dash-api

SONiC gNMI oriented DASH northbound API
C++
4
star
29

sonic-host-services

Python
3
star
30

sonic-ztp

Python
3
star
31

sonic-utilities.msft

3
star
32

sonic-dhcpmon

C++
2
star
33

sonic-dash-ha

SONiC SmartSwitch HA related services
Rust
2
star
34

sonic-platform-pdk-pde

Python
1
star
35

saibcm-modules

This repository contains the SDK GPL module from broadcom.
1
star
36

sonic-dhcp-relay

SONiC DHCP relay repo
C++
1
star
37

sonic-bmp

C++
1
star