Repository navigation
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change to vendor plain FastAPI while retaining Uvicorn.
No open issues 🎉
What changed in this PR
This PR reduces API worker artifact size and cold-start overhead by vendoring plain fastapi instead of fastapi[standard], while retaining uvicorn>=0.30.
Changes:
- Removes FastAPI’s standard extras from vendored API runtime requirements and documents reliance on API images for optional dependencies.
- Adds a regression test confirming that plain FastAPI and Uvicorn are requested without FastAPI extras.
| File | Description |
|---|---|
tests/test_apps/test_build.py |
Adds coverage for API runtime vendoring requirements. |
runpod/apps/build.py |
Removes the FastAPI standard extra and explains the dependency choice. |
Review effort: Balanced
This branch has not been deployed
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.
What
Vendor plain
fastapifor the API runtime instead offastapi[standard]:Why
Every app with a load-balanced resource vendored
fastapi[standard], giving a 5,937-file / 31.9 MB artifact (pygments, opentelemetry, sentry_sdk, google, dns, fastapi_cloud_cli). The runtime only importsfastapianduvicorn, and the[standard]extras are already present in the API images through sdk-runtime's own dependency. uvicorn still finds uvloop and httptools in the image's site-packages, because the vendored env is placed ahead of the image packages, not instead of them.Measured
Test plan
test_api_runtime_vendors_fastapi_without_the_standard_extra.make quality-check: 3458 passed, 7 skipped.Risks
fastapi[standard]extras being vendored (for examplepython-multipartfor forms) still gets them from the built-in API images. Custom images installrunpod-sdk-runtime, which depends onfastapi[standard]itself.