-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Prefect deploy hangs indefinitely when flow imports AzureML MLClient and MlflowClient #15621
Comments
hi @AMontgomerie - hmm interesting. I have reproduced but I'm not sure what's causing this to hang I will say that you should be able to unblock yourself by deferring your imports, something like # hello.py
from prefect import flow
from prefect.logging import get_run_logger
@flow
def hello():
from azure.ai.ml import MLClient # noqa
from mlflow.tracking import MlflowClient # noqa
get_run_logger().info("hello")
if __name__ == "__main__":
hello() will try to understand more about what's going on |
Thanks for the workaround! It was a little awkward to implement because these imports are inside a utility package that is imported throughout a lot of different flows, but I am able to deploy the flows now at least. |
I'm running into the same error when importing mlflow in any of my flow scripts. @zzstoatzz did you already found a clue what is causing this behaviour? I don't want to use the workaround you proposed because mlflow is used all over the place in my codebase. |
@jeanluciano Yes, I can confirm that my issue has been resolved with version 3.1.13 |
Awesome! will be closing this issue. |
Bug summary
After upgrading from prefect 2 to 3, running
prefect --no-prompt deploy --prefect-file prefect.yaml --all
gets stuck indefinitely. With log level set to debug, the only console output is:After lots of trial and error, I managed to track down the lines of code that are causing it to get stuck. If my flow imports both
azure.ai.ml.MLClient
andmlflow.tracking.MlflowClient
then this issue occurs. If either class is not imported then deployment goes ahead normally.For example:
Version info (
prefect version
output)Additional context
Other dependencies:
I have a local self-hosted Prefect server running inside Docker Desktop Kubernetes, and also a Prefect Cloud account with a work pool that connects to an AKS cluster, and the same issue occurs when attempting to deploy to either.
The text was updated successfully, but these errors were encountered: