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

[SPM] Add logic to disable the feature before stopping it and enabling it before starting #3344

Merged

Conversation

vadymhlushko-mlnx
Copy link
Contributor

What I did

Add logic to disable the feature before stopping and enabling it before starting in order to properly clean the systemd symlinks to avoid issues with delayed attribute explained in the How to verify it section.

How I did it

Add the systemctl disable ... after the systemctl stop... and the systemctl enable ... before the systemctl start .. for some feature.

How to verify it

  • Add repository for some featureX
  • sonic-package-manager repository <featureX> <URL>
  • Install featureX version 1.0.0 where the delayed flag is equal to false (delayed flag means - the feature will be started right after the system boots or after the PortInitDone event)
  • sonic-package-manager install featureX==1.0.0 -y
  • Enable the feature in SONiC
  • config feature state featureX enabled
  • Install featureX version 1.0.1 where the delayed flag is equal to true
  • sonic-package-manager install featureX==1.0.1 -y
  • Check the manifest file to verify the delayed field value
  • sonic-package-manager show package manifest featureX
  • config save -y
  • reboot
  • Check that the featureX is delayed on the system start

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

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

@vadymhlushko-mlnx vadymhlushko-mlnx marked this pull request as ready for review May 29, 2024 13:22
@liat-grozovik
Copy link
Collaborator

@lguohan can you suggest a reviewer for this issue?

@liat-grozovik
Copy link
Collaborator

@lguohan kindly reminder the fix should go for both 202311 and 202405

@liat-grozovik
Copy link
Collaborator

@qiluo-msft could you please help to review?

@liat-grozovik
Copy link
Collaborator

@qiluo-msft kindly reminder. do you want to assign someone else ? we need this to get in soon please

@@ -1017,8 +1017,10 @@ def _get_installed_packages_except(self, package: Package) -> Dict[str, Package]

def _stop_feature(self, package: Package):
self._systemctl_action(package, 'stop')
self._systemctl_action(package, 'disable')
Copy link
Contributor

@qiluo-msft qiluo-msft Sep 21, 2024

Choose a reason for hiding this comment

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

_systemctl_action

Seems you are fixing a bug in old code. Could you add a testcase which fails old code and passes new code? #Closed

Copy link
Contributor

Choose a reason for hiding this comment

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

@qiluo-msft UT added

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
qiluo-msft
qiluo-msft previously approved these changes Oct 26, 2024
@stepanblyschak
Copy link
Contributor

/Azpw run

@stepanblyschak
Copy link
Contributor

/azpw run

@bingwang-ms
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft merged commit 093ed4a into sonic-net:master Nov 11, 2024
7 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-utilities that referenced this pull request Nov 15, 2024
…g it before starting (sonic-net#3344)

What I did
Add logic to disable the feature before stopping and enabling it before starting in order to properly clean the systemd symlinks to avoid issues with delayed attribute explained in the How to verify it section.

How I did it
Add the systemctl disable ... after the systemctl stop... and the systemctl enable ... before the systemctl start .. for some feature.

How to verify it
Add repository for some featureX
sonic-package-manager repository <featureX> <URL>
Install featureX version 1.0.0 where the delayed flag is equal to false (delayed flag means - the feature will be started right after the system boots or after the PortInitDone event)
sonic-package-manager install featureX==1.0.0 -y
Enable the feature in SONiC
config feature state featureX enabled
Install featureX version 1.0.1 where the delayed flag is equal to true
sonic-package-manager install featureX==1.0.1 -y
Check the manifest file to verify the delayed field value
sonic-package-manager show package manifest featureX
config save -y
reboot
Check that the featureX is delayed on the system start
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #3619

mssonicbld pushed a commit that referenced this pull request Nov 15, 2024
…g it before starting (#3344)

What I did
Add logic to disable the feature before stopping and enabling it before starting in order to properly clean the systemd symlinks to avoid issues with delayed attribute explained in the How to verify it section.

How I did it
Add the systemctl disable ... after the systemctl stop... and the systemctl enable ... before the systemctl start .. for some feature.

How to verify it
Add repository for some featureX
sonic-package-manager repository <featureX> <URL>
Install featureX version 1.0.0 where the delayed flag is equal to false (delayed flag means - the feature will be started right after the system boots or after the PortInitDone event)
sonic-package-manager install featureX==1.0.0 -y
Enable the feature in SONiC
config feature state featureX enabled
Install featureX version 1.0.1 where the delayed flag is equal to true
sonic-package-manager install featureX==1.0.1 -y
Check the manifest file to verify the delayed field value
sonic-package-manager show package manifest featureX
config save -y
reboot
Check that the featureX is delayed on the system start
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.

6 participants