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

Skip optional plugins while running Kedro Viz #1544

Merged
merged 17 commits into from
Oct 16, 2023
Merged

Conversation

ravi-kumar-pilla
Copy link
Contributor

@ravi-kumar-pilla ravi-kumar-pilla commented Sep 29, 2023

Description

Resolves #1159

Development notes

  • Add additional option during kedro viz run to ignore plugins
  • Modify kedro-dataset-stats hook name
  • Refactor public method names to private

QA notes

  1. Install local kedro Viz package by executing pip install -e package
  2. Navigate to demo project cd demo-project
  3. Install kedro mlflow pip install kedro-mlflow
  4. Run kedro viz without ignoring plugins - kedro viz
  5. You will find logs in the terminal related to mlflow plugin
  6. Re-run kedro viz with --ignore-plugins flag - kedro viz --ignore-plugins
  7. There should not be any logs related to mlflow.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
@ravi-kumar-pilla
Copy link
Contributor Author

Hi @tynandebold , @rashidakanchwala, @noklam

This PR is still in draft phase (I need to add pytests for the same). Before I do that, I would like to get some feedback with the approach here. This is from Nok's suggestion here

To summarize, I have added an additional option of --ignore-plugins=True while running Kedro viz via cli. This unregisters all plugins other than the kedro viz mandatory plugins which is kedro-telemetry for now. Please let me know your thoughts or suggestions. Thank you

@noklam
Copy link
Contributor

noklam commented Sep 29, 2023

Comments:

  • kedro-telemetry is not a mandatory requirements, it should not fail if such plugin doesn't exist
  • Is there any value to run plugins at all, or should we default --ignore-plugin yes?
  • I actually think the original proposal with _NullManager() is sufficient, it should still track kedro viz telemetry. You can verify this with HEAP, if you are not familiar with it maybe ask @tynandebold how to test it with the development environment. I vaguely remember there are guides in confluence too if you search "HEAP" in "kedro" confluence.

@ravi-kumar-pilla
Copy link
Contributor Author

Comments:

  • kedro-telemetry is not a mandatory requirements, it should not fail if such plugin doesn't exist

Yes it is true. But, I felt we should have kedro telemetry to collect the data during a kedro viz run. I will confirm this with @tynandebold

  • Is there any value to run plugins at all, or should we default --ignore-plugin yes?

In future when vizro integration is complete, we will have it as plugin and there should be some way to not ignore few mandatory plugins.

  • I actually think the original proposal with _NullManager() is sufficient, it should still track kedro viz telemetry. You can verify this with HEAP, if you are not familiar with it maybe ask @tynandebold how to test it with the development environment. I vaguely remember there are guides in confluence too if you search "HEAP" in "kedro" confluence.

I need to set this up locally. I will get in touch with Tynan or if someone points me to the doc for setup. Thank you

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
@ravi-kumar-pilla
Copy link
Contributor Author

Hi @noklam ,

What you said is right regarding kedro telemetry. I can see network requests even after unregistering the hook. I think the data is collected from the kedro side and viz actually does not need the plugin. I have modified the code to initialize _NullPluginManager() as suggested.

But I am keeping the --ignore-plugins flag default to False as I see there are some meta files being generated when executing kedro viz with mlflow installed. Also this will help when we need vizro plugin to be mandatory. Thank you

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
…ature/skip-hooks

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
@ravi-kumar-pilla ravi-kumar-pilla marked this pull request as ready for review September 29, 2023 21:30
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
…ro-viz into feature/skip-hooks

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

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

I left some small comments, but in general this approach looks good 👍

package/setup.py Show resolved Hide resolved
package/kedro_viz/integrations/kedro/data_loader.py Outdated Show resolved Hide resolved
Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
Copy link
Contributor

@rashidakanchwala rashidakanchwala left a comment

Choose a reason for hiding this comment

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

LGTM. thanks. The tests are failing because of the kedro-datasets ticket..so we can merge that first.

Copy link
Member

@tynandebold tynandebold left a comment

Choose a reason for hiding this comment

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

This looks good to me.

In the future, we could add something to the docs, akin to this. We don't do that with every CLI option we have though, so for now, this is good to go.

@tynandebold
Copy link
Member

Also, please don't forget to add a line to the release notes.

Signed-off-by: ravi-kumar-pilla <ravi_kumar_pilla@mckinsey.com>
@tynandebold tynandebold merged commit 1339535 into main Oct 16, 2023
19 checks passed
@tynandebold tynandebold deleted the feature/skip-hooks branch October 16, 2023 09:07
@tynandebold tynandebold mentioned this pull request Oct 20, 2023
5 tasks
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.

Kedro-viz needs too much to run properly
5 participants