https://prefect.io logo
Title
a

Aleksandr Liadov

01/04/2023, 4:31 PM
Hello guys, I have a problem to connect to my existing dask cluster
my_flow.with_options(
        task_runner=DaskTaskRunner(
            address="<tls://10.4.83.2:8786>"
        )
Log:
prefect.task_runner.dask - Connecting to an existing Dask cluster at <tls://10.4.83.2:8786>
17:20:30.497 | ERROR   | Flow run 'jolly-griffin' - Crash detected! Execution was interrupted by an unexpected exception: TypeError: TLS expects a `ssl_context` argument of type ssl.SSLContext (perhaps check your TLS configuration?) Instead got None
What do I wrong? Dask cluster running on Kubernetes managed with Dask Gateway.
m

Mason Menges

01/04/2023, 7:16 PM
Hey @Aleksandr Liadov I'm not super familiar with Dask but I think you still need to pass some additional parameters to the DaskTaskRunner to access tls/ssl connections https://distributed.dask.org/en/latest/tls.html has more information on what those parameters are, I think you should be able to pass theses in as client kwargs on the task runner.
a

Aleksandr Liadov

01/05/2023, 8:17 AM
Yes, I have found also this solution 🙂 For someone who’ll have trouble:
task_runner=DaskTaskRunner(
    address=cluster_dask.scheduler_info["address"],
    client_kwargs={"security": cluster_dask.security},
)