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

Populate TaskNodeMetadata on CreateNodeExecutionModel to correctly display fast cache #483

Merged
merged 3 commits into from
Mar 29, 2023

Conversation

hamersaw
Copy link
Contributor

TL;DR

Current the CacheStatus field on node executions is only set when updating an existing model. In the case of fast cache work, where only a single node execution event will be sent for a node (ie. cache hit / succeeded), this information is never set and as a result the "cache hit" icon is never displayed in the UI. This PR sets CacheStatus if it exists on the first node execution event.

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

^^^

Tracking Issue

flyteorg/flyte#2886

Follow-up issue

NA

@codecov
Copy link

codecov bot commented Oct 10, 2022

Codecov Report

Merging #483 (dca1a2d) into master (cca9e17) will increase coverage by 1.58%.
The diff coverage is 100.00%.

❗ Current head dca1a2d differs from pull request most recent head 049e37c. Consider uploading reports for the commit 049e37c to get more accurate results

@@            Coverage Diff             @@
##           master     #483      +/-   ##
==========================================
+ Coverage   58.78%   60.37%   +1.58%     
==========================================
  Files         170      170              
  Lines       16055    13155    -2900     
==========================================
- Hits         9438     7942    -1496     
+ Misses       5783     4379    -1404     
  Partials      834      834              
Flag Coverage Δ
unittests ?

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

Impacted Files Coverage Δ
pkg/repositories/transformers/node_execution.go 75.20% <100.00%> (+3.87%) ⬆️

... and 155 files with indirect coverage changes

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

@@ -132,6 +132,9 @@ func TestCreateNodeEvent(t *testing.T) {
StartedAt: occurredAtProto,
CreatedAt: occurredAtProto,
UpdatedAt: occurredAtProto,
TargetMetadata: &admin.NodeExecutionClosure_TaskNodeMetadata{
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this change necessary? we shouldn't be initializing the metadata in the closure unless it's sourced from the event itself, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I'm not sure I follow. Currently the TaskNodeMetadata from a node event is only used if when we UpdateNodeExecutionModel here. In the CreateNodeExecutionModel func (which is called on the first node node event, update on all subsequent) we just drop any information in the TaskNodeMetadata. This PR adds support for processing the TaskNodeMetadata in the CreateNodeExecutionModel function - which creates the initial model based on the first event. This change results in setting the TaskNodeMetadata in the CreateNodeEvent function. So I copied the TargetMetadata from the unit tests for updating the node model. Does this make sense? Or am I thinking about this wrong?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah sorry, I didn't realize the event under test actually had a non-empty TargetMetadata - and we should therefore expect to see the closure here have an initialized TargetMetadata

katrogan
katrogan previously approved these changes Oct 17, 2022
@hamersaw hamersaw merged commit eb695b1 into master Mar 29, 2023
@hamersaw hamersaw deleted the feature/fast-cache branch March 29, 2023 20:34
eapolinario pushed a commit that referenced this pull request Sep 6, 2023
…splay fast cache (#483)

* adding cache information on first node event

Signed-off-by: Daniel Rammer <[email protected]>

* fixed unit tests

Signed-off-by: Daniel Rammer <[email protected]>

---------

Signed-off-by: Daniel Rammer <[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