https://kedro.org/ logo
#questions
Title
# questions
a

Armen Paronikyan

03/20/2023, 11:25 AM
Hi guys, I would like to know if I can have access to the data in the credentials.yml file in kedro hooks?
m

marrrcin

03/20/2023, 11:32 AM
In the
after_context_created
hook, you will have access to
KedroContext
, which has
config_loader
property, which you can use to load the credentials for example.
What is your use case here? Why do you need access to credentials files?
a

Armen Paronikyan

03/20/2023, 12:28 PM
I am doing an AWS login for Mlflow in hooks with our utility.
m

marrrcin

03/20/2023, 12:30 PM
a

Armen Paronikyan

03/20/2023, 12:32 PM
This will work in case my AWS credentials are located in the tracking server yes?
m

marrrcin

03/20/2023, 12:34 PM
This is useful when you have secured MLflow instance (it’s not related to the authorization for the underlying artifact storage).
a

Armen Paronikyan

03/20/2023, 12:37 PM
than it is a different use case I guess no?
m

marrrcin

03/20/2023, 12:39 PM
You’ve said “AWS login for Mlflow”, so I’ve assumed authorization to a secured mlflow instance. I guess you’re looking for the authorization to the actual artifact storage used by MLflow - S3 I guess?
a

Armen Paronikyan

03/20/2023, 12:39 PM
Yes
sorry for the confusion
m

marrrcin

03/20/2023, 12:42 PM
Then either: • approach with the hook, if you need some custom logic there • approach with
OmegaConfigLoader
https://docs.kedro.org/en/stable/kedro_project_setup/configuration.html?highlight=OmegaConfigLoader#environment-variables-for-credentials if you’re running the latest Kedro
a

Armen Paronikyan

03/20/2023, 12:47 PM
I need a custom logic, so in the hooks I can acecss the data by both context and omega config I guess
👍 1