https://prefect.io logo
Title
d

David

05/03/2023, 4:38 PM
Hi all. I'm trying to deploy my etl using github filesystem. I've pushed my python script containing the flow on github, created a github block on Prefect, and I've this deployment code:
from prefect.deployments import Deployment
from prefect.filesystems import GitHub
from etl_web_to_gcs import etl

github_block = GitHub.load("github-block")

# Deployment Object
github_dep = Deployment.build_from_flow(
    flow=etl,
    name="github-flow",
    infrastructure=github_block
)

if __name__ == "__main__":
    github_dep.apply()
When I run the code above, I get the following error:
...
cls_init(__pydantic_self__, **data)
 File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Deployment
infrastructure
 Infrastructure block must have 'run-infrastructure' capabilities. (type=value_error)
Any idea how to fix this?
r

redsquare

05/03/2023, 4:38 PM
I was replying when you removed the post:)
the github_block is not infra but storage
d

David

05/03/2023, 4:39 PM
Sorry for that
r

redsquare

05/03/2023, 4:40 PM
you will also need some sort of infrastructure so prefect knows how you want the flow to run