exp show: use unique executor name for dvc-task & standalone tempdir exps

This commit is contained in:
Peter Rowlands
2022-07-12 21:39:49 +09:00
committed by Peter Rowlands (변기호)
parent 1f7b802f79
commit 4e005411fe
2 changed files with 11 additions and 4 deletions
+7 -3
View File
@@ -65,7 +65,7 @@ class TempDirExecutor(BaseLocalExecutor):
# suggestions) that are not applicable outside of workspace runs
WARN_UNTRACKED = True
QUIET = True
DEFAULT_LOCATION = "temp"
DEFAULT_LOCATION = "tempdir"
def init_git(self, scm: "Git", branch: Optional[str] = None):
from dulwich.repo import Repo as DulwichRepo
@@ -127,7 +127,9 @@ class TempDirExecutor(BaseLocalExecutor):
makedirs(parent_dir, exist_ok=True)
tmp_dir = mkdtemp(dir=parent_dir)
try:
executor = cls._from_stash_entry(repo, stash_rev, entry, tmp_dir)
executor = cls._from_stash_entry(
repo, stash_rev, entry, tmp_dir, **kwargs
)
logger.debug("Init temp dir executor in '%s'", tmp_dir)
return executor
except Exception:
@@ -150,7 +152,9 @@ class WorkspaceExecutor(BaseLocalExecutor):
**kwargs,
):
root_dir = repo.scm.root_dir
executor = cls._from_stash_entry(repo, stash_rev, entry, root_dir)
executor = cls._from_stash_entry(
repo, stash_rev, entry, root_dir, **kwargs
)
logger.debug("Init workspace executor in '%s'", root_dir)
return executor
+4 -1
View File
@@ -29,7 +29,10 @@ def setup_exp(entry_dict: Dict[str, Any]) -> str:
# TODO: split executor.init_cache into separate subtask - we can release
# exp.scm_lock before DVC push
executor = BaseStashQueue.setup_executor(
repo.experiments, entry, TempDirExecutor
repo.experiments,
entry,
TempDirExecutor,
location="dvc-task",
)
infofile = repo.experiments.celery_queue.get_infofile_path(entry.stash_rev)
executor.info.dump_json(infofile)