Comments (2)
So I started working on output caching for tasks; however, I quickly ran into a question: where should the cached data be stored?
I began implementing it analogously to #78 by putting the outputs into a task's State
which is then fed into the FlowRunner
via task_states
. However, after a successful first run the returned state is Success
which effectively is an output cache except with no input-validation to ensure the cache is still valid.
We could continue down this route, and let the TaskRunner
perform the necessary cache-validation checks when the task has a Success
state, but this might alter the fundamental behavior of the TaskRunner
when it is provided with a Success
state (for example, if the TaskRunner
receives a Success
state whose cache is not valid anymore).
Two other options I immediately see:
- the
Task
itself maintains the cache prefect.Context
somehow maintains a cache for all tasks via a dictionary_cached_tasks
The answer should probably depend on how we envision this output cache behaving in relation to our server and whether the cache should work across Flows or not.
cc: @jlowin
from prefect.
Another option is to create a new State
: CachedState
which inherits from Success
but is handled differently than a Success
in that the TaskRunner
will rerun this task if the cache is no longer valid. (I think I actually prefer this option the most)
from prefect.
Related Issues (20)
- Duplicate message in CLI on `prefect cloud login`
- `prefect cloud login` ability to go back to previous menu or start over
- Memory leak impacting long running flows HOT 1
- Prefect has an undeclared dependency on / broken import of `opentelemetry`, raises ModuleNotFoundError HOT 1
- Unable to handle 'Cancelling' events HOT 3
- Cancellation of the parent flow does not cascade down to the parent flow except in the case of task-wrapped deployments. HOT 1
- Cascading cancellation should work for normal subflows, not just sub-deployments. HOT 1
- flaky "ModuleNotFoundError caused by missing module" "no module named" in Prefect Cloud + ECS push work pools HOT 3
- to_deployment causes infinite Pending state for other flows importing the same module HOT 3
- Task Merge inside with case condition always run no matter value of condition HOT 2
- Lists of integer parameters are not correctly copied to new runs of a deployment HOT 2
- Automation action jinja vars not rendering in composite trigger
- Required deployment string parameters do not come through when setting up an automation action
- Add deployment status events on deployment edit and creation HOT 1
- Work pool is returned as null when flow runs are in a running & scheduled state - Cloud only
- Add the ability to filter events (& create triggers) based on not having certain labels
- Consolidate `jsonschema` usage for validation
- Tasks still running with Sequential Task Runner, if any task fails, when also using submit on task execution HOT 3
- Add `delete` and `ls` commands for `prefect work-pool worker` command group
- Failed to generate job configuration Server error '500 Internal Server Error' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prefect.