From f6db1358872517b074975d9a6d3e3ab335e686af Mon Sep 17 00:00:00 2001 From: Haytham AbuelFutuh Date: Fri, 6 Dec 2019 13:20:19 -0800 Subject: [PATCH] Remove flytekit version check (#41) * Remove flytekit version check * lint --- pkg/controller/nodes/dynamic/handler.go | 18 ++---------------- pkg/controller/nodes/dynamic/utils.go | 19 ------------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/pkg/controller/nodes/dynamic/handler.go b/pkg/controller/nodes/dynamic/handler.go index d292e6c3fa..0d77b8c65b 100644 --- a/pkg/controller/nodes/dynamic/handler.go +++ b/pkg/controller/nodes/dynamic/handler.go @@ -5,8 +5,6 @@ import ( "fmt" "time" - "github.com/Masterminds/semver" - "github.com/lyft/flyteplugins/go/tasks/pluginmachinery/catalog" pluginCore "github.com/lyft/flyteplugins/go/tasks/pluginmachinery/core" "github.com/lyft/flyteplugins/go/tasks/pluginmachinery/io" @@ -35,9 +33,6 @@ import ( const dynamicNodeID = "dynamic-node" -// TODO: Remove after deploying version 0.2.4 -var arrayFlyteKitVersion = semver.MustParse("0.2.3") - type TaskNodeHandler interface { handler.Node ValidateOutputAndCacheAdd(ctx context.Context, nodeID v1alpha1.NodeID, i io.InputReader, r io.OutputReader, outputCommitter io.OutputWriter, @@ -257,17 +252,8 @@ func (d dynamicNodeTaskNodeHandler) buildDynamicWorkflowTemplate(ctx context.Con // TODO: This is a hack since array tasks' interfaces are malformed. Remove after // FlyteKit version that generates the right interfaces is deployed. if t.Type == "container_array" { - isBelow, err := isFlyteKitVersionBelow(t.GetMetadata().Runtime, arrayFlyteKitVersion) - if err != nil { - logger.Warnf(ctx, "Failed to validate flytekit version of task [%v] will skip array"+ - " interface manipulation.", t.GetId()) - continue - } - - if isBelow { - iface := t.GetInterface() - iface.Outputs = makeArrayInterface(iface.Outputs) - } + iface := t.GetInterface() + iface.Outputs = makeArrayInterface(iface.Outputs) } } } diff --git a/pkg/controller/nodes/dynamic/utils.go b/pkg/controller/nodes/dynamic/utils.go index b10becd2c2..b17f701d58 100644 --- a/pkg/controller/nodes/dynamic/utils.go +++ b/pkg/controller/nodes/dynamic/utils.go @@ -3,8 +3,6 @@ package dynamic import ( "context" - "github.com/Masterminds/semver" - "k8s.io/apimachinery/pkg/util/sets" "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core" @@ -79,23 +77,6 @@ func compileTasks(_ context.Context, tasks []*core.TaskTemplate) ([]*core.Compil return compiledTasks, nil } -func isFlyteKitVersionBelow(runtime *core.RuntimeMetadata, ver *semver.Version) (bool, error) { - if runtime == nil { - return false, nil - } - - if runtime.Type != core.RuntimeMetadata_FLYTE_SDK { - return false, nil - } - - v, err := semver.NewVersion(runtime.Version) - if err != nil { - return false, err - } - - return v.LessThan(ver), nil -} - func makeArrayInterface(varMap *core.VariableMap) *core.VariableMap { if varMap == nil || len(varMap.Variables) == 0 { return varMap