ol-infrastructure icon indicating copy to clipboard operation
ol-infrastructure copied to clipboard

Investigate replacement of uWSGI for application server

Open blarghmatey opened this issue 1 year ago • 2 comments
trafficstars

Description/Context

The uWSGI project has been officially in maintenance mode for over a year now. In order to mitigate any risk from lack of support or feature development in a core part of our serving capability we need to identify and implement a viable replacement for this technology.

A common alternative to uWSGI is Gunicorn, but that is more limited in its capabilities (e.g. no serving of static assets). Alternatives to investigate:

  • gunicorn - https://gunicorn.org/
  • uvicorn - https://www.uvicorn.org/
  • Hypercorn - https://github.com/pgjones/hypercorn
  • Nginx Unit - https://unit.nginx.org/
  • Granian - https://github.com/emmett-framework/granian

Plan/Design

We want the replacement to be flexible and applicable to all of our current serving environments. It is also beneficial if we can use it for future applications without requiring substantial customization. Nginx Unit is the most akin to uWSGI in that it is able to serve multiple language runtimes and is not tightly coupled to Python.

After determining the likely candidate(s) we need to implement it in a test application to establish the necessary patterns for its use and itegration with our existing infrastructure.

blarghmatey avatar Jan 02 '24 18:01 blarghmatey

Once we identify the target that we want to support, we will need to follow up with replacing uWSGI across our various applications. This includes (not an exhaustive list):

  • Open edX
  • MITx Online
  • xPRO
  • OCW Studio
  • Bootcamps
  • ODL Video
  • Open edX components (edx-platform, notes)

blarghmatey avatar Jan 05 '24 17:01 blarghmatey

The most likely target as a replacement for uWSGI, and allowing for unification of runtime for WSGI and ASGI services is the Granian server https://github.com/emmett-framework/granian/. We should migrate the Docker build of a candidate application (likely Learn as part of the Kubernetes migration) and validate functionality. Once we are confident in its operational characteristics we can replace all usage of uWSGI with Granian.

blarghmatey avatar Apr 01 '25 16:04 blarghmatey