Commit Graph

50 Commits

Author SHA1 Message Date
Junchao-Mellanox
bc9b39a2fe Stop PMON before swss during warm reboot (#10046)
- Why I did it
Stopping swss and syncd causes some driver module unloading. Those driver modules are depended by PMON. This could trigger ERROR logs in syslog.

- How I did it
Adjust warmboot shutdown order in make file

- How to verify it
Manual test
2022-03-01 20:13:09 +00:00
Samuel Angebault
e7c26fb0c9
[Arista] Update platform configurations and library (#7527)
Platform library changes
 - Fix the use of /proc/modules during testing, fixes #7463
 - Add `libsfp-eeprom.so` build to read/write xcvr eeproms in C
 - Add some more reboot-cause information
 - Write down temperature hw thresholds to the sensors
 - Report software thresholds through platform api
 - Writ `port_name sysfs` file of optoe`
 - Tests enhancements
 - Fix dependency issues for chassis provisioning

Platform configuration changes
 - Add `pcie.yaml` configuration for a few platforms
 - Mount `libsfp-eeprom.so` inside `pmon`
 - Fix `Arista-7050SX3-48C8` and `Arista-7050SX3-48YC8' platform and hwsku
 - Miscellaneous fixes

Co-authored-by: Boyang Yu <byu@arista.com>
Co-authored-by: Zhi Yuan Carl Zhao <zyzhao@arista.com>
2021-05-06 10:59:22 -07:00
Stepan Blyshchak
cd2c86eab6
[dockers] label SONiC Docker with manifest (#5939)
Signed-off-by: Stepan Blyschak stepanb@nvidia.com

This PR is part of SONiC Application Extension

Depends on #5938

- Why I did it
To provide an infrastructure change in order to support SONiC Application Extension feature.

- How I did it
Label every installable SONiC Docker with a minimal required manifest and auto-generate packages.json file based on
installed SONiC images.

- How to verify it
Build an image, execute the following command:

admin@sonic:~$ docker inspect docker-snmp:1.0.0 | jq '.[0].Config.Labels["com.azure.sonic.manifest"]' -r | jq
Cat /var/lib/sonic-package-manager/packages.json file to verify all dockers are listed there.
2021-04-26 13:51:50 -07:00
shlomibitton
43d4d45645
Backport ethtool to support QSFP-DD (#5725)
Backport ethtool debian package version 5.9 to support QSFP-DD cable parsing.

Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
2021-03-16 09:56:53 -07:00
fk410167
20f0f069c1
Making PDDF 2.0 base classes python3 compliant (#6924)
- Made python2 to python3 changes
- Removed ord() func as python3 return int instead of str
- Had to change chr(..) to bytes([..]) function while using ctypes class methods
2021-03-01 09:48:59 -08:00
Junchao-Mellanox
51f896b33e
Add pmon daemons python3 build support (#6176)
**- Why I did it**

python2 is end of life and SONiC is going to support python3. This PR is going to support:

1. Build pmon daemons with python3
2. Install and run python3 version pmon daemons

**- How I did it**

1. Change pmon daemons make files to build bothe python2 and python3 whl
2. Change docker-platform-monitor make files to install both python2 and python3 whl
3. Change pmon docker startup files to start pmon daemons according to the supported platform API version
2020-12-28 10:19:24 -08:00
Joe LeVeque
d40c9a1e8d
[docker-base-buster][docker-config-engine-buster] No longer install Python 2 (#6162)
**- Why I did it**

As part of migrating SONiC codebase from Python 2 to Python 3

**- How I did it**

- No longer install Python 2 in docker-base-buster or docker-config-engine-buster.
- Install Python 2 and pip2 in the following containers until we can completely eliminate it there:
    - docker-platform-monitor
    - docker-sonic-mgmt-framework
    - docker-sonic-vs
- Pin pip2 version <21 where it is still temporarily needed, as pip version 21 will drop support for Python 2
- Also preform some other cleanup, ensuring that pip3, setuptools and wheel packages are installed in docker-base-buster, and then removing any attempts to re-install them in derived containers
2020-12-25 21:29:25 -08:00
Renuka Manavalan
ba02209141
First cut image update for kubernetes support. (#5421)
* First cut image update for kubernetes support.
With this,
    1)  dockers dhcp_relay, lldp, pmon, radv, snmp, telemetry are enabled
        for kube management
        init_cfg.json configure set_owner as kube for these

    2)  Each docker's start.sh updated to call container_startup.py to register going up
          As part of this call, it registers the current owner as local/kube and its version
          The images are built with its version ingrained into image during build

    3)  Update all docker's bash script to call 'container start/stop/wait' instead of 'docker start/stop/wait'.
         For all locally managed containers, it calls docker commands, hence no change for locally managed.
        
    4)  Introduced a new ctrmgrd service, that helps with transition between owners as  kube & local and carry over any labels update from STATE-DB to API server

    5)  hostcfgd updated to handle owner change

    6) Reboot scripts are updatd to tag kube running images as local, so upon reboot they run the same image.

   7) Added kube_commands.py to handle all updates with Kubernetes API serrver -- dedicated for k8s interaction only.
2020-12-22 08:01:33 -08:00
mprabhu-nokia
00cea080af
Chassisd to monitor cards in a modular chassis (#5523)
HLD: Azure/SONiC#646

Introducing chassisd process to monitor status of the control, line and fabric cards in a modular chassis.

- Why I did it
Modular Chassis has control-cards, line-cards and fabric-cards along with other peripherals. Chassisd will be a central entity that has visibility of the entire chassis.

- How I did it
Chassisd process will monitor cards in the main thread. Another configuation_handling_task is created to listen to CONFIG_DB for admin_status up/down events. The monitored status is persisted in REDIS-DB.
2020-12-15 16:28:58 -08:00
Junchao-Mellanox
51c77b179f
[Mellanox] Add python3 support for Mellanox platform API (#6175)
python2 is end of life and SONiC is going to support python3. This PR is going to support:

1. Mellanox SONiC platform API python3 support
2. Install both python2 and python3 verson of Mellanox SONiC platform API or pmon and host side
2020-12-11 10:51:31 -08:00
Joe LeVeque
83f0d8240e
[pmon]: Install vanilla 'thrift' Python 2 and 3 packages for Barefoot in host and PMon (#6080)
Barefoot platform vendors' sonic_platform packages import the Python 'thrift' library. Previously, our custom-built package was being installed in the PMon container and host OS. However, we are only building a Python 2 version of that package, which was only intended for use with saithrift.

Fixes #6077
2020-12-04 08:41:17 -08:00
fk410167
a3dd3f55f9
Platform Driver Developement Framework (PDDF) (#4756)
This change introduces PDDF which is described here: https://github.com/Azure/SONiC/pull/536

Most of the platform bring up effort goes in developing the platform device drivers, SONiC platform APIs and validating them. Typically each platform vendor writes their own drivers and platform APIs which is very tailor made to that platform. This involves writing code, building, installing it on the target platform devices and testing. Many of the details of the platform are hard coded into these drivers, from the HW spec. They go through this cycle repetitively till everything works fine, and is validated before upstreaming the code.
PDDF aims to make this platform driver and platform APIs development process much simpler by providing a data driven development framework. This is enabled by:

JSON descriptor files for platform data
Generic data-driven drivers for various devices
Generic SONiC platform APIs
Vendor specific extensions for customisation and extensibility

Signed-off-by: Fuzail Khan <fuzail.khan@broadcom.com>
2020-11-12 10:22:38 -08:00
Samuel Angebault
12911ba619
[Arista] Update arista driver submodules (#5736)
- Change `/run/arista` mount to pmon by `/var/run/platform_cache`
 - Python3 by default for Arista platform initialisation
 - Fix outstanding py2/3 compatibility issues (eeprom mostly)
 - Use pytest for unit testing
 - Miscellaneous modular fixes
2020-10-30 04:17:30 -07:00
Samuel Angebault
5bfe37ca42
[Arista] Update driver submodules (#5686)
- Enable thermalctld support for our platforms
 - Fix Chassis.get_num_sfp which had an off by one
 - Implement read_eeprom and write_eeprom in SfpBase
 - Refactor of Psus and PsuSlots. Psus they are now detected and metadata reported
 - Improvements to modular support

Co-authored-by: Zhi Yuan Carl Zhao <zyzhao@arista.com>
2020-10-23 12:28:36 -07:00
Volodymyr Boiko
d71a4efe3b
[sonic-platform-common] Install Python 3 package in host OS and PMon container (#5461)
Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
2020-09-29 13:57:54 -07:00
Samuel Angebault
6f4ef03b29
[arista] Update driver submodules (#5147)
- fix watchdog timeout units
- fix import path for thermal_manager
- remove arista bind mounts for docker-snmp
- improve arista bind mounts for pmon
2020-08-21 10:38:35 -07:00
Joe LeVeque
6132ae34fe
[build] Build/install remaining platform daemons as Python wheel packages (#5188)
As part of migrating all Python-based package installers to wheel format rather than Debian packages. Also to allow for easily building a Python 3 version of the package in the near future. ledd and psud were converted in earlier PRs. This PR converts the remainder:

- pcied
- syseepromd
- thermalctld
- xcvrd
2020-08-15 08:42:11 -07:00
Joe LeVeque
c3202d8982
[build] Build/install sonic-psud as a Python wheel package (#5182)
As part of migrating all Python-based package installers to wheel format rather than Debian packages. Also to allow for easily building a Python 3 version of the package in the near future.
2020-08-14 11:11:45 -07:00
Joe LeVeque
fc9e97fc3d
[build] Build/install sonic-ledd as a Python wheel package (#5168)
As part of migrating all Python-based package installers to wheel format rather than Debian packages. Also to allow for easily building a Python 3 version of the package in the near future.

- Also remove some references to sonic-daemon-base which I previously missed and add missing sonic-py-common dependency for sonic-pcied.
2020-08-13 11:26:43 -07:00
Sujin Kang
02a98add92
Add pcied to PMON docker to monitor the PCIe device status (#5000)
* Add pcied to PMON container

* remove tailing spaces

* update pmon submodule

* review comments

* rebase to the latest
2020-07-29 11:27:49 -07:00
Joe LeVeque
c0d1616f89
Introduce sonic-py-common package (#5003)
Consolidate common SONiC Python-language functionality into one shared package (sonic-py-common) and eliminate duplicate code.

The package currently includes three modules:

- daemon_base
- device_info
- logger
2020-07-26 23:15:41 -07:00
Stepan Blyshchak
16a37d8c17
[dockers] update mellanox syncd and pmon to buster (#4818)
Upgrade to libsensors5

Updated sonic-sairedis pointer:
    d54bfb4 [SAI] update pointer (#636)
    1885a8c [syncd] Fix notification on shutdown request (#635)
    9e57ba2 Fixing hostif For Genetlink host interfaces (#633)
    449a092 sonic-sairedis: Add support to sonic-sairedis for gearbox phys (#632)

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
2020-07-18 03:46:15 -07:00
Junchao-Mellanox
be549db395
Add thermal control support for SONiC (#3949) 2020-03-09 10:41:10 -07:00
SuvarnaMeenakshi
c9483796dc [baseimage]: support building multi-asic component (#3856)
- move single instance services into their own folder
- generate Systemd templates for any multi-instance service files in slave.mk
- detect single or multi-instance platform in systemd-sonic-generator based on asic.conf platform specific file.
- update container hostname after creation instead of during creation (docker_image_ctl)
- run Docker containers in a network namespace if specified
- add a service to create a simulated multi-ASIC topology on the virtual switch platform

Signed-off-by: Lawrence Lee <t-lale@microsoft.com>
Signed-off-by: Suvarna Meenakshi <Suvarna.Meenaksh@microsoft.com>
2020-01-26 13:56:42 -08:00
yozhao101
4fa3a1e27e [Services] Restart Platform-monitor service upon unexpected critical process exit. (#3689)
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
2019-11-04 17:44:01 -08:00
Andriy Moroz
976850fc00 [submodule update] Add SSD Health tools (#3218)
Signed-off-by: Andriy Moroz <c_andriym@mellanox.com>
2019-10-04 10:52:58 -07:00
zzhiyuan
2095d6ec03 [devices]: Update arista submodule (#3431)
- Add support for fans in new platform API
- Mount platform API in pmon for arista platforms
2019-09-10 14:37:05 -07:00
Andriy Kokhan
4eb356874e [platform]: fixed syseeprom access for BFN platform (#3216)
Signed-off-by: Andriy Kokhan <akokhan@barefootnetworks.com>
2019-07-25 08:43:30 -07:00
Renuka Manavalan
76bf5a0bc4 [build]: Added debug symbols to many debug dockers. (#3098)
* Added debug symbols to many debug dockers.

* For debug images *only*:
1) Archive source files into debug image
2) Archived source is copied into /src
3) Created an empty dir /debug
4) Mount both /src as ro & /debug as rw into every docker
5) Login banner will give some details on /src & /debug
6) Devs can copy core file into /debug and view it from inside a container.
7) Dev may create all gdb logs and other data directly into /debug.

* Dropped redundant REDIS_TOOLS per review comments.

* Added debug symbols to frr package and hence FRR based BGP docker.

* 1) Moved dbg_files.sh to scripts/
2) Src directories to archive are now collected from individual Makefiles.
3) Added few more debug symbols
4) Added few more debug dockers.

Here after no more changes except per review comments.

To debug:
Install required version of debug image in Switch or VM.
Copy core file into /debug of host
Get into Docker
gdb /usr/bin/<daemon> -c /debug/<your core file>
set directory /src/... <-- inside gdb to get the source

For non-in-depth debugging:

Download corresponding debug Docker image (docker-...-dbg.gz) to your VM
Load the image
Run image with entrypoint as 'bash' with dir containing core mapped in.
Run gdb on the core.
2019-07-03 22:13:55 -07:00
Kebo Liu
8a08595006 [Pmon] Add new daemon "syseepromd" to pmon docker (#2866) 2019-06-18 11:02:24 -07:00
Renuka Manavalan
ba0ca01ee0 [build]: Makefile: Extend to build debug docker images for all stretch dockers (#2789)
Overall goal: Build debug images for every stretch docker.

An earlier PR (#2789) made the first cut, by transforming broadcom/orchagent to build target/docker-orhagent-dbg.gz.

Changes in this PR:

Made docker-orchagent build to be platform independent.
1.1) Created rules/docker_orchagent.mk
1.2) Removed platform//docker-orchagent-*.mk
1.3) Removed the corresponding entry from platform//rules.mk

Extended the debug docker image build to stretch based syncd dockers.
2.1) For now, only mellanox & barefoot are stretch based.
2.2) All the common variable definitions are put in one place platform/template/docker-syncd-base.mk
2.3) platform/[mellanox, bfn]/docker-syncd-[mlnx, bfn].mk are updated as detailed below.
2.3.1) Set platform code and include template base file
2.3.2) Add the dependencies & debug dependencies and any update over what base template offers.

Extended all stretch based non-platform dockers to build debug dockers too.
3.1) Affected are:
docker-database.mk,
docker-platform-monitor.mk,
docker-router-advertiser.mk,
docker-teamd.mk,
docker-telemetry.mk

Next: Build debug flavor of final images with regular dockers replaced with debug dockers where available.
2019-04-19 18:49:21 -07:00
Wirut Getbamrung
27803ec603 [docker-platform-monitor]: Add smartmontools 6.6-1 (#2703) 2019-04-10 21:55:54 -07:00
Mykola F
33818d6b26 [pmon]: fix lm-sensors binaries build (#2749)
Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>
2019-04-05 15:10:54 -07:00
Mykola F
3826ffd30f [pmon] move platform monitor docker to stretch (#2680)
Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>
2019-03-22 16:42:56 -07:00
Kevin(Shengkai) Wang
fa84c4226b [sonic-daemon-base] Create DaemonBase class for all daemons (#2570)
DaemonBase is to wrap the common function of daemons, such as logging,
signal handling, db connector, load specific platform plugins.

Signed-off-by: Kevin Wang <kevinw@mellanox.com>
2019-03-06 08:55:43 +02:00
Kevin(Shengkai) Wang
a9d2bf37e1 [mellanox] Implement PSU related APIs based on the new platform API (#2460)
* Implement part of PSU related APIs including get_status(), get_presence()

Signed-off-by: Kevin Wang <kevinw@mellanox.com>
2019-02-13 15:21:07 +02:00
lguohan
f20665008c
[build]: put stretch debian packages under target/debs/stretch/ (#2519)
* [build]: put stretch debian packages under target/debs/stretch/

* in stretch build phase, all debian packages built in that stage are placed under target/debs/stretch directory.
* for python-based debian packages, since they are really the same for jessie and stretch, they are placed under target/python-debs directory.

Signed-off-by: Guohan Lu <gulv@microsoft.com>
2019-02-04 22:06:37 -08:00
Kevin(Shengkai) Wang
b3abf9af7f [docker-platform-monitor] add psud daemon to Pmon (#2423)
* Add psud daemon to pmon container
* Update submodule sonic-platform-daemons

Submodule update sonic-platform-daemons:

e5d8155 - [sonic-psud] add a new daemon sonic-psud to platform monitor (#20)

Signed-off-by: Kevin Wang <kevinw@mellanox.com>
2019-01-15 21:24:47 -08:00
Kebo Liu
38beca654c [docker-platform-monitor] make file and supervisord conf change for new xcvrd deamon (#1840)
* [docker-platform-monitor] make file and supervisord conf change for new xcvrd deamon

* make file change for the new daemon
* supervisord conf change for the new daemon

signed-off-by Liu Kebo kebol@mellanox.com

* make xcvrd start sequence aligned with the supervisord conf

* update submodules to include xcvrd modification
2018-08-03 16:33:56 -07:00
Joe LeVeque
1df7c9a993
[docker-platform-monitor] Convert ledd from polling-based to subscription-based model (#1623) 2018-04-20 10:42:19 -07:00
Joe LeVeque
ab26a5c589
Install sonic-platform-common package in platform-monitor docker for ledd (#1330)
* Install sonic-platform-common package in platform-monitor docker for ledd

* Specify Python wheel dependencies in docker-platform-monitor.mk; Remove explicit specifications from Dockerfile.j2
2018-01-22 10:52:52 -08:00
Samuel Angebault
bc73082922 [devices]: Add led plugin for Arista 7060CX-32S and 7260CX3-64 (#945)
* Bump sonic-platform-modules-arista submodule

* Allow image specific mount option for containers

* Add led plugin for DCS-7060CX-32S

* Add led plugin for DCS-7260CX3-64
2017-09-11 15:29:42 -07:00
Taoyu Li
b6efe438b5 Introduce ConfigDB (#808)
* [cfggen] Support reading from and writing to configdb
* [bgp] Move bgp_admin_state to configdb, support dynamic admin state change
* [sonic-utilities] Adapt configDB for admin status, support config save and config load
2017-08-01 19:02:00 -07:00
lguohan
d9cf398855 [pmon]: add swsssdk dependency for pmon docker (#700) 2017-06-12 21:13:11 -07:00
Joe LeVeque
d094ceecc2 [docker-platform-monitor]: Add LED control daemon and plugin for x86_64-arista_7050_qx32 platform (#691)
* Add files for building ledd package; add ledd to docker-platform-monitor; Control platform monitor docker using supervisord

* Add sonic-platform-daemons submodule

* Rename ledd.mk -> sonic-ledd.mk

* Add led_control.py plugin for x86_64-arista_7050_qx32 platform

* Rename Dockerfile -> Dockerfile.j2

* Fix build

* Remove blank line
2017-06-10 22:05:11 -07:00
lguohan
b6753e7960 [docker-config-engine]: introduce docker sonic config engine (#274)
* [docker-config-engine]: introduce docker sonic config engine

sonic config engine provide the sonic configure engine for all sonic
dockers that rely on the engine to generate runtime configuration.
2017-02-07 18:11:19 -08:00
Oleksandr Ivantsiv
53a9792014 [Makefile]: Add possibility for docker containers to install files to base image (#240)
- Add vtysh/lldpctl/sensors to baseimage
2017-02-07 00:33:20 -08:00
Oleksandr Ivantsiv
d6f0c4611b Add platform-monitor container to one image. (#232) 2017-02-01 13:02:08 -08:00
Taoyu Li
4fe1bdcf87 sonic-cfggen with sonicv2 dockers (#190)
Add a sonic-config-engine to help generate config file based on minigraph and other data on runtime. Modify fpm, teamd, lldp, snmp, and platform-monitor docker to use sonic-config-engine to generate config in docker upon load.
2017-01-19 20:56:26 -08:00
Marian Pritsak
e9098b99fb Build improvements (#80)
* Build improvements

Fix dependencies
Add configuration options
Automatically build sonic-slave

* Set default number of jobs to 1

* Auto generate target/debs directory

Signed-off-by: marian-pritsak <marianp@mellanox.com>

* Automatically remove sonic-slave container after exit

* Silence clean-logs

* Add SONIC_CLEAN_TARGETS to clean

* Use second expansion for clean dependencies

* Avoid creating empty log files

Remove log file on flush instead of writing empty string

* Put dpkg install inside lock

Use same lock as debian install targets do to avoid
race condition in dpkg installation

* Remove redirect to log from docker save

* Add .platform dependency to all and clean targets

* Remove header and footer from clean targets

* Disable messages for SONIC_CLEAN_TARGETS

* Exit with error if dpkg-buildpackage fails

* Set new location for debs in build_debian.sh

* Add recipe for docker-database

* Update redis version to 3.2.4

* Add support for p4 platform

* Add recipe for snmpd

* Add slave targets to phony and make all target default

* Remove build.sh from thrift

* Add versioning to team, nl, hiredis and initramfs

* Change sonic-slave to support snmpd build from sources

* Remove src/tenjin

* Add recipe for lldpd

* Add recipe for mpdecimal

* Remove hiredis directory on rebuild

* Add recipe for Mellanox hw management

* Remove generic image from all targets for Mellanox

* Add support for python wheels

* Add lldp and snmp dockers

* Sync docker-database to include libjemalloc

* Fix asyncsnmp variable name

* Change default build configuration

Redirect output to log files by default
Set number of jobs to nproc value
Do not print dependencies
Fix logging to print log of failed job into console

* Use docker inspect to check if sonic-slave image exists

* Use config in slave.mk directly

* Disable color output by default

* Remove sswsdk dependency from lldp and snmp dockers

* Fix comment in py wheels install targets

* Add dependency between two versions of sswsdk

* Add containers to mellanox platform

lldp, snmp and database containers

* Add recipe for team docker

* Add team docker to mellanox platform

* Encrypt password passed to build_debian.sh

* Update mellanox SAI version

Make version and revision setting only in main recipe

* Fix error handling in makefiles

As makefiles use .ONESHELL we should add -e
option to shell options in order to exit after any command fails

* Add recipe for platform monitor image

* Add platfotm monitor to mellanox targets

* Ignore submodules when building base image
2016-12-05 11:12:19 -08:00