Skip to content

Commit

Permalink
Implementation for node timeout (flyteorg#42)
Browse files Browse the repository at this point in the history
* Implementation for node timeout

* .

* adding some tests

* bogus change to retrigger travis

* cr feedback

Creating a separate state in the CRD for failure type so we can distinguish between user and system error. For now, we will use it for timeout failures.

* removing failure type and adding TimingOut as a separate phase

* updated mockery

* finalize to abort on timeout

* fixing NodePhaseTimedout
  • Loading branch information
surindersinghp authored Dec 11, 2019
1 parent f6db135 commit 96c9ee9
Show file tree
Hide file tree
Showing 24 changed files with 534 additions and 258 deletions.
94 changes: 51 additions & 43 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cmd/kubectl-flyte/cmd/printers/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ func ColorizeNodePhase(p v1alpha1.NodePhase) string {
return color.YellowString("%s", p.String())
case v1alpha1.NodePhaseSucceeded:
return color.HiGreenString("%s", p.String())
case v1alpha1.NodePhaseTimedOut:
return color.HiRedString("%s", p.String())
case v1alpha1.NodePhaseFailed:
return color.HiRedString("%s", p.String())
}
Expand Down
12 changes: 12 additions & 0 deletions pkg/apis/flyteworkflow/v1alpha1/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package v1alpha1
import (
"context"

"time"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -54,6 +56,8 @@ const (
NodePhaseFailed
NodePhaseSkipped
NodePhaseRetryableFailure
NodePhaseTimingOut
NodePhaseTimedOut
)

func (p NodePhase) String() string {
Expand All @@ -64,6 +68,10 @@ func (p NodePhase) String() string {
return "Queued"
case NodePhaseRunning:
return "Running"
case NodePhaseTimingOut:
return "NodePhaseTimingOut"
case NodePhaseTimedOut:
return "NodePhaseTimedOut"
case NodePhaseSucceeding:
return "Succeeding"
case NodePhaseSucceeded:
Expand Down Expand Up @@ -216,6 +224,7 @@ type MutableNodeStatus interface {
GetOrCreateDynamicNodeStatus() MutableDynamicNodeStatus
GetDynamicNodeStatus() MutableDynamicNodeStatus
ClearDynamicNodeStatus()
ClearLastAttemptStartedAt()
}

// Interface for a Node p. This provides a mutable API.
Expand All @@ -228,6 +237,7 @@ type ExecutableNodeStatus interface {
GetStoppedAt() *metav1.Time
GetStartedAt() *metav1.Time
GetLastUpdatedAt() *metav1.Time
GetLastAttemptStartedAt() *metav1.Time
GetParentNodeID() *NodeID
GetParentTaskID() *core.TaskExecutionIdentifier
GetDataDir() DataReference
Expand Down Expand Up @@ -290,6 +300,8 @@ type ExecutableNode interface {
GetResources() *v1.ResourceRequirements
GetConfig() *v1.ConfigMap
GetRetryStrategy() *RetryStrategy
GetExecutionDeadline() *time.Duration
GetActiveDeadline() *time.Duration
}

// Interface for the Workflow p. This is the mutable portion for a Workflow
Expand Down
Loading

0 comments on commit 96c9ee9

Please sign in to comment.