Skip to content

Recover saved Kubernetes terminal state#298

Open
nateGeorge wants to merge 1 commit into
TangleML:masterfrom
nateGeorge:nate/kubernetes-terminal-recovery
Open

Recover saved Kubernetes terminal state#298
nateGeorge wants to merge 1 commit into
TangleML:masterfrom
nateGeorge:nate/kubernetes-terminal-recovery

Conversation

@nateGeorge

@nateGeorge nateGeorge commented Jul 16, 2026

Copy link
Copy Markdown

Tangle now finishes from already-saved container state after a restart instead of trying to read a deleted Kubernetes resource. For Jobs, a finished parent result remains valid when child Pod details or logs are no longer available.

Draft follow-up #299 adds an opt-in single-node Job mode so Kubernetes can retain terminal state after a completed task Pod is removed.

Testing

  • .venv/bin/black --check cloud_pipelines_backend/launchers/interfaces.py cloud_pipelines_backend/launchers/kubernetes_launchers.py cloud_pipelines_backend/orchestrator_sql.py tests/test_kubernetes_terminal_recovery.py (passed)
  • uv run --frozen --with-editable . pytest -q tests/test_kubernetes_terminal_recovery.py (34 passed)
  • uv run --frozen --with-editable . pytest -q (471 passed, 16 warnings)
  • git diff --check (passed)

Co-authored-by: AI (Pi/GPT-5.6 Sol) <noreply@pi.dev>
ERROR = "ERROR"


class LauncherResourceNotFound(LauncherError):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's your plan for using this common exception in non-Kubernetes launchers?

ERROR = "ERROR"


class LauncherResourceNotFound(LauncherError):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this exception used (caught)?

Comment on lines -1470 to -1473
# There can be multiple pods for each index.
# This can happen when Job gets suspended and resumed multiple times and Pods can get stuck in "Terminating" phase.
# In this case we want to get the latest Pods.
# Alternatively, we could store all pods, but this can complicate the routines that determine status and get logs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain what was your intent when making this change?

Comment on lines +215 to +221
# Mark our active ExecutionNodes as SYSTEM_ERROR.
execution_nodes = [
execution_node
for execution_node in running_container_execution.execution_nodes
if execution_node.container_execution_status
!= bts.ContainerExecutionStatus.CANCELLED
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain this change?

launcher_interfaces.ContainerStatus.FAILED,
)

if not cached_snapshot_is_terminal:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is cached_snapshot_is_terminal true?

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.

2 participants