Roman
01/06/2024, 7:12 PMprefect deploy
? I thought the entrypoint is just a path specification. I don't understand the reason why the code needs to be executed locally when the deployment code (including the entrypoint) is designed to be executed in a Docker container (in a Kubernetes job in my case). What is the purpose of this?Uriel Mandujano
01/08/2024, 3:54 PMpefect deploy
, the CLI tries to parse the entrypoint to do more configuration on the deployment, such as by adding a parameter schema, and configuring some metadata. The way it does that is by opening the path and loading the function defined in the entrypoint.
Are you using this setup to run your flow? This setup will prevent your flow from running when it gets imported.
@flow
def my_flow():
return 42
if __name__ == "__main__":
my_flow()
Roman
01/08/2024, 4:05 PMprefect deploy
command. It's a bit frustrating because I have to ensure that all module imports and environment variables work correctly in the local environment. Unfortunately, it seems impossible to disable this parsing.Uriel Mandujano
01/08/2024, 4:29 PM