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

Use PluginCleanupPolicy from flyteorg/flyteplugins#203 #311

Merged
merged 8 commits into from
Sep 14, 2021

Conversation

clairemcginty
Copy link
Contributor

TL;DR

Per discussion in #feature-discussions Slack channel, I'm opening this as a draft PR as to center discussions related to flyteorg/flyte#1345.

This PR applies the PluginCleanupPolicy interface from flyteorg/flyteplugins#203, if applicable, instead of defaulting to just deleting the resource when the task is aborted.

this will need to be updated once the flyteplugins changed is merged & its version is bumped in go.mod.

cc @regadas , @EngHabu , @kumare3 :)

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

Remove the 'fixes' keyword if there will be multiple PRs to fix the linked issue

fixes https://github.com/flyteorg/flyte/issues/

Follow-up issue

NA
OR
https://github.com/flyteorg/flyte/issues/

@welcome
Copy link

welcome bot commented Aug 24, 2021

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).

} else if behavior.Update != nil {
err = e.kubeClient.GetClient().Update(ctx, o, behavior.Update.Options...)
} else {
err = errors.Errorf(errors.RuntimeFailure, "AbortBehavior for resource %v must specify either a Patch and an Update operation if Delete is set to false. Only one can be supplied.", o.GetName())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe worth adding a custom error type to flyteplugins' errors package? InvalidPluginConfiguration or something like that? cc @EngHabu

@kumare3
Copy link
Contributor

kumare3 commented Sep 8, 2021

looks good to me, I will let @EngHabu +1.
Can you sign the dco?

@clairemcginty clairemcginty marked this pull request as ready for review September 10, 2021 18:47
@clairemcginty
Copy link
Contributor Author

thanks @EngHabu, I applied your suggestions! I also updated the flyteplugins version (+ dependencies) ; looks like I might not have permissions to modify go.mod/go.sum files though...?

assert.Equal(t, expectedErr, err)
})

t.Run("Abort Plugin has Delete PluginAbortOverride", func(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't include tests for AbortBehaviors with a non-nil Resource because the existing test framework made it a little difficult (can't make assertions on the calls made to the extendedFakeClient as it's not a mock)... I'll brainstorm a bit if there's an easier way to test that.

@EngHabu
Copy link
Contributor

EngHabu commented Sep 13, 2021

You will need to run git pull origin master and resolve conflicts then git add -A, git merge --continue and git push...

Signed-off-by: Claire McGinty <[email protected]>
Signed-off-by: Claire McGinty <[email protected]>
Signed-off-by: Claire McGinty <[email protected]>
Signed-off-by: Claire McGinty <[email protected]>
Signed-off-by: Claire McGinty <[email protected]>
Signed-off-by: Claire McGinty <[email protected]>
@codecov
Copy link

codecov bot commented Sep 13, 2021

Codecov Report

Merging #311 (9edfa07) into master (0efd3af) will increase coverage by 0.04%.
The diff coverage is 60.86%.

❗ Current head 9edfa07 differs from pull request most recent head ca2ba22. Consider uploading reports for the commit ca2ba22 to get more accurate results

@EngHabu
Copy link
Contributor

EngHabu commented Sep 13, 2021

🙇🏽

@EngHabu EngHabu changed the title (draft) Use PluginCleanupPolicy from flyteorg/flyteplugins#203 Use PluginCleanupPolicy from flyteorg/flyteplugins#203 Sep 14, 2021
@EngHabu EngHabu merged commit a1d959b into flyteorg:master Sep 14, 2021
@welcome
Copy link

welcome bot commented Sep 14, 2021

Congrats on merging your first pull request! 🎉

eapolinario pushed a commit to eapolinario/flytepropeller that referenced this pull request Aug 9, 2023
* use PluginCleanupPolicy if it exists

Signed-off-by: Claire McGinty <[email protected]>

* add unit test

Signed-off-by: Claire McGinty <[email protected]>

* cleanup test code

Signed-off-by: Claire McGinty <[email protected]>

* assert OnAbort is not attempted by default

Signed-off-by: Claire McGinty <[email protected]>

* update plugin override interface

Signed-off-by: Claire McGinty <[email protected]>

* lint

Signed-off-by: Claire McGinty <[email protected]>

* Apply PR suggestions

Signed-off-by: Claire McGinty <[email protected]>

* update flyteplugins lib

Signed-off-by: Claire McGinty <[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