Repository navigation
Resolve the run script that submitted executions with multiple provenance copies - #494
tomvothecoder wants to merge 5 commits into
Conversation
Verify on Perlmutter with the issue's example caseExample execution: Expected: Re-running ingestion (scheduled or 1. Read-only parser check (no API, no writes)cd backend
uv run python -c '
from pathlib import Path
from app.scripts.ingestion.backfill.metadata import _read_execution
path = Path("/global/cfs/cdirs/e3sm/OLD_PERF/2025-03/performance_archive_2025_03_21_08_00_29/COMPLETED/njeffery/20250319.v3.LR.CBGC.FrazilEcosys.noSpinu.Icepack1.5.0.pm-cpu/37013148.250320-123519")
print(_read_execution(path, None, ["run-script"]).run_script_path)
'2. Scoped run-script backfill for this one case (dry run)This uses the stored execution-to-directory mappings for this case only. It covers every make metadata-backfill machine=perlmutter env=dev \
SIMBOARD_ROOT=/path/to/simboard_root \
args='--fields run-script --sources archive --case-name 20250319.v3.LR.CBGC.FrazilEcosys.noSpinu.Icepack1.5.0.pm-cpu --hpc-username njeffery --dry-run'
Not planned: a full metadata backfill for this optional field. After deploy, new executions are resolved by production ingestion. |
|
Closing without merging. This only affects one user's executions ( |
Description
When an execution's CaseDocs holds several run-script provenance copies, SimBoard now records the script that actually submitted the job. If CaseStatus doesn't identify it, the run script stays unset with a warning, as before. It never guesses the newest copy.
Evidence used. The E3SM run script saves a copy of itself on every invocation, and calls
./case.submitonly whendo_case_submit=true. CIME logs<time>: case.submit success <job_id>in CaseStatus. In the issue's example, three copies (111614,112114,113750) were saved andcase.submit success 37013148was logged at11:38:00, so113750is the copy that submitted it. It is also the only copy withdo_case_submit=true.Rule. Pick the latest copy saved at or before the user's submit for this job:
case.run successorst_archive success) uses the manual submit that started the chain. Copies saved later that never submitted are excluded.The run script stays unset when CaseStatus has no submit record for the job, copies tie at the chosen time, or the chain's start isn't logged.
Changes
parsers/case_status.py: addparse_case_submit_time. Both CaseStatus readers now treat a truncated.gz(EOFError) as unreadable.parsers/parser.py:_resolve_run_script_pathuses that time when several copies match. One or zero matches behave as before.backfill/metadata.py:--fields run-scriptnow reads CaseStatus. Without this, the backfill could never resolve executions with several copies. A duplicate CaseStatus match is treated as no evidence, so the record doesn't fail.Validation
make pre-commit-run: all hooks pass.qa/cases/OLD_PERF, gitignored), both ingestion parsing and the backfill reader resolve…sh.20250319-113750. Every other QA execution keeps the script it had before.case.run startingIDs match the preceding submit, and 381 of 484 submits directly followcase.run success. The rest follow user actions.Risks
Copy timestamps and CaseStatus times are compared as local time. Anchoring resubmits to the manual submit keeps both on the user's login side.
The rule assumes one active submit chain per case directory.
An execution with a single copy still uses it without checking CaseStatus (unchanged behavior).
Closes [Bug]: Multiple, ambigiuous run scripts for executions omit artifact ingestion #434
Checklist
Deployment Notes (if any)
No migration. New executions are resolved by production ingestion after deploy. Executions that are already ingested are skipped as duplicates, so their run script stays unset unless a scoped metadata backfill is run. See the verification comment below.