Skip to content

Fix condor history logging and expose CPU/GPU usage in report UI#108

Draft
Copilot wants to merge 2 commits intov0.8-previewfrom
copilot/fix-condor-history-logging
Draft

Fix condor history logging and expose CPU/GPU usage in report UI#108
Copilot wants to merge 2 commits intov0.8-previewfrom
copilot/fix-condor-history-logging

Conversation

Copy link

Copilot AI commented Feb 19, 2026

collect_history was entirely broken: the happy path (named scheduler found) never called history() or returned a value, and the fallback path consumed the job iterator with list(jobs) before iterating it. Profiling data was also never surfaced in the report UI.

Changes

asimov/scheduler.py — scheduler interface

  • Added collect_history(cluster_id) as an abstract method on Scheduler
  • Implemented in HTCondor: queries the configured schedd first, falls back to all locatable schedds; converts results to {"end", "cpus", "gpus", "runtime"} dict
  • Extracted _HISTORY_CLASSADS constant and _datetime_from_epoch helper to module scope
  • Added RequestGpus to the classad projection (was absent); fixed GPU default fallback from 10
  • Added NotImplementedError stub in Slurm

asimov/condor.py — fix and delegate

Replaced the broken hand-rolled implementation with a clean delegation to HTCondorScheduler.collect_history:

def collect_history(cluster_id):
    scheduler = HTCondorScheduler(schedd_name=schedd_name)
    return scheduler.collect_history(cluster_id)

asimov/monitor_states.py — remove over-restrictive guard

Dropped the config.get("condor", "scheduler") check that silently skipped history collection whenever no named scheduler was configured. Any reachable schedd now suffices.

asimov/event.py — emit profiling attributes

Added get_profiling_attrs(node) helper that reads node.meta["profiling"] and emits data-profiling-runtime, data-profiling-cpus, data-profiling-gpus, data-profiling-end on the hidden data <div> for both DAG and non-DAG render paths.

asimov/cli/report.py — "Resource Usage" modal section

Added a collapsible table to the analysis modal displaying:

  • Wall time (formatted as Xh Ym Zs)
  • CPU time (cpus × runtime)
  • GPU time (gpus × runtime, hidden when GPUs = 0)
  • Completed date

The section is hidden entirely when no profiling data is present.

tests/test_condor.py — new tests

Five new tests covering: successful retrieval from configured schedd, fallback to secondary schedds, ValueError when nothing found, RequestCpus/RequestGpus fallback, and condor.collect_history delegation.

Original prompt

This section details on the original issue you should resolve

<issue_title>Fix condor history logging</issue_title>
<issue_description>Asimov is meant to have functionality for storing history information from the scheduler, such as job runtime, when the job completes.
This doesn't seem to work.

We should generalise this so that it can be accessed via the scheduler interface.

We should be able to record the amount of CPU time and GPU time which were consumed by a given analysis, and then report this on the asimov report page (e.g. on the modal for that analysis).</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…port UI and tests

Co-authored-by: transientlunatic <4365778+transientlunatic@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix condor history logging functionality Fix condor history logging and expose CPU/GPU usage in report UI Feb 19, 2026
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.

2 participants