Skip to content
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

Swap Flask API for FastAPI #78

Open
dgarnitz opened this issue Oct 25, 2023 · 10 comments
Open

Swap Flask API for FastAPI #78

dgarnitz opened this issue Oct 25, 2023 · 10 comments

Comments

@dgarnitz
Copy link
Owner

Right now we are running Flask with Gunicorn using PM2. There are a few problems with this:

  • Flask is not fast
  • PM2 is designed for node JS, not pythonb

We should swap Flask for FastAPI and (if possible in one PR) swap PM2 for something more appropriate.

Note: We currently depend on Flask-sql alchemy for our DB ORM. We will need to swap this when migrating away from Flask. This may also require changes to the DB services that are also dependencies for the worker and vdb upload worker

@OlivierCavadenti
Copy link

Also FastAPI have an awesome automatic documentation generation :
https://fastapi.tiangolo.com/tutorial/metadata/

@dgarnitz
Copy link
Owner Author

dgarnitz commented Nov 8, 2023

Thanks for linking that @OlivierCavadenti! Any chance you want to implement this upgrade for us? We would really value your contribution!

@OlivierCavadenti
Copy link

Thanks for linking that @OlivierCavadenti! Any chance you want to implement this upgrade for us? We would really value your contribution!

I can check want I can do !

@datgerhardt
Copy link

Hi @dgarnitz , I will love take this take on

@dgarnitz
Copy link
Owner Author

Go for it!

@dgarnitz
Copy link
Owner Author

Let me know if I can help!

@datgerhardt
Copy link

Hi @dgarnitz, I was trying to maintain the abstraction of the request to get API Keys and files. I am having issues with handling the files. This is sample representation of the file "<_io.BufferedReader name='api/tests/fixtures/test_text.txt'>"

Also with this approach we will lose better auto docs generation support

@dgarnitz
Copy link
Owner Author

@datgerhardt Can you provide me with more context around the bug you ran into? Perhaps some screenshots or a code snippet

@david-vectorflow
Copy link
Collaborator

Any update?

@datgerhardt
Copy link

Thanks for your patience, I had the Internet outage in Ghana due to a problem with undersea cable for past few weeks

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

No branches or pull requests

4 participants