Skip to content

Commit 6121e81

Browse files
committed
Fix: Added a new regex to make sure the restoring logs are caught correclty.
1 parent 61c0816 commit 6121e81

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

dags/orbax/util/validation_util.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,14 +467,16 @@ def validate_restored_correct_checkpoint(
467467
namespace="default",
468468
pod_pattern=pod_pattern,
469469
text_filter=(
470-
"(textPayload:\"'event_type'\" OR jsonPayload.message:\"'event_type'\")"
470+
"(textPayload:\"'event_type'\" OR jsonPayload.message:\"'event_type'\" OR "
471+
"textPayload:\"restoring from this run's directory step\" OR "
472+
"jsonPayload.message:\"restoring from this run's directory step\")"
471473
),
472474
start_time=start_time,
473475
end_time=end_time,
474476
)
475477

476478
if not entries:
477-
raise AirflowFailException("No event_type found in the log.")
479+
raise AirflowFailException("No event_type or restore log found in the log.")
478480

479481
local_saved_steps_before_restore = []
480482
for entry in entries:
@@ -497,15 +499,17 @@ def validate_restored_correct_checkpoint(
497499

498500
local_saved_steps_before_restore.append(int(saved_step_match.group(1)))
499501

500-
elif re.search(r"'event_type': '(emergency_)?restore'", message):
502+
elif re.search(
503+
r"'event_type': '(emergency_)?restore'", message
504+
) or re.search(r"restoring from this run's directory step \d+", message):
501505
logging.info("Found restore event: %s", message)
502506
logging.info(
503507
"Saved steps before restore: %s", local_saved_steps_before_restore
504508
)
505509

506510
restored_step_match = re.search(
507511
r"'step':\s*(?:np\.int32\()?(\d+)", message
508-
)
512+
) or re.search(r"restoring from this run's directory step (\d+)", message)
509513
restored_step = (
510514
int(restored_step_match.group(1)) if restored_step_match else None
511515
)

0 commit comments

Comments
 (0)