-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Storage documents not working as expected from Deployment.build_from_flow followed by Deployment.apply (Prefect2.1.0) #6463
Comments
Thanks for opening the issue and describing the problem so nicely. I couldn't reproduce any issues following the same deployment configuration as the one you shared and I didn't have to change anything on the block document side. Could you perhaps try the same with CLI without making any code changes to Prefect and see if this fixes the issue for you? prefect deployment build healthcheck.py:healthcheck --name az -q prod -t project -o az.yaml -sb azure/prod
prefect deployment apply az.yaml
prefect deployment run healthcheck/az |
@anna-geller thanks for the reply. I tried creating the flow as suggested above using the CLI and everything's all working there :) I then went back to create a really simple hello world python flow and deployment (I have also upgraded to v2.1.1 now): test_flow.py from prefect import flow
@flow
def hello_world():
print("Hello World!") test_dp.py from prefect import flow
from prefect.deployments import Deployment
from prefect.filesystems import Azure
from test_flow import hello_world
storage_block = Azure.load("azure-storage-block")
deployment = Deployment.build_from_flow(
name="az",
flow=hello_world,
flow_name="hello-world",
work_queue_name="dev",
tags=["dev"],
description="Some description.",
storage=storage_block,
output="az.yaml",
)
if __name__ == "__main__":
deployment.apply() The deployment went up to prefect cloud just fine. I then ran an agent locally and an error with the path (looking for an absolute path on my machine in the azure container). After having a look at the prefect cloud, I noticed that on line 479 of deployments.py, if we changed |
Same issue here. Allowing an 'entrypoint' argument to override this behavior would help as well. YAML with the CLI entrypoint: hub_prefect/flows/xandr/validate_daily/flow.py:main YAML with the Python entrypoint: /Users/rossteach/Documents/code/git/hub-prefect/hub_prefect/flows/xandr/validate_daily/flow.py:main |
Thanks all for reporting. I couldn't reproduce but I passed the issue along to other engineers, so it might be that someone will have a look next week. Until then, I'd recommend using the CLI, as it remains the primary and recommended way of creating deployments. |
First check
Bug summary
Hi, I've found a little bug with deployments and storage blocks/documents.
When running code very similar to the example @anna-geller gave here, but using an Azure container instead of an S3 bucket, the storage was not a document but just a pointer to the azure storage block in prefect cloud. I managed to find a way to get this working again, but I'm not sure whether it could cause problems elsewhere.
I found the bug by creating the deployment on my local machine, spinning up an agent on an azure vm, and then running the deployment from prefect cloud. The error message just showed that the file was not found (as it was looking for an absolute path on my machine).
The solution I came up with was adding this into line 386 of prefect.deployments.py:
This works for my use case, but I'm not sure if it messes with things elsewhere.
Thanks :)
Reproduction
Error
Versions
Additional context
No response
The text was updated successfully, but these errors were encountered: