- Notifications
You must be signed in to change notification settings - Fork644
SONiC Switch State Service (SwSS)
License
sonic-net/sonic-swss
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
static analysis:
sonic-swss builds:
The SWitch State Service (SWSS) is a collection of software that provides a database interface for communication with and state representation of network applications and network switch hardware.
Install the following dependencies:
sudo apt install redis-serversudo apt install libhiredis0.14sudo apt install libzmq5 libzmq3-devsudo apt install libboost-serialization1.74.0sudo apt install libboost1.71-devsudo apt install libasan6Note: If your are using Ubuntu 18.04, installlibhiredis0.13 instead.
Visit theofficial sonic-buildimage Azure pipeline for the VS platform and choose the branch that matches the sonic-swss branch you are trying to build or install. Then select the latest successful build.From the Summary tab, access build artifacts.
Download the foldersonic-buildimage.vs/target/debs/{your host machine's Debian code name}. You can check the Debian code name of your machine by runningcat /etc/debian_version.
Extract the downloaded zip file usingunzip sonic-buildimage.vs.zip. Then navigate tosonic-buildimage.vs/target/debs/{Debian code name}/ and install the following Debian packages:
sudo dpkg -i libdashapi_1.0.0_amd64.deb libnl-3-200_3.5.0-1_amd64.deb libnl-3-dev_3.5.0-1_amd64.deb libnl-cli-3-200_3.5.0-1_amd64.deb libnl-cli-3-dev_3.5.0-1_amd64.deb libnl-genl-3-200_3.5.0-1_amd64.deb libnl-genl-3-dev_3.5.0-1_amd64.deb libnl-nf-3-200_3.5.0-1_amd64.deb libnl-nf-3-dev_3.5.0-1_amd64.deb libnl-route-3-200_3.5.0-1_amd64.deb libnl-route-3-dev_3.5.0-1_amd64.deb libprotobuf32_3.21.12-3_amd64.deb libsaimetadata_1.0.0_amd64.deb libsaimetadata-dev_1.0.0_amd64.deb libsairedis_1.0.0_amd64.deb libsairedis-dev_1.0.0_amd64.deb libsaivs_1.0.0_amd64.deb libsaivs-dev_1.0.0_amd64.deb libswsscommon_1.0.0_amd64.deb libswsscommon-dev_1.0.0_amd64.deb libteam5_1.31-1_amd64.deb libteamdctl0_1.31-1_amd64.deb libyang_1.0.73_amd64.deb libyang-dev_1.0.73_amd64.deb python3-swsscommon_1.0.0_amd64.debNote: You can alsobuild these packages yourself (for the VS platform).
Now, you can either directly install the SONiC SWSS package or you can build it from source and then install it. To install the SONiC SWSS package that is already insonic-buildimage.vs/target/debs/{Debian code name}/, simply run the following command:
sudo dpkg -i swss_1.0.0_amd64.debInstall build dependencies:
sudo apt install libtoolsudo apt install autoconf automakesudo apt install dh-execsudo apt install nlohmann-json3-devsudo apt install libgmock-devClone thesonic-swss repository on your host machine:git clone https://github.com/sonic-net/sonic-swss.git.
Make sure that SAI header files exist in/usr/include/sai. Since you have already installedlibsairedis-dev,libsaimetadata-dev, andlibsaivs-dev, this should already be the case. If you have compiledlibsairedis yourself, make sure that the SAI header files are copied to/usr/include/sai.
You can compile and install from source using:
./autogen.sh./configuremake && sudo make installNote: This will NOT run the mock tests located undertests/mock_tests.
You can also build a debian package using:
./autogen.shfakeroot debian/rules binaryUnfortunately,libboost-serialization1.74.0 is not officially supported on Ubuntu 20.04 (focal) even though it is supported on Debian 11 (bullseye). Therefore, you must build this package from source. You can use a script similar tothis one, but you only need to create a package for the Boost serialization library. You should also make sure that the generated package is namedlibboost-serialization1.74.0. After the package is created, you can install it by runningsudo dpkg -i libboost-serialization1.74.0_1.74.0_amd64.deb.
If you cannot installlibzmq3-dev because of dependency issues, please check the version oflibkrb5 packages installed on your host machine:
sudo dpkg -l | grep "libkrb5"If the version is not1.17-6ubuntu4.7, then you need to install the correct version:
sudo apt install libkrb5support0=1.17-6ubuntu4.7sudo apt install libzmq3-devWarning: This may remove many packages that are already installed on your system. Please take note of what is being removed.
Note: Do NOT install*krb5* packages that are located in thesonic-buildimage.vs folder that you downloaded. These packages have a higher version and will cause dependency issues.
If you run into dependency issues during the installation of a package, you can runsudo apt -f install to fix the issue. But note that ifapt is unable to fix the dependency problem, it will attempt to remove the broken package(s).
If you get a C++ exception with the description "Too many open files" during the mock tests, you should check the maximum number of open files that are permitted on your system:
ulimit -a | grep "open files"You can increase it by executing this command:ulimit -n 8192. Feel free to change8192. This value worked fine for me.
Note: This change is only valid for the current terminal session. If you want a persistent change, appendulimit -n 8192 to~/.bashrc.
For general questions, setup help, or troubleshooting:
For bug reports or feature requests, please open an Issue.
See thecontributors guide for information about how to contribute.
We're following basic GitHub Flow. If you have no idea what we're talking about, check outGitHub'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 your@email.com
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: user@dev.null
- Each developer should fork this repository andadd 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
About
SONiC Switch State Service (SwSS)
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.