dask / distributed

A distributed task scheduler for Dask
https://distributed.dask.org
BSD 3-Clause "New" or "Revised" License
1.57k stars 718 forks source link

Deploying dask using Docker on different machines #8658

Closed simplew2011 closed 3 months ago

simplew2011 commented 4 months ago
mrocklin commented 4 months ago

cc @jacobtomlinson maybe you have time to help here

simplew2011 commented 4 months ago

image

image

simplew2011 commented 3 months ago
2024-05-31 08:08:34,530 - distributed.scheduler - INFO -   Scheduler at: tcp://192.168.30.161:8786
2024-05-31 08:08:34,530 - distributed.scheduler - INFO -   dashboard at:  http://192.168.30.161:8787/status
2024-05-31 08:10:16,884 - distributed.scheduler - INFO - Register worker <WorkerState 'tcp://192.168.20.139:43259', status: init, memory: 0, processing: 0>
2024-05-31 08:10:17,174 - distributed.scheduler - INFO - Starting worker compute stream, tcp://192.168.20.139:43259
2024-05-31 08:10:17,175 - distributed.core - INFO - Starting established connection to tcp://192.168.20.139:43478
2024-05-31 08:10:17,178 - distributed.scheduler - INFO - Register worker <WorkerState 'tcp://192.168.20.139:37555', status: init, memory: 0, processing: 0>
jacobtomlinson commented 3 months ago

Dask workers connect to each other on random high ports, so when you run the workers without any network or port settings they cannot talk to each other.

Setting --network host will work because it removes network isolation. Alternatively you can create a dedicated docker network which will allow all the containers to talk to each other, this is what we do in our documentation examples.

docker network create dask

docker run --network dask -p 8787:8787 --name scheduler ghcr.io/dask/dask dask scheduler  # start scheduler

docker run --network dask ghcr.io/dask/dask dask worker scheduler:8786 # start worker
docker run --network dask ghcr.io/dask/dask dask worker scheduler:8786 # start worker
docker run --network dask ghcr.io/dask/dask dask worker scheduler:8786 # start worker

Following these steps everything works and I am unable to reproduce the dashboard issue with the latest version of the ghcr.io/dask/dask image.