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

Skipping of cached task outputs via execution config #482

Merged

Conversation

MorpheusXAUT
Copy link
Contributor

TL;DR

flyteadmin sets the SkipCache flag in the execution config to instruct flytepropeller to ignore cached data for an execution.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

Similar to the Interruptible override, a new SkipCache execution config flag was introduced. flyteadmin ensures the flag is passed onto flytepropeller accordingly for CreateExecution and RelaunchExecution requests.

As this uses currently unmerged versions of flyteidl, flyteplugins, flytestdlib and flytepropeller, the PR is created as a draft (for review) until the respective new versions are available.

Tracking Issue

flyteorg/flyte#2867

Follow-up issue

NA

@codecov
Copy link

codecov bot commented Oct 5, 2022

Codecov Report

Merging #482 (45f81de) into master (acbf818) will increase coverage by 0.04%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #482      +/-   ##
==========================================
+ Coverage   61.63%   61.67%   +0.04%     
==========================================
  Files         158      158              
  Lines       11530    11534       +4     
==========================================
+ Hits         7106     7114       +8     
+ Misses       3688     3683       -5     
- Partials      736      737       +1     
Flag Coverage Δ
unittests 60.61% <50.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/manager/impl/util/shared.go 65.31% <0.00%> (-0.77%) ⬇️
pkg/manager/impl/execution_manager.go 74.01% <100.00%> (+0.02%) ⬆️
pkg/workflowengine/impl/prepare_execution.go 85.88% <100.00%> (+0.16%) ⬆️
...implementations/workflow_execution_event_writer.go 80.00% <0.00%> (+40.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines 81 to 85
// SkipCache 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"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a known use-case for this? Or just adding for completeness?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no use-case I could think of that would make sense, however since MergeExecutionConfig is using a WorkflowExecutionConfigInterface and the application configuration is used as a fallback for other values as well, this was required to satisfy the interface.

It currently returns the actual setting (in case someone wants to set that), however we could also just always have it return false for the ApplicationConfig and not make it configurable at all on application level.

@MorpheusXAUT MorpheusXAUT force-pushed the cache-eviction-execution-override branch from 0e5d9e3 to 342b05e Compare November 7, 2022 10:29
@hamersaw hamersaw changed the title Skipping of cached task outputs via execution config #minor Skipping of cached task outputs via execution config Nov 7, 2022
Nick Müller added 5 commits November 10, 2022 17:10
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]>
Signed-off-by: Nick Müller <[email protected]>
@@ -291,5 +291,10 @@ func MergeIntoExecConfig(workflowExecConfig admin.WorkflowExecutionConfig, spec
if workflowExecConfig.GetInterruptible() == nil && spec.GetInterruptible() != nil {
workflowExecConfig.Interruptible = spec.GetInterruptible()
}

if !workflowExecConfig.GetOverwriteCache() && spec.GetOverwriteCache() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting - so we can essentially disable caching for an entire project+domain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, in theory, we could disable the caching for an entire project/domain or even the whole application via the matchable resources or application config.
Whilst that's not one of the main use cases I had in mind, it's definitely an option and might be useful at some point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do worry that there's no way to tell whether the value is omitted in the execution request spec, in which case it defaults to false vs. explicitly set to false. It's hard to tell by the false value alone whether the workflow exec config value should be overwritten.

Perhaps we can amend flyteidl to use the nullable google.protobuf.BoolValue like we do here: https://github.com/flyteorg/flyteidl/blob/master/protos/flyteidl/admin/launch_plan.proto#L127

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that, similar to how I previously added the interruptible flag, however I didn't see the exact use case of overwriting it to false (being able to distinguish between not set/false).
Since the main intended use case was for a single execution, I didn't anticipate we'd need the "tri-state" bool, especially since it's also less confusing in the console UI for end users.

@katrogan If you'd prefer to have the option, I can certainly adapt it since it'll be a minor change anyways.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I suppose the project-domain and even application setting use cases are themselves probably very nice to haves that I can't imagine are used frequently. 👍 We can always revisit this if it ends up being a feature request

@katrogan katrogan merged commit 4cc2381 into flyteorg:master Nov 14, 2022
@MorpheusXAUT MorpheusXAUT deleted the cache-eviction-execution-override branch November 14, 2022 22:23
eapolinario pushed a commit that referenced this pull request Sep 6, 2023
* Implemented SkipCache handling for execution config

Signed-off-by: Nick Müller <[email protected]>

* Added cache skip override to RelaunchExecution endpoint

Signed-off-by: Nick Müller <[email protected]>

* Updated to latest version of flytepropeller

Signed-off-by: Nick Müller <[email protected]>

* Renamed SkipCache flag to OverwriteCache
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]>

* Updated flyteidl, flytepropeller and flytestdlib to latest released versions

Signed-off-by: Nick Müller <[email protected]>

* Reworded comment for clarity

Signed-off-by: Nick Müller <[email protected]>

Signed-off-by: Nick Müller <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants