Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/dstack/_internal/cli/services/configurators/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ def apply_configuration(
# is not set (emulate pre-0.19.27 JobConfigutor logic), otherwise fall back to
# `/workflow`.
if isinstance(conf, DevEnvironmentConfiguration) or conf.commands:
conf.working_dir = LEGACY_REPO_DIR
# relative path for compatibility with pre-0.19.27 servers
conf.working_dir = "."
warn(
"[code]working_dir[/code] is not set."
f" Using legacy working directory [code]{LEGACY_REPO_DIR}[/code]\n\n"
Expand All @@ -117,6 +118,12 @@ def apply_configuration(
f"To keep using legacy working directory, set"
f" [code]working_dir[/code] to [code]{legacy_working_dir}[/code]\n"
)
else:
# relative path for compatibility with pre-0.19.27 servers
try:
conf.working_dir = str(PurePosixPath(working_dir).relative_to(LEGACY_REPO_DIR))
except ValueError:
pass

if conf.repos and conf.repos[0].path is None:
warn(
Expand Down
2 changes: 2 additions & 0 deletions src/dstack/_internal/core/compatibility/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ def get_run_spec_excludes(run_spec: RunSpec) -> IncludeExcludeDictType:

if run_spec.repo_dir in [None, LEGACY_REPO_DIR]:
spec_excludes["repo_dir"] = True
elif run_spec.repo_dir == "." and configuration.working_dir in [None, LEGACY_REPO_DIR, "."]:
spec_excludes["repo_dir"] = True

if configuration.fleets is None:
configuration_excludes["fleets"] = True
Expand Down
Loading