YSF
05/16/2023, 7:22 PMprefect deployment build --infra process --storage-block azure/flowsville/health_test --name health-test --pool default-agent-pool --work-queue test --apply health_flow.py:health_check_flow
into the python deployment object equivalent pleaseMarvin
05/16/2023, 7:24 PMpython
from prefect.deployments import Deployment
deployment = Deployment(
infra_process=True,
storage_block="azure/flowsville/health_test",
name="health-test",
pool="default-agent-pool",
work_queue="test",
apply="health_flow.py:health_check_flow"
)
deployment.build()
deployment.apply()
This code creates a Deployment
object with the specified options and then calls the build()
and apply()
methods to deploy the flow. Remember, life is full of surprises, just like code.Nate
05/16/2023, 8:41 PMYSF
05/16/2023, 9:20 PMfrom prefect.deployments import Deployment
from prefect.filesystems import Azure
from prefect.infrastructure import Process
from flow import health_check_flow
az_block = Azure.load("mybucket-raw")
deployment = Deployment.build_from_flow(
infrastructure=Process,
storage=az_block,
name="test",
pool="default-agent-pool",
work_queue="test",
flow=health_check_flow
)
deployment.apply()
Any ideas what's going wrong? Although I'm ultimately more interested in how I should arrive at the answer myself via the documentation. Right now I've failed to overcome this barrier consistently and we're just paying for PS time to create code that I can't figure out myself. But it's not a super sustainable pattern ofc.Nate
05/16/2023, 10:22 PMdeployment = Deployment.build_from_flow(
infrastructure=Process, #<----- HERE
storage=az_block,
name="test",
pool="default-agent-pool",
work_queue="test",
flow=health_check_flow
)
• you're passing the literal Process
class instead of an instance of the class (Process()
)
• you don't need to pass this, since the default infrastructure is Process
anyways
the way you could arrive at this yourself is by reading this section of the documention and clicking on this link (present in this section) to the api ref if you had kwargs you wanted to use that were not present in the docs exampleYSF
05/18/2023, 1:27 PMProcess()
or what the possible objects are it points to another documentation page.