-
Notifications
You must be signed in to change notification settings - Fork 598
Conversation
7087cb9
to
9a85467
Compare
'replace Tornado with FastAPI for self documentation of API' |
While cleaning up and adding type annotations to python code in other parts of the codebase I have already been changing Tornado to FastAPI (e.g. in heron ui). The last remaining users of tornado after this are heron shell and one in integration test component. p.s. on the lines of servers and async in python, heron instance uses asyncore (deprecated) which could probably also benefit from a clean up and migration to asyncio |
Great! Less dependencies is better~
…On Sat, Dec 5, 2020 at 1:40 AM Oliver Bristow ***@***.***> wrote:
While cleaning up and adding type annotations to python code in other
parts of the codebase I have already been changing Tornado to python (e.g. in
heron ui <#3597>). The last
remaining users of tornado after this are heron shell and one in
integration test component.
*p.s. on the lines of servers and async in python, heron instance uses
asyncore (deprecated) which could probably also benefit from a clean up*
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3642 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQPBH57AH2AUKZMEMQX5DLSTH52RANCNFSM4UKP6TZQ>
.
|
Is this ready to merge, or do we still need to complete the "To Do" section found in the above description? |
I just updated the checklist; the python versions in Dockerfiles needs updating, as well as docs on it - 3.8 works, but 3.7 or 3.8 may be the minimum. I wouldn't want to merge this at the moment with the Heron 0.20.3 being almost finalised, but it would be good to after. I'd be happiest with someone using this branch in their environment to make sure it works outside of the limited unit+integration tests. When this is confirmed as working, it will be easier to understand what is going on and add tests to cover that functionality over time. |
Yes. Let's hold off on merging until we get 0.20.3-incubating-rc8 fully released. We are still going through the vote process on general@. |
c1fccd7
to
60c3c0f
Compare
TODO: * add container methods+views * add metrics methods+views * sort out typing * sort out return evelope stuff * sort out tests * add exception hierarchy and give traceback dev issues
TODO: * move Tracker.pb2_to_api stuff to Topology and update object necissary
60c3c0f
to
3037f50
Compare
I rebased this after seeing a PR went in for python 3.8 support, but it looks like the properly supported version isn't that high yet. There's still the issue of requiring python 3.7+ for this PR. I don't have the time to go through and update and test all of the Docker images which would get this in a good place for testing. |
Do you think the work done on this branch is worth one of us following up on to fix the Mac OS build issues related to pex? |
If the core bazel rules required a newer version of Python then that would be a separate line of work to this, which would unblock this PR. I haven't checked in on it so no idea if an upgrade would be needed for it, but could hope not, or that at least it would be apparently very early on from reading bazel's docs. I don't think there's anything in this PR as is which would help the migration to drop the PEX rules. The closest I can imagine is that this PR is towards removing the last of the |
Closing as #3646 now has the changes from this PR. |
The main goal of these changes are to help make the tracker easier to understand and work on in the future. Documentation is automatically generated from the code (thanks to FastAPI) and served at
/
of running tracker instances. E.g.heron-tracker --port=8080 & sleep 5 open http://localhost:8080/
Type annotations are included throughout. Adding
mypy
to the builds [e.g.] would be good to take advantage of the typing, but it would take additional work due to thepex_*
rules instead of regularpy_*
ones.A lot of things were touched, but I tried to leave things that looked suspicious but might be relied on as a feature, and didn't intentionally make changes to the interface aside from dropping the redirect at
/
and some methods returning objects with None values instead of undefined values (hopefully inconsequential - its managable in FastAPI/Pydantic that way). The tests now pass locally.The API feels a bit rough, for example returning objects with all None values rather than just a None, but I am not addressing things like that now as that would touch additional services.
The commits will be squashed down on merge so I'll clean up the commit message then.
Tracker changes
ResponseEnvelope
)There's probably still refinement potential, but I'm happy with the improvements to readability.
Exceptions may not appear as graceful in logs, but that's to help highlight where oddities occur so they can be factored out rather than just quietly skipped over.
Behaviour changes
/
→/topologies
redirect with (OpenAPI on ReDoc) documentationexecutiontime
and always return 0.0 for it in the response envelope - this could probably be put back in, but I don't think it's worth itTo do
This PR:
tools/python/checkstyle.ini
(it currently allows TODO/XXX/FIXME)Follow ons: