I have a FastAPI application which should start/stop a prodigy annotation server via endpoints. I'm using python's multiprocessing package to create a new process that calls
prodigy.serve on a specific port. All this works great on Windows 10. However, when I build it as a Docker image and try using it, it fails when prodigy tries to run the uvicorn server with the following error:
File "/usr/local/lib/python3.8/site-packages/prodigy/__init__.py", line 43, in serve server(controller, controller.config) File "/usr/local/lib/python3.8/site-packages/prodigy/app.py", line 529, in server uvicorn.run( File "/usr/local/lib/python3.8/site-packages/uvicorn/main.py", line 362, in run server.run() File "/usr/local/lib/python3.8/site-packages/uvicorn/main.py", line 389, in run loop = asyncio.get_event_loop() File "/usr/local/lib/python3.8/asyncio/events.py", line 639, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0'
Furthermore, I have configured the host to be
0.0.0.0 as suggested in other threads.
I'm using prodigy version 1.10.8.
I think this is exactly the same problem as one mentioned in this thread.