Skip to content

Backfill cluster_id for pre-rc21 job.assigned events - #29

Merged
iross merged 3 commits into
mainfrom
fix/enrich-jobad-backfill-cluster-id
Sep 1, 2026
Merged

Backfill cluster_id for pre-rc21 job.assigned events#29
iross merged 3 commits into
mainfrom
fix/enrich-jobad-backfill-cluster-id

Conversation

@iross

@iross iross commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • 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.

Test plan

  • uv run pytest tests/ -q — 278 passed, 2 skipped
  • ruff check / ty check clean

🤖 Generated with Claude Code

iross and others added 3 commits August 26, 2026 09:59
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>
@iross
iross merged commit 1113fce into main Sep 1, 2026
1 check passed
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.

1 participant