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

repro: introduce --keep-going/--ignore to continue on error #9712

Merged
merged 3 commits into from
Jul 12, 2023

Conversation

skshetry
Copy link
Member

@skshetry skshetry commented Jul 7, 2023

-k/--keep-going will skip all dependents of a stage if it fails. It'll still try to reproduce the other dependencies of the pending targets, before it exits with a non-zero status.

--ignore-errors will treat any error during stage execution as a success, and will continue executing other dependencies as if it succeeded. Exits with 0 even on failure.

Also fixes:

  • --force-downstream used to force everything even if one upstream nodes changed. This used to work when we supported a single targets, but there could be independent pipelines, so we should not force everything if any node changes. Now we'll force reproduce the stage only if one of its dependency changed upstream or it's upstream node was also forced.

  • Makes --downstream more correct, in relation to --allow-missing and --pull. Now we use an active graph for downstream/upstream logic instead of a subgraph. Note that this does not affect the downstream logic though, as dvc always goes downstream, so subgraph was no different than active graph. The subgraph only did not have the upstream nodes.

Fixes #8647 and fixes #7292.

@skshetry skshetry added A: cli Related to the CLI A: pipelines Related to the pipelines feature labels Jul 7, 2023
@skshetry skshetry requested a review from a team July 7, 2023 16:18
`-k`/`--keep-going` will skip all dependents of a stage if it fails.
It'll still try to reproduce the other dependencies of the pending
targets, before it exits with a non-zero status.

`--ignore-errors` will treat any error during stage execution as a
success, and will continue executing other dependencies as if it
succeeded. Exits with 0 even on failure.

Also fixes:
* --force-downstream used to force everything even if one upstream nodes changed.
  This used to work when we supported a single targets, but there could be independent
  pipelines, so  we should not force everything if any node changes.
  Now we'll force reproduce the stage only if one of its dependency changed upstream
  or it's upstream node was also forced.

* Makes `--downstream` more correct, in relation to `--allow-missing` and `--pull`.
  Now we use an active graph for downstream/upstream logic instead of a subgraph.
  Note that this does not affect the downstream logic though, as dvc always goes
  downstream, so subgraph was no different than active graph.
  The subgraph only did not have the upstream nodes.
@codecov
Copy link

codecov bot commented Jul 7, 2023

Codecov Report

Patch coverage: 99.17% and project coverage change: -0.35 ⚠️

Comparison is base (0d1f1f6) 90.53% compared to head (5074872) 90.19%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9712      +/-   ##
==========================================
- Coverage   90.53%   90.19%   -0.35%     
==========================================
  Files         480      480              
  Lines       36423    36543     +120     
  Branches     5233     5258      +25     
==========================================
- Hits        32976    32960      -16     
- Misses       2855     2967     +112     
- Partials      592      616      +24     
Impacted Files Coverage Δ
tests/unit/command/test_repro.py 100.00% <ø> (ø)
dvc/repo/reproduce.py 98.30% <98.27%> (-0.47%) ⬇️
dvc/commands/repro.py 100.00% <100.00%> (ø)
dvc/exceptions.py 93.70% <100.00%> (-0.09%) ⬇️
tests/func/repro/test_repro.py 100.00% <100.00%> (ø)
tests/unit/repo/test_reproduce.py 100.00% <100.00%> (+2.70%) ⬆️

... and 31 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@skshetry skshetry requested a review from dberenbaum July 12, 2023 15:17
@skshetry
Copy link
Member Author

@dberenbaum, let me know what you think from the product side.

Copy link
Collaborator

@dberenbaum dberenbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@skshetry skshetry merged commit eb212a7 into iterative:main Jul 12, 2023
20 checks passed
@skshetry skshetry deleted the repro-continue branch July 12, 2023 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: cli Related to the CLI A: pipelines Related to the pipelines feature
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Continue running non-dependent stages after stage failure repro: allow reproducing disjoint dags on error
2 participants