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

dvc repro foreach stage name should auto-expand all stages #6424

Closed
schuhschuh opened this issue Aug 14, 2021 · 3 comments
Closed

dvc repro foreach stage name should auto-expand all stages #6424

schuhschuh opened this issue Aug 14, 2021 · 3 comments

Comments

@schuhschuh
Copy link

Similar to #6035 but without the aspect of running the stages in parallel (which would be great but a separate issue), it would be great if one can run dvc repro foreach_stage_name which then get expanded to all the individual stages which DVC produces from the foreach stage. It can be annoying and cumbersome having to specify each foreach_stage_name@substage_name_or_id separately.

Given dvc.yaml:

stages:
  foreach_stage_name:
    foreach:
      - a
      - b
    do:
      ...

it should be possible to run dvc repro foreach_stage_name. Currently, I have to run

dvc repro foreach_stage_name@a foreach_stage_name@b

Looking at the documentation of dvc repro, it appears this could be done using --glob:

dvc repro --glob "foreach_stage_name@*"

While this satisfies my use case, I still wonder if for foreach stages it would make sense to not have to use an explicit glob pattern? Given the special @ separator in the stage names and the stage key specified when editing the dvc.yaml. Intuitively, I thought this should work. When it didn't, I hadn't realized that the --glob option existed until now.

@skshetry
Copy link
Member

@schuhschuh, this is already supported. DVC will run all of the expanded stages with just the foreach_stage_name.

@schuhschuh
Copy link
Author

Oh, nice. I admit I haven't tried this since with newer versions. Thanks!

@skshetry
Copy link
Member

@schuhschuh, this was introduced together with the same feature in 2.0. It might have been the case that the other stage did not need to be reproduced.

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

No branches or pull requests

2 participants