Remove/Redefine Stage

In 0.94, this feature of having multiple stages was a hidden feature as it was still work-in-progress. We did a lot of changes/improvements since then which is available now to use in v1.0.

pipelines.yaml is now renamed to dvc.yaml and has some file format changes. To redefine a stage, you can use --force and it should overwrite. In 1.0, you can remove a stage from the pipeline file using dvc remove <stage_name>.

Now, for you to migrate, the easiest thing would be to dvc run for all stages and build from there (which should now be dvc.yaml), and then later remove pipelines.yaml.

If you don’t want to dvc run, you can edit manually and then rename pipelines.yaml to dvc.yaml and pipelines.lock to dvc.lock. The incompatibilities between 0.94 and 1.0 in .yaml file is that, we no longer have metrics_no_cache, outs_persist, outs_no_cache kind of sections in dvc.yaml. So, if you do that you might need to make adjustments similar to the following:

In 0.94:

stages:
  stage_one:
    cmd: "command"
    outs:
     - foo
    outs_no_cache:
     - bar
    outs_persist:
     - foobar

In 1.0:

stages:
  stage_one:
    cmd: "command"
    ...
    outs:
     - foo
     - bar:
         cache: false
     - foobar:
         persist: true
1 Like