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

Refactoring webserver: async metrics handler, upgrades dependencies and fixes testing fixtures #2343

Merged
merged 32 commits into from
May 21, 2021

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented May 19, 2021

What do these changes do?

General maintenance of the webserver

  • CHANGES: makes metrics_handler implementation async by using a thread pool executor ot execute prometheos_client.generate_latest call
  • CHANGES: general upgrade of webserver dependencies:
  • FIXES: services/web/server/tests/integration/01/test_exporter.py was de-activated.
    • Minor refactoring of fixtures
  • CHANGES: unified pylint testing by reusing pytest-simcore utils
  • CHANGES: moves socket-io fixtures to simcore-pytest

Next steps (different PRs)

Related issue/s

Towards spliting webserver

How to test

Checklist

  • Did you change any service's API? Then make sure to bundle document and upgrade version (make openapi-specs, git commit ... and then make version-*)
  • Unit tests for the changes exist
  • Runs in the swarm
  • Documentation reflects the changes
  • New module? Add your github username to .github/CODEOWNERS

@codecov
Copy link

codecov bot commented May 19, 2021

Codecov Report

Merging #2343 (ef900eb) into master (2f08064) will increase coverage by 1.5%.
The diff coverage is 57.1%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2343     +/-   ##
========================================
+ Coverage    73.0%   74.6%   +1.5%     
========================================
  Files         508     508             
  Lines       19768   19772      +4     
  Branches     1943    1943             
========================================
+ Hits        14436   14751    +315     
+ Misses       4846    4506    -340     
- Partials      486     515     +29     
Flag Coverage Δ
integrationtests 66.7% <35.7%> (+4.7%) ⬆️
unittests 68.3% <57.1%> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...imcore_service_webserver/diagnostics_monitoring.py 88.7% <50.0%> (-2.5%) ⬇️
...mcore_service_webserver/socketio/handlers_utils.py 92.8% <100.0%> (+0.2%) ⬆️
...ce_webserver/resource_manager/garbage_collector.py 74.8% <0.0%> (-1.9%) ⬇️
.../director/src/simcore_service_director/producer.py 60.8% <0.0%> (+0.2%) ⬆️
...imcore_service_webserver/scicrunch/scicrunch_db.py 48.5% <0.0%> (+2.8%) ⬆️
...r/src/simcore_service_webserver/exporter/config.py 100.0% <0.0%> (+5.5%) ⬆️
...er/src/simcore_service_webserver/catalog_client.py 53.9% <0.0%> (+7.8%) ⬆️
...ce_webserver/exporter/formatters/base_formatter.py 100.0% <0.0%> (+18.1%) ⬆️
.../src/simcore_service_webserver/storage_handlers.py 79.6% <0.0%> (+19.4%) ⬆️
...vice_webserver/exporter/formatters/sds/__init__.py 100.0% <0.0%> (+20.0%) ⬆️
... and 11 more

@pcrespov pcrespov added a:webserver issue related to the webserver service dependencies Pull requests that update a dependency file t:maintenance Some planned maintenance work labels May 19, 2021
@pcrespov pcrespov added this to the Chinchilla milestone May 19, 2021
@pcrespov pcrespov self-assigned this May 20, 2021
@pcrespov pcrespov force-pushed the maintenance/webserver branch 2 times, most recently from 915c2bb to 3900657 Compare May 20, 2021 17:18
@pcrespov pcrespov marked this pull request as ready for review May 20, 2021 22:06
@pcrespov pcrespov changed the title Maintenance/webserver refactoring webserver: async metrics handler, upgrades dependencies and fixes testing fixtures May 20, 2021
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great! just concerning the thread pool quickly check my comment there before merging.

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice overall.
One concern, as said below. Why not replace the prometheus client with the async version?

@pcrespov pcrespov requested a review from GitHK May 21, 2021 13:09
@pcrespov pcrespov changed the title refactoring webserver: async metrics handler, upgrades dependencies and fixes testing fixtures Refactoring webserver: async metrics handler, upgrades dependencies and fixes testing fixtures May 21, 2021
Copy link
Member

@mguidon mguidon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Did you think about using celery for the metrics generation?

@pcrespov pcrespov merged commit 9a64948 into ITISFoundation:master May 21, 2021
@pcrespov pcrespov deleted the maintenance/webserver branch May 21, 2021 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service dependencies Pull requests that update a dependency file t:maintenance Some planned maintenance work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants