haris khan
10/24/2024, 5:41 PMMarvin
10/24/2024, 5:42 PMDaskTaskRunner
, the cluster_kwargs
parameter allows you to pass a dictionary of keyword arguments that configure the Dask cluster according to your needs. Here are some potential keys you might use in `cluster_kwargs`:
1. n_workers: Specify the number of worker processes to use. For example, setting {"n_workers": 4}
will use 4 worker processes.
2. threads_per_worker: Set the number of threads for each worker. For instance, {"threads_per_worker": 2}
will assign 2 threads per worker process.
3. image: When using a cluster manager like dask_cloudprovider
, you can specify the Docker image for workers. For example, {"image": "my-prefect-image"}
.
The DaskTaskRunner
allows you to create temporary clusters using any of Dask's cluster managers, which can be specified by passing a cluster_class
. This configuration is particularly useful for tailoring specific requirements for each flow run or for using different computation resources like AWS Fargate or others that Dask supports.
For more detailed configuration options, you can refer to the Prefect 3 Dask integration documentation.