Currently using managed worker pool. Deploying wit...
# ask-community
j
Currently using managed worker pool. Deploying with pool using prefect3 results in the run crashing with "_Reported flow run ... as crashed: Flow run process exited with non-zero status code 1._" Downgrading the pool to use prefect2 kind of solves this crash (also mentioned here: https://github.com/PrefectHQ/prefect/issues/15234#issuecomment-2339776848). But now (with prefect2) it complains about "ModuleNotFoundError: No module named 'prefect_github'" which I need to get GitHubCredentials. Possible to add pip package to the managed work pool, so I added it like this ["prefect[github]"]. Now it runs successfully. But why does the run crash in the first place with the worker pool with prefect3? Had no issues when using .serve instead of .deploy
Copy code
if __name__ == "__main__":
    main_flow.from_source(
        source=GitRepository(
        url="<https://github.com/me/myrepo.git>",
        credentials=GitHubCredentials.load("github-personal-access-token")
    ),
        entrypoint="prefect/main_flow.py:main_flow",
    ).deploy(
        name="my-deployment",
        work_pool_name="default",
        build=False
    )
b
I am still learning myself, but .serve is very likely using your "local" environment and has the. necessary packages to run a flow; it sends the logs to Prefect cloud for your to review in the web console Whereas the managed work pool will pull your project and spin up a container for remote execution, which requires the necessary packages to be added at runtime.
j
Yes that makes sense regarding the missing prefect-github dependency. but I'm not sure if that's the reason for it crashing with "_Flow run process exited with non-zero status code 1."_ instead of giving error with prefect3 worker
b
I could be wrong but it is likely crashing as the container can’t build or execute without the library, and that’s being captured relative to the flow execution. I think of the managed worker pool as a service that attempts to build an image that executes our code, and in this case, the error is more at the container level. I could be way way off but that’s my mental model at the moment anyway.