Backfill cluster_id for pre-rc21 job.assigned events - #29
Merged
Conversation
capture_job_ad_fields() only started including cluster_id/proc_id as of v0.1.0rc21. job.assigned events written by jobs pinned to an older MLDAG_VERSION have neither field, so enrich_from_jobad_events() silently skipped every one of them -- confirmed against a real database: 86 job.assigned events, 0 with cluster_id. job.assigned events lacking cluster_id are now backfilled by cross-referencing any other event sharing the same run_id (job.executing/job.queued/etc from log_monitor.py always carry both run_id and cluster_id together). proc_id defaults to 0 when backfilled this way. An event with neither its own cluster_id nor a same-run_id fallback is skipped, not counted. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
capture_job_ad_fields() was silently dropping arguments/request_gpus/ resource_name on every job: post.py's _DEFAULT_FIELD_MAPPING and history_enrich.py's _FIELD_MAPPING used ClassAd attribute names that don't match what HTCondor actually writes for this repo's submit descriptions -- confirmed against a live job. Args (not Arguments, since all submit descriptions here use unquoted old-syntax arguments), RequestGPUs (not RequestGpus), and JOBGLIDEIN_ResourceName / MachineAttrGLIDEIN_ResourceName0 (not GLIDEIN_ResourceName, which isn't a real top-level job-ad attribute). resource_name now sources from JOBGLIDEIN_ResourceName (always populated -- "Local Job" on CHTC-direct resources); a new glidein_resource_name column keeps the raw MachineAttr value (null on CHTC-direct jobs) for callers that want to distinguish an actual glidein match. A new machine field (MachineAttrMachine0) is captured end-to-end as an HTCondor-verified cross-check against pretrain_local.sh's self-reported hostname. Also fixes parse_classad() to treat ClassAd's bare undefined literal as an absent attribute instead of capturing the string "undefined". Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Includes the ClassAd attribute name fixes for job-ad field capture (task-37): arguments/request_gpus/resource_name were silently never being captured due to attribute-name mismatches with what HTCondor actually writes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
capture_job_ad_fields()only started includingcluster_id/proc_idas of v0.1.0rc21.job.assignedevents written by jobs pinned to an olderMLDAG_VERSIONhave neither field, soenrich_from_jobad_events()silently skipped every one of them — confirmed against a real database (86job.assignedevents, 0 withcluster_id).job.assignedevents lackingcluster_idare now backfilled by cross-referencing any other event sharing the samerun_id(job.executing/job.queued/etc fromlog_monitor.pyalways carry bothrun_idandcluster_idtogether).proc_iddefaults to 0 when backfilled this way. An event with neither its owncluster_idnor a same-run_idfallback is skipped, not counted.Test plan
uv run pytest tests/ -q— 278 passed, 2 skippedruff check/ty checkclean🤖 Generated with Claude Code