Hi everyone, I am new here! I am trying Prefect fo...
# ask-community
m
Hi everyone, I am new here! I am trying Prefect for the first time but I have come into an issue. My registered flow is not showing in the UI. I am running it locally via docker. testflow.py
Copy code
import prefect
from prefect import Flow, task

@task
def test_task():
    return 'ok'

with Flow('test_flow') as flow:
    test_task()

flow.register(project_name="other")
my CLI:
Copy code
> prefect backend server
Backend switched to server
> prefect server create-tenant --name default
Tenant created with ID: 6bf4ef79-ddcb-4ea3-8ea2-4dcab05a375a
> prefect agent local start
[2022-01-10 15:12:15,508] INFO - agent | Starting LocalAgent with labels ['72f026a71863']
...
> python /home/testflow.py
Flow URL: <http://localhost:8080/default/flow/bf9d5401-9034-4ec0-8e43-9149b0718d23>
 └── ID: 5e6af0a7-d5af-47bf-831b-b0a4fb4d3401
 └── Project: other
 └── Labels: ['72f026a71863']
when I open the URL directly, I can see the flow in the UI. I can run it via “quick run” and it runs. however, the flow is not listed in my project nor the run is visible under the flow (when accessed via URL, I see no activity and no run history). on the main dashboard, the run activity is showed but seem like it went astray since it is not assigned to the flow. the “flows” tab shows “you have no flows in this project” SETUP: I created
docker-compose.yaml
via
prefect server config
and changed hasura image to
hasura/graphql-engine:latest
because the default hasura image is not working fine with my mac M1 pro. I added another service from which I try to register and run flows
Copy code
client:
    image: python:3.8.12-slim
    command: bash -c "apt-get update -y && apt-get install gcc -y && pip install prefect[dev] && prefect backend server && tail -f /dev/null"
    volumes:
      - ./client:/home # here I have my testflow.py
    networks:
      prefect-server: null
    environment:
      - PREFECT__SERVER__HOST=<http://apollo>
EDIT: added info on my setup
k
Do you see your agent in the Agents tab of the UI?
m
yes.
k
Can you try querying for flows in the Interactive API to see if you fetch the one you registered?
m
this is the screenshot of the run (triggered via the quick run button). as you can see, the breadcrumb shows full path “other > test_flow > Version 1 > FLOW RUN”
k
Copy code
query {
  flow {
    name
    project {
      id
      name
    }
  }
}
m
yes, the query works
k
Could you show me what the Dashboard and Other project look like?
m
Other project
dashboard
k
You mean it doesn’t appear other Flows in Other?
m
this is the “flows” tab
an this is the flow detail when I access it via the URL from CLI. as you can see, there is no run nor activity showed
it seems like some association or some kind of relationship is not registered properly
k
Gotcha. Can you open the console for both Dashboard and Flows page and then refresh and see what error we get?
m
what do you mean by console? the UI?
k
Yeah the browser console
m
it looks just like on the screenshots I uploaded before, nothing has changed
I will add little more details on my setup to the original post. maybe I screwed up the infrastructure
k
You should see errors in the console if the data is not loading
m
oh I see, sorry I misunderstood. there is an error, looks like some resource has null value in uuid
k
This is weird. Yeah how did you spin up server and what version are you on?
m
what do you mean by spin up? sorry I am total beginner also with docker. I have installed prefect via
pip install prefect[dev]
, it downloaded
prefect-0.15.11-py3-none-any.whl
I am running it inside docker container based on
python:3.8.12-slim
image
k
You did
prefect server start
inside the Docker container?
m
no, I have listed my cli commands inside the docker container in the original post. I did
docker-compose up
from the outside instead of
prefect server start
because with
prefect server start
it was ignoring my docker-compose.yaml in which I needed to change hasura version
I updated the original post with more info on setup, please see
k
I don’t know what is causing this error. I’ll need to ask the team and get back to you
m
thank you for your help, I really appreciate
k
Did you create the project before registering?
m
yes I did. btw I made some advance. I downgraded hasura back to v1.3.3 and now it is working like charm.
so I guess the problem is with hasura. however, v1.3.3 is not working well on my machine (m1 processor, maybe that is the problem). it is eating all the available ram
I tried the latest hasura version and it was using ~60mb ram, v1.3.3 is eating 6GB right after start.
k
Thanks for the update. That’s odd, a lot of our team is on the M1
m
look at the memory usage. I have only started the server with default config, created one project, one tenant, one local agent and added that simple flow. nothing else
if I try any other hasura version it keeps failing or not working well as discussed above
would you please ask your mates if they used any configuration that can help?
k
I can test it for you. Running now
I have similar numbers for hasura
I think at this point, we should open a Github issue so one of the core team will see it
m
do you also have M1 Pro? can we confirm this is not the case for intel CPUs?
k
Yes I do. Intel…I can try on my desktop one sec. It’s windows though so I am not sure it will work. Give me a few
Never mind sorry I don't have Docker so I can't immediately test
m
k
Sounds good!