Skip to content

Commit e56f57b

Browse files
[DevOps] Revise collection execution logging (#253)
1 parent fe55821 commit e56f57b

7 files changed

Lines changed: 1711 additions & 229 deletions

File tree

backend/app/features/ingestion/parsers/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def _locate_metadata_files(exp_dir: str) -> SimulationFiles:
437437
raise IncompleteArchiveError(missing_required_errors)
438438

439439
if missing_optional:
440-
logger.warning(
440+
logger.debug(
441441
"Optional files missing in execution directory "
442442
f"'{exp_dir}': {', '.join(missing_optional)}"
443443
)

backend/app/scripts/ingestion/hpc_upload_archive_ingestor.py

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
"""Scan archives and upload changed cases to SimBoard as single-case archives.
1+
"""Scan archives and upload cases to SimBoard as single-case archives.
22
33
This runner mirrors the NERSC path-ingestor state/dedupe behavior, but instead
4-
of sending a filesystem path it packages each changed case directory into a
5-
temporary ``.tar.gz`` archive and uploads it to the dedicated
4+
of sending a filesystem path it packages each submission-qualified case
5+
into a temporary ``.tar.gz`` archive and uploads it to the dedicated
66
``/api/v1/ingestions/from-hpc-upload`` endpoint.
7+
8+
More information can be found in ``nersc_archive_ingestor.py``.
79
"""
810

911
from __future__ import annotations
@@ -112,30 +114,45 @@ def _run_ingestor(
112114
)
113115
return 1
114116

115-
scan_results, candidates, discovery_stats, state = _scan_archive(
116-
config,
117-
state,
118-
metadata_locator=metadata_locator,
119-
)
117+
(
118+
scan_results,
119+
candidates,
120+
submission_qualified_case_count,
121+
discovery_stats,
122+
) = _scan_archive(config, state, metadata_locator=metadata_locator)
120123

121124
_log_event(
122125
"scan_completed",
123126
{
124127
"archive_root": str(config.archive_root),
125128
"discovered_cases": len(scan_results),
126-
"candidate_cases": len(candidates),
129+
"submission_qualified_cases": submission_qualified_case_count,
130+
"selected_submission_cases": len(candidates),
127131
"execution_dirs_scanned": discovery_stats["execution_dirs_scanned"],
128132
"execution_dirs_accepted": discovery_stats["execution_dirs_accepted"],
129133
"skipped_incomplete": discovery_stats["skipped_incomplete"],
130134
"skipped_invalid": discovery_stats["skipped_invalid"],
135+
"accepted_execution_ids": discovery_stats["accepted_execution_ids"],
136+
"rejected_existing_execution_ids": discovery_stats[
137+
"rejected_existing_execution_ids"
138+
],
139+
"rejected_incomplete_execution_ids": discovery_stats[
140+
"rejected_incomplete_execution_ids"
141+
],
142+
"rejected_invalid_execution_ids": discovery_stats[
143+
"rejected_invalid_execution_ids"
144+
],
145+
"deferred_execution_ids": discovery_stats["deferred_execution_ids"],
131146
},
132147
)
133148

134149
if config.dry_run:
135150
return _handle_dry_run(
136151
candidates,
137152
scan_results,
153+
submission_qualified_case_count,
138154
discovery_stats,
155+
archive_root=config.archive_root,
139156
)
140157

141158
return _handle_ingest_run(
@@ -144,6 +161,7 @@ def _run_ingestor(
144161
config,
145162
endpoint_url,
146163
state,
164+
submission_qualified_case_count,
147165
discovery_stats,
148166
sleep_fn=sleep_fn,
149167
post_request_fn=post_request_fn,

0 commit comments

Comments
 (0)