From 7abdcd77b606739bafc780a2bd45196c5bff908f Mon Sep 17 00:00:00 2001 From: Dan Rammer Date: Fri, 7 Apr 2023 17:12:26 -0500 Subject: [PATCH 1/3] returning 'Undefined' when recovering a SKIPPED node so that the node is executed (#551) Signed-off-by: Daniel Rammer --- pkg/controller/nodes/executor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/nodes/executor.go b/pkg/controller/nodes/executor.go index 3d0707469..c447b779c 100644 --- a/pkg/controller/nodes/executor.go +++ b/pkg/controller/nodes/executor.go @@ -216,7 +216,7 @@ func (c *nodeExecutor) attemptRecovery(ctx context.Context, nCtx handler.NodeExe // A recoverable node execution should always be in a terminal phase switch recovered.Closure.Phase { case core.NodeExecution_SKIPPED: - return handler.PhaseInfoSkip(nil, "node execution recovery indicated original node was skipped"), nil + return handler.PhaseInfoUndefined, nil case core.NodeExecution_SUCCEEDED: fallthrough case core.NodeExecution_RECOVERED: From ef164c5b7088510a88056c2a2f3a08af4295e026 Mon Sep 17 00:00:00 2001 From: ByronHsu Date: Mon, 10 Apr 2023 17:32:53 -0700 Subject: [PATCH 2/3] Remove resource injection on the node for container task (#544) * Remove resource injection on the node for container task Signed-off-by: byhsu * fix conflict Signed-off-by: byhsu * fix lint Signed-off-by: byhsu * downgrade plugin Signed-off-by: byhsu --------- Signed-off-by: byhsu Co-authored-by: byhsu --- go.mod | 2 +- go.sum | 4 ++-- pkg/compiler/transformers/k8s/node.go | 2 -- pkg/compiler/transformers/k8s/node_test.go | 16 ---------------- pkg/compiler/transformers/k8s/utils.go | 12 ------------ 5 files changed, 3 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index ca9d98ee2..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.45 + 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 f84741c20..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.45 h1:I/N4ehOxX6ln8DivyZ9gayp/UYiBcqoizBbG1hfwIXM= -github.com/flyteorg/flyteplugins v1.0.45/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= 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{ 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 2be01e251f21687e581e2f78a55b965e46cf184f Mon Sep 17 00:00:00 2001 From: Jeev B Date: Tue, 11 Apr 2023 21:22:41 -0700 Subject: [PATCH 3/3] Infer GOOS and GOARCH from environment (#552) Signed-off-by: Jeev B --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 0e653fa93..659ecb134 100644 --- a/Makefile +++ b/Makefile @@ -3,17 +3,18 @@ include boilerplate/flyte/docker_build/Makefile include boilerplate/flyte/golang_test_targets/Makefile include boilerplate/flyte/end2end/Makefile - .PHONY: update_boilerplate update_boilerplate: @curl https://raw.githubusercontent.com/flyteorg/boilerplate/master/boilerplate/update.sh -o boilerplate/update.sh @boilerplate/update.sh .PHONY: linux_compile +linux_compile: export CGO_ENABLED = 0 +linux_compile: export GOOS = linux linux_compile: - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/flytepropeller ./cmd/controller/main.go - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/flytepropeller-manager ./cmd/manager/main.go - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/kubectl-flyte ./cmd/kubectl-flyte/main.go + go build -o /artifacts/flytepropeller ./cmd/controller/main.go + go build -o /artifacts/flytepropeller-manager ./cmd/manager/main.go + go build -o /artifacts/kubectl-flyte ./cmd/kubectl-flyte/main.go .PHONY: compile compile: @@ -25,9 +26,9 @@ compile: cross_compile: @glide install @mkdir -p ./bin/cross - GOOS=linux GOARCH=amd64 go build -o bin/cross/flytepropeller ./cmd/controller/main.go - GOOS=linux GOARCH=amd64 go build -o bin/cross/flytepropeller-manager ./cmd/manager/main.go - GOOS=linux GOARCH=amd64 go build -o bin/cross/kubectl-flyte ./cmd/kubectl-flyte/main.go + go build -o bin/cross/flytepropeller ./cmd/controller/main.go + go build -o bin/cross/flytepropeller-manager ./cmd/manager/main.go + go build -o bin/cross/kubectl-flyte ./cmd/kubectl-flyte/main.go op_code_generate: @RESOURCE_NAME=flyteworkflow OPERATOR_PKG=github.com/flyteorg/flytepropeller ./hack/update-codegen.sh @@ -53,4 +54,3 @@ clean: golden: go test ./cmd/kubectl-flyte/cmd -update go test ./pkg/compiler/test -update -