multi-py / python-gunicorn-uvicorn Goto Github PK
View Code? Open in Web Editor NEWMultiarchitecture Docker Containers for Python using Gunicorn and Uvicorn
License: MIT License
Multiarchitecture Docker Containers for Python using Gunicorn and Uvicorn
License: MIT License
I use this container to host an ML model, which takes a while to load on startup. Uvicorn tries to kill it because of this. Normally one could set the timeout, but this is not yet supported in this container.
Maybe it would be nice to have some way to add parts to the uvicorn command, such as timeout values.
Hello.
We were using ghcr.io/multi-py/python-uvicorn images for local development since some of our devs are on mac M1.
But for production, we use tiangolo/uvicorn-gunicorn-fastapi
So I decided it would be a great thing to update our local image to this container: ghcr.io/multi-py/python-gunicorn-uvicorn
However, after doing so, I end up with the error in the title. it seems to be quite a low level error, with some somponents missing in the image as per I understand.
Here is the complete log:
Attaching to back-end-1
back-end-1 | Checking for script in /app/prestart.sh
back-end-1 | There is no script /app/prestart.sh
back-end-1 | [2024-03-15 09:17:44 +0000] [1] [INFO] Starting gunicorn 21.2.0
back-end-1 | [2024-03-15 09:17:44 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
back-end-1 | [2024-03-15 09:17:44 +0000] [1] [INFO] Using worker: gevent
back-end-1 | [2024-03-15 09:17:44 +0000] [8] [INFO] Booting worker with pid: 8
back-end-1 | [2024-03-15 09:17:44 +0000] [8] [ERROR] Exception in worker process
back-end-1 | Traceback (most recent call last):
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
back-end-1 | worker.init_process()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/ggevent.py", line 147, in init_process
back-end-1 | super().init_process()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 131, in init_process
back-end-1 | self.reloader = reloader_cls(extra_files=self.cfg.reload_extra_files,
back-end-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/reloader.py", line 80, in __init__
back-end-1 | self._watcher = Inotify()
back-end-1 | ^^^^^^^^^
back-end-1 | File "/usr/local/lib/python3.11/site-packages/inotify/adapters.py", line 60, in __init__
back-end-1 | self.__epoll = select.epoll()
back-end-1 | ^^^^^^^^^^^^
back-end-1 | AttributeError: module 'select' has no attribute 'epoll'
back-end-1 | [2024-03-15 09:17:44 +0000] [8] [INFO] Worker exiting (pid: 8)
back-end-1 | [2024-03-15 09:17:44 +0000] [9] [INFO] Booting worker with pid: 9
back-end-1 | [2024-03-15 09:17:44 +0000] [1] [ERROR] Worker (pid:8) exited with code 3
back-end-1 | [2024-03-15 09:17:44 +0000] [9] [ERROR] Exception in worker process
back-end-1 | Traceback (most recent call last):
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker
back-end-1 | worker.init_process()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/ggevent.py", line 147, in init_process
back-end-1 | super().init_process()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 131, in init_process
back-end-1 | self.reloader = reloader_cls(extra_files=self.cfg.reload_extra_files,
back-end-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/reloader.py", line 80, in __init__
back-end-1 | self._watcher = Inotify()
back-end-1 | ^^^^^^^^^
back-end-1 | File "/usr/local/lib/python3.11/site-packages/inotify/adapters.py", line 60, in __init__
back-end-1 | self.__epoll = select.epoll()
back-end-1 | ^^^^^^^^^^^^
back-end-1 | AttributeError: module 'select' has no attribute 'epoll'
back-end-1 | [2024-03-15 09:17:44 +0000] [9] [INFO] Worker exiting (pid: 9)
back-end-1 | [2024-03-15 09:17:44 +0000] [1] [ERROR] Worker (pid:9) exited with code 3
back-end-1 | Traceback (most recent call last):
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 202, in run
back-end-1 | self.manage_workers()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 571, in manage_workers
back-end-1 | self.spawn_workers()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 643, in spawn_workers
back-end-1 | time.sleep(0.1 * random.random())
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
back-end-1 | self.reap_workers()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 530, in reap_workers
back-end-1 | raise HaltServer(reason, self.WORKER_BOOT_ERROR)
back-end-1 | gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
back-end-1 |
back-end-1 | During handling of the above exception, another exception occurred:
back-end-1 |
back-end-1 | Traceback (most recent call last):
back-end-1 | File "<frozen runpy>", line 198, in _run_module_as_main
back-end-1 | File "<frozen runpy>", line 88, in _run_code
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/__main__.py", line 7, in <module>
back-end-1 | run()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 67, in run
back-end-1 | WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/app/base.py", line 236, in run
back-end-1 | super().run()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/app/base.py", line 72, in run
back-end-1 | Arbiter(self).run()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 229, in run
back-end-1 | self.halt(reason=inst.reason, exit_status=inst.exit_status)
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 342, in halt
back-end-1 | self.stop()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 396, in stop
back-end-1 | time.sleep(0.1)
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
back-end-1 | self.reap_workers()
back-end-1 | File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 530, in reap_workers
back-end-1 | raise HaltServer(reason, self.WORKER_BOOT_ERROR)
back-end-1 | gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
back-end-1 exited with code 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.