mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
stage.run: always set DVC_ROOT env var
This commit is contained in:
committed by
Peter Rowlands (변기호)
parent
20606d480b
commit
65d412bfa3
@@ -348,6 +348,8 @@ class BaseStashQueue(ABC):
|
||||
if not name:
|
||||
name = get_random_exp_name(self.scm, baseline_rev)
|
||||
run_env[DVC_EXP_NAME] = name
|
||||
# Override DVC_ROOT env var to point to the parent DVC repo
|
||||
# root (and not an executor tempdir root)
|
||||
run_env[DVC_ROOT] = self.repo.root_dir
|
||||
|
||||
# save studio config to read later by dvc and dvclive
|
||||
|
||||
@@ -39,10 +39,14 @@ def _enforce_cmd_list(cmd):
|
||||
|
||||
|
||||
def prepare_kwargs(stage, run_env=None):
|
||||
from dvc.env import DVC_ROOT
|
||||
|
||||
kwargs = {"cwd": stage.wdir, "env": fix_env(None), "close_fds": True}
|
||||
|
||||
if run_env:
|
||||
kwargs["env"].update(run_env)
|
||||
if DVC_ROOT not in kwargs["env"]:
|
||||
kwargs["env"][DVC_ROOT] = stage.repo.root_dir
|
||||
|
||||
# NOTE: when you specify `shell=True`, `Popen` [1] will default to
|
||||
# `/bin/sh` on *nix and will add ["/bin/sh", "-c"] to your command.
|
||||
|
||||
Reference in New Issue
Block a user