Skip to content

Conversation

@javierdelapuente
Copy link
Contributor

@javierdelapuente javierdelapuente commented Aug 30, 2024

  • Have you signed the CLA?

This PR implements the spec ISD160 - 12-Factor FastAPI Support" for rockcraft.

For that, a new init profile called "fastapi-framework" and a new fastapi extension, called "fastapi-framework" are needed. These additions are similar to the flask and django init profiles and extensions, with several differences. Some of the main differences are:

FastAPI and starlette supported.
The ASGI entrypoint location can be in serveral places (and it is ASGI instead of WSGI).
No dependency on gunicorn. FastAPI works with uvicorn without a configuration file.
No statsd.
Ubuntu 24.04 by default (supported bases 24.04 and bare).

All current extensions (go, django, flask and now fastapi), have similarities (at the end they extend/change the rockcraft.yaml file), but also many subtle different details, like how they service command is overridden, extra tools or frameworks, what can be overridden and how, extra env variables (only Go).... As so, I have decided to not try to use a common base class for all of them (allowing them to easily evolve independently without a coupled inheritance structure). This is a tradeoff, as code is similar between frameworks. This is open for discussion.

@javierdelapuente javierdelapuente marked this pull request as ready for review August 30, 2024 12:08
@javierdelapuente
Copy link
Contributor Author

Hi @tigarmo can you have a look at this PR? Thanks!

Copy link
Collaborator

@tigarmo tigarmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@tigarmo tigarmo requested a review from a team September 16, 2024 13:59
@lengau lengau requested a review from a team September 16, 2024 14:35
@tigarmo tigarmo merged commit e75db7f into canonical:main Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants