<@ULVA73B9P> I'm using the dask task_runner. I alr...
# ask-marvin
d
@Marvin I'm using the dask task_runner. I already ran `prefect server start to show a dashboard (on port 4200). However, when I run my python script with prefect I can't view the flow on the dashboard (port 4200). I believe it's being displayed on a different port/dashboard but I can't find it. I also get this message on my output " INFO | prefect - Starting temporary server on http://127.0.0.1:8444", but when I click on the link it shows a "can't reach this page" error.
m
thought for 41.1 seconds
There are actually two separate dashboards at play here, which explains the confusion: 1. The Prefect UI (port 4200) - This is where you see your flow runs and overall Prefect orchestration 2. The Dask dashboard - This is what's trying to start on port 8444, and it's specifically for monitoring Dask task execution The "temporary server" message you're seeing is for the Dask dashboard, not the Prefect UI. The reason you can't access it immediately is that the Dask dashboard is only available while your flow is actually running. Here's how to fix this: 1. Keep your Prefect server running on port 4200 2. When you run your flow, watch for the Dask dashboard URL in the logs 3. While your flow is actively running, try accessing the Dask dashboard URL 4. Your flow runs will still show up in the Prefect UI (port 4200), but the Dask-specific metrics will be on the Dask dashboard If you want to ensure the Dask dashboard is accessible, you can explicitly configure the DaskTaskRunner. Here's an example:
Copy code
python
from prefect import flow
from prefect_dask import DaskTaskRunner

@flow(task_runner=DaskTaskRunner(
    cluster_kwargs={"dashboard_address": ":8787"}  # Specify a fixed port
))
def my_flow():
    # your flow code here
    pass
This will make the Dask dashboard consistently available on port 8787 while your flow is running. Remember: - The Prefect UI (4200) shows your flow runs, logs, and overall orchestration - The Dask dashboard shows Dask-specific execution metrics and is only available while your flow is running - Both dashboards are useful but serve different purposes You can find more details about the Dask integration in the Prefect-Dask documentation.
n
what does
prefect config view
show?
i suspect you're running against an ephemeral server instead of the one you intend to use
d
Copy code
PREFECT_PROFILE='local'
PREFECT_API_URL='<http://127.0.0.1:4200/api>' (from profile)
oh nevermind...
Copy code
PREFECT_PROFILE='ephemeral'
PREFECT_SERVER_ALLOW_EPHEMERAL_MODE='true' (from profile)
so I'm running my python script (with prefect) through a docker container, I'm assuming this is why the context is different
@Nate Could I simply set an environment variable within my docker container environment to ensure that it stays on the intended server (port 4200)?
n
im not sure i understand your setup > through a docker container where is your script relative to the server? the main point is that
PREFECT_API_URL
ought to be set to the address of your prefect server's API, the value of the address being subject to your networking setup so commonly i run
Copy code
» docker run -p 4200:4200 --rm -d prefecthq/prefect:3.4.7-python3.12 -- prefect server start --host 0.0.0.0
and then since that's port forwarded to my localhost, this profile setup works
Copy code
» p config view
🚀 you are connected to:
<http://127.0.0.1:4200>
PREFECT_PROFILE='bleeding'
PREFECT_API_URL='<http://127.0.0.1:4200/api>' (from profile)
d
Essentially, my setup is that I'm mounting some directories
Copy code
docker run --rm -it -v C:/Users/foo/project:/app --workdir //app image:latest bash
Issue resolved