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

[reload] Improve reload by using sonic.target. #1199

Merged
merged 11 commits into from
Mar 1, 2021

Conversation

stepanblyschak
Copy link
Contributor

Signed-off-by: Stepan Blyshchak stepanb@nvidia.com

- What I did

To remove the list of hardcoded order-dependent lists of services to stop/restart/reset-failed.

- How I did it

Used sonic.target to stop/restart/reset-failed.

- How to verify it

Execute config reload and observe the services do restart.

- Previous command output (if the output of a command-line utility has changed)

admin@r-tigon-11:~$ sudo config reload -y
Executing stop of service telemetry...
Executing stop of service swss...
Executing stop of service lldp...
Executing stop of service bgp...
Executing stop of service hostcfgd...
Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --write-to-db
Running command: /usr/local/bin/db_migrator.py -o migrate
Executing reset-failed of service bgp...
Executing reset-failed of service dhcp_relay...
Executing reset-failed of service hostcfgd...
Executing reset-failed of service hostname-config...
Executing reset-failed of service interfaces-config...
Executing reset-failed of service lldp...
Executing reset-failed of service ntp-config...
Executing reset-failed of service pmon...
Executing reset-failed of service radv...
Executing reset-failed of service rsyslog-config...
Executing reset-failed of service snmp...
Executing reset-failed of service swss...
Executing reset-failed of service syncd...
Executing reset-failed of service teamd...
Executing reset-failed of service telemetry...
Executing restart of service hostname-config...
Executing restart of service interfaces-config...
Executing restart of service ntp-config...
Executing restart of service rsyslog-config...
Executing restart of service swss...
Executing restart of service bgp...
Executing restart of service lldp...
Executing restart of service hostcfgd...
Executing restart of service telemetry...
Reloading Monit configuration ...
Reinitializing monit daemon

- New command output (if the output of a command-line utility has changed)

admin@r-tigon-11:~$ sudo config reload -y
Stopping SONiC target ...
Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --write-to-db
Running command: /usr/local/bin/db_migrator.py -o migrate
Resetting failed status on bgp.service
Resetting failed status on dhcp_relay.service
Resetting failed status on hostcfgd.service
Resetting failed status on hostname-config.service
Resetting failed status on interfaces-config.service
Resetting failed status on lldp.service
Resetting failed status on mgmt-framework.timer
Resetting failed status on nat.service
Resetting failed status on ntp-config.service
Resetting failed status on pmon.service
Resetting failed status on radv.service
Resetting failed status on rsyslog-config.service
Resetting failed status on sflow.service
Resetting failed status on swss.service
Resetting failed status on syncd.service
Resetting failed status on teamd.service
Resetting failed status on telemetry.timer
Restarting SONiC target ...
Reloading Monit configuration ...
Reinitializing monit daemon

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Telemetry test case is no longer valid scenario to unit test.

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
@lgtm-com
Copy link

lgtm-com bot commented Oct 28, 2020

This pull request introduces 1 alert when merging 6b63721 into 1753f22 - view on LGTM.com

new alerts:

  • 1 for Unused import

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
@keboliu
Copy link
Collaborator

keboliu commented Nov 4, 2020

retest this please

yxieca
yxieca previously approved these changes Nov 10, 2020
@yxieca yxieca requested a review from jleveque November 10, 2020 17:29
@jleveque
Copy link
Contributor

This PR depends on sonic-net/sonic-buildimage#5705

…_enhancement

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
…_enhancement

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
…_enhancement

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
@stepanblyschak
Copy link
Contributor Author

@rajendra-dendukuri I've just merged master and resolved conflict, could you please approve?

@stepanblyschak
Copy link
Contributor Author

@yxieca Could you please review after merges from master?

yxieca
yxieca previously approved these changes Jan 24, 2021
@liat-grozovik
Copy link
Collaborator

retest this please

1 similar comment
@liat-grozovik
Copy link
Collaborator

retest this please

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
yxieca
yxieca previously approved these changes Feb 2, 2021
@liat-grozovik
Copy link
Collaborator

@rajendra-dendukuri and yxieca can you please review again?

@liat-grozovik
Copy link
Collaborator

@yxieca as it was approved before and we lost you r approval with the recent merge, can you please review and approve so we can move forward with merging it?

liat-grozovik pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Feb 25, 2021
- Why I did it
Group all SONiC services together and able to manage them together. Will be used in config reload command as much simpler and generic way to restart services.

- How I did it
Add services to sonic.target

- How to verify it
Together with sonic-net/sonic-utilities#1199
config reload -y

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
@liat-grozovik liat-grozovik merged commit 8b3bc18 into sonic-net:master Mar 1, 2021
anand-kumar-subramanian pushed a commit to anand-kumar-subramanian/sonic-utilities that referenced this pull request Mar 2, 2021
- What I did
To remove the list of hardcoded order-dependent lists of services to stop/restart/reset-failed.

- How I did it
Used sonic.target to stop/restart/reset-failed.

- How to verify it
Execute config reload and observe the services do restart.

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Mar 4, 2021
- Why I did it
Group all SONiC services together and able to manage them together. Will be used in config reload command as much simpler and generic way to restart services.

- How I did it
Add services to sonic.target

- How to verify it
Together with sonic-net/sonic-utilities#1199
config reload -y

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
@liat-grozovik
Copy link
Collaborator

@stepanblyschak should we label it for 202012 as well? sonic.target is expected to be included in 202012 if i remember correct.

@stepanblyschak
Copy link
Contributor Author

@liat-grozovik yes, it looks like we want this feature in 202012 and this PR is crucial part of it.

@daall
Copy link
Contributor

daall commented Mar 10, 2021

@stepanblyschak @liat-grozovik there is a merge conflict when cherry-picking, please open a PR against 202012 branch

@daall
Copy link
Contributor

daall commented Mar 19, 2021

included in 202012 via #1509

carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
- Why I did it
Group all SONiC services together and able to manage them together. Will be used in config reload command as much simpler and generic way to restart services.

- How I did it
Add services to sonic.target

- How to verify it
Together with sonic-net/sonic-utilities#1199
config reload -y

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
lolyu pushed a commit to lolyu/sonic-buildimage that referenced this pull request Sep 13, 2021
- Why I did it
Group all SONiC services together and able to manage them together. Will be used in config reload command as much simpler and generic way to restart services.

- How I did it
Add services to sonic.target

- How to verify it
Together with sonic-net/sonic-utilities#1199
config reload -y

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
@qiluo-msft
Copy link
Contributor

def _get_disabled_services_list(config_db):

This function is not used anymore.

Wondering whether your new code could handle disabled service as before, such as telemetry disabled?


Refers to: config/main.py:703 in bf3d2fd. [](commit_id = bf3d2fd, deletion_comment = True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants