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

Changes for LLDP docker to support multi-npu platforms #4530

Merged
merged 3 commits into from
May 11, 2020

Conversation

abdosi
Copy link
Contributor

@abdosi abdosi commented May 4, 2020

- Why I did it
To support lldp for multi-npu platforms following changes are done:
a) Enable LLDP for Host namespace for Management Port
b) Make sure Management IP is available in per asic namespace
needed for LLDP Chassis configuration
c) Make sure chassis mac-address is correct in per asic namespace
d) Do not run lldp on eth0 of per asic namespace and avoid chassis
configuration for same
e) Use Linux hostname instead from Device Metadata for lldp chassis
configuration since in multi-npu platforms device metadata hostname
will be different

- How I did it
Updated the lldp docker templates to use device metadata sub_role which will be specified
for multi-npu platforms

- How to verify it
Verified LLDP Neighbors and chassis configuration for both single npu and multi-npu platforms.

Copy link
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some questions. Can you please respond on them?

# update the hostname. Not using device metadata as in multi-npu platform each namespace
# has its own device metadata hostname. Using the hostname set by docker using host enviroment

sed -e "s/\${hostname}/$(hostname)/" -i /etc/lldpd.conf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where hostname is defined?

Copy link
Contributor Author

@abdosi abdosi May 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pavel-shirshov this is linux hostname based of /etc/host

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pavel-shirshov this change is no more applicable and we will continue to use Device Metadata hostname.

@@ -31,7 +31,11 @@ stderr_logfile=syslog
# - `-dd` means to stay in foreground, log warnings to console
# - `-ddd` means to stay in foreground, log warnings and info to console
# - `-dddd` means to stay in foreground, log all to console
{% if DEVICE_METADATA['localhost']['sub_role'] is defined and DEVICE_METADATA['localhost']['sub_role']|length %}
command=/usr/sbin/lldpd -d -I Ethernet* -C Ethernet*
{% else %}
command=/usr/sbin/lldpd -d -I Ethernet*,eth0 -C eth0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about rewritong this command line using sed,inside of supervisord.conf? And don't use jinja2 template for that?
We can change supervisor config in start.sh

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suggest to make this code generic, detect if there is eth0, if there is then use eth0, if there is no, do not add eth0 into the command line. it is better than templating based on the sub_role.

Copy link
Contributor Author

@abdosi abdosi May 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pavel-shirshov : I tried couple of things to avoid jinja2 template
a) supervisor environment variable
b) sed command
However both does not seems to work. supervisos.conf gets loaded whens supervisor comes up and seems there is some dependency we can't change run time from start.sh

@lguohan: eth0 is present both in container and host. So we cannot distinguish that, Do we need to check if container is using --net= host or not ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pavel-shirshov , what is the concern for using jinja2 template for supervisord.conf? if we can first generate and start supervisord, then we do not need to reload.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pavel-shirshov Based on above comment will be using jinja template for suerpvisor.conf

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lguohan It looks like we're going to have another snowflake in SONiC. Everywhere we start with "start.sh" script. Here the "start.sh" is not run on the start (So the name is misleading). And we have another start script, with another name. This is confusing.

dockers/docker-lldp-sv2/lldpd.conf.j2 Outdated Show resolved Hide resolved
a) Enable LLDP for Host namespace for Management Port
b) Make sure Management IP is avaliable in per asic namespace
   needed for LLDP Chassis configuration
c) Make sure chassis mac-address is correct in per asic namespace
d) Do not run lldp on eth0 of per asic namespace and avoid chassis
   configuration for same
e) Use Linux hostname instead from Device Metadata for lldp chassis
   configuration since in multi-npu platforms device metadata hostname
   will be differnt

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@abdosi abdosi force-pushed the multinpu_lldp branch 2 times, most recently from d9f1b54 to 16da822 Compare May 6, 2020 07:12
a) Use Device Metadata hostname even in per namespace conatiner.
   updated minigraph parsing for same to have hostname as system
   hostname and add new key for asic name

b) Minigraph changes to have MGMT_INTERFACE Key in per asic/namespace
   config also as needed for LLDP for setting chassis management IP.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
lguohan
lguohan previously approved these changes May 7, 2020
@abdosi
Copy link
Contributor Author

abdosi commented May 7, 2020

@pavel-shirshov can you please review/approve the PR.

Copy link
Contributor

@pavel-shirshov pavel-shirshov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please address the comment?

@@ -35,12 +35,13 @@ RUN apt-get purge -y python-pip && \
/python-wheels \
~/.cache

COPY ["docker-lldp-init.sh", "/usr/local/bin/"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please put the script into /usr/bin?
We never use /usr/local for anything (but agree it is more appropriate to put our own code).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abdosi
Copy link
Contributor Author

abdosi commented May 10, 2020

retest vsimage please

@abdosi abdosi merged commit a96f9ec into sonic-net:master May 11, 2020
@abdosi abdosi deleted the multinpu_lldp branch May 11, 2020 18:08
abdosi added a commit that referenced this pull request May 20, 2020
* Changes for LLDP for Multi NPU Platoforms:-
a) Enable LLDP for Host namespace for Management Port
b) Make sure Management IP is avaliable in per asic namespace
   needed for LLDP Chassis configuration
c) Make sure chassis mac-address is correct in per asic namespace
d) Do not run lldp on eth0 of per asic namespace and avoid chassis
   configuration for same
e) Use Linux hostname instead from Device Metadata for lldp chassis
   configuration since in multi-npu platforms device metadata hostname
   will be differnt

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>

* Address Review Comment with following changes:
a) Use Device Metadata hostname even in per namespace conatiner.
   updated minigraph parsing for same to have hostname as system
   hostname and add new key for asic name

b) Minigraph changes to have MGMT_INTERFACE Key in per asic/namespace
   config also as needed for LLDP for setting chassis management IP.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>

* Address Review Comments
bbinxie added a commit to SONIC-DEV/sonic-buildimage that referenced this pull request May 22, 2020
* [201911][devices] skip_fancontrol for wedge 100 barefoot platforms (sonic-net#4528)

* [device] DellEMC s5232f  50G hwsku support (sonic-net#4525)

* [device] DellEmc S5232 support for new hwsku C8D48
8 100G ports and 48 50G ports

* 10G ports update for S5232 hwsku-C8D48

Signed-off-by: Srideep Devireddy <srideep_devireddy@dell.com>

* DellEMC S6000 updated sensors.conf (sonic-net#4568)

Change PSU MAX temperature to 80 degree
Change tmp75 sensors default temperature value from 25/50 to 70/80 degree.

* [sonic-slave-stretch]: install same version for docker-ce and docker-ce-cli

difference versions can cause compatibility issue between the server and client

Signed-off-by: Guohan Lu <lguohan@gmail.com>

* [baseimage]: install same version for docker-ce and docker-ce-cli

Signed-off-by: Guohan Lu <lguohan@gmail.com>

* [FRR]: Update frr to latest 7.2.1-s3 (sonic-net#4294)

- Updated to latest frr 7.2.1 from the master.
- Updated patches accordingly

* [sonic-buildimage] updated minigraph for ACL Table data and ACL Interface Binding for Multi-NPU platforms (sonic-net#4491)

* [sonic-buildimage] updated minigraph for ACL Table data and ACL Interface
binding update for multu-npu platform based on subrole as "Frontend" or
"Backend". For backend npu no ACL table is associated. For frontend npu
only front-panel interface are associated.

Updated with test case and fix typo in sample-mingraph for npu

Address Review comments

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>

* Fixed the logic as per preview comment. Interface Filter logic
only applies to Everflow/Mirror tables.

* Address Review Comments.

* Changes for LLDP docker to support multi-npu platforms (sonic-net#4530)

* Changes for LLDP for Multi NPU Platoforms:-
a) Enable LLDP for Host namespace for Management Port
b) Make sure Management IP is avaliable in per asic namespace
   needed for LLDP Chassis configuration
c) Make sure chassis mac-address is correct in per asic namespace
d) Do not run lldp on eth0 of per asic namespace and avoid chassis
   configuration for same
e) Use Linux hostname instead from Device Metadata for lldp chassis
   configuration since in multi-npu platforms device metadata hostname
   will be differnt

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>

* Address Review Comment with following changes:
a) Use Device Metadata hostname even in per namespace conatiner.
   updated minigraph parsing for same to have hostname as system
   hostname and add new key for asic name

b) Minigraph changes to have MGMT_INTERFACE Key in per asic/namespace
   config also as needed for LLDP for setting chassis management IP.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>

* Address Review Comments

* Moved utility functions for multi-npu platforms from sonic-utilities to sonic_device_util.py (sonic-net#4559)

* Moved utility functions for multi-npu platforms from
sonic-utilities config/main.py to here so that they can be used
any module

* Fix the issue with test run during compilation with acl-uploader
PR#908 of sonic-utilities.

* Fix get_num_npu as it was retuning string and not int

* Address Review Comments

* Address Review Comments

* Fix for issue where image is compile with flag ENABLE_DHCP_GRAPH_SERVICE (sonic-net#4573)

and then we load image and reboot even if there was existing
config_db.json we will look for DHCP Service. we should disbale
update_graph in such cases. This behaviour is silimar to what we have in
201811 image.

* Change to enable redistribute connected on Frontend asics instead of backend asics (sonic-net#4588)

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>

* [DellEMC] S6000 Disable Low power mode by default (sonic-net#4592)

* [BFN] Updated Barefoot SDK to 2020-05-07 (sonic-net#4566)

Signed-off-by: Andriy Kokhan <akokhan@barefootnetworks.com>

* [minigraph] Add tags for egress mirror tables (sonic-net#4526)

Signed-off-by: Danny Allen <daall@microsoft.com>

* [Submodule update] sonic-utlities with PR's
[201911][show] Fix abbreviations for 'show ip bgp ...' commands (sonic-net#909)
Changes to support acl-loader and mirror-session config commands for
multi-npu platforms. (sonic-net#908)
Changes to commands  config reload/load-minigraph (sonic-net#919)
Stop/Start restapi server upon config reload (sonic-net#911)
[config] Add 'interface transceiver' subgroup with 'lpmode' and
'reset' subcommands (sonic-net#904)

* [minigraph] Support FECDisabled in minigraph parser (sonic-net#4556) (sonic-net#4624)

Signed-off-by: Qi Luo <qiluo-msft@users.noreply.github.com>

* [ntp] enable/disable NTP long jump according to reboot type (sonic-net#4577)

* [ntp] enable/disable NTP long jump according to reboot type

- Enable NTP long jump after cold reboot.
- Disable NTP long jump after warrm/fast reboot.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* fix typo

* further refactoring

* use sonic-db-cli instead

* [arista]: remove the soc property disabling sram scan (sonic-net#4623)

* Changes to support config-setup service for multi-npu (sonic-net#4609)

* Changes to support config-setup service for multi-npu
platforms. For Multi-npu we are not supporting as of
now config initializtion and ZTP. It will support creating
config db from minigraph or using  config db from previous
file system

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>

* Address Review Comments.

* Address Review comments

* Address Review Comments of using pyhton based config load_minigraph/
config save/config reload from shell scripts so that we don't duplicate
code. Also while running from shell we will skip stop/start services
done by those commands.

* Updated to use python command so no code duplication.

* [config]: Fix the device  type and internal bgp session status for multi NPU platforms (sonic-net#4600)

* The following changes for multi-npu platforms are done
- Set the type in device_metadata for asic configuration to be same as host
- Set the admin-status of internal bgp sessions as up
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>

* Adding new BGP peer groups PEER_V4_INT and PEER_V6_INT.  (sonic-net#4620)

* Adding new BGP peer groups PEER_V4_INT and PEER_V6_INT. The internal BGP sessions
will be added to this peer group while the external BGP sessions will be added
to the exising PEER_V4 and PEER_V6 peer group.

* Check for "ASIC" keyword in the hostname to identify the internal neighbors.

* [submodule update] sonic-swss with PR
 [vnet] Fix IP2ME route creation logic for BITMAP VNET interface (sonic-net#1284)

* [submodule update] sonic-util
 Revert "[config] Add 'interface transceiver' subgroup with 'lpmode' and
 'reset' subcommands (sonic-net#904)"
  Multi-asic changes for config bgp commands and utilities. (sonic-net#910)

* [submodule update] sonic-rest API's
PR#39  Setup module versioning
Add support for get all Vlans (#37)

* Update golang version for 1.11.5 to 1.14.2 (sonic-net#4520)

Co-authored-by: Myron Sosyak <49795530+msosyak@users.noreply.github.com>
Co-authored-by: Srideep <srideep_devireddy@dell.com>
Co-authored-by: paavaanan <paavaanan_t_n@dell.com>
Co-authored-by: Guohan Lu <lguohan@gmail.com>
Co-authored-by: pavel-shirshov <pavelsh@microsoft.com>
Co-authored-by: abdosi <58047199+abdosi@users.noreply.github.com>
Co-authored-by: arlakshm <55814491+arlakshm@users.noreply.github.com>
Co-authored-by: Santhosh Kumar T <53558409+santhosh-kt@users.noreply.github.com>
Co-authored-by: Andriy Kokhan <43479230+akokhan@users.noreply.github.com>
Co-authored-by: Danny Allen <daall@microsoft.com>
Co-authored-by: Abhishek Dosi <abdosi@microsoft.com>
Co-authored-by: Qi Luo <qiluo-msft@users.noreply.github.com>
Co-authored-by: Ying Xie <yxieca@users.noreply.github.com>
Co-authored-by: Samuel Angebault <staphylo@arista.com>
Co-authored-by: judyjoseph <53951155+judyjoseph@users.noreply.github.com>
abdosi added a commit to abdosi/sonic-mgmt that referenced this pull request May 29, 2020
make sure only syncd is match on pgrep
abdosi added a commit to sonic-net/sonic-mgmt that referenced this pull request May 31, 2020
make sure only syncd is match on pgrep
yxieca pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Jun 2, 2020
make sure only syncd is match on pgrep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants