https://prefect.io logo
Title
m

Marcin Grzybowski

06/02/2022, 4:35 PM
Hi, maybe someone knows why it does not work for me. I'm trying to run simple flow (one flow with print) locally in manually built docker container and I get:
root@3b776c4684ea:/prefect/jobs# python3 simple.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/asgi_lifespan/_concurrency/asyncio.py", line 17, in wait
    await self._event.wait()
  File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:
dockerfile looks something like this:
FROM python:3.10-bullseye

RUN apt-get update
RUN apt install sqlite3

run pip install prefect==2.0b5 prefect-snowflake==0.1.0
plus ofcourse copying my sources, entrypoint etc
k

Kevin Kho

06/02/2022, 5:03 PM
This looks like it’s related to the Python script you actually ran right?
m

Marcin Grzybowski

06/02/2022, 5:09 PM
yes,
python3 simple.py
:
from prefect import flow

@flow()
def myflow():
    print(["AAAA"] * 15)

    
if __name__ == "__main__":
    myflow()
k

Kevin Kho

06/02/2022, 5:11 PM
That’s pretty weird. Can you try with the prefect container instead?
m

Marcin Grzybowski

06/02/2022, 5:17 PM
sure, but probably tomorrow ... where can I get the image or dockerfile ?
k

Kevin Kho

06/02/2022, 5:24 PM
https://hub.docker.com/r/prefecthq/prefect Maybe like
docker run prefecthq/prefect:2.0b5-python3.8
1
m

Marcin Grzybowski

06/03/2022, 5:52 AM
similar problems using this image (I have copied my simple.py into container and run it with python3:
root@1668c7681eb0:/opt/prefect# python3 simple.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/asgi_lifespan/_concurrency/asyncio.py", line 44, in run_and_fail_after
    await asyncio.wait_for(coroutine(), timeout=seconds)
  File "/usr/local/lib/python3.8/asyncio/tasks.py", line 501, in wait_for
    raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError
so probably something wrong with my docker/ environment ?
locally (without docker) it works
marcin@WSW-5M78J5J:/mnt/h/projects/prefect2.0$ python3 src/simple.py
08:02:40.568 | INFO    | prefect.engine - Created flow run 'incredible-beluga' for flow 'parallel-flow'
08:02:40.568 | INFO    | Flow run 'incredible-beluga' - Using task runner 'ConcurrentTaskRunner'
08:02:40.584 | WARNING | Flow run 'incredible-beluga' - No default storage is configured on the server. Results from this flow run will be stored in a temporary directory in its runtime environment.
['AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA', 'AAAA']
08:02:40.643 | INFO    | Flow run 'incredible-beluga' - Finished in state Completed()
It works in docker on native linux, so it's my env
ok, my wsl was using windows docker was able to install docker on wsl without docker desktop and it helped