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

[WIP] Refact/generic strategy #334

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

jneo8
Copy link
Contributor

@jneo8 jneo8 commented Oct 8, 2024

  • Restructure StrategyABC to have consistence interface
  • Remove HWToolHelper and move the logic into service layer
  • Change the install function return on BaseExporter for blocked message required
  • New ResourceMixin embedded into BaseExporter

partial fix: #272
relate to: #333

detect if NVIDIA driver is present by the /proc/driver/nvidia/version
file and:

* if present, doesn't try to install
* if not present, try to install using the ubuntu-drivers pkg
* even if installed, the machine might require reboot. To detect
  this, we check if nvidia-smi command is working.
@jneo8 jneo8 force-pushed the refact/generic-strategy branch 2 times, most recently from 019afc4 to 482882b Compare October 8, 2024 09:25
- Restructure StrategyABC to have consistence interface
- Remove HWToolHelper and move the logic into service layer
- Change the `install` function return on BaseExporter for blocked
message required
- New ResourceMixin embedded into BaseExporter

partial fix: canonical#272
Copy link
Contributor

@chanchiwai-ray chanchiwai-ray left a comment

Choose a reason for hiding this comment

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

I believe this PR is still not done, but currently it's still not refactored enough: as you can see here, these lines are still using something outside redfish strategy line 539-641 in src/service.py

@jneo8
Copy link
Contributor Author

jneo8 commented Oct 9, 2024

I believe this PR is still not done, but currently it's still not refactored enough: as you can see here, these lines are still using something outside redfish strategy line 539-641 in src/service.py

About the functions in HardwareExporter relate to Redfish, IMO they should belong to service layer because the purpose of those functions here is to generate the configuration for the hardware-exporter. We can have a discuss about to find a way to encapsulate they but it should be another refactor. The goal of this PR is about remove the HwToolHelper and consistence the strategy interface, and the size of PR is already pretty big. So I suggest this can be a follow up discussion.

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.

[Refactor] Make exporter service become juju Object base.
3 participants