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

✨🐛Webserver: enable socketio horizontal scaling + ensure only 1 update goes through (⚠️ devops) #4286

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented May 30, 2023

What do these changes do?

  • enable python-socket-io horizontal scaling by leveraging RabbitMQ
  • new wb-db-listener service that ensure only 1 service gets the DB notifications
    • this is a temporary fix until legacy dynamic services are hopefully one day gone
    • this service cannot be scaled up, since it will re-create the same issues as described in Isolate comp_tasks_listening_task runtime (inconsistent port data) #3849
    • this service cannot be restarted without breaking stuff as it is meant to run alone (@mrnicegyu11) it was malfunctioning in the webserver and needs to run alone. That is the best I can do for now.
    • it basically runs a LISTEN vs the comp_tasks table in the dB, when a comp_tasks outputs/run_hash or state changes it triggers, update the projects table in the dB and notify the connected users
    • the notifications works as is because of the horizontal scaling feature of python-socketio
  • ⚠️ devops: there is a new service called wb-db-event-listener
    Bonuses
  • probably fixed some flakyness in webserver [int] tests
  • cleanup tests in integration
  • re-enabled test_computation_start_stop

Related issue/s

How to test

DevOps Checklist

@sanderegg sanderegg added the a:webserver issue related to the webserver service label May 30, 2023
@sanderegg sanderegg added this to the Pastel de Nata milestone May 30, 2023
@sanderegg sanderegg self-assigned this May 30, 2023
@sanderegg sanderegg requested a review from mguidon May 30, 2023 14:18
@codecov
Copy link

codecov bot commented May 30, 2023

Codecov Report

Merging #4286 (8f3ea94) into master (a25c044) will increase coverage by 11.0%.
The diff coverage is 100.0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #4286      +/-   ##
=========================================
+ Coverage    72.6%   83.7%   +11.0%     
=========================================
  Files         781     468     -313     
  Lines       33173   24364    -8809     
  Branches      600     173     -427     
=========================================
- Hits        24087   20393    -3694     
+ Misses       8948    3922    -5026     
+ Partials      138      49      -89     
Flag Coverage Δ
integrationtests 68.0% <88.3%> (+0.1%) ⬆️
unittests 80.7% <98.3%> (+3.5%) ⬆️

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

Impacted Files Coverage Δ
...rc/simcore_service_webserver/db_listener/_utils.py 100.0% <ø> (ø)
.../simcore_service_webserver/notifications/plugin.py 100.0% <ø> (ø)
.../web/server/src/simcore_service_webserver/_meta.py 100.0% <100.0%> (ø)
...erver/src/simcore_service_webserver/application.py 97.9% <100.0%> (+49.0%) ⬆️
.../simcore_service_webserver/application_settings.py 98.7% <100.0%> (+18.4%) ⬆️
...re_service_webserver/application_settings_utils.py 97.9% <100.0%> (+1.2%) ⬆️
...erver/db_listener/_db_comp_tasks_listening_task.py 87.0% <100.0%> (ø)
...rc/simcore_service_webserver/db_listener/plugin.py 100.0% <100.0%> (ø)
...src/simcore_service_webserver/garbage_collector.py 100.0% <100.0%> (ø)
...imcore_service_webserver/garbage_collector_task.py 84.7% <100.0%> (+0.3%) ⬆️
... and 3 more

... and 644 files with indirect coverage changes

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.

👍 Nice to see this one

@sanderegg sanderegg force-pushed the enhancement/enable-socketio-horizontal-scaling branch 2 times, most recently from 8cff96e to e4ef880 Compare May 31, 2023 08:56
@sanderegg sanderegg force-pushed the enhancement/enable-socketio-horizontal-scaling branch from da5dbf7 to 70d4c06 Compare May 31, 2023 20:50
Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

Great job!! Some minor comments
Thanks for catching up on this topic since so far I was not able to tackle it!

@sanderegg sanderegg force-pushed the enhancement/enable-socketio-horizontal-scaling branch from 70d4c06 to 2aad3ba Compare June 1, 2023 11:48
@sanderegg sanderegg changed the title ✨🐛Webserver: enable socketio horizontal scaling + ensure only 1 update goes through ✨🐛Webserver: enable socketio horizontal scaling + ensure only 1 update goes through (⚠️ devops) Jun 1, 2023
@sanderegg sanderegg force-pushed the enhancement/enable-socketio-horizontal-scaling branch 2 times, most recently from dfba6b2 to 8b9d24d Compare June 1, 2023 15:32
@sanderegg sanderegg enabled auto-merge (squash) June 1, 2023 16:23
@sanderegg sanderegg force-pushed the enhancement/enable-socketio-horizontal-scaling branch from 8b9d24d to 8f3ea94 Compare June 1, 2023 16:54
@codeclimate
Copy link

codeclimate bot commented Jun 1, 2023

Code Climate has analyzed commit 8f3ea94 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Jun 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sanderegg sanderegg disabled auto-merge June 1, 2023 19:33
@sanderegg sanderegg merged commit 7ef5279 into ITISFoundation:master Jun 1, 2023
@sanderegg sanderegg deleted the enhancement/enable-socketio-horizontal-scaling branch June 1, 2023 19:34
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Jun 14, 2023
25 tasks
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
Projects
None yet
4 participants