mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 23:10:42 +01:00
repro: Continue on RunCacheNotSupported
Closes #9470
(cherry picked from commit e98bf38d4c)
This commit is contained in:
committed by
David de la Iglesia Castro
parent
6d783b8d97
commit
4a5307603f
@@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Iterator, List
|
||||
|
||||
from dvc.exceptions import DvcException, ReproductionError
|
||||
from dvc.repo.scm_context import scm_context
|
||||
from dvc.stage.cache import RunCacheNotSupported
|
||||
from dvc.stage.exceptions import CheckpointKilledError
|
||||
|
||||
from . import locked
|
||||
@@ -127,7 +128,10 @@ def reproduce( # noqa: C901, PLR0912
|
||||
|
||||
if kwargs.get("pull", False):
|
||||
logger.debug("Pulling run cache")
|
||||
self.stage_cache.pull(None)
|
||||
try:
|
||||
self.stage_cache.pull(None)
|
||||
except RunCacheNotSupported:
|
||||
logger.debug("Failed to pull run cache")
|
||||
|
||||
return _reproduce_stages(self.index.graph, list(stages), **kwargs)
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ from dvc.cli import main
|
||||
from dvc.dvcfile import LOCK_FILE, PROJECT_FILE
|
||||
from dvc.exceptions import CyclicGraphError, ReproductionError
|
||||
from dvc.stage import PipelineStage
|
||||
from dvc.stage.cache import RunCacheNotSupported
|
||||
from dvc.stage.exceptions import StageNotFound
|
||||
from dvc.utils.fs import remove
|
||||
|
||||
@@ -457,3 +458,17 @@ def test_repro_allow_missing_and_pull(tmp_dir, dvc, mocker, local_remote):
|
||||
ret = dvc.reproduce(pull=True, allow_missing=True)
|
||||
# create-foo is skipped ; copy-foo pulls missing dep
|
||||
assert len(ret) == 1
|
||||
|
||||
|
||||
def test_repro_pulls_continue_without_run_cache(tmp_dir, dvc, mocker, local_remote):
|
||||
(foo,) = tmp_dir.dvc_gen("foo", "foo")
|
||||
|
||||
dvc.push()
|
||||
mocker.patch.object(
|
||||
dvc.stage_cache, "pull", side_effect=RunCacheNotSupported("foo")
|
||||
)
|
||||
dvc.stage.add(name="copy-foo", cmd="cp foo bar", deps=["foo"], outs=["bar"])
|
||||
remove("foo")
|
||||
remove(foo.outs[0].cache_path)
|
||||
|
||||
assert dvc.reproduce(pull=True)
|
||||
|
||||
Reference in New Issue
Block a user