-
Notifications
You must be signed in to change notification settings - Fork 2
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
Make SDX Local Controller a WSGI app #149
Conversation
This is unnecessary if we're using WSGI or even flask
Pull Request Test Coverage Report for Build 9556400895Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9558410474Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9558450035Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9568411630Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9568543362Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9568572969Details
💛 - Coveralls |
All so that uvicorn will use and print the same port that we specified with SDXLC_PORT when running `docker compose up`.
Pull Request Test Coverage Report for Build 9570971840Details
💛 - Coveralls |
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.
ASGI vs WSGI;
Flask vs. uvicorn vs. gunicorn
FastAPI vs. swagger UI
Please write a blog for educational purpose...
@YufengXin Is that a request meant for me? 🙈 🙉 🙊 |
@sajith Yes-:) I assume you're moving to upgrade sdx-controller too? |
This is already done on sdx-controller. For production usage, using Flask's built-in web server directly is not a good idea, since it is single threaded and synchronous. It is good enough during development, but it just not meant to be used in production. It should be used in conjunction with a WSGI server (Gunicorn, uWSGI), since it is more secure, scalable, and can work with reverse proxy web servers (such as nginx or caddy, which we will need for SSL termination). ASGI is essentially the updated version of WSGI that understands |
The first part is clear as we always do. I don't know much about ASGI. So the key is the wsgi_to_asgi converter. as my naive understanding is that FASTAPI is to ASGI as Flask to WSGI. But somebody on Internet said Flask2.0 supports ASGI.... Nice upgrade. I'll read more into it. |
FastAPI is an alternative to connexion and Flask, if I understood correctly. It probably would be nicer too, but it is also very likely to come with its own set of limitations. Since the choice has already been made, and since we're somewhat familiar with Flask and connexion, and since there is a cost (time and opportunity) to switching, I am of the opinion that we should continue working with the current setup. Unless there is a good reason to switch to something else, of course. :-) |
Also the |
Totally agree. Let's keep it this way, because you made it work well-:) |
Thank you. There's more to be done, of course. :-) |
Resolves #86.