I want to create a docker-compose.yml containing our company analysis toolchain. For this purpose, I add dask. The docker-compoe.yml looks like this:
docker-compose.yml
version: '3'
services:
jupyter:
build: docker/jupyter/.
ports:
- "8899:8899"
depends_on:
- dask-scheduler
- dask-worker
volumes:
- ./notebooks:/notebooks
dask-scheduler:
build:
docker/dask/.
hostname: dask-scheduler
ports:
- "8786:8786"
- "8787:8787"
volumes:
- ./notebooks:/notebooks
command: ["dask-scheduler"]
dask-worker:
build:
docker/dask/.
depends_on:
- dask-scheduler
volumes:
- ./notebooks:/notebooks
command: ["dask-worker", "tcp://dask-scheduler:8786"]
For building up the both dask containers, I use this Dockerfile:
docker/dask/Dockerfile
FROM python:3.7
RUN apt-get update -y && apt-get install -y python3-pip libsnappy-dev
RUN pip install numpy
RUN pip install dask
RUN pip install distributed
RUN pip install fsspec
RUN pip install fastavro
RUN pip install python-snappy
RUN pip install dask[bag]
RUN pip install dask[dataframe]
RUN pip install jupyter-server-proxy
# Dashboard
EXPOSE 8787
# Scheduler
EXPOSE 8786
In my notebook, I use following code snipped to connect to the scheduler:
from dask.distributed import Client
client = Client(address="dask-scheduler:8786")
client.dashboard_link
=> 'http://dask-scheduler:8787/status'
Using the IP of the container also not works.
this allows me to do my requested computation and works fine. But what is not working is the dashboard, that should be available on http://localhost:8787/status. This just returns
404: Not Found
My questions 1 is: What I am doing wrong? I found the --dashboard-address
argument in the docs and tried various combinations, but this now made any changes regarding the output of the dashboard. This goes to my second question:
Why is the argument available in the scheduler and the worker
and finally what changes I need to do, to make it work? Using Docker Desktop Community on Mac OS Version 2.3.0.3 with Engine 19.03.8
Thanks for any hints.