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

Active/Archive management on Runs for Archived Experiment #5114

Open
zijianjoy opened this issue Feb 9, 2021 · 18 comments
Open

Active/Archive management on Runs for Archived Experiment #5114

zijianjoy opened this issue Feb 9, 2021 · 18 comments

Comments

@zijianjoy
Copy link
Collaborator

What happened:

During the PR #5040, which allows user to see Active/Archive run lists of an experiment, regardless of whether that experiment is active or archived. There is discussion on whether a user can restore a Run from an Archived Experiment. See #5040 (comment) for the initial question. And #5040 (comment) for the argument. Currently this behavior is allowed on the latest code.

Decision Making

The question: Can a user restore a Run from an Archived Experiment? If so, what is the use case? If not, why it is discouraged?

Follow-up items

  • If this behavior is allowed, should we update UI to call out the state of Experiment in ExperimentDetail.tsx file?
  • If this behavior is not allowed, what is the error message we should show to users?

/kind discussion
/area frontend

@StefanoFioravanzo
Copy link
Member

I think the question is: "Should we allow Active Runs in Archived Experiments"?

If the answer was no, I can think of the following implications:

  • Archiving an Experiment would imply archiving of ALL the Runs belonging to the Experiment. We could prompt users of course, saying that the Experiment archival will have this effect.
  • Restoring an Experiment will restore ALL Runs belonging to the Experiment.

It is natural to me thinking about Experiments as direct parents (containers) of Runs, thus if I see an archived Experiment I would expect all of its runs to be Archived as well.

It's clear that KFP follows a more loosely coupled approach. @Bobgy Was this a specific decision, taken at some point in time, grounded on some specific rationale? Maybe there is some old issue where this had been discussed.

@Bobgy
Copy link
Contributor

Bobgy commented Feb 11, 2021

There were no formal discussion when it was implemented, and we sort of took the shortest path. Feel free to argue about whatever option makes the most sense to you.

@Bobgy
Copy link
Contributor

Bobgy commented Feb 11, 2021

One weird case would be:

  1. Archive some runs, but not all
  2. Archive the experiment, so all runs are archived
  3. Restore the experiment, should all runs get brought back? What if archiving the experiment was a mistake?

Just to mean this is sth we can discuss, we may not need to support this corner case so well.

@Bobgy
Copy link
Contributor

Bobgy commented Feb 11, 2021

I agree with @StefanoFioravanzo 's proposal and when experiment is archived, runs should fail to unarchiv

@StefanoFioravanzo
Copy link
Member

@Bobgy This is a fair point!

One weird case would be:

  1. Archive some runs, but not all
  2. Archive the experiment, so all runs are archived
  3. Restore the experiment, should all runs get brought back? What if archiving the experiment was a mistake?

Just to mean this is sth we can discuss, we may not need to support this corner case so well.

I think the following approach addresses it:

  • Archive Experiment: All Runs belonging to the Experiment get archived as well (upon user confirmation)
  • UnArchive Experiment: All Runs REMAIN archived; if the user wants to unarchive them all then they can go to the Experiment Details page, Archived Runs tab, and perform a bulk restore

@StefanoFioravanzo
Copy link
Member

In this way we enforce this first implication

Archived Experiment -> Archived Runs

But not the opposite, and it's completely the users' choice whether to restore Runs, all of them or just in part. And if they want to restore an Experiment and keep it empty of Active Runs, to start creating new ones, they can do so.

@Bobgy
Copy link
Contributor

Bobgy commented Feb 11, 2021

SGTM

@Bobgy
Copy link
Contributor

Bobgy commented Feb 11, 2021

if the user wants to unarchive them all then they can go to the Experiment Details page, Archived Runs tab, and perform a bulk restore

In fact, the argument seems to apply reversely too, if all runs are restored by default, users can bulk archive them again.

I think we should think about which operation is more common as user intent? I feel like restoring all runs when restoring the experiment would be more Intuitive for me. WDYT?

@StefanoFioravanzo
Copy link
Member

I think we should just make this configurable. When you restore an experiment we can ask: "Do you want to restore all archived Runs as well?" -> "yes"/"no". So we definitely cover all potential use cases. WDYT?

@Bobgy
Copy link
Contributor

Bobgy commented Feb 11, 2021

Agreed, that's a good point!

@zijianjoy
Copy link
Collaborator Author

zijianjoy commented Feb 11, 2021

I agree with the statement that Archived Experiment should not contain Active Runs.

In terms of state management of archiving/restoring an Experiment, I think the original intent of Archived Runs is to avoid accidental deletion of active runs, because active runs cannot be deleted, it has be archived first. And the concept of Archived Experiment is to group a list of runs which are ready to be deleted. See #3283 (comment).

Therefore, I agree with the interactive approach to ask users whether to restore Runs while restoring Experiment.

To summarize the list of changes required as a result of this decision:

  1. frontend: Hide Active runs list in ExperimentDetail.tsx when Experiment is Archived. Because no run should be active if Experiment is archived.
  2. frontend: When restoring an experiment, popup should shows 3 options for user to choose: Cancel, Restore Experiment and Restore Experiment and All Runs, and highlight Restore Experiment because that is the default behavior.
  3. backend: Check whether a run is under archived experiment when Unarchive API is called. If so, fail with error 400 (FAILED_PRECONDITION).

Feel free to comment if I am missing anything or need adjustment. Thank you!

@Bobgy
Copy link
Contributor

Bobgy commented Feb 12, 2021

I agree with the statement that Archived Experiment should not contain Active Runs.

In terms of state management of archiving/restoring an Experiment, I think the original intent of Archived Runs is to avoid accidental deletion of active runs, because active runs cannot be deleted, it has be archived first. And the concept of Archived Experiment is to group a list of runs which are ready to be deleted. See #3283 (comment).

Therefore, I agree with the interactive approach to ask users whether to restore Runs while restoring Experiment.

To summarize the list of changes required as a result of this decision:

  1. frontend: Hide Active runs list in ExperimentDetail.tsx when Experiment is Archived. Because no run should be active if Experiment is archived.

Personal opinion, UI should be stable, when a button doesn't apply in a context, we can disable it and add a hover tooltip to tell why. Removing it might leave people confused -- where is the tab?

  1. frontend: When restoring an experiment, popup should shows 3 options for user to choose: Cancel, Restore Experiment and Restore Experiment and All Runs, and highlight Restore Experiment because that is the default behavior.

Note, we need to implent this feature in backend too.

  1. backend: Check whether a run is under archived experiment when (Unarchive API)[https://www.kubeflow.org/docs/pipelines/reference/api/kubeflow-pipeline-api-spec/#operation--apis-v1beta1-runs--id-:unarchive-post] is called. If so, fail with error 400 (FAILED_PRECONDITION).

Feel free to comment if I am missing anything or need adjustment. Thank you!

Thanks! Per priority, sounds like 3 should be done first, 1 and 2 are good to haves. Users wouldn't be very distracted with current implementation too.

@StefanoFioravanzo
Copy link
Member

Personal opinion, UI should be stable, when a button doesn't apply in a context, we can disable it and add a hover tooltip to tell why. Removing it might leave people confused -- where is the tab?

Yes! I completely agree on this!

@capri-xiyue capri-xiyue added the help wanted The community is welcome to contribute. label Feb 19, 2021
@Bobgy
Copy link
Contributor

Bobgy commented Feb 19, 2021

I think

backend: Check whether a run is under archived experiment when (Unarchive API)[https://www.kubeflow.org/docs/pipelines/reference/api/kubeflow-pipeline-api-spec/#operation--apis-v1beta1-runs--id-:unarchive-post] is called. If so, fail with error 400 (FAILED_PRECONDITION).

can be a good first issue.
Welcome contribution!

@capri-xiyue capri-xiyue changed the title [Discuss] Active/Archive management on Runs for Archived Experiment Active/Archive management on Runs for Archived Experiment Feb 19, 2021
@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the lifecycle/stale The issue / pull request is stale, any activities remove this label. label Jun 2, 2021
@difince
Copy link
Member

difince commented Dec 7, 2021

Hi, @Bobgy and @StefanoFioravanzo can I work on number: 3?

backend: Check whether a run is under archived experiment when Unarchive API is called. If so, fail with error 400 (FAILED_PRECONDITION).

I will create a separate issue about this.

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the lifecycle/stale The issue / pull request is stale, any activities remove this label. label Apr 17, 2022
@zijianjoy
Copy link
Collaborator Author

/lifecycle frozen

@google-oss-prow google-oss-prow bot added lifecycle/frozen and removed lifecycle/stale The issue / pull request is stale, any activities remove this label. labels Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants