Can you point <https://docs.prefect.io/orchestrati...
# ask-community
c
Can you point https://docs.prefect.io/orchestration/flow_config/executors.html#connecting-to-an-existing-cluster to a ECS cluster? I.E I have an ECS Agent deployed as a task in a AWS ECS Cluster, can I point the DaskExecutor to the same cluster to contain everything?
j
yep!
You should have full flexibility to deploy dask in any manner that works best for you.
c
Incoming dumb question - What would the address be? Or do I have to specifically deploy dask first into the ECS Cluster?
j
I recommend using a temporary dask cluster rather than connecting to an existing dask cluster, but in general yes you'd need to know the address beforehand (there are some hacky ways around this, but I won't recommend them unless you definitely need them).
c
What we're hoping for is keeping it within a contained space so we can inherit AWS Tagging for costing purposes
j
For a temporary cluster, you could configure your
DaskExecutor
to use
dask_cloudprovider.aws.FargateCluster
to spin up a temporary dask cluster per flow run.
c
Oh I'd just pass
tags: <dict>
to the Executor?
j
Any argument to
FargateCluster
is available here through
cluster_kwargs
, so if
dask_cloudprovider
supports what you need then yes.
c
Huh. Neat,
Cool thanks I'll give that a go!
@Jim Crist-Harif is
dask_cloudprovider
bundled in the
prefect
install?/with the
aws
extra?
j
No, you'd need to install it extra in your image.
c
Hmmm okay, would including it in the base image be a bad thing?
j
Sorry, what base image?
c
Maybe I'm missing something. What image would dask use if I didn't specify one?
Sorry, each line I'm writing is new territory 🤣
j
Gotcha. If your flow(s) make use of it, then you'll need to install it in the image specified on your flow's run_config.
You might be based on one of our base images and add only your new dependencies. Something like:
Copy code
FROM prefecthq/prefect:latest

RUN pip install dask-cloudprovider[aws]
If you haven't yet, I recommend reading through the docker doc I linked above. If you have further questions after that, I'm still happy to answer them. Trying to find what's missing in our docs that you're looking for so we can improve the docs.
c
I guess my initial thought is why isn't that just in the prefect image, not to sound too blunt haha https://docs.prefect.io/orchestration/flow_config/executors.html#executors could do with being more explicit in saying 'you can't run this example unless you install X,Y,Z with :W'
But yes I'll take a look haha
j
ah, gotcha. Dask has many many different deployment backends - we can't include them all, so we opt not to include any of them.
c
Fair enough haha
My usual lazy view is 'If you're mentioning it, why not include it' 🤣
But totally appreciate that reason