Galileo-Galilei / kedro-mlflow

A kedro-plugin for integration of mlflow capabilities inside kedro projects (especially machine learning model versioning and packaging)
https://kedro-mlflow.readthedocs.io/
Apache License 2.0
194 stars 29 forks source link

Kedro mlflow CLI does not work inside a subdirectory of the project for kedro≥0.19.4 #531

Closed swertz closed 2 months ago

swertz commented 3 months ago

Description

Running kedro mlflow ui doesn't work.

Context

I have followed the 'Getting Started' guide in https://kedro-mlflow.readthedocs.io/en/stable/source/03_getting_started/index.html but cannot launch any of the MLFlow commands as indicated.

Steps to Reproduce

Simply install a recent version of Kedro-MLFlow:

pip install kedro-mlflow
kedro mlflow -h

Expected Result

The Kedro-MLflow commands should be available.

Actual Result

Usage: kedro [OPTIONS] COMMAND [ARGS]...
Try 'kedro -h' for help.

Error: No such command 'mlflow'.

Note that kedro info shows that the plugin is available:

Installed plugins:
kedro_mlflow: 0.12.1 (entry points:hooks,project)

Your Environment

Does the bug also happen with the last version on master?

Yes, same behaviour.

Galileo-Galilei commented 3 months ago

I think this is due to the recent changes to allow running the CLI anywhere inside a kedro project, not only at the root. This was released in 0.19.3. I'll publish a hotfix soon

EDIT: This commit is likely the root cause: https://github.com/kedro-org/kedro/commit/a22bc32fa7e5513460146fb71a25329f61b13c53

EDIT 2 : This will be an issue in 0.19.4, but this is not merged yet. Still investigating...

Galileo-Galilei commented 3 months ago

I've tested the following script on Centos & Windows 11:

mamba create -n temp python=3.10 -y
mamba activate temp
pip install kedro==0.19.3 kedro_mlflow
kedro new --starter=spaceflights-pandas
cd spaceflights-pandas
kedro mlflow ui

and everything works fine. I can't test on a Mac right now. Can you try to check if it works for you?

One thing that happen sometimes is that you have a corrupted environment with incompatible packages versions. kedro run works and it only raises warnings, but I've already noticed that it breaks all CLI discovery. Can you check if you can use another plugin (e.g. kedro-viz) in your environment?

swertz commented 3 months ago

I have just tested again and everything works fine. Now I'm really confused why it didn't work yesterday... Sorry for the noise!

Galileo-Galilei commented 3 months ago

It is very likely that you were not running the command at the root of a kedro project, but this will be possible in 0.19.4! I don't close the issue since I need to make the change before next release.

Galileo-Galilei commented 2 months ago

Closed by #539