Skip to content

option --always-changed of dvc run #2531

@dashohoxha

Description

@dashohoxha

There is a discussion that illustrates the usage of --always-changed with this example:

dvc run -d ... -o s3://my-bucket/folder.parquet ./create_dir.sh
dvc run -d s3://my-bucket/folder.parquet -o marker --always-changed ./generate_effective_md5.sh
dvc run -d marker -o ... ./do_something_with_dir.sh

I was thinking if we could solve the same problem with a callback stage, like this:

dvc run -d ... -o s3://my-bucket/folder.parquet ./create_dir.sh
dvc run -o marker ./generate_effective_md5.sh
dvc run -d marker -o ... ./do_something_with_dir.sh

or like this:

dvc run -o marker './create_dir.sh && ./generate_effective_md5.sh'
dvc run -d marker -o ... ./do_something_with_dir.sh

It seems like these are equivalent to the first example.

Then I realized that maybe the option --always-changed is not needed at all, since in all the cases we can convert it to a callback stage that is equivalent.
Indeed, if --always-changed ignores the dependencies, then just don't specify any dependencies to the stage, making it a callback stage, and it will always be executed.

I wonder if there are any cases when an --always-changed stage cannot be converted to an equivalent callback stage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionrequires active participation to reach a conclusion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions