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

Add interruptible override to launch forms #chore #417

Merged
merged 9 commits into from
May 3, 2022

Conversation

MorpheusXAUT
Copy link
Contributor

TL;DR

Adds an option to override the interruptible flag for a single execution to launch forms.

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

A new LaunchInterruptibleInput component has been added, providing a small form input for marking a single execution of a task or workflow as interruptible via a checkbox. Both LaunchTaskForm and LaunchWorkflowForm now include this additional input - it has been added to the advanced options of a workflow launch form.
Relaunching an execution applies the previously selected interruptible override setting to the new launch form.
Additionally, a simple true/false indication has been added to the execution metadata overview, displaying whether an execution had its interruptible flag overwritten.

Some very basic tests have been added to check correct application of the checkbox' value. Manual smoke testing for workflow and single task executions has been performed together with flightadmin and flightpropeller.

Tracking Issue

flyteorg/flyte#2284

Follow-up issue

NA

Nick Müller and others added 3 commits April 20, 2022 11:00
Workflows and tasks can now have their interruptible flag set for a single execution
Added indication about interruptible override to execution metadata

Signed-off-by: Nick Müller <[email protected]>
@welcome
Copy link

welcome bot commented Apr 21, 2022

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

@MorpheusXAUT
Copy link
Contributor Author

Looks like checks failed due to unreleased flyteidl changes. Is there anything that should be done before the IDL changes are merged (like with replace in go.mod), or should I update my PR once the spec changes are available?

@anrusina
Copy link
Contributor

Looks like checks failed due to unreleased flyteidl changes. Is there anything that should be done before the IDL changes are merged (like with replace in go.mod), or should I update my PR once the spec changes are available?

@MorpheusXAUT Any fix I can think of will fix it only locally for you, and will still present the problem in PR circle CI and during/after merge if your curernt PR depends on flyteidl changes.

We are using flyteidl changes in flyteconsole only to resolve typings, so if new interruptible parameter already exists in latest flyteidl, you can update package.json file with new version:

        "@flyteorg/flyteidl": "0.24.11",

and run yarn install locally afterwards.
Then add yarn.lock and package.json changes to this PR.

I should be able to smoke test changes and look deeper into in in few hours.

@MorpheusXAUT
Copy link
Contributor Author

@MorpheusXAUT Any fix I can think of will fix it only locally for you, and will still present the problem in PR circle CI and during/after merge if your curernt PR depends on flyteidl changes.

Right, that's what I did for development locally as well...
Unfortunately, I've only created the PR for flyteidl today, so it's not been merged yet: flyteorg/flyteidl#287

@anrusina I'll update this issue once the changes have been approved/released and I can update the packages accordingly, sorry for the early PR in that case 😄

@anrusina anrusina added the wip label Apr 21, 2022
@anrusina anrusina changed the title Add interruptible override to launch forms #minor Add interruptible override to launch forms #chore Apr 21, 2022
Nick Müller added 2 commits April 26, 2022 15:55
Defaults to indeterminate state, allowing for executions to have their interruptible setting overriden to  and
Added text indicator for override status to checkbox label

Signed-off-by: Nick Müller <[email protected]>
…teconsole into execution-interruptible

Signed-off-by: Nick Müller <[email protected]>
@MorpheusXAUT
Copy link
Contributor Author

MorpheusXAUT commented Apr 26, 2022

@anrusina Unfortunately still WIP due to pending flyteidl merges, but a slight change has been made already. As the interruptible flag is optional and supports an override to enable and disable the setting for an execution, I'm having to visualize a boolean with 3 states 😄
For now, I've come up with the following:

default, no override
default, no override

override to enabled
override to enabled

override to disabled
override to disabled

Clicking the checkbox cycles through not set -> enabled -> disabled -> not set, updating the label for additional clarity.

As I'm neither a great frontend developer nor an UX expert, I'm not sure if there's a better way to represent this while being more clear. I could of course add two separate checkboxes/toggles a la "Enable override" and "Override to", however I found that a bit... tedious to use.

Is there a better/preferred way you can think of to visualize this new setting?

@anrusina
Copy link
Contributor

Clicking the checkbox cycles through not set -> enabled -> disabled -> not set, updating the label for additional clarity.
As I'm neither a great frontend developer nor an UX expert, I'm not sure if there's a better way to represent this while being more clear. I could of course add two separate checkboxes/toggles a la "Enable override" and "Override to", however I found that a bit... tedious to use.

@MorpheusXAUT I don't think that two toggles will make it more clear, and solution you come up with is pretty clever. I asked our designer to look into it - to see if he can suggest something better in this case

Copy link
Contributor

@anrusina anrusina left a comment

Choose a reason for hiding this comment

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

Beautiful code 😍, left two nits which could be ignored.
I definitely haven't smoked it yet, as flyteidl changes I believe still need some time to cook..
Package.k=json will need to point to new flyteidl version when it would be ready.

I will check tomorrow with our designer if he had any suggestions on UI change for you :)

Signed-off-by: Nick Müller <[email protected]>
@hongxunjin
Copy link

tedious

@MorpheusXAUT (cc @anrusina ) Overall, it is awesome! One thing that could possibly be improved is to set the color of the text [interruptible(no override)] as grey when the checkbox turns to "not set", which can visually differentiate "not set" and "disabled".

@MorpheusXAUT
Copy link
Contributor Author

MorpheusXAUT commented Apr 28, 2022

@MorpheusXAUT (cc @anrusina) Overall, it is awesome! One thing that could possibly be improved is to set the color of the text [interruptible(no override)] as grey when the checkbox turns to "not set", which can visually differentiate "not set" and "disabled".

Sounds like a good plan! How do you like the following (just setting color="textSecondary", or would you like a more nuanced color?)

indeterminate
indeterminate state

checked
checked state

@hongxunjin
Copy link

indeterminate

It looks great!

@MorpheusXAUT
Copy link
Contributor Author

Feedback from the review has been included, I'll push another commit and update this issue once the IDL changes are merged 🙂

@MorpheusXAUT
Copy link
Contributor Author

@anrusina flyteidl/npm package has been published, PR should build locally/in CI now 🥳
Sorry for the delay!

@codecov
Copy link

codecov bot commented May 2, 2022

Codecov Report

Merging #417 (12b8bff) into master (ddcda48) will increase coverage by 0.10%.
The diff coverage is 95.58%.

@@            Coverage Diff             @@
##           master     #417      +/-   ##
==========================================
+ Coverage   67.08%   67.18%   +0.10%     
==========================================
  Files         407      413       +6     
  Lines        9147     9295     +148     
  Branches     1614     1630      +16     
==========================================
+ Hits         6136     6245     +109     
- Misses       3011     3050      +39     
Impacted Files Coverage Δ
...cutions/ExecutionDetails/RelaunchExecutionForm.tsx 100.00% <ø> (ø)
src/components/Launch/LaunchForm/constants.ts 100.00% <ø> (ø)
src/components/Launch/LaunchForm/launchMachine.ts 86.53% <ø> (ø)
src/components/Launch/LaunchForm/types.ts 100.00% <ø> (ø)
src/models/Execution/api.ts 58.97% <33.33%> (-3.19%) ⬇️
...nts/Launch/LaunchForm/LaunchInterruptibleInput.tsx 97.87% <97.87%> (ø)
...utions/ExecutionDetails/ExecutionMetadataExtra.tsx 100.00% <100.00%> (ø)
...omponents/Executions/ExecutionDetails/constants.ts 100.00% <100.00%> (ø)
...rc/components/Launch/LaunchForm/LaunchTaskForm.tsx 100.00% <100.00%> (ø)
...omponents/Launch/LaunchForm/LaunchWorkflowForm.tsx 100.00% <100.00%> (ø)
... and 20 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 8f2e13d...12b8bff. Read the comment docs.

@anrusina anrusina removed the wip label May 2, 2022
anrusina
anrusina previously approved these changes May 3, 2022
Copy link
Contributor

@anrusina anrusina left a comment

Choose a reason for hiding this comment

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

LGTM, some tests are needed, than could be merged.

Copy link
Contributor

@anrusina anrusina left a comment

Choose a reason for hiding this comment

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

Lgtm

🚢

@anrusina anrusina merged commit 919e90c into flyteorg:master May 3, 2022
@welcome
Copy link

welcome bot commented May 3, 2022

Congrats on merging your first pull request! 🎉

@MorpheusXAUT MorpheusXAUT deleted the execution-interruptible branch September 28, 2022 14:56
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.

3 participants