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

✨ Computational backend: connect to resource tracking via RabbitMQ (🗃️, ⚠️) #4570

Merged

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Aug 2, 2023

What do these changes do?

This PR let now the director-v2 send messages when computational services are started/stopped and while they are running (heartbeat concept)

  • passes correct simcore_user_agent to instrumentation RabbitMQ messages when running computational services
  • publishes Resource Usage Tracker messages events when start/stop computational services
  • publishes Resource Usage Tracker heartbeat events when running computational services
  • (⚠️Devops) new ENV SERVICE_TRACKING_HEARTBEAT in date time format, defines the interval with which a heartbeat is sent into RabbitMQ while a computational service is running defaults to 60 seconds, this ENV is global as it will be used in other services (such as RUTH)
  • 🗃️comp_tasks table enhanced with last_heartbeat, created, modified timestamps
  • added tests to check for correct publication of the RabbitMQ messages
  • 🗃️ new RabbitMQ exchange to send messages about started,stopped and heartbeat messages is used from the computational scheduler

various:

  • removed RunningState.RETRY state as unused and confusing
  • fixed running postgres-database with external database

Related issue/s

How to test

DevOps Checklist

@sanderegg sanderegg added the a:director-v2 issue related with the director-v2 service label Aug 2, 2023
@sanderegg sanderegg added this to the Sundae milestone Aug 2, 2023
@sanderegg sanderegg self-assigned this Aug 2, 2023
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Merging #4570 (3a296eb) into master (74636e0) will decrease coverage by 5.1%.
The diff coverage is 71.4%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #4570     +/-   ##
========================================
- Coverage    84.5%   79.4%   -5.1%     
========================================
  Files        1040     903    -137     
  Lines       44269   37500   -6769     
  Branches     1013     960     -53     
========================================
- Hits        37416   29802   -7614     
- Misses       6635    7491    +856     
+ Partials      218     207     -11     
Flag Coverage Δ
integrationtests 38.9% <ø> (-0.1%) ⬇️
unittests 78.9% <71.4%> (-5.5%) ⬇️

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

Files Changed Coverage Δ
...odels-library/src/models_library/projects_state.py 98.4% <ø> (-0.1%) ⬇️
...ackages/service-library/src/servicelib/rabbitmq.py 94.1% <ø> (ø)
...ls-library/src/models_library/rabbitmq_messages.py 90.2% <50.0%> (-0.8%) ⬇️
...ckages/models-library/src/models_library/docker.py 89.4% <66.6%> (-1.3%) ⬇️
...src/simcore_postgres_database/models/comp_tasks.py 100.0% <100.0%> (ø)

... and 242 files with indirect coverage changes

@sanderegg sanderegg force-pushed the comp/connect-resource-tracking branch 8 times, most recently from 3e21496 to c15ba73 Compare August 8, 2023 13:12
@sanderegg sanderegg changed the title ✨ Computational backend: connect to resource tracking via RabbitMQ ✨ Computational backend: connect to resource tracking via RabbitMQ (🗃️) Aug 8, 2023
@sanderegg sanderegg changed the title ✨ Computational backend: connect to resource tracking via RabbitMQ (🗃️) ✨ Computational backend: connect to resource tracking via RabbitMQ (🗃️, ⚠️) Aug 8, 2023
@sanderegg sanderegg marked this pull request as ready for review August 8, 2023 14:07
Copy link
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

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

tldr

green light for the ops changes thanks a lot for the nice summary in the PR text :--)

@sanderegg sanderegg force-pushed the comp/connect-resource-tracking branch from 4136666 to 51db626 Compare August 8, 2023 15:16
Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

Looking good! 👍

@sanderegg sanderegg force-pushed the comp/connect-resource-tracking branch 2 times, most recently from 2118c87 to 99698ef Compare August 9, 2023 06:07
Copy link
Contributor

@YuryHrytsuk YuryHrytsuk left a comment

Choose a reason for hiding this comment

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

Thinking aloud

If we want to be fully transparent with env and avoid implicit defaults (in code), then we want to have no defaults in code and provide values transparently via .env files 🤔

*I am still not sure if we want to go in this direction

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.

Please consider my comments regarding the moving of some code.

@sanderegg sanderegg force-pushed the comp/connect-resource-tracking branch from 7c61686 to 9940197 Compare August 9, 2023 08:48
@sanderegg sanderegg force-pushed the comp/connect-resource-tracking branch from 8a54c13 to 3a296eb Compare August 9, 2023 12:17
@codeclimate
Copy link

codeclimate bot commented Aug 9, 2023

Code Climate has analyzed commit 3a296eb and detected 0 issues on this pull request.

View more on Code Climate.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 9, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

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
14.0% 14.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:director-v2 issue related with the director-v2 service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants