getindata / kedro-vertexai

Kedro Plugin to support running workflows on GCP Vertex AI Pipelines
https://kedro-vertexai.readthedocs.io
Apache License 2.0
34 stars 9 forks source link

Incorrect inheritance in class MLFlowGoogleOAuthCredentialsProvider #112

Closed doxenix closed 1 year ago

doxenix commented 1 year ago

class MLFlowGoogleOAuthCredentialsProvider in gcp.pyfile should inheritance from RequestHeaderProviderWithKedroContext

Based on documentation - doc If we will choose OAuth authorization and do like is desribed right now:

settings.py

DISABLE_HOOKS_FOR_PLUGINS = ("kedro-mlflow",)
from kedro_vertexai.auth.mlflow_request_header_provider_hook import MLFlowRequestHeaderProviderHook
from kedro_vertexai.auth.gcp import MLFlowGoogleOAuthCredentialsProvider
from kedro_mlflow.framework.hooks import MlflowHook
HOOKS = (MlflowHook(), MLFlowRequestHeaderProviderHook(MLFlowGoogleOAuthCredentialsProvider), )

we get error: AssertionError: Provider class needs to be a subclass of RequestHeaderProviderWithKedroContext

marrrcin commented 1 year ago

Hi @doxenix , actually there's a mistake in the docs. We have 4 classes in gcp.py:

For dynamic authorization you should use the *RequestHeaderProvider classes, the other two are for legacy, "static" authorization method. Sorry for that. Could you change the docs instead of the code in the PR, since you're already on it? 🙂


FYI, I've discussed the "dynamic authorization" issue with the author of kedro-mlflow and this functionality was ported to the kedro-mlflow plugin natively: https://kedro-mlflow.readthedocs.io/en/stable/source/04_experimentation_tracking/01_configuration.html#authentication-with-expiring-tokens

doxenix commented 1 year ago

Hi @marrrcin Thanks for explanation. Docs is corrected right now.