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

chore: @rest endpoints are now run by starlette/uvicorn instead of flask/werkzeug #75

Merged
merged 10 commits into from
May 3, 2023

Conversation

viniarck
Copy link
Member

@viniarck viniarck commented Apr 25, 2023

Closes #74
Closes #73

This PR depends on kytos-ng/kytos#375

(I'll revert the pinned branch feat/starlette on requirements/dev.in later on, it's need for tests to pass)

Summary

Notice that requirements/dev.in is being used directly now instead of requirements/dev.txt to simplify code maintenance and house keeping, for more information check out the linked issue, in summary, we're making a trade-off to trust kytos-ng dev upstream transitive dependencies.

Local Tests

  • Created a MW, listed all, get the MW, deleted it (the rest will be covered on e2e):
2023-04-25 17:12:09,877 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:47586 - "GET /api/kytos/maintenance/v1/ HTTP/1.1" 200
2023-04-25 17:12:10,809 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:47586 - "GET /api/kytos/maintenance/v1/ HTTP/1.1" 200
2023-04-25 17:12:16,796 - INFO [kytos.napps.kytos/maintenance] (AnyIO worker thread) Scheduling "some_mw4"
2023-04-25 17:12:16,818 - INFO [apscheduler.scheduler] (AnyIO worker thread) Added job "MaintenanceStart" to job store "default"
2023-04-25 17:12:16,818 - INFO [kytos.napps.kytos/maintenance] (AnyIO worker thread) Scheduled "some_mw4" start at 2023-10-29 16:08:00-03:00
2023-04-25 17:12:16,819 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:58848 - "POST /api/kytos/maintenance/v1 HTTP/1.1" 201
2023-04-25 17:12:26,820 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:33124 - "GET /api/kytos/maintenance/v1/ HTTP/1.1" 200
2023-04-25 17:12:28,669 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:33124 - "GET /api/kytos/maintenance/v1/ HTTP/1.1" 200
2023-04-25 17:12:35,966 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:46588 - "GET /api/kytos/maintenance/v1/some_mw4 HTTP/1.1" 200
kytos $>                                                                                                                                                                                 

kytos $> 2023-04-25 17:12:52,415 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:36538 - "GET /api/kytos/flow_manager/v2/stored_flows/?state=installed HTTP/1.1" 200          
2023-04-25 17:12:52,420 - INFO [kytos.napps.kytos/mef_eline] (mef_eline) EVC(40d9cde9f6d74b, epl) enabled but inactive - activating
2023-04-25 17:12:52,419 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:36532 - "PUT /api/amlight/sdntrace_cp/v1/traces HTTP/1.1" 200
2023-04-25 17:12:55,642 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:41924 - "DELETE /api/kytos/maintenance/some_mw4 HTTP/1.1" 405
2023-04-25 17:13:11,095 - INFO [kytos.napps.kytos/maintenance] (AnyIO worker thread) Job to end "some_mw4" already removed.
2023-04-25 17:13:11,095 - INFO [apscheduler.scheduler] (AnyIO worker thread) Removed job some_mw4-start
2023-04-25 17:13:11,102 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:33574 - "DELETE /api/kytos/maintenance/v1/some_mw4 HTTP/1.1" 200
2023-04-25 17:13:18,080 - INFO [uvicorn.access] (ThreadPoolExecutor-1_0) 127.0.0.1:47768 - "GET /api/kytos/maintenance/v1/some_mw4 HTTP/1.1" 404


End-to-End Tests

e2e tests with this PR and related starlette PRs can be found here, they're passing

@viniarck viniarck requested a review from a team as a code owner April 25, 2023 20:16
@viniarck viniarck marked this pull request as draft April 25, 2023 20:16
@viniarck viniarck marked this pull request as ready for review May 1, 2023 16:05
requirements/dev.in Outdated Show resolved Hide resolved
@viniarck viniarck merged commit 0d5b5f0 into master May 3, 2023
@viniarck viniarck deleted the chore/starlette branch May 3, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant