Miroslav Rác
01/10/2022, 3:25 PMimport 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:
> 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
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 setupKevin Kho
Miroslav Rác
01/10/2022, 3:28 PMKevin Kho
Kevin Kho
query {
flow {
name
project {
id
name
}
}
}
Miroslav Rác
01/10/2022, 3:30 PMKevin Kho
Miroslav Rác
01/10/2022, 3:31 PMMiroslav Rác
01/10/2022, 3:32 PMKevin Kho
Miroslav Rác
01/10/2022, 3:34 PMMiroslav Rác
01/10/2022, 3:35 PMMiroslav Rác
01/10/2022, 3:35 PMKevin Kho
Miroslav Rác
01/10/2022, 3:37 PMKevin Kho
Miroslav Rác
01/10/2022, 3:38 PMMiroslav Rác
01/10/2022, 3:40 PMKevin Kho
Miroslav Rác
01/10/2022, 3:46 PMKevin Kho
Miroslav Rác
01/10/2022, 3:50 PMpip 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
imageKevin Kho
prefect server start
inside the Docker container?Miroslav Rác
01/10/2022, 3:54 PMdocker-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 versionMiroslav Rác
01/10/2022, 3:55 PMKevin Kho
Miroslav Rác
01/10/2022, 4:15 PMKevin Kho
Miroslav Rác
01/10/2022, 6:14 PMMiroslav Rác
01/10/2022, 6:15 PMMiroslav Rác
01/10/2022, 6:15 PMKevin Kho
Miroslav Rác
01/10/2022, 6:55 PMMiroslav Rác
01/10/2022, 6:55 PMMiroslav Rác
01/10/2022, 6:56 PMKevin Kho
Kevin Kho
Kevin Kho
Miroslav Rác
01/10/2022, 7:06 PMKevin Kho
Kevin Kho
Miroslav Rác
01/10/2022, 9:47 PMKevin Kho