fix: Multi-Node Jobs ended_at time not being set#184
Open
yuechao-qin wants to merge 1 commit intomasterfrom
Open
fix: Multi-Node Jobs ended_at time not being set#184yuechao-qin wants to merge 1 commit intomasterfrom
ended_at time not being set#184yuechao-qin wants to merge 1 commit intomasterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Background
Closes https://github.com/Shopify/oasis-frontend/issues/542
Kubernetes Job conditions use
"Complete"for successful jobs and"Failed"for failed jobs. TheLaunchedKubernetesJob.ended_atproperty was checking for"Succeeded"instead of"Complete", which meantended_atwas alwaysNonefor successful K8s Jobs. This caused the API to return no end time for completed executions.Separately, when the orchestrator hit an internal error processing a running execution (SYSTEM_ERROR), it set the status but never recorded
ended_at, making it impossible to tell when the failure occurred.Fix
ended_atnow correctly resolves for successful K8s Jobs by matching the"Complete"condition typeended_atso the API shows when the error occurredstatus,ended_at,exit_code,started_at) are set through a single helper to prevent future inconsistenciesChanges
cloud_pipelines_backend/launchers/kubernetes_launchers.pyJobConditionTypeandConditionStatusenums with K8s API doc references, replacing magic strings throughout the fileended_atto check("Complete", "Failed")instead of("Succeeded", "Failed")cloud_pipelines_backend/orchestrator_sql.py_set_terminal_state()helper that sets all terminal fields on aContainerExecutionin one placeended_at(was previously missing)Test