Skip to content

Commit

Permalink
Support calling RunCollection.get_plan() without repo (#1741)
Browse files Browse the repository at this point in the history
  • Loading branch information
r4victor authored Sep 30, 2024
1 parent ec8d4a7 commit fccc8dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/dstack/api/_public/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def create_instance(self, profile: Profile, requirements: Requirements) -> Insta
def get_plan(
self,
configuration: AnyRunConfiguration,
repo: Repo,
repo: Optional[Repo] = None,
configuration_path: Optional[str] = None,
backends: Optional[List[BackendType]] = None,
regions: Optional[List[str]] = None,
Expand All @@ -442,6 +442,12 @@ def get_plan(
# Returns:
# run plan
# """

if repo is None:
repo = configuration.get_repo()
if repo is None:
raise ConfigurationError("Repo is required for this type of configuration")

if working_dir is None:
working_dir = "."
elif repo.repo_dir is not None:
Expand Down

0 comments on commit fccc8dd

Please sign in to comment.