Nivi Mukka
08/13/2021, 9:02 PMcluster_kwargs
in DaskExecutor: https://github.com/PrefectHQ/prefect/blob/6b59d989dec33aad8c62ea2476fee519c32f5c63/src/prefect/executors/dask.py#L88-L89
https://docs.prefect.io/api/latest/executors.html#daskexecutorKevin Kho
Nivi Mukka
08/13/2021, 9:57 PMKevin Kho
executor = DaskExecutor(
cluster_class="dask_cloudprovider.FargateCluster",
cluster_kwargs={
"image": "prefecthq/prefect:latest",
"n_workers": 5,
...
},
)
so those can passed to FargateCluster
.Kevin Kho
env
argument. Which one are you using?Kevin Kho
Kevin Kho
Nivi Mukka
08/13/2021, 10:11 PMfrom dask_gateway import BasicAuth, Gateway
def create_cluster(min_workers, max_workers, docker_image, proxy_address):
# connect to dask-gateway proxy
auth = BasicAuth(password=secrets['dask_gateway_secret'])
gateway = Gateway(address=proxy_address, auth=auth)
options = gateway.cluster_options()
options.image = docker_image
options.worker_memory = 16.0 # max is 16.0
options.worker_cores = 5 # max is 8
cluster = gateway.new_cluster(options)
cluster.adapt(minimum=min_workers, maximum=max_workers)
return cluster
This cluster
is passed to the cluster_class
param in DaskExecutor
Kevin Kho
Nivi Mukka
08/13/2021, 10:21 PM