-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python] Use various engines #4568
Conversation
@RobertoPrevato with Traceback (most recent call last):
File "blacksheep/baseapp.pyx", line 79, in blacksheep.baseapp.BaseApplication.handle
TypeError: user_info() missing 1 required positional argument: 'id' The docker file use is FROM python:3.9-slim
WORKDIR /usr/src/app
RUN apt-get -qq update
RUN apt-get -qy install build-essential
COPY server.py server.py
COPY requirements.txt requirements.txt
RUN pip install daphne
RUN pip install -r requirements.txt
CMD daphne -b 0.0.0.0 -p 3000 server:app have you ever tried https://github.com/django/daphne ? |
Hi @waghanza, thanks for the heads up. I never tried Daphne, I'm currently supporting Hypercorn and Uvicorn including integration tests. I will soon check why and if I can make BlackSheep work with it. |
indeed. the idea of this project is to produce some results from frameworks (but with various setups for this |
Yes and I think it's a very good idea to test with different setups, it's very useful for benchmarks to show these scenarios. |
@waghanza index.py can run on uvicorn, hypercorn, daphne or other servers that implement the ASGI interface. |
220da84
to
033cf8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes look OK
@waghanza Falcon should be runnable with any compliant ASGI server. We currently test with uvicorn, daphne, and hypercorn: https://github.com/falconry/falcon/blob/master/tests/asgi/test_asgi_servers.py#L535 That being said, we recommend uvicorn where performance is concerned. cc @vytas7 |
@ahopkins I have a 500 on Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/sanic/app.py", line 1715, in __call__
await asgi_app()
File "/usr/local/lib/python3.9/site-packages/sanic/asgi.py", line 223, in __call__
await self.sanic_app.handle_exception(self.request, e)
File "/usr/local/lib/python3.9/site-packages/sanic/app.py", line 736, in handle_exception
await self.dispatch(
File "/usr/local/lib/python3.9/site-packages/sanic/signals.py", line 191, in dispatch
return await dispatch
File "/usr/local/lib/python3.9/site-packages/sanic/signals.py", line 130, in _dispatch
group, handlers, params = self.get(event, condition=condition)
File "/usr/local/lib/python3.9/site-packages/sanic/signals.py", line 92, in get
group, param_basket = self.find_route(
TypeError: 'NoneType' object is not callable |
@Ayehavgunne Same issue on Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/daphne/http_protocol.py", line 163, in process
self.application_queue = yield maybeDeferred(
TypeError: __call__() got an unexpected keyword argument 'receive' |
This is a known thing. Daphne does not execute the life cycle startup events. Last I checked it was an implementation issue with Daphne. |
Ok. Then probably worth to add some point in the doc https://sanicframework.org/en/guide/deployment/running.html#asgi |
Thanks @waghanza. I just updated to docs. For reference for anyone coming across this: django/daphne#264 |
Does anyone has public result with the different engines? |
Not yet @bgervan. We need to have a customized frontend first. Actual results shows only 1 engine => https://web-frameworks-benchmark.netlify.app/result |
* fix outdated rake config * remove duplicated config * wrong merge for php dockerfile * use phalcon 4.x * merge imi * update ci * add workerman config for imi * bad version required for phalcon * update ci config * lint * add swoole / workerman for mixphp * merge node and uwebsockets versions for chubbyjs * update ci config * fix * fix * add ssl layer in php containers * enable ci for engines * fix ci * fix chiubbyjs * use built-in php ssl module * missing config for nest * update sails config * lint * use phalcon 5.0.0alpha6 * fix roadrunner config for spiral * fix tower config * fix phalcon config * lint files * remove duplicate upload on container * show docker version used on CI * quotify paths for file uploaded to containers * downgrade imi to 2.0.11 * [Javascript] Add opine (#4839) * unrestrict imi version * fix docker error due to duplicate upload onto containers * deduplicates framework build steps * use phalcon beta * avoid multiple gemfiles for ruby based projects * typo * [Python] Use various engines (#4568) * start pythonization * run ci only for python * add blacksheep * add bottle * add cyclone * add gunicorn for django * disable daphne for blacksheep * add hypercorn for django * add asgi adapter for django * add asgi support for baize * add accurate engine for python frameworks * missing cheroo * add command for waitress / uwsgi * typo * complete python suite * remove daphne for blacksheep * typo * use safe navigation * remove meinheld patching * fix * remove outdated LOCs * fix CI for uwebsocket based frameworks * make gunicorn default choice for python * fix low-http-server * start working on golang * fix specs * pass on golang frameworks * fix deprecation warning on npm usage * Create codeql-analysis.yml * fix gramework * bad config for basolato * remove debug * add pcntl extension for workeman * typo * wrong container definition for php * configuration changes * use non lts version for uwsgi * beautify * fix go dockerfile * typos * remove codeql * restore old behavior * fix go dockerfiles * restore data * restore imi variants * restore laravel s * restore mixphp variants * restore one fpm * restore slim variants * restore sunrise router variants * restore yii swoole * fix aurora * typo * update go dockerfile * restore basolato * restore basolator * fix some php containers * typo * restore turbo polka * reduce PR size * reduce PR size * reduce PR size * restore fyrejet uwebsocket * beautify * upgrade node * reduce PR size * reduce PR size * typo * typo * typo * cleanup * cleanup * fix bottle * add engines * fix deprecated action * reduce ci tasks * reduce ci tasks * fix CI * increase CI tasks * increase CI tasks * increase CI tasks * increase CI tasks * increase CI tasks * increase CI tasks * increase CI tasks * typo * align config files * fix amber * typo * typo * missing static files into go containers * typo * missing files onto container * modify c dockerfile * missing dub.sdl for dlang * fix go builds * fix routejs config for uws * fix nginx config for php * missing ts compilation for adonis * use openjdk 17 * fix adonis config * fix haskell * fix yada * fix luminus * fix routerling * fix masonite * fix basolato * fix basicphp * fix workerman * fix antidot * fix chubbyphp * update dub * add redis / pcntl for formo * add pcntl for hyperf * beautify * cleanup * update * typo on config * pcntl is a php module not extension * lint * run I only on first engine * restore cpp / java frameworks * typos on some dockerfiles * fix java config * add properties files onto java containers * use jammy image for donkey * typo on dart config * typo * typo on java config * specify jvm level for kotlin based frameworks * add config file onto kotlin containers * add road runner config file onto containers * update camping config * html entity issue in r dockerfile * fix hug config * add yml files for ligt-4j * fix micronaut dockerfile * typo on config for spring * fix light-4j config * add gradle build files for micronaut * fix micronaut build * fix event moudle load for php * use first engine * update * add run.sh * update scorper * update
Hi,
This
PR
starts using various engines (or setup) per python frameworks.The idea is to run framework on built-in capability (if provided) and other deployment options.
The is a lot of server engines (
gunicorn
,uvicorn
,bjoern
,uwsgi
...). The idea is to test with officially supported deployment options + some few accurate options (hypercorn
for ASGI for example)I, on purpose, keep a small list of setups per framework :
Here is the list of engines / setups we can use for each frameworks
Feel free to react / give me some feedback @dutradda @douglasfarinelli @almarklein @abersheeran @RobertoPrevato @webknjaz @defnull @cyclone @bdarnell @vitalik @kgriffs @tiangolo @bloodbare @masipcat @josephmancuso @pgjones @ahopkins @tomchristie @Ayehavgunne @taoufik07 @Bogdanp @gi0baro
Regards,