Skip to content

Commit

Permalink
Remove flytekit version check (flyteorg#41)
Browse files Browse the repository at this point in the history
* Remove flytekit version check

* lint
  • Loading branch information
EngHabu authored Dec 6, 2019
1 parent f487cfe commit f6db135
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
18 changes: 2 additions & 16 deletions pkg/controller/nodes/dynamic/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
}
}
Expand Down
19 changes: 0 additions & 19 deletions pkg/controller/nodes/dynamic/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f6db135

Please sign in to comment.