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

Add GetDeckPath to OutputReader #268

Merged
merged 8 commits into from
Jun 7, 2022
Merged

Add GetDeckPath to OutputReader #268

merged 8 commits into from
Jun 7, 2022

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Jun 6, 2022

Signed-off-by: Kevin Su pingsutw@apache.org

TL;DR

In order to cache the deck file, we need to add a new attribute DeckPath to InMemoryOutputReader

Related flyteorg/flytepropeller#443

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

How did you fix the bug, make the feature etc. Link to any design docs etc

Tracking Issue

flyteorg/flyte#2175

Follow-up issue

NA

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
@codecov
Copy link

codecov bot commented Jun 6, 2022

Codecov Report

Merging #268 (a5d0aa0) into master (2c83e24) will increase coverage by 0.45%.
The diff coverage is 68.42%.

@@            Coverage Diff             @@
##           master     #268      +/-   ##
==========================================
+ Coverage   62.55%   63.01%   +0.45%     
==========================================
  Files         142      142              
  Lines        8960     8968       +8     
==========================================
+ Hits         5605     5651      +46     
+ Misses       2834     2796      -38     
  Partials      521      521              
Flag Coverage Δ
unittests 62.36% <60.00%> (+0.32%) ⬆️

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

Impacted Files Coverage Δ
go/tasks/pluginmachinery/ioutils/paths.go 84.61% <ø> (ø)
go/tasks/plugins/array/awsbatch/monitor.go 61.79% <0.00%> (ø)
go/tasks/plugins/array/k8s/management.go 55.77% <0.00%> (ø)
go/tasks/plugins/k8s/sagemaker/builtin_training.go 72.00% <0.00%> (ø)
...sks/plugins/k8s/sagemaker/hyperparameter_tuning.go 60.45% <0.00%> (ø)
go/tasks/plugins/presto/execution_state.go 50.65% <0.00%> (ø)
go/tasks/plugins/array/outputs.go 73.29% <50.00%> (ø)
...pluginmachinery/ioutils/in_memory_output_reader.go 78.94% <100.00%> (+78.94%) ⬆️
...uginmachinery/ioutils/remote_file_output_reader.go 20.54% <100.00%> (+3.40%) ⬆️
...uginmachinery/ioutils/remote_file_output_writer.go 58.33% <100.00%> (+58.33%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c83e24...a5d0aa0. Read the comment docs.

Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw pingsutw requested a review from EngHabu June 6, 2022 17:07
EngHabu
EngHabu previously approved these changes Jun 7, 2022
@@ -107,7 +107,7 @@ func (w assembleOutputsWorker) Process(ctx context.Context, workItem workqueue.W
}

ow := ioutils.NewRemoteFileOutputWriter(ctx, i.dataStore, i.outputPaths)
if err = ow.Put(ctx, ioutils.NewInMemoryOutputReader(finalOutputs, nil)); err != nil {
if err = ow.Put(ctx, ioutils.NewInMemoryOutputReader(finalOutputs, nil, nil)); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to think about this (maybe open a separate issue) for how to aggregate (if any) these html files in array case

Copy link
Member Author

Choose a reason for hiding this comment

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

okay, will create a new issue for it.

@EngHabu
Copy link
Contributor

EngHabu commented Jun 7, 2022

Looks like you may need to add a few more unit tests for patch coverage...

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
@EngHabu EngHabu merged commit f577f62 into master Jun 7, 2022
@honnix
Copy link
Member

honnix commented Aug 1, 2022

This is unfortunately a breaking change that we could have been more verbose and bumped minor (even major) version. One of our plugins needs to be updated to incorporate this. What is deck? Can we pass a nil if our plugin doesn't care?

@honnix
Copy link
Member

honnix commented Aug 1, 2022

What is deck? Can we pass a nil if our plugin doesn't care?

OK I found it here https://docs.flyte.org/projects/cookbook/en/latest/auto/core/flyte_basics/deck.html#sphx-glr-auto-core-flyte-basics-deck-py. Seem to be quite useful. So how we do pass in the path instead of nil?

@pingsutw
Copy link
Member Author

pingsutw commented Aug 4, 2022

@honnix what error did you run into? you can set deckPath to nil in NewInMemoryOutputReader.
In flytekit, output.pb will be written to output_dir/output.pband Flyte deck (an HTML file) will be written to output_dir/deck.html

https://github.com/pingsutw/flytepropeller/blob/f08ccaad75246c7a1149be632206c0278608e61e/pkg/controller/nodes/executor.go#L239-L249

Some plugins (like bigquery) that will not generate a deck file, we also set deckPath to nil.

@honnix
Copy link
Member

honnix commented Aug 4, 2022

Thanks for replying @pingsutw .

what error did you run into?

Since the signature of NewInMemoryOutputReader was changed by adding one more argument, one of our internal plugins failed to compile. Since this type of APIs could be used by any plugin, we might want to be more careful when making changes in the future.

The same as you suggested, we put nil as the deck path to fix it, and now everything is fine.

@pingsutw
Copy link
Member Author

pingsutw commented Aug 4, 2022

@honnix got it, sorry. we'll be more careful when making changes to public API in the future.

@honnix
Copy link
Member

honnix commented Aug 4, 2022

@pingsutw No worries. It was easy to catch and fix. :)

eapolinario pushed a commit that referenced this pull request Sep 6, 2023
* Add GetDeckPath to RemoteFileOutputReader

Signed-off-by: Kevin Su <pingsutw@apache.org>

* make generate

Signed-off-by: Kevin Su <pingsutw@apache.org>

* Fix tests

Signed-off-by: Kevin Su <pingsutw@apache.org>

* Fix tests

Signed-off-by: Kevin Su <pingsutw@apache.org>

* Fix tests

Signed-off-by: Kevin Su <pingsutw@apache.org>

* more tests

Signed-off-by: Kevin Su <pingsutw@apache.org>

* nit

Signed-off-by: Kevin Su <pingsutw@apache.org>
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