I've been trying to figure out how to properly exp...
# ask-community
o
I've been trying to figure out how to properly expose the Dask Dashboard so it can be accessed externally outside of a flow's Docker Container on a flow run w/ DockerRun and DaskCluster Executor (ephemeral Local Dask Cluster), and the initial path I went down wasn't successful, so looking for some advice. Right now I have the Flow Runs running with containers on a user-defined Docker bridge network. Currently, can't reach the Dask Dashboard, which I assume is because its port (8787) isn't accessible outside the container. So, I figured the most straightforward way would be to enable port forwarding for the 8787 port (which Dask Dashboard runs on by default) for the containers. I was planning on adding in that extra config for port-forwarding with the
host_config
arg of
DockerRun
, however looking at the Docker Python SDK docs, it appears the ports for forwarding have to additionally be passed into the
create_container()
function (https://docker-py.readthedocs.io/en/stable/api.html#docker.api.container.ContainerApiMixin.create_container), which looking at the prefect source code, is not an additional arg I can pass into the run configs of
DockerRun
to thus be sent into
create_container()
. So, doesn't seem possible. This feels like something pretty common and doable, and I'm guessing I'm just looking at it the wrong direction. Has anyone accomplish this before and have any suggestions? Thanks!
e
create_container
is called by the docker agent, and it currently doesn't receives a
ports
kwarg at all. So it doesn't seem possible at this point. I believe the agent passes down the
host_config
of
DockerRun
correctly, so the only thing missing is delivering a simple list to the
DockerAgent
. This would be a simple feature to add, why not open a issue/PR?
k
Hey @Owen McMahon, I understand what you are saying. I think you and Emre are right this currently can’t be done unless there are edits to the Docker Agent. Would you be interested in contributing?
o
Sure! Definitely seems like it'd be a pretty straightforward addition to make.