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

Implement an interface from fetching job metrics from InfluxDB #663

Conversation

matheushent
Copy link
Member

What

This PR implement the necessary code in the Jobbergate Agent and its Snap to enable job metric collection from InfluxDB.

The implementation involves a settings parameter which is used for connecting to InfluxDB. The logic happens during the active_submissions_task task. If any part of the upload of metrics of an active job submission fails, it won't interrupt the execution.

Once fetched the metrics for an active job submission, the agent sends to the API.

Why

Provide insights regarding jobs through the API.

Task: https://sharing.clickup.com/t/h/c/18022949/PENG-2457/BU7UOA63B936N27


Peer Review

Please follow the upstream omnivector documentation concerning
peer-review guidelines.

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.68%. Comparing base (326d36d) to head (ab37a46).
Report is 1 commits behind head on feature/PENG-2455--job-metric-collection.

Additional details and impacted files
@@                             Coverage Diff                              @@
##           feature/PENG-2455--job-metric-collection     #663      +/-   ##
============================================================================
+ Coverage                                     92.57%   92.68%   +0.10%     
============================================================================
  Files                                            85       87       +2     
  Lines                                          4483     4632     +149     
============================================================================
+ Hits                                           4150     4293     +143     
- Misses                                          333      339       +6     
Flag Coverage Δ
agent 93.45% <ø> (+0.64%) ⬆️
api 95.32% <ø> (ø)
cli 88.60% <ø> (ø)
core 96.31% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matheushent matheushent force-pushed the matheushent/PENG-2457--job-metric-collection--agent branch from 01fb385 to 71d3ffd Compare November 27, 2024 20:50
@fschuch fschuch self-requested a review December 2, 2024 20:01
Comment on lines +37 to +38
msgpack = "^1.1.0"
influxdb = "^5.3.2"
Copy link
Member

Choose a reason for hiding this comment

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

I think these two guys could be optional dependencies. On initialize_influx_client, unsure to cover ImportError if metrics are enabled but dependencies are not installed.

Copy link
Member Author

Choose a reason for hiding this comment

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

that would require the logistical part of setting up the agent to install these dependencies. I think that, for running the agent easily, it's better to leave as is

Copy link
Member

@fschuch fschuch Dec 4, 2024

Choose a reason for hiding this comment

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

I had no auto installation in mind, at installation time they could be included with pip install jobbergate-agent[metrics], for instance. But at the same time it is not a big deal, it is more a suggestion.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wonder how that would be customizable in the snap. I'd had to spend a bit of time on that

@matheushent matheushent changed the base branch from main to feature/PENG-2455--job-metric-collection December 11, 2024 12:24
Copy link
Member

@dusktreader dusktreader left a comment

Choose a reason for hiding this comment

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

Nice work, here. Added some comments for you!

jobbergate-agent/jobbergate_agent/clients/influx.py Outdated Show resolved Hide resolved
jobbergate-agent/jobbergate_agent/jobbergate/schemas.py Outdated Show resolved Hide resolved
jobbergate-agent/jobbergate_agent/jobbergate/update.py Outdated Show resolved Hide resolved
jobbergate-agent/tests/jobbergate/test_compute.py Outdated Show resolved Hide resolved
jobbergate-agent/tests/jobbergate/test_compute.py Outdated Show resolved Hide resolved
jobbergate-agent/tests/jobbergate/test_compute.py Outdated Show resolved Hide resolved
@matheushent matheushent merged commit 179f0ec into feature/PENG-2455--job-metric-collection Dec 13, 2024
13 checks passed
@matheushent matheushent deleted the matheushent/PENG-2457--job-metric-collection--agent branch December 13, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants