Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Maintaining Interruptible and OverwriteCache for reference launchplans #557

Merged
merged 3 commits into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/controller/nodes/subworkflow/launchplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ func (l *launchPlanHandler) StartLaunchPlan(ctx context.Context, nCtx handler.No
RawOutputDataConfig: nCtx.ExecutionContext().GetRawOutputDataConfig().RawOutputDataConfig,
Labels: nCtx.ExecutionContext().GetLabels(),
Annotations: nCtx.ExecutionContext().GetAnnotations(),
Interruptible: nCtx.ExecutionContext().GetExecutionConfig().Interruptible,
OverwriteCache: nCtx.ExecutionContext().GetExecutionConfig().OverwriteCache,
}

if nCtx.ExecutionContext().GetExecutionConfig().RecoveryExecution.WorkflowExecutionIdentifier != nil {
Expand Down
29 changes: 20 additions & 9 deletions pkg/controller/nodes/subworkflow/launchplan/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@ import (
"fmt"
"time"

evtErr "github.com/flyteorg/flytepropeller/events/errors"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service"

"github.com/flyteorg/flytestdlib/cache"
"golang.org/x/time/rate"
"k8s.io/client-go/util/workqueue"

stdErr "github.com/flyteorg/flytestdlib/errors"

"github.com/flyteorg/flytestdlib/logger"

"github.com/flyteorg/flytestdlib/promutils"

"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/core"
"github.com/flyteorg/flyteidl/gen/pb-go/flyteidl/service"
evtErr "github.com/flyteorg/flytepropeller/events/errors"

"github.com/golang/protobuf/ptypes/wrappers"

"golang.org/x/time/rate"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"k8s.io/client-go/util/workqueue"
)

var isRecovery = true
Expand Down Expand Up @@ -93,6 +95,13 @@ func (a *adminLaunchPlanExecutor) Launch(ctx context.Context, launchCtx LaunchCo
}
}

var interruptible *wrappers.BoolValue
if launchCtx.Interruptible != nil {
interruptible = &wrappers.BoolValue{
Value: *launchCtx.Interruptible,
}
}

req := &admin.ExecutionCreateRequest{
Project: executionID.Project,
Domain: executionID.Domain,
Expand All @@ -111,6 +120,8 @@ func (a *adminLaunchPlanExecutor) Launch(ctx context.Context, launchCtx LaunchCo
SecurityContext: &launchCtx.SecurityContext,
MaxParallelism: int32(launchCtx.MaxParallelism),
RawOutputDataConfig: launchCtx.RawOutputDataConfig,
Interruptible: interruptible,
OverwriteCache: launchCtx.OverwriteCache,
},
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/controller/nodes/subworkflow/launchplan/launchplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ type LaunchContext struct {
RawOutputDataConfig *admin.RawOutputDataConfig
Annotations map[string]string
Labels map[string]string
Interruptible *bool
OverwriteCache bool
}

// Executor interface to be implemented by the remote system that can allow workflow launching capabilities
Expand Down