-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Feature][Fix] Upgrade dependencies #284
Conversation
ipython==8.1.1 lockfile==0.12.2 flask-socketio==5.2.0 flask_cors==3.0.10 flask==2.1.3 python-daemon==2.3.1 janus==1.0.0 jinja2==3.1.2 watchdog==2.1.9 pyjwt==2.4.0
Late initialization of KytosBuffers to get asyncio event loop
Fixed failing unit tests
Updated typing-extension constraint to use >= it's safe
Replaced asyncio loop initialization with new_event_loop Extracted functions from async_main for testability
Removed old compatibility when shutting down threadpool from older versions
I'll leave this PR in draft until Kytos-ng NApps also regenerate their requirement/run.txt dependencies, otherwise it'll break pip dendencies resolution in the docker image, so this PR needs to be strategically merged only when the NApps are ready, I'll keep track of them with this list, I'll also run e2e tests with these branches when they're ready:
|
The docker image has been built successfully using the branches that upgraded the dependencies, e2e tests are passing as well, I'll go ahead and mark this PR as ready for review:
|
Shifted loop.create_task of consumers after loading NApps
Shifted loop.create_task of consumers after loading NApps
I'll go ahead and merge this. |
Fixes #155, #158, #159, #282
Changes Summary
async
support, so NApps can leverageasyncio
and its ecosystem when applicable using the samerest
decorator. I'll give an example below.get_event_loop
withget_running_loop
when applicable to be compatible with python 3.9+ in the future.ipython
console now provides command completion withctrl + f
, no changes in storing command history though.pylint
since a very old one was being used causing conflicts on development dependencies, as a result the linter is picking up more errors, so I had to fix several of tiny linter issues. I didn't want to touch this many files in this same PR, but it had to be done.APIServer
instance after unloading NAppsFlask async route example
v1/request
endpoint, notice the only difference is theasync
keyword before the method definition. This method will run in the event loop, still backed by a thread. In this case, it's performing two concurrent requests and returning an empty response. You can leverageasyncio
when it's suitable to do so:Request stress test
New endpoint
I've added a temporarily
v1/compute
endpoint in thesample_ui
NApp, it handled 100+ request/sec over 30 secs successfully:Existing sync endpoints
I've also repeated the same tests that were used on #225, and the existing instability still exist when a significant rate 500+ req /sec over 30 sec happens which is expected since there were no changes in this endpoints, so confirming that no regression happened: