Repository navigation
Fix job input sizes and resource metric selection - #191
Conversation
hexylena
left a comment
There was a problem hiding this comment.
It was not part of our policy, but could you please rewrite your code comments in your own words, I find them hard to read as written. If you could also update the PR description to reflect what issues you encountered that led to this PR being created, it would be really helpful! :) I can somewhat kinda get that you encountered duplicately counted values which is indeed sub-optimal, but it looks like this is trying to do more and I don't understand why or what your job metrics looked like, that necessitates this
| # Internal SQL builder: arguments are trusted SQL expressions/literals supplied by | ||
| # query functions, never command-line values. Multiple names are alternatives | ||
| # for the same quantity, not values to combine or choose between. |
There was a problem hiding this comment.
reads like slop to me, could you please rewrite this in your own words? It would be helpful to say instead what the intention of this snippet is.
"never command line values" is not remotely correct in the context of this project where we freely inject command line values into queries as all user input is considered trusted and it's an error
| Only core-plugin metrics are used. Identical non-null duplicates count once; | ||
| conflicting or null observations leave that job's allocation unknown. Missing | ||
| values are not replaced with defaults. These commands do not establish compute | ||
| eligibility or collection coverage for a public indicator. |
There was a problem hiding this comment.
what is "compute eligibility" and "collection covergae for a public indicator" supposed to mean?
| CASE WHEN count(*) = count(metric_value) AND min(metric_value) = max(metric_value) | ||
| THEN min(metric_value) END AS metric_value | ||
| FROM job_metric_numeric | ||
| WHERE plugin = 'core' AND metric_name IN ('runtime_seconds', 'galaxy_slots') |
There was a problem hiding this comment.
I don't understand the situation that would arise that would necessitate this. Could you provide an example of the situation you're fixing here?
| - core_hrs: allocated core hours (runtime_seconds * galaxy_slots, 1 slot if unset) | ||
| - core_hrs: allocated core hours (runtime_seconds * galaxy_slots) |
There was a problem hiding this comment.
why was this changed? It seems pretty reasonable to assume cores = 1 for calculating core hours I don't see a rationale for this anywhere?
| @@ -0,0 +1,43 @@ | |||
| CREATE TEMP TABLE expected_jobs (job_id bigint, total_filesize numeric, num_files bigint, runtime_seconds numeric, slots numeric, memory_bytes numeric); | |||
There was a problem hiding this comment.
I don't find value in any of these test cases, I fear. It's unit testing the SQL and mocking the galaxy tables which I don't think has enough ROI to maintain. If it did have value, we would've done it by now. Could I ask you to remove them?
(using sql and raising exceptions in sql is the sort of hilarious cursed thing I'd normally be into but it's a big cost to pay during testing for what we'd get from it.)
I had considered testing a reduced production database, but after spending a couple days trying to reduce and make it sufficiently private, the scope was still too large to make it worth it.
If galaxy wanted to offer an 'example' database, or something where y'all could guarantee nothing private was stored (perhaps a database from galaxy test cases?) then that would be really worth considering, we could download and test against that dump.
|
Thanks for the review. Some of the earlier changes had emerged from one agent making changes behind the other one's back to the changes guarded against that; removed now. Description updated. |
Came up while working on the new version of the KUI dashboard.
job-metricstreated history dataset association IDs as dataset IDs, which lead to inputs being missed. For example, on usegalaxy.org, job 81088166 previously missed an input entirely; the corrected join includes its 1,092,097 bytes and counts it as one input.The review also found inconsistent resource-metric selection. The queries now select runtime and allocation metrics from the core plugin and use cgroup memory peaks that exclude swap.