https://prefect.io logo
Title
w

Wellington Braga

03/20/2023, 2:56 PM
I'm trying to implement a new flow to run with container. But I'm getting this error when deploying. How do I resolve this?
Traceback (most recent call last):
  ...
  Remote Storage block must have 'get-directory' capabilities. (type=value_error)
j

Jason Noxon

03/20/2023, 4:08 PM
Hi! My instinct is that the Docker block is an infrastructure block, not a storage block. You'd need an S3 block, Azure block, GitHub block, or use local storage - just to name a few. The Docker block is just HOW you want to run your flow, but not where the flow code is stored.
w

Wellington Braga

03/20/2023, 4:21 PM
oh really
j

Jason Noxon

03/20/2023, 4:21 PM
Let me grab a screenshot of what I was doing...
👀 1
az_block = Azure.load("azure-blob-block")
docker_container_block = DockerContainer.load("docker-block")
deployment = Deployment.build_from_flow(
flow=flow.with_options(name="EmilIsTheBest"),
name=config["name"],
description=config["description"],
tags=config["tags"],
work_queue_name=environment,
output=True,
apply=True,
storage=az_block,
infrastructure=docker_container_block,
path=config["name"]
)
🙌 1
w

Wellington Braga

03/20/2023, 4:25 PM
I didn't quite understand how that would work. But with your example I managed to have a better understanding and direction of what I need to do. Thank you very much!
j

Jason Noxon

03/20/2023, 4:25 PM
You're welcome. Ping me if you run into anything else.
🙏 1
Also, I think build_from_flow has a parameter called "apply=True" - so you don't need the extra step 🙂
😧 1
w

Wellington Braga

03/20/2023, 6:37 PM
I'm still having a little trouble running a flow in the container. When creating and executing the flow, it manages to start from the container, but it does not find the file path
image.png
j

Jason Noxon

03/20/2023, 6:39 PM
what happens if you remove the storage parameter all together
w

Wellington Braga

03/20/2023, 6:39 PM
it tries to download the code from opt/
image.png
j

Jason Noxon

03/20/2023, 6:41 PM
Is that where your flow code is located?
Also, are you running local server or cloud?
w

Wellington Braga

03/20/2023, 6:46 PM
opt is the container directory. I'm not sure which container directory Prefect references the code in. I'm running the server locally.
j

Jason Noxon

03/20/2023, 6:46 PM
So, are you using the stock prefecthq image?
w

Wellington Braga

03/20/2023, 6:47 PM
sure
image.png
j

Jason Noxon

03/20/2023, 6:52 PM
I'm perplexed! lol