Matthew Scanlon
10/21/2023, 1:58 PMasync def _check_flow_run(self, flow_run: "FlowRun") -> None:
"""
Performs a check on a submitted flow run to warn the user if the flow run
was created from a deployment with a storage block.
"""
if flow_run.deployment_id:
deployment = await self._client.read_deployment(flow_run.deployment_id)
if deployment.storage_document_id:
raise ValueError(
f"Flow run {flow_run.id!r} was created from deployment"
f" {deployment.name!r} which is configured with a storage block."
" Workers currently only support local storage. Please use an"
" agent to execute this flow run."
)
Matthew Scanlon
10/21/2023, 2:23 PMJenny
10/21/2023, 2:58 PMJenny
10/21/2023, 3:06 PMMatthew Scanlon
10/21/2023, 4:49 PMMatthew Scanlon
10/21/2023, 5:06 PMJenny
10/21/2023, 5:23 PMJenny
10/21/2023, 5:32 PMfrom prefect import flow
if __name__ == "__main__":
flow.from_source(
source="https://github.com/org/repo.git",
entrypoint="flows.py:my_flow",
).deploy(
"example-deployment",
work_pool="my-work-pool",
image="my-repository/my-image:dev",
)
Matthew Scanlon
10/21/2023, 8:51 PMdeployment.upload_to_storage()
on a deployment that has a storage block specified. Not that the flow code lives in remote storageJenny
10/22/2023, 11:48 AMMatthew Scanlon
10/22/2023, 2:04 PMMatthew Scanlon
10/22/2023, 2:15 PMJenny
10/22/2023, 4:39 PMMatthew Scanlon
10/22/2023, 4:51 PMDeployment.build_from_flow
, .upload_to_storage
, and .apply
For instance how could you define a pull step (or multiple pull steps) I would really love to see something that is along the lines of Deployment.from_yaml() similar to <http://Deployment.to|Deployment.to>_yaml()
Jenny
10/22/2023, 5:37 PMJenny
10/22/2023, 5:38 PM