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

Config Reload Enhancement #1203

Merged
merged 13 commits into from
Feb 23, 2023

Conversation

dgsudharsan
Copy link
Contributor

@dgsudharsan dgsudharsan commented Jan 3, 2023

Design to address the issue sonic-net/sonic-buildimage#12071
Enhancing config reload to sequence the services and faster system initialization.

  • Immediately restart the critical services during config reload.
  • The non critical should be started only after all the ports are initialized.
  • Services can be configured to be started immediately or delayed. This can be using a field in FEATURE table.
  • The existing timers should be removed by this event driven approach.
  • This flow is applicable in case of all reboots (warm/fast/cold) as well as config reload.
Repo PR title State
sonic-host-services [config reload]Config Reload Enhancement GitHub issue/pull request detail
sonic-utilities [config reload]Config Reload Enhancement GitHub issue/pull request detail
sonic-buildimage [config reload]Config Reload Enhancement GitHub issue/pull request detail
sonic-mgmt [config reload]Modifying config reload tests to align with latest config reload enhancement GitHub issue/pull request detail

@skg-net
Copy link
Member

skg-net commented Jan 9, 2023

@dgsudharsan can you please add how this works along with ZTP? ZTP might use some of the GNMI services during reload cases.

@dgsudharsan
Copy link
Contributor Author

@dgsudharsan can you please add how this works along with ZTP? ZTP might use some of the GNMI services during reload cases.

@skg-net I don't think it is going to affect ZTP. In the ZTP too, there will be swss initialization, followed by PortInitDone message posted to APP_DB. Once it is received, all the delayed services include telemetry and mgmt-framework should start. Even today they start in a delayed fashion (3m 30 seconds) but with this change, they should be starting soon after port initialization.

@dgsudharsan dgsudharsan requested review from prvattem and prsunny and removed request for prvattem January 26, 2023 05:22
@liat-grozovik
Copy link
Collaborator

@prvattem @prsunny would you please help to review/approve the HLD? code PRs should be available soon and better to close HLD before

@liat-grozovik
Copy link
Collaborator

@prsunny @prvattem could you please review following feedback provided/answered?

@liat-grozovik
Copy link
Collaborator

@zhangyanzhao this HLD is ready for weeks now and already passed community review. what is next?

@liat-grozovik liat-grozovik merged commit c30ff69 into sonic-net:master Feb 23, 2023
qiluo-msft pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Apr 11, 2023
…fig reload enhancement (#7558)

### Approach
#### What is the motivation for this PR?
Modifying config reload tests to align with latest config reload enhancement according to HLD sonic-net/SONiC#1203

#### How did you do it?
Removed the timer based checks

#### How did you verify/test it?
Run the tests with config reload enhamcenet changes
qiluo-msft pushed a commit to sonic-net/sonic-utilities that referenced this pull request Apr 11, 2023
#### What I did
Code changes for HLD: sonic-net/SONiC#1203
Removed the timer based checks for config reload
Added db_migrator to migrate from "has_timer" to "delayed"
Modified package-manager to migrate from "has_timer" to "delayed"

#### How I did it
Modified relevant files

#### How to verify it
Added UT to verify
qiluo-msft pushed a commit to sonic-net/sonic-host-services that referenced this pull request Apr 11, 2023
Code changes for config reload Enhancement sonic-net/SONiC#1203.
Enhancing config reload to sequence the services and faster system initialization.

Immediately restart the critical services during config reload.
The non critical should be started only after all the ports are initialized.
Services can be configured to be started immediately or delayed. This can be using a field in FEATURE table.
The existing timers should be removed by this event driven approach.
This flow is applicable in case of all reboots (warm/fast/cold) as well as config reload.
qiluo-msft pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Apr 12, 2023
#### Why I did it
Implementing code changes for sonic-net/SONiC#1203

#### How I did it
Removed the timers and delayed target since the delayed services would start based on event driven approach.
Cleared port table during config reload and cold reboot scenario.
Modified yang model, init_cfg.json to change has_timer to delayed

#### How to verify it
Running regression
keboliu pushed a commit to keboliu/sonic-host-services that referenced this pull request Apr 17, 2023
Code changes for config reload Enhancement sonic-net/SONiC#1203.
Enhancing config reload to sequence the services and faster system initialization.

Immediately restart the critical services during config reload.
The non critical should be started only after all the ports are initialized.
Services can be configured to be started immediately or delayed. This can be using a field in FEATURE table.
The existing timers should be removed by this event driven approach.
This flow is applicable in case of all reboots (warm/fast/cold) as well as config reload.
Conflicts:
	tests/hostcfgd/hostcfgd_test.py
	tests/hostcfgd/test_vectors.py
dgsudharsan added a commit to dgsudharsan/sonic-utilities that referenced this pull request May 26, 2023
Code changes for HLD: sonic-net/SONiC#1203
Removed the timer based checks for config reload
Added db_migrator to migrate from "has_timer" to "delayed"
Modified package-manager to migrate from "has_timer" to "delayed"

Modified relevant files

Added UT to verify
dgsudharsan added a commit to dgsudharsan/sonic-host-services that referenced this pull request May 26, 2023
Code changes for config reload Enhancement sonic-net/SONiC#1203.
Enhancing config reload to sequence the services and faster system initialization.

Immediately restart the critical services during config reload.
The non critical should be started only after all the ports are initialized.
Services can be configured to be started immediately or delayed. This can be using a field in FEATURE table.
The existing timers should be removed by this event driven approach.
This flow is applicable in case of all reboots (warm/fast/cold) as well as config reload.
dgsudharsan added a commit to dgsudharsan/sonic-buildimage that referenced this pull request May 26, 2023
Implementing code changes for sonic-net/SONiC#1203

Removed the timers and delayed target since the delayed services would start based on event driven approach.
Cleared port table during config reload and cold reboot scenario.
Modified yang model, init_cfg.json to change has_timer to delayed

Running regression
StormLiangMS pushed a commit to sonic-net/sonic-host-services that referenced this pull request Jun 10, 2023
Backporting #45
Code changes for config reload Enhancement sonic-net/SONiC#1203.
Enhancing config reload to sequence the services and faster system initialization.

Immediately restart the critical services during config reload.
The non critical should be started only after all the ports are initialized.
Services can be configured to be started immediately or delayed. This can be using a field in FEATURE table.
The existing timers should be removed by this event driven approach.
This flow is applicable in case of all reboots (warm/fast/cold) as well as config reload.
StormLiangMS pushed a commit to sonic-net/sonic-utilities that referenced this pull request Jun 10, 2023
Backporting #2693

What I did
Code changes for HLD: sonic-net/SONiC#1203
Removed the timer based checks for config reload
Added db_migrator to migrate from "has_timer" to "delayed"
Modified package-manager to migrate from "has_timer" to "delayed"

How I did it
Modified relevant files

How to verify it
Added UT to verify
dgsudharsan added a commit to dgsudharsan/sonic-buildimage that referenced this pull request Jun 10, 2023
Implementing code changes for sonic-net/SONiC#1203

Removed the timers and delayed target since the delayed services would start based on event driven approach.
Cleared port table during config reload and cold reboot scenario.
Modified yang model, init_cfg.json to change has_timer to delayed

Running regression
StormLiangMS pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jun 12, 2023
Backporting #13969

Why I did it
Implementing code changes for sonic-net/SONiC#1203

Work item tracking
Microsoft ADO (number only):
How I did it
Removed the timers and delayed target since the delayed services would start based on event driven approach.
Cleared port table during config reload and cold reboot scenario.
Modified yang model, init_cfg.json to change has_timer to delayed

How to verify it
Added UT to verify
@skg-net
Copy link
Member

skg-net commented Feb 5, 2024

@dgsudharsan Can you please update the Quality Metric (Alpha/Beta/GA) for the feature either in this PR comments or in HLD itself based on https://github.com/sonic-net/SONiC/blob/master/doc/SONiC%20feature%20quality%20definition.md
Thanks

qiluo-msft pushed a commit to sonic-net/sonic-utilities that referenced this pull request Sep 15, 2024
Config Reload Enhancements PR sonic-net/SONiC#1203 does not completely remove TIMERs from SONiC Package Manager infra. This PR is intended to complete the original changes.

`Systemd` TIMERs infra was replaced by `hostcfgd` service management.
That was done to improve reliability of service management.

#### What I did
* Removed redundant TIMERs infra

#### How I did it
* Updated SPM auto generation logic

#### How to verify it
1. Install application extension
```bash
spm install --from-tarball <app_ext_path>
```
2. Make sure `delayed` flag is set
```bash
docker image inspect <app_ext_image> | jq '.[].Config.Labels["com.azure.sonic.manifest"]' | python -c 'import sys,ast; print(ast.literal_eval(sys.stdin.read()))' | jq .service.delayed
true
```
3. Check no TIMERs were generated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants