Add FastAPI framework support to Oryx#2904
Merged
Saipriya-1144 merged 23 commits intomainfrom Apr 29, 2026
Merged
Conversation
Saipriya-1144
commented
Apr 20, 2026
Saipriya-1144
commented
Apr 20, 2026
…hintalapat/onboard-fastapi-detection
vijaysaayi
reviewed
Apr 24, 2026
vijaysaayi
reviewed
Apr 24, 2026
sarsharma
reviewed
Apr 27, 2026
sarsharma
reviewed
Apr 27, 2026
sarsharma
reviewed
Apr 27, 2026
sarsharma
approved these changes
Apr 27, 2026
vijaysaayi
approved these changes
Apr 27, 2026
…hintalapat/onboard-fastapi-detection
sarsharma
approved these changes
Apr 28, 2026
surenderssm
reviewed
Apr 29, 2026
surenderssm
reviewed
Apr 29, 2026
surenderssm
reviewed
Apr 29, 2026
surenderssm
reviewed
Apr 29, 2026
surenderssm
approved these changes
Apr 29, 2026
vijaysaayi
reviewed
Apr 29, 2026
Shi1810
approved these changes
Apr 29, 2026
prathambande
approved these changes
Apr 29, 2026
surenderssm
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR onboards FastAPI as a first-class detected framework in Oryx, alongside Django and Flask.
How detection works
During startup, the script generator scans the app directory for common entry files — main.py, app.py, application.py, server.py — and looks for "from fastapi import" or "FastAPI(" in their contents. Detection runs in priority order: Django → FastAPI → Flask, so if an app somehow imports both FastAPI and Flask, FastAPI wins.
How the app starts
Once detected, Oryx generates a Gunicorn startup command with Uvicorn workers:
gunicorn --timeout 600 --access-logfile '-' --error-logfile '-' -c /opt/startup/gunicorn.conf.py --chdir=/tmp/8dea620f57fccb8" gunicorn -k uvicorn_worker.UvicornWorker main:appFastAPI is ASGI, so it needs Uvicorn workers instead of Gunicorn's default sync workers. Gunicorn acts as the process manager (timeouts, restarts, worker scaling) while Uvicorn handles the async protocol.
Debug mode
In debug mode, Oryx skips Gunicorn entirely and runs:
python -m debugpy --listen 0.0.0.0:5678 -m uvicorn main:app --host 0.0.0.0 --port 8000Added Go startup script generator tests to unit-tests.yaml — they now run on every PR and push to main.Added Go startup script generator tests to unit-tests.yaml — they now run on every PR and push to main.
Testing:
Created a runtime image with these changes and deployed a fastapi app
For python 3.14:

For python 3.13:

Deployed the same fastapi app as above, but it detected the app as flask - as expected
Debug mode:

