Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates caching docs to be all about the new style of caching #14165

Merged
merged 5 commits into from
Jun 20, 2024
Merged

Conversation

cicdw
Copy link
Member

@cicdw cicdw commented Jun 20, 2024

Note that some changes depend on #14164

My goal here was to give a practical orientation to caching without mentioning transactions, as those will be more advanced

@cicdw cicdw requested a review from a team as a code owner June 20, 2024 00:16
- the code definition of the task
- the prevailing flow run ID, or if executed autonomously, the prevailing task run ID

All of these are hashed to compute the task's _cache key_.
Copy link
Member

Choose a reason for hiding this comment

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

I think it is important to acknowledge the expected consequence is that a task called twice in the same flow with the same arguments will not run twice but reuse its cached results -- inter-flow idempotency.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call, will do

Copy link
Member Author

Choose a reason for hiding this comment

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

@jlowin updated

- `DEFAULT`: this cache policy uses the task's inputs, it's code definition, as well as the prevailing flow run ID
to compute the task's cache key.
- `INPUTS`: this cache policy uses _only_ the task's inputs to compute the cache key.
- `TASKDEF`: this cache policy uses _only_ the task's code definition to compute the cache key.
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, all the other values here are self documenting but this one really isn't clear unless you read this doc.

Suggestions:

TASK_CODE
TASK_DEF (maybe)
TASK_SOURCE

Copy link
Member Author

Choose a reason for hiding this comment

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

Love it; TASK_SOURCE sounds best to me but it's a bit formal. Will need to think about which to use but I'll change it either way

Copy link
Member Author

Choose a reason for hiding this comment

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

source actually hints at how I get this (getsource()) so I think it's the best

Copy link
Member Author

Choose a reason for hiding this comment

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

Made this change in my code companion PR to this: e8c996d

docs/3.0rc/develop/write-tasks/index.mdx Outdated Show resolved Hide resolved
cicdw and others added 2 commits June 19, 2024 17:59
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
@cicdw cicdw merged commit a9ddc6b into main Jun 20, 2024
4 checks passed
@cicdw cicdw deleted the lets-go-txns branch June 20, 2024 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants