metaflow
metaflow copied to clipboard
add list runs command
~TODO: I need to add tests~
@valayDave @savingoyal this is ready for review
This will close #602
~Oh I need to add the bit about the --quiet flag~
Update: fixed this by using echo instead of echo_always
@savingoyal I was discussing this with @valayDave and some questions:
- Do we want to add a
--namespaceflag as well? - If we want to add 1, should we not have the
--userflag and let people pass the namespaceuser:<username>instead? - If we want to keep both a
--namepsaceand--userflag, should they be mutually exclusive, or how do we want to handle collisions in this case, should we throw an error if there if there is a--namespaceargument withuser:<username>etc?
Thanks
How about we add both? It's usually a lot easier as a user for me to do python flow.py list --my runs or python flow.py list --user=hamel runs. We can also support namespace and make the set - my, user and namespace mutually exclusive. wdyt?
Ok. Here are some key questions that would need decisions to quickly converge on code changes.
- What are the levels of filters were wish to support. Some I can think of are:
tags,namespace,user,date,branch/project,success/failure. - When options for these filters are provided from CLI, then will the resultant runs be filtered based on the union of filters or will there be some compatibility Constraints. An example constraint: You can provide
dateortagsbut not both. Not saying we need to place this constraint. Just giving an example. - Should the namespace command be
listor something else ? Since we right now have something likecard listorbatch list-jobsetc. Similarly why notruns list. I agree that it is quite close torunmaking it a little confusing for someone at some point. And if we are addinglistthen should we addcardsand others under this namespace too? - Given the convergence on the above decisions, what is the final command spec. (Example command with all arguments)
@savingoyal I have added the --namespace flag so that we have something to look at and consider, but I think we should definitely discuss @valayDave 's comments above. Please LMK your thoughts
The namespace is implicitly the user (which I thought was the initial intent) but yes, this is exactly the type of conversation I was mentioning we should have around this more general "listing" API. These types of higher-level options (independent in effect of whether you are listing runs, steps, artifacts, etc) is useful.
ignore this comment (duplicate caused by weird browser glitch
ok @romain-intel I made the changes (If I understood correctly) in this commit
I made the following changes:
- removed the
--my-runsflag and made that the default behavior - added a
--allflag that callsnamespace(None)to allow you to access the global namespace - Filtered runs by calling
namespace(<namespace>), instead of iterating through tags of each run
Please let me know if I am understanding correctly, hopefully, I'm getting closer!
We still have to have a discussion of this interface in general. Note: this PR was also meant as a "Good First Issue" for me tackle with regards to learning the code base of Metaflow (just to let you know the dual purpose of this PR)
Feedback from @savingoyal
My take is that we can expand list in the future to include cards etc. and supporting just --namespace (and maybe --my and --user as well) for now is a good start. We can always introduce more flags as we learn usage patterns. --namespace already takes care of tags , user , date , project etc.
re: --my-runs feedback from @savingoyal:
I shared with Savin that I removed the --my-runs flag per @romain-intel 's suggestion and added the --show-all flag and he thinks this is 👍🏽 , with one minor suggestion:
can we do list --all runs instead of list --show-all runs
Converted the PR to draft since it is not ready for review yet.