I wish that I could get a list of locked DVC stages in my DVC pipeline,
Something with a simular output as given by grep -r 'locked: true'
*.dvc. See also https://discordapp.com/channels/485586884165107732/485596304961962003/565456202541301770
Possible DVC command could be:
dvc lock --list
dvc pipeline show --locked
I prefer the feature is added to the dvc pipeline
command, because the current purpose of it is to present the pipeline, not edit it. Where as the dvc lock
command edits the pipeline.
Aother posible solution is to present the locked flag by default with the dvc pipeline
command, thus the current output
$ dvc pipeline show output.dvc
raw.dvc
data.dvc
output.dvc
could be changed to
$ dvc pipeline show output.dvc
raw.dvc (locked)
data.dvc
output.dvc
if the raw.dvc
stage is locked.
Working on this. Will post updates here.
Expect a PR soon
@rpip Thank you very much!
Should this also display the lock files when printing commands and output files? If that's the case, then I think dvc pipeline show --locked
is the best approach as it works nicely with the existing options.
Alternatively, we could indicate the lock status by default for dvc pipeline show
.
@rpip Agreed, dvc pipeline show
with an explicit --locked
is a good way to start. We will be able to make it enabled by default later after that if we wish to. :slightly_smiling_face:
@rpip, Hmm, could you give some detailed examples of the possible commands and their output?
The tricky thing here is to keep the output easy to understand. A stage can be locked, but is it possible to lock a dependency or output?
I would say no for dependencies, but as an output file (in DVC only) can com from one DVC stage, one could say it is indirectly locked by its stage.馃
All clear now - thanks @PeterFogh.
For now, it'd be dvc pipeline show
with an explicit --locked
argument.
This basically filters/displays only the locked stages:
$ dvc pipeline show output.dvc --locked
raw.dvc
Later, when --locked
is enabled by default it would look like this as proposed in the ticket:
$ dvc pipeline show output.dvc
raw.dvc (locked)
data.dvc
output.dvc
We can also add some colors to the terminal output to highlight the differences more
@rpip, awesome plan and handling of the feature馃憤
@rpip let me clarify this, so if the current implementation you made is effectively filters stages I don't understand how then it can be made enabled "by default". Does it make sense to just keep the filter --locked
option _and_ an additional option -x (extended) or something similar to show additional information about each stage (including that locked
suffix)? I can imagine in the future we'll want to show some other information about each stage, not only the locked flag.
Good point, @shcheklein. I had thought about this earlier using the verbose flag instead. That way, when in verbose mode, we display more information about the stages, and we could implement a system-wide verbose-mode display of objects. But I also thought using the verbose flag might conflict with other intentions behind the verbose flag.
So yes, I think an option -x (extended) or something similar to show additional information about each stage (including that locked suffix) sounds good.
@PeterFogh 0.40.0 with this feature is out. Please feel free to give it a try 馃檪
Most helpful comment
All clear now - thanks @PeterFogh.
For now, it'd be
dvc pipeline show
with an explicit--locked
argument.This basically filters/displays only the locked stages:
Later, when
--locked
is enabled by default it would look like this as proposed in the ticket:We can also add some colors to the terminal output to highlight the differences more