kytos-ng / maintenance

Kytos Maintenance Window NApp
https://kytos-ng.github.io/api/maintenance.html
0 stars 7 forks source link

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

Closed viniarck closed 1 year ago

viniarck commented 1 year ago

Closes #74 Closes #73

This PR depends on https://github.com/kytos-ng/kytos/pull/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

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