-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Remove all of the experiments in the workspace #6394
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
Conversation
dvc/repo/experiments/remove.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will remove all experiments in the user's entire git repository. exp remove --workspace should only remove experiments that are based on the user's current HEAD (and not experiments based on other git commits)
so we can't use the general exp_refs() iterator here, it should be:
head = repo.scm.get_ref()
exp_refs_by_baseline(head)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to leave the behavior as is and rename the flag to --all. That fits the requirement here and is easier to explain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karajan1001 can you please rename the flag to --all? If it is left as --workspace it will be confusing, since all other DVC commands use --workspace to mean HEAD + whatever is in the actual working directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pmrowla , @dberenbaum
I think the feature --all is not as useful as --workspace? Can add it sometime later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think which is more useful depends. Most of the time, I would guess users won't notice a different between them. If they have experiments in other commits, they might want to keep those, but I think it's just as likely that they have forgotten about them or don't know they still exist and would be happy to drop them.
After the discussion in this ticket, I prefer --all because:
- It's easier to explain and understand. It's not obvious what is a "workspace" experiment, and users might want to confirm that these are the experiments they want to remove.
- It parallels
dvc exp list. If we eventually want to do something likedvc exp remove --remote, having this paralleldvc exp listseems useful since it's easy to see what experiments will be deleted. - Similarly, in the future we could add the
--revoption like indvc exp list. This is probably more useful than the--workspace/--all-branches/--all-tags/--all-commitsflags since--revis more granular (and--rev HEADcan do the same as--workspace), and I don't see--all-branchesor--all-tagsever being useful indvc exp remove.
fix treeverse#5676 1. remove all the experiments in workspace 2. add tests for it
Co-authored-by: Peter Rowlands (λ³κΈ°νΈ) <peter@pmrowla.com>
|
Also, don't forget that this will need a docs PR |
dvc/repo/experiments/remove.py
Outdated
| removed = len(repo.experiments.stash) | ||
| repo.experiments.stash.clear() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not actually sure if -A/--all should affect queued experiments, since we have a separate option for that (--queue). It seems to me that -A should only affect "full" experiments that have already been reproduced
maybe a question for @dberenbaum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π€ It seems simpler to explain if it includes the queue, but it's probably more useful if it doesn't since we already have an option to remove the whole queue. Going back to the discussion above, dvc exp list ignores queued experiments, and I think it makes sense to do the same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dberenbaum , Same with -w/--workspace, do not affect queued ones?
| table | workspace based | all based |
|---|---|---|
| committed | 1 | 2 |
| queued | 3 | 4 |
currently --queue removes 3 and 4. After next change --all removes 1 and 2, and workspace? removes 1 and 3 or only 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I thought we were getting rid of --workspace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep both of them for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend keeping one, and I prefer --all so we don't have to get into the confusing corner cases like the one you mentioned above. I think when you document the features, you will find it easier if you don't have to document --workspace π .
As mentioned in the other discussion above, I think you can add --rev later if functionality similar to --workspace is needed.
Co-authored-by: Peter Rowlands (λ³κΈ°νΈ) <peter@pmrowla.com>
Co-authored-by: Peter Rowlands (λ³κΈ°νΈ) <peter@pmrowla.com>
pmrowla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on the engineering side, but should hold off on merging until @dberenbaum double checks the final usage
dberenbaum
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Sorry for the lack of clarity on the syntax. Hopefully keeping it simple for now will be helpful, especially when we start expanding usage like in #6006.
fix #5676
β I have followed the Contributing to DVC checklist.
π If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Remove all experimentsΒ dvc.org#2722
Thank you for the contribution - we'll try to review it as soon as possible. π