-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Stage-level vars
alternative in DVC 3.X
#9639
Comments
Okay, I just realise that stage-level support for
|
vars
alternative in DVC 3.X
Hi, you can move the vars:
- config_setup1.yaml
stages:
process_setup1:
cmd: python apply.py
wdir: ./
deps:
- ${datastore}
process_setup2:
cmd: python apply.py
wdir: ./
deps:
- ${datastore} |
Thanks @skshetry for your quick response. However, the variable |
I think there are three ways:
# config_setup.yaml
setup1:
datastore: ...
setup2:
datastore: ...
# dvc.yaml
vars:
- config_setup.yaml
stages:
process_setup1:
deps: ${setup1.datastore}
# config_setup1.yaml
setup1:
datastore: ...
# config_setup2.yaml
setup2:
datastore: ...
|
Thank you for showing these other options. To my feeling the stage-level I use for example a template yaml file that contains all necessary information to apply a trained neural network to a specific image dataset. For each image dataset I apply the neural network on, I create a new configuration file that contains for example the source-path. I like to think of these configurations as separate projects that share a common code base, but should be independent. Having several variables with the same meaning (e.g. Any chance this could be added again? |
yes, we are discussing that in #9630. Will let you know if we decide on anything. 🙂 |
@observingClouds @sjawhar As you can see, we have reverted dropping stage-level vars for now, but we are still discussing whether to move towards dropping it in the future with more warning. It would be great to get your thoughts here and brainstorm whether there are better alternatives we could develop. |
I think all my use-cases of stage-level vars stem from not having support for parameter grids beyond a single foreach. I won't pretend to represent every use case (I reviewed @observingClouds 's post above and didn't quite understand all of @skshetry 's suggestions), but I think that implementing |
We created stages;
train_model:
foreach: [model1, model2]
do:
wdir: ${model}
vars: params.yaml
cmd: ./script ${thresh} Here, While above @observingClouds use leads to a cleaner definition, we did not create |
Absolutely, 100% agree 👍 The simplicity of a static YAML file is one of my favorite things about DVC, and my usage of YAML anchors feels much more like a hack than something clear and explicit like |
Is there a discussion/documentation about the planned |
@observingClouds, yes, please take a look at #5172. |
Would it maybe easier to support the global |
We discussed this previously in #3633. We decided against it because it gets ugly quite fast, as file paths tend to get longer and you have to repeat the file name each time (going against why we introduced parametrization in the first place: to reduce duplication). But I don’t think I have any strong opposition to it, but at the same time, I’d prefer to keep things simple. Still, I’ll encourage you create a feature request explaining your scenario. |
(But if you have to use it sparingly, it’s a good solution, it probably should not be the default recommendation) |
Bug Report
Description
I updated DVC from 2.58.2 to 3.0.0 and now get an error when trying to reproduce previous stages.
The entire content of
dvc.yaml
is:Issue #9630 focus on this kind of break with respect to error handling. Here, I'm however interested in how I have to rewrite my dvc.yaml file to overcome this issue and retrieve the expected results. I appreciate your help.
Reproduce
Expected
I expected compatibility with DVC 3.X. However, I understand that breaking changes can occur for a major release.
Environment information
Output of
dvc doctor
:Additional Information (if any):
The text was updated successfully, but these errors were encountered: