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

Replace cherrypy by something new #2180

Open
Safihre opened this issue May 16, 2022 · 8 comments
Open

Replace cherrypy by something new #2180

Safihre opened this issue May 16, 2022 · 8 comments

Comments

@Safihre
Copy link
Member

Safihre commented May 16, 2022

cherrypy has not really been updated since 2019.

I was looking into replacing it with starlette and uvicorn, which use Python's async framework.

It would require a major rewrite of all interface code, so it might not be worth it.
In the end we do not care that much about thousands of concurrent transactions and mostly SABnzbd's own code is the bottleneck.

@thezoggy
Copy link
Contributor

thezoggy commented May 16, 2022

i would vote for using uvicorn for server, fastapi for api (which is built ontop of starlette, and uses pydantic for validation)
then automatic api tests using schemathesis/dredd

but web framework+api side, there is prob a bit of things we could optimize within sab code as you noted.
one example off the top of my head is all our uses for urllib, we could use requests instead.

@Safihre
Copy link
Member Author

Safihre commented May 17, 2022

@thezoggy You mentioned the urllib part a number of times, but the only real place where we really use it a lot is in the URLGrabber, and that code is not overly complicated because of urllib use.

Will take a look at fastapi!

@thezoggy
Copy link
Contributor

I recently picked this up, so far has been a good read:
https://livebook.manning.com/book/microservice-apis-in-python/

@stale stale bot added the Stale Issues automatically closed because they became stale label Jun 10, 2022
@stale stale bot removed the Stale Issues automatically closed because they became stale label Jun 11, 2022
@sabnzbd sabnzbd deleted a comment from stale bot Jun 11, 2022
@Safihre
Copy link
Member Author

Safihre commented Aug 14, 2022

After implementing, double check errors like: #2267.

@Safihre
Copy link
Member Author

Safihre commented Oct 4, 2023

@jcfp any chance I can interest you in this? 😊 You know how to handle big impact projects like replacing the Sorter!
I already made a POC start: https://github.com/sabnzbd/sabnzbd/tree/feature/uvicorn

We can also consider dropping functionality (like supporting both http and https simultaneously on different ports, as an example) if they turn out too complicating.

It seems cherrypy is really not maintained anymore.

@jcfp
Copy link
Member

jcfp commented Oct 9, 2023

I'll take a look

@thezoggy
Copy link
Contributor

thezoggy commented Jan 24, 2024

wow, cheroot finally pulled in that ssl pr. hopefully new cherrpy soon

@Safihre
Copy link
Member Author

Safihre commented Jan 24, 2024

Hopefully, although I still want to rip it out as soon as possible. It's close to abandonware, although Cheetah is probably worse..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants