From 7323dafd0ed328d79a1073ef62142bd3ab6e6764 Mon Sep 17 00:00:00 2001 From: Dan Rammer Date: Fri, 29 Sep 2023 09:38:42 -0500 Subject: [PATCH 1/2] using negative interruptibleFailureThreshold as complementary (#403) Signed-off-by: Daniel Rammer --- .../go/tasks/pluginmachinery/core/exec_metadata.go | 2 +- .../core/mocks/task_execution_metadata.go | 10 +++++----- .../go/tasks/plugins/array/k8s/subtask_exec_context.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go b/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go index b3115a7a20..7133bb3ad4 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/exec_metadata.go @@ -44,6 +44,6 @@ type TaskExecutionMetadata interface { GetSecurityContext() core.SecurityContext IsInterruptible() bool GetPlatformResources() *v1.ResourceRequirements - GetInterruptibleFailureThreshold() uint32 + GetInterruptibleFailureThreshold() int32 GetEnvironmentVariables() map[string]string } diff --git a/flyteplugins/go/tasks/pluginmachinery/core/mocks/task_execution_metadata.go b/flyteplugins/go/tasks/pluginmachinery/core/mocks/task_execution_metadata.go index 29f0055dc8..14a545eb5c 100644 --- a/flyteplugins/go/tasks/pluginmachinery/core/mocks/task_execution_metadata.go +++ b/flyteplugins/go/tasks/pluginmachinery/core/mocks/task_execution_metadata.go @@ -92,7 +92,7 @@ type TaskExecutionMetadata_GetInterruptibleFailureThreshold struct { *mock.Call } -func (_m TaskExecutionMetadata_GetInterruptibleFailureThreshold) Return(_a0 uint32) *TaskExecutionMetadata_GetInterruptibleFailureThreshold { +func (_m TaskExecutionMetadata_GetInterruptibleFailureThreshold) Return(_a0 int32) *TaskExecutionMetadata_GetInterruptibleFailureThreshold { return &TaskExecutionMetadata_GetInterruptibleFailureThreshold{Call: _m.Call.Return(_a0)} } @@ -107,14 +107,14 @@ func (_m *TaskExecutionMetadata) OnGetInterruptibleFailureThresholdMatch(matcher } // GetInterruptibleFailureThreshold provides a mock function with given fields: -func (_m *TaskExecutionMetadata) GetInterruptibleFailureThreshold() uint32 { +func (_m *TaskExecutionMetadata) GetInterruptibleFailureThreshold() int32 { ret := _m.Called() - var r0 uint32 - if rf, ok := ret.Get(0).(func() uint32); ok { + var r0 int32 + if rf, ok := ret.Get(0).(func() int32); ok { r0 = rf() } else { - r0 = ret.Get(0).(uint32) + r0 = ret.Get(0).(int32) } return r0 diff --git a/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go b/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go index 646118698e..f3a372666a 100644 --- a/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go +++ b/flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go @@ -268,7 +268,7 @@ func NewSubTaskExecutionMetadata(taskExecutionMetadata pluginsCore.TaskExecution } subTaskExecutionID := NewSubTaskExecutionID(taskExecutionMetadata.GetTaskExecutionID(), executionIndex, retryAttempt) - interruptible := taskExecutionMetadata.IsInterruptible() && uint32(systemFailures) < taskExecutionMetadata.GetInterruptibleFailureThreshold() + interruptible := taskExecutionMetadata.IsInterruptible() && int32(systemFailures) < taskExecutionMetadata.GetInterruptibleFailureThreshold() return SubTaskExecutionMetadata{ taskExecutionMetadata, utils.UnionMaps(taskExecutionMetadata.GetAnnotations(), secretsMap), From 6d5815499575215cf3300b775a065a1478594b7b Mon Sep 17 00:00:00 2001 From: Eduardo Apolinario Date: Mon, 2 Oct 2023 13:57:44 -0700 Subject: [PATCH 2/2] Test PR Signed-off-by: Eduardo Apolinario --- flyteplugins/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/flyteplugins/README.md b/flyteplugins/README.md index d2002cc54d..74d5b92589 100755 --- a/flyteplugins/README.md +++ b/flyteplugins/README.md @@ -1,2 +1,3 @@ # flyteplugins + Plugins contributed by flyte community.