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

[caching] fix issues that execution metadata with overwrite cache is not written to artifacts table #4550

Closed

Conversation

ysysys3074
Copy link
Contributor

Why are the changes needed?

When we execute workflow with overwrite cache flag and then run the execution again, "view source execution" is still linked to the old cached execution link instead of execution with overwrite cache which is confusing, so this PR is correct this behavior.
Screenshot 2023-12-07 at 9 23 51 AM

What changes were proposed in this pull request?

The root cause for this issue is new metadata from execution with overwrite cache is not passed to UpdateArtifactRequest, and artifacts table is not really updated with new serializedmetadata.

How was this patch tested?

unit tests added
E2E tests are done in Linkedin's internal flyte platform so can not share the execution link.
screeshots:

  1. first run with normal cache
Screenshot 2023-12-07 at 9 31 40 AM
  1. seond run, it will pick cache from first run
Screenshot 2023-12-07 at 9 32 05 AM
  1. second run, i chose overwrite cache button from UI
    link to first execution - fopdnzo2lxkd5a

  2. fourth run, it picks the cache from second run, link to the right execution
    link to the third execution - f14xkrarmxyiws. (it will link to first run before my code changes)

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Copy link

welcome bot commented Dec 7, 2023

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Dec 7, 2023
@ysysys3074 ysysys3074 changed the title [caching] enable overwrite cache [caching] fix issues that execution metadata with overwrite cache is not written to artifacts table Dec 7, 2023
@hamersaw hamersaw self-requested a review December 7, 2023 22:22
@hamersaw
Copy link
Contributor

hamersaw commented Dec 8, 2023

Thanks for the PR! Can you add DCO signoff to all commits as well? This is necessary as we are a Linux Foundation project.

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (91d24a9) 58.98% compared to head (e73f234) 59.06%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4550      +/-   ##
==========================================
+ Coverage   58.98%   59.06%   +0.07%     
==========================================
  Files         621      587      -34     
  Lines       52483    50339    -2144     
==========================================
- Hits        30957    29731    -1226     
+ Misses      19059    18232     -827     
+ Partials     2467     2376      -91     
Flag Coverage Δ
unittests 59.06% <100.00%> (+0.07%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eapolinario
Copy link
Contributor

Can you rebase? The tests / docs CI check failure is unrelated, fixed in #4556.

@ysysys3074
Copy link
Contributor Author

Thanks for the PR! Can you add DCO signoff to all commits as well? This is necessary as we are a Linux Foundation project.

sure i have added that in my commit thanks!

@ysysys3074
Copy link
Contributor Author

Can you rebase? The tests / docs CI check failure is unrelated, fixed in #4556.

yeah i just rebase, thanks

add metadata in updateartifact request in propeller

change in catalog

add test

Signed-off-by: Yue Shang <[email protected]>
Signed-off-by: Yue Shang <[email protected]>
Signed-off-by: Yue Shang <[email protected]>
metaData := &datacatalog.Metadata{
KeyMap: map[string]string{"key2": "value2"},
}
serializedMetadata, err := transformers.SerializedMetadata(metaData)
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like there is a lint err here because err is not used. maybe add assert.Nil(...) on the err here.

metaData := &datacatalog.Metadata{
KeyMap: map[string]string{"key2": "value2"},
}
serializedMetadata, err := transformers.SerializedMetadata(metaData)
Copy link
Contributor

Choose a reason for hiding this comment

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

also assert on error here.

Comment on lines +382 to +384
logger.Debugf(ctx, "ArtifactModel is %+v", artifactModel)
logger.Debugf(ctx, "ArtifactModel ArtifactData is %+v", artifactModel.ArtifactData)
logger.Debugf(ctx, "ArtifactModel SerializedMetadata is %+v", artifactModel.SerializedMetadata)
Copy link
Contributor

Choose a reason for hiding this comment

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

if we're going to leave this, can it be a single log line rather than 3? The first line should print the entire artifactModel, then the next two are printing fields that should already be exposed in the first.

@hamersaw
Copy link
Contributor

closing in favor of #4617

@hamersaw hamersaw closed this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants