From 46393bcf983a92e1b9d7bbb7eea304996ee6f4c8 Mon Sep 17 00:00:00 2001 From: byhsu Date: Mon, 27 Mar 2023 11:30:20 -0700 Subject: [PATCH 1/4] Remove resource injection on the node for container task Signed-off-by: byhsu --- pkg/compiler/transformers/k8s/node.go | 2 -- pkg/compiler/transformers/k8s/node_test.go | 16 ---------------- 2 files changed, 18 deletions(-) diff --git a/pkg/compiler/transformers/k8s/node.go b/pkg/compiler/transformers/k8s/node.go index f8d5947c9..d9ac41dd4 100644 --- a/pkg/compiler/transformers/k8s/node.go +++ b/pkg/compiler/transformers/k8s/node.go @@ -45,8 +45,6 @@ func buildNodeSpec(n *core.Node, tasks []*core.CompiledTask, errs errors.Compile if n.GetTaskNode().Overrides != nil && n.GetTaskNode().Overrides.Resources != nil { resources = n.GetTaskNode().Overrides.Resources - } else { - resources = getResources(task) } } diff --git a/pkg/compiler/transformers/k8s/node_test.go b/pkg/compiler/transformers/k8s/node_test.go index 010eb0c3d..a9732d9d7 100644 --- a/pkg/compiler/transformers/k8s/node_test.go +++ b/pkg/compiler/transformers/k8s/node_test.go @@ -93,22 +93,6 @@ func TestBuildNodeSpec(t *testing.T) { mustBuild(t, n, 1, errs.NewScope()) }) - t.Run("Task with resources", func(t *testing.T) { - expectedCPU := resource.MustParse("10Mi") - n.Node.Target = &core.Node_TaskNode{ - TaskNode: &core.TaskNode{ - Reference: &core.TaskNode_ReferenceId{ - ReferenceId: &core.Identifier{Name: "ref_2"}, - }, - }, - } - - spec := mustBuild(t, n, 1, errs.NewScope()) - assert.NotNil(t, spec.Resources) - assert.NotNil(t, spec.Resources.Requests.Cpu()) - assert.Equal(t, expectedCPU.Value(), spec.Resources.Requests.Cpu().Value()) - }) - t.Run("node with resource overrides", func(t *testing.T) { expectedCPU := resource.MustParse("20Mi") n.Node.Target = &core.Node_TaskNode{ From 9efb52f7f7c11cb58fd2773f394ef716f8e2d966 Mon Sep 17 00:00:00 2001 From: byhsu Date: Sat, 8 Apr 2023 22:48:17 -0700 Subject: [PATCH 2/4] fix conflict Signed-off-by: byhsu --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ca9d98ee2..6485b3c5b 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/benlaurie/objecthash v0.0.0-20180202135721-d1e3d6079fc1 github.com/fatih/color v1.13.0 github.com/flyteorg/flyteidl v1.3.14 - github.com/flyteorg/flyteplugins v1.0.45 + github.com/flyteorg/flyteplugins v1.0.48 github.com/flyteorg/flytestdlib v1.0.15 github.com/ghodss/yaml v1.0.0 github.com/go-redis/redis v6.15.7+incompatible diff --git a/go.sum b/go.sum index f84741c20..da1be1abb 100644 --- a/go.sum +++ b/go.sum @@ -262,8 +262,8 @@ github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYF github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flyteorg/flyteidl v1.3.14 h1:o5M0g/r6pXTPu5PEurbYxbQmuOu3hqqsaI2M6uvK0N8= github.com/flyteorg/flyteidl v1.3.14/go.mod h1:Pkt2skI1LiHs/2ZoekBnyPhuGOFMiuul6HHcKGZBsbM= -github.com/flyteorg/flyteplugins v1.0.45 h1:I/N4ehOxX6ln8DivyZ9gayp/UYiBcqoizBbG1hfwIXM= -github.com/flyteorg/flyteplugins v1.0.45/go.mod h1:ztsonku5fKwyxcIg1k69PTiBVjRI6d3nK5DnC+iwx08= +github.com/flyteorg/flyteplugins v1.0.48 h1:2r1dxp6WMnANQNgAGVQwYnRu6YDKJ0R+DbCeoZAng5Q= +github.com/flyteorg/flyteplugins v1.0.48/go.mod h1:ztsonku5fKwyxcIg1k69PTiBVjRI6d3nK5DnC+iwx08= github.com/flyteorg/flytestdlib v1.0.15 h1:kv9jDQmytbE84caY+pkZN8trJU2ouSAmESzpTEhfTt0= github.com/flyteorg/flytestdlib v1.0.15/go.mod h1:ghw/cjY0sEWIIbyCtcJnL/Gt7ZS7gf9SUi0CCPhbz3s= github.com/flyteorg/stow v0.3.6 h1:jt50ciM14qhKBaIrB+ppXXY+SXB59FNREFgTJqCyqIk= From 73997ede2ad2506ebb8a265b979c8591850106cb Mon Sep 17 00:00:00 2001 From: byhsu Date: Mon, 10 Apr 2023 09:41:13 -0700 Subject: [PATCH 3/4] fix lint Signed-off-by: byhsu --- pkg/compiler/transformers/k8s/utils.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pkg/compiler/transformers/k8s/utils.go b/pkg/compiler/transformers/k8s/utils.go index 1cf9a521c..5f8a0f85a 100644 --- a/pkg/compiler/transformers/k8s/utils.go +++ b/pkg/compiler/transformers/k8s/utils.go @@ -48,18 +48,6 @@ func computeDeadline(n *core.Node) (*v1.Duration, error) { return deadline, nil } -func getResources(task *core.TaskTemplate) *core.Resources { - if task == nil { - return nil - } - - if task.GetContainer() == nil { - return nil - } - - return task.GetContainer().Resources -} - func toAliasValueArray(aliases []*core.Alias) []v1alpha1.Alias { if aliases == nil { return nil From 72e2f1ddf36e51e968c1ad727c857482745e7667 Mon Sep 17 00:00:00 2001 From: byhsu Date: Mon, 10 Apr 2023 12:53:47 -0700 Subject: [PATCH 4/4] downgrade plugin Signed-off-by: byhsu --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6485b3c5b..cca83ecda 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/benlaurie/objecthash v0.0.0-20180202135721-d1e3d6079fc1 github.com/fatih/color v1.13.0 github.com/flyteorg/flyteidl v1.3.14 - github.com/flyteorg/flyteplugins v1.0.48 + github.com/flyteorg/flyteplugins v1.0.47 github.com/flyteorg/flytestdlib v1.0.15 github.com/ghodss/yaml v1.0.0 github.com/go-redis/redis v6.15.7+incompatible diff --git a/go.sum b/go.sum index da1be1abb..c4379d8fb 100644 --- a/go.sum +++ b/go.sum @@ -262,8 +262,8 @@ github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYF github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flyteorg/flyteidl v1.3.14 h1:o5M0g/r6pXTPu5PEurbYxbQmuOu3hqqsaI2M6uvK0N8= github.com/flyteorg/flyteidl v1.3.14/go.mod h1:Pkt2skI1LiHs/2ZoekBnyPhuGOFMiuul6HHcKGZBsbM= -github.com/flyteorg/flyteplugins v1.0.48 h1:2r1dxp6WMnANQNgAGVQwYnRu6YDKJ0R+DbCeoZAng5Q= -github.com/flyteorg/flyteplugins v1.0.48/go.mod h1:ztsonku5fKwyxcIg1k69PTiBVjRI6d3nK5DnC+iwx08= +github.com/flyteorg/flyteplugins v1.0.47 h1:+SnRM7Z257xiIg5B5i3gLJxEUtZJlEyrzCPCAMolsug= +github.com/flyteorg/flyteplugins v1.0.47/go.mod h1:ztsonku5fKwyxcIg1k69PTiBVjRI6d3nK5DnC+iwx08= github.com/flyteorg/flytestdlib v1.0.15 h1:kv9jDQmytbE84caY+pkZN8trJU2ouSAmESzpTEhfTt0= github.com/flyteorg/flytestdlib v1.0.15/go.mod h1:ghw/cjY0sEWIIbyCtcJnL/Gt7ZS7gf9SUi0CCPhbz3s= github.com/flyteorg/stow v0.3.6 h1:jt50ciM14qhKBaIrB+ppXXY+SXB59FNREFgTJqCyqIk=