Prefect 2.0
You can pass the cluster_class
argument to the DaskTaskRunner
:
from prefect_dask import DaskTaskRunner
@flow(task_runner=DaskTaskRunner(
cluster_class="dask_cloudprovider.aws.FargateCluster",
cluster_kwargs={"n_workers": 4, "image": "my-prefect-image"},
)
)
Prefect 1.0
You can pass the cluster_class
argument to the DaskExecutor
:
with Flow(executor=DaskExecutor(
cluster_class="dask_cloudprovider.aws.FargateCluster",
cluster_kwargs={"n_workers": 4, "image": "my-prefect-image"},
) as flow: