-
Notifications
You must be signed in to change notification settings - Fork 56
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
Use python3 instead of php. #80
Comments
For whatever it's worth, I prefer small light frameworks such as flask. My 2 cents, |
@aaronkaplan you're 100% right IMHO. +1 |
The decision for a web framework will have an effect on several intelmq components, so it should be taken centrally. I've created certtools/intelmq#708 for it. |
When fixing #111 is makes sense to also switch from php to python3. As https://github.com/Intevation/intelmq-fody-backend is working nicely with https://www.hug.rest/ Rough plan:
Is is allowed to change the endpoints and their parameters if researching shows that something can be done better, because the serving and html pages and javascript parts are delivered together and considered internal implementation detail. |
I don't quite agree and I am also not sure if it fits with future architectures. |
@aaronkaplan thanks for commenting! Can you be more specific about which parts you do not agree? Choice of microframework hug versus fastAPIWe'll take a look at FastAPI. Explanation of the current suggestion hug: Small hint: fastapi itself lists hug as a major influence and good step forward, so it is not bad in the eyes of the fastapi developers. :) |
In certtools/intelmq#708 (comment) there is a look about the strength and weaknesses of FastAPI versus hug as general web framework choice. In conclusion FastAPI has the potential to surpass hug, because it takes more modern approaches. Currently it is not as mature and has some unneeded complexity for an internal interface (which is the main topic in this issue). So there is some more work in using FastAPI, here for the deployment: DeploymentFastAPI is newer, it needs an ASGI server and those again need an TLS capable HTTP server/proxy. Some of the dependencies are not considered production stable (yet). To check the packaging level in Debian (as example):
For hug there are packages (though python-hug is not yet in Debian Stable): ConclusionThe microframework choice is not the main focus of this issue. Both FastAPI and hug would work. We from Intevation would be fine to do either variant, so it is up to you @aaronkaplan, @wagner-certat and our customers to decide what you prefer. |
@aaronkaplan could you please be more specific on why hug et al isn't fit? |
Sunet contracted us (from Intevation) do resolve this issue, timeframe is within two month. |
The main problem I see is that we have multiple Python-based web applications in IntelMQ. Yet it's fody and and webinput, now the manager gets converted too. That will make the set-up procedure much harder , it's already a pain with only fody and webinput. Maybe the manager could act as an proxy/relay here to keep/make it manageable. |
From what I've read and the existance of the issue itself, we agree that moving away from php is a good thing. :) Proliferation of python3 microframeworks is a possible negative aspect. However gaining experience If we move to hug, it is one technology less and we will find something to see if we keep the urls between the manager and fody and other apis separated. Moving to FastAPI would give us more experience with a potentially raising microserving technology, @aaronkaplan What is your opinion now, that you've read the various cons and pros? |
I'm going to start working on this. In order to keep the effort focused I'm going to to use hug as framework for reasons already mentioned in |
Hi @bernhard-herzog , @bernhardreiter , so... I'd like to schedule a quick call with you regarding the IntelMQ 3.0 architecture. ok? In principle, for the next version I don't care which RESTful API framework you want to use. Could you please mail me a few suggestions when you would have time (I can only do afternoons Mo-Thursday, FR the whole day). Thanks + Best, |
I've now actually started on this with a bit of prototyping of a |
About the IntelMQ 3 architecture and the small mumble conf: We've talked about https://github.com/certtools/intelmq/blob/version-3.0-ideas/docs/architecture-3.0.md and it does not affect this point, as the timeline is much longer and it is all in the idea and feedback collection phase. So all green light for getting this done quickly and with hug3. :) @bernhard-herzog plans to have our prototype in a branch within the next days (when get around doing it). |
On 21.04.2020, at 12:49, Bernhard E. Reiter ***@***.***> wrote:
About the IntelMQ 3 architecture and the small mumble conf: We've talked about https://github.com/certtools/intelmq/blob/version-3.0-ideas/docs/architecture-3.0.md and it does not affect this point, as the timeline is much longer and it is all in the idea and feedback collection phase. So all green light for getting this done quickly and with hug3. :)
@bernhard-herzog plans to have our prototype in a branch within the next days (when get around doing it).
confirmed.
|
I've just pushed the first part of my implementation to |
technical considerationsStatic parts for HTML, javascript, css for the single page web application could also be served outside of hug3 by a webserver, and only optionally like https://github.com/hugapi/hug/blob/develop/examples/static_serve.py . So preparation of the spa could happen as pre-procession. However I'm not sure if we get this done as part of this issue. |
Python-backend is feature completeI've finished the port of the PHP backend and can now run The main thing left to do is installation and setup. This includes the One thing that is missing is a timeout for the intelmqctl subprocesses. |
Wow, that is great news! Could the timeout maybe easier be implemented in intelmqctl itself? |
I've replied to this in #195 (comment) |
I've updated docs/INSTALL-DEV in our |
Some of next steps: Feed-backHas anybody tried it? Did it work? What do we need to change? Code organisationThe Python code is in the Possible solutions:
DocumentationIn particular, the installation instructions obviously have to be I've developed the python port on Ubuntu 18.04LTS, so the new |
Works for me! I tried it on our development instance and haven't seen any bug yet :)
Do you prefer one over the other? I'm fine with both variants.
No, as 18.04 works, that's fine. For example we do not need to support Debian 8 and Ubuntu <= 16.04. I can add instructions for Debian, CentOS and openSUSE myself.
👍 |
Personally my tendency is renaming to 'static' to separate the python code module more clearly. |
Great!
After looking into this a bit, I went with |
My test was successful, I did an overview test, covering:
hints for improvement and packaging
positions.confThis needs a writable manager/positions.conf file, even if it just an empty one and the documentation
from intelmq installation instructions https://github.com/certtools/intelmq/blob/develop/docs/Developers-Guide.md#development-environment may not be enough to ensure this, so packageing might. Maybe a solution is to have the manager be able to create the file if it does not exist (which we can put in a new issue). |
The actual porting is done. What's missing is documentation and |
If the plan is to release IntelMQ Manager 2.3.0 with the new python backend module (https://github.com/certtools/intelmq-api) (So basically we could close here, because Issues are closed when they are in the code and not when they are release?) |
Yes, we can close here. Before doing the release just we need more testing |
What kind of testing would be needed? (Just asking, if it is known, someone could estimate if they could help.) |
Just using it in practice to check if there are some glitches. We need to do that internally and I intend to write a mail to the mailinglists as well to announce this major change (and ask for testing it & feedback). |
Using python3 to serve the manager would get rid of a major dependency ("php").
Given that large frameworks always has defects it is desireable to remove php
as python3 is already coming with intelqm.
Technically: Should be a reasonable effort because most stuff happens in Javascript anyway.
Would need a python3 webframe work to move, which needs to be selected.
(E.g. from stuff like Django to flask and bottle.)
The text was updated successfully, but these errors were encountered: