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

Commit

Permalink
Renamed SkipCache flag to OverwriteCache
Browse files Browse the repository at this point in the history
Updated to latest released versions of flyteidl, flyteplugins and flytestdlib
Updated to latest unmerged version of flytepropeller

Signed-off-by: Nick Müller <[email protected]>
  • Loading branch information
Nick Müller committed Nov 7, 2022
1 parent e915075 commit 342b05e
Show file tree
Hide file tree
Showing 9 changed files with 244 additions and 180 deletions.
13 changes: 4 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ module github.com/flyteorg/flyteadmin

go 1.18

replace (
github.com/flyteorg/flyteidl => github.com/blackshark-ai/flyteidl v0.24.22-0.20221005103053-1172311340ca
github.com/flyteorg/flyteplugins => github.com/blackshark-ai/flyteplugins v1.0.2-0.20220927114241-fb57ce261bb5
github.com/flyteorg/flytepropeller => github.com/blackshark-ai/flytepropeller v0.16.48-0.20221005131926-b28ee5ec71d3
github.com/flyteorg/flytestdlib => github.com/blackshark-ai/flytestdlib v1.0.1-0.20220927112514-285faf0b16b4
)
replace github.com/flyteorg/flytepropeller => github.com/blackshark-ai/flytepropeller v0.16.48-0.20221104140634-612ad8925372

require (
cloud.google.com/go/iam v0.3.0
Expand All @@ -20,10 +15,10 @@ require (
github.com/cloudevents/sdk-go/v2 v2.8.0
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/flyteorg/flyteidl v1.1.19
github.com/flyteorg/flyteplugins v1.0.15
github.com/flyteorg/flyteidl v1.2.3
github.com/flyteorg/flyteplugins v1.0.18
github.com/flyteorg/flytepropeller v1.1.28
github.com/flyteorg/flytestdlib v1.0.5
github.com/flyteorg/flytestdlib v1.0.11
github.com/flyteorg/stow v0.3.6
github.com/ghodss/yaml v1.0.0
github.com/go-gormigrate/gormigrate/v2 v2.0.0
Expand Down
225 changes: 147 additions & 78 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/manager/impl/execution_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ func (m *ExecutionManager) RelaunchExecution(
}
executionSpec.Metadata.Mode = admin.ExecutionMetadata_RELAUNCH
executionSpec.Metadata.ReferenceExecution = existingExecution.Id
executionSpec.SkipCache = request.GetSkipCache()
executionSpec.OverwriteCache = request.GetOverwriteCache()
var executionModel *models.Execution
ctx, executionModel, err = m.launchExecutionAndPrepareModel(ctx, admin.ExecutionCreateRequest{
Project: request.Id.Project,
Expand Down
158 changes: 79 additions & 79 deletions pkg/manager/impl/execution_manager_test.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/manager/impl/shared/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ type WorkflowExecutionConfigInterface interface {
GetLabels() *admin.Labels
// GetInterruptible indicates a workflow should be flagged as interruptible for a single execution. If omitted, the workflow's default is used.
GetInterruptible() *wrappers.BoolValue
// GetSkipCache indicates a workflow should skip all its cached results and re-compute its output, overwriting any already stored data.
GetSkipCache() bool
// GetOverwriteCache indicates a workflow should skip all its cached results and re-compute its output, overwriting any already stored data.
GetOverwriteCache() bool
}
4 changes: 2 additions & 2 deletions pkg/manager/impl/util/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ func MergeIntoExecConfig(workflowExecConfig admin.WorkflowExecutionConfig, spec
workflowExecConfig.Interruptible = spec.GetInterruptible()
}

if !workflowExecConfig.GetSkipCache() && spec.GetSkipCache() {
workflowExecConfig.SkipCache = spec.GetSkipCache()
if !workflowExecConfig.GetOverwriteCache() && spec.GetOverwriteCache() {
workflowExecConfig.OverwriteCache = spec.GetOverwriteCache()
}

return workflowExecConfig
Expand Down
12 changes: 6 additions & 6 deletions pkg/runtime/interfaces/application_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ type ApplicationConfig struct {
Annotations map[string]string `json:"annotations,omitempty"`
// Interruptible indicates whether all tasks should be run as interruptible by default (unless specified otherwise via the execution/workflow/task definition)
Interruptible bool `json:"interruptible"`
// SkipCache indicates all workflows and tasks should skip all their cached results and re-compute their outputs,
// OverwriteCache indicates all workflows and tasks should skip all their cached results and re-compute their outputs,
// overwriting any already stored data.
// Note that setting this setting to `true` effectively disabled all caching in Flyte as all executions launched
// will have their SkipCache setting enabled.
SkipCache bool `json:"skipCache"`
// will have their OverwriteCache setting enabled.
OverwriteCache bool `json:"overwriteCache"`

// Optional: security context override to apply this execution.
// iam_role references the fully qualified name of Identity & Access Management role to impersonate.
Expand Down Expand Up @@ -163,16 +163,16 @@ func (a *ApplicationConfig) GetInterruptible() *wrappers.BoolValue {
}
}

func (a *ApplicationConfig) GetSkipCache() bool {
return a.SkipCache
func (a *ApplicationConfig) GetOverwriteCache() bool {
return a.OverwriteCache
}

// GetAsWorkflowExecutionConfig returns the WorkflowExecutionConfig as extracted from this object
func (a *ApplicationConfig) GetAsWorkflowExecutionConfig() admin.WorkflowExecutionConfig {
// These three should always be set, the first two are a number/bool, and the other returns nil when empty.
wec := admin.WorkflowExecutionConfig{
MaxParallelism: a.GetMaxParallelism(),
SkipCache: a.GetSkipCache(),
OverwriteCache: a.GetOverwriteCache(),
Interruptible: a.GetInterruptible(),
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/workflowengine/impl/prepare_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func addExecutionOverrides(taskPluginOverrides []*admin.PluginOverride,
executionConfig.Interruptible = &interruptible
}

executionConfig.SkipCache = workflowExecutionConfig.GetSkipCache()
executionConfig.OverwriteCache = workflowExecutionConfig.GetOverwriteCache()
}
if taskResources != nil {
var requests = v1alpha1.TaskResourceSpec{}
Expand Down
4 changes: 2 additions & 2 deletions pkg/workflowengine/impl/prepare_execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ func TestAddExecutionOverrides(t *testing.T) {
})
t.Run("skip cache", func(t *testing.T) {
workflowExecutionConfig := &admin.WorkflowExecutionConfig{
SkipCache: true,
OverwriteCache: true,
}
workflow := &v1alpha1.FlyteWorkflow{}
addExecutionOverrides(nil, workflowExecutionConfig, nil, nil, workflow)
assert.True(t, workflow.ExecutionConfig.SkipCache)
assert.True(t, workflow.ExecutionConfig.OverwriteCache)
})
}

Expand Down

0 comments on commit 342b05e

Please sign in to comment.